xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ x;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/ *);
void saveFile() {
  FILE *fp;
  fp = fopen("test.bin", "wb");
  char x[10] = "ABCDEFGHIJ";
  fwrite(x, sizeof(x[0]), sizeof(x) / sizeof(x[0]), fp);
}


x86 assembly (clang, -O0):
<saveFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xed1(%rip),%rdi
lea    0xed3(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    0xec6(%rip),%rax
mov    %rax,-0x12(%rbp)
mov    0xec3(%rip),%ax
mov    %ax,-0xa(%rbp)
lea    -0x12(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
mov    $0xa,%edx
call   1040 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<saveFile>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0xed7(%rip),%rsi
call   1030 <fopen@plt>
movabs $0x4847464544434241,%rcx
46 47 48
mov    %rcx,0x8(%rsp)
movw   $0x4a49,0x10(%rsp)
lea    0x8(%rsp),%rdi
mov    $0x1,%esi
mov    $0xa,%edx
mov    %rax,%rcx
call   1040 <fwrite@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"test.bin\00"
@.str.1 = [3 x i8] c"wb\00"
@__const.saveFile.x = [10 x i8] c"ABCDEFGHIJ"
define void @saveFile() {
%1 = alloca i32*
%2 = alloca [10 x i8]
%3 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %1
%4 = bitcast [10 x i8]* %2 to i8*
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%6 = load i32*, i32** %1
%7 = call i32 @fwrite(i8* %5, i32 1, i32 10, i32* %6)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"test.bin\00"
@.str.1 = [3 x i8] c"wb\00"
@__const.saveFile.x = [10 x i8] c"ABCDEFGHIJ"
define void @saveFile() {
%1 = alloca [10 x i8]
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = call i32 @fwrite(i8* %3, i32 1, i32 10, i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int main() {
  int d;
  foo(d);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x4(%rbp),%edi
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 @foo(i32 %2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 undef)
ret i32 0
}
/* Variables and functions */
void *memalign(int, size_t);
void *valloc(size_t bytes) { return memalign((4096), bytes); }


x86 assembly (clang, -O0):
<valloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x1000,%edi
call   1030 <memalign@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<valloc>:
mov    %rdi,%rsi
mov    $0x1000,%edi
jmp    1030 <memalign@plt>

LLVM IR (-O0):
define i8* @valloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @memalign(i32 4096, i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define noalias i8* @valloc(i64 %0) {
%2 = tail call align 4096 i8* @memalign(i32 4096, i64 %0)
ret i8* %2
}
float quadraticEaseInOutf(float p) {
  if (p < 0.5) {
    return 2 * p * p;
  } else {
    return (-2 * p * p) + (4 * p) - 1;
  }
}


x86 assembly (clang, -O0):
<quadraticEaseInOutf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee6(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1140 <quadraticEaseInOutf+0x40>
movss  0xee8(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1178 <quadraticEaseInOutf+0x78>
movss  0xec8(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  -0x8(%rbp),%xmm2
movss  0xeb2(%rip),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  0xe99(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<quadraticEaseInOutf>:
movss  0xef8(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    111c <quadraticEaseInOutf+0x1c>
movaps %xmm0,%xmm1
addss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret
movss  0xee0(%rip),%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  0xed4(%rip),%xmm0
addss  %xmm1,%xmm0
addss  0xecc(%rip),%xmm0
ret

LLVM IR (-O0):
define float @quadraticEaseInOutf(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fcmp olt double %5, 5.000000e-01
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load float, float* %3
%9 = fmul float 2.000000e+00, %8
%10 = load float, float* %3
%11 = fmul float %9, %10
store float %11, float* %2
br label %20
12: ; preds = %1
%13 = load float, float* %3
%14 = fmul float -2.000000e+00, %13
%15 = load float, float* %3
%16 = load float, float* %3
%17 = fmul float 4.000000e+00, %16
%18 = call float @llvm.fmuladd.f32(float %14, float %15, float %17)
%19 = fsub float %18, 1.000000e+00
store float %19, float* %2
br label %20
20: ; preds = %12, %7
%21 = load float, float* %2
ret float %21
}

LLVM IR (-O2):
define float @quadraticEaseInOutf(float %0) {
%2 = fcmp olt float %0, 5.000000e-01
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = fmul float %0, 2.000000e+00
%5 = fmul float %4, %0
br label %11
6: ; preds = %1
%7 = fmul float %0, -2.000000e+00
%8 = fmul float %0, 4.000000e+00
%9 = tail call float @llvm.fmuladd.f32(float %7, float %0, float %8)
%10 = fadd float %9, -1.000000e+00
br label %11
11: ; preds = %6, %3
%12 = phi float [ %5, %3 ], [ %10, %6 ]
ret float %12
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void byteorder2(void *dst, const void *src, size_t dst_size, size_t src_size) {
  assert(dst_size >= src_size);
  memcpy(dst, src, src_size);
}


x86 assembly (clang, -O0):
<byteorder2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<byteorder2>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %edi,%edi
cmp    %rcx,%rdx
setae  %dil
call   1030 <assert@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <memcpy@plt>

LLVM IR (-O0):
define void @byteorder2(i8* %0, i8* %1, i64 %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %7
%10 = load i64, i64* %8
%11 = icmp uge i64 %9, %10
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i8*, i8** %5
%15 = load i8*, i8** %6
%16 = load i64, i64* %8
%17 = call i32 @memcpy(i8* %14, i8* %15, i64 %16)
ret void
}

LLVM IR (-O2):
define void @byteorder2(i8* %0, i8* %1, i64 %2, i64 %3) {
%5 = icmp uge i64 %2, %3
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ MC_put2_16(int, int /*<<< orphan*/ *,
                              int /*<<< orphan*/ const *, int, int, int);
void MC_put_x_16_3dnow(uint8_t *dest, const uint8_t *ref, int stride,
                       int height) {
  MC_put2_16(height, dest, ref, stride, 1, 1);
}


x86 assembly (clang, -O0):
<MC_put_x_16_3dnow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x1,%r9d
mov    %r9d,%r8d
call   1030 <MC_put2_16@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MC_put_x_16_3dnow>:
mov    %edx,%eax
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %ecx,%edi
mov    %eax,%ecx
mov    $0x1,%r8d
mov    $0x1,%r9d
jmp    1030 <MC_put2_16@plt>

LLVM IR (-O0):
define void @MC_put_x_16_3dnow(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = load i32*, i32** %5
%11 = load i32*, i32** %6
%12 = load i32, i32* %7
%13 = call i32 @MC_put2_16(i32 %9, i32* %10, i32* %11, i32 %12, i32 1, i32 1)
ret void
}

LLVM IR (-O2):
define void @MC_put_x_16_3dnow(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = tail call i32 @MC_put2_16(i32 %3, i32* %0, i32* %1, i32 %2, i32 1, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int start, finish;
  int *examine;
  start = 100;
  finish = 9;
  examine = &start;
  *examine = 100;
  printf("%d little old ladies started the race.\n", start);
  examine = &finish;
  printf("But only %d little old ladies finished.\n", *examine);
  printf("");
  exit(3245);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
movl   $0x9,-0xc(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x64,(%rax)
mov    -0x8(%rbp),%esi
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xcad,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x64,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
mov    $0x9,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0xcad,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"%d little old ladies started the race.\0A\00"
@.str.1 = [41 x i8] c"But only %d little old ladies finished.\0A\00"
@.str.2 = [1 x i8] zeroinitializer
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
store i32 0, i32* %1
store i32 100, i32* %2
store i32 9, i32* %3
store i32* %2, i32** %4
%5 = load i32*, i32** %4
store i32 100, i32* %5
%6 = load i32, i32* %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %6)
store i32* %3, i32** %4
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @exit(i32 3245)
unreachable
}

LLVM IR (-O2):
@.str = [40 x i8] c"%d little old ladies started the race.\0A\00"
@.str.1 = [41 x i8] c"But only %d little old ladies finished.\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 100)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i32 9)
%3 = tail call i32 @exit(i32 3245)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xc3() {
  Assert_real((islower(195) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_islower.c",
              980, ("islower should be 0 for 0xc3"));
}


x86 assembly (clang, -O0):
<t_islower_0xc3>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc3,%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x3d4,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_islower_0xc3>:
push   %rax
mov    $0xc3,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3d4,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xc3\00"
define void @t_islower_0xc3() {
%1 = call i64 @islower(i32 195)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 980, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xc3\00"
define void @t_islower_0xc3() {
%1 = tail call i64 @islower(i32 195)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 980, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned int _uiCommInit(void) { return (0x0000); }


x86 assembly (clang, -O0):
<_uiCommInit>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_uiCommInit>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @_uiCommInit() {
ret i32 0
}

LLVM IR (-O2):
define i32 @_uiCommInit() {
ret i32 0
}
void input_to_data(int fd, void *vdata) {}


x86 assembly (clang, -O0):
<input_to_data>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<input_to_data>:
ret

LLVM IR (-O0):
define void @input_to_data(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @input_to_data(i32 %0, i8* nocapture %1) {
ret void
}
/* Type definitions */
struct ether_addr {
  int dummy;
};

/* Variables and functions */
int ARPHRD_ETHER;
char *ether_ntoa(struct ether_addr *);
char *hw_addr_parse(char *haddr, int htype) {
  if (!(htype == ARPHRD_ETHER))
    return "UNSPEC";
  return ether_ntoa((struct ether_addr *)haddr);
}


x86 assembly (clang, -O0):
<hw_addr_parse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2ebf(%rip),%rcx
cmp    (%rcx),%eax
je     1141 <hw_addr_parse+0x31>
lea    0xec8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    114e <hw_addr_parse+0x3e>
mov    -0x10(%rbp),%rdi
call   1030 <ether_ntoa@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hw_addr_parse>:
mov    0x2ed1(%rip),%rax
cmp    %esi,(%rax)
jne    1120 <hw_addr_parse+0x10>
jmp    1030 <ether_ntoa@plt>
lea    0xed9(%rip),%rax
ret

LLVM IR (-O0):
%struct.ether_addr = type { i32 }
@ARPHRD_ETHER = global i32 0
@.str = [7 x i8] c"UNSPEC\00"
define i8* @hw_addr_parse(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = load i32, i32* @ARPHRD_ETHER
%8 = icmp eq i32 %6, %7
br i1 %8, label %10, label %9
9: ; preds = %2
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %3
br label %14
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = bitcast i8* %11 to %struct.ether_addr*
%13 = call i8* @ether_ntoa(%struct.ether_addr* %12)
store i8* %13, i8** %3
br label %14
14: ; preds = %10, %9
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
%struct.ether_addr = type { i32 }
@ARPHRD_ETHER = global i32 0
@.str = [7 x i8] c"UNSPEC\00"
define i8* @hw_addr_parse(i8* %0, i32 %1) {
%3 = load i32, i32* @ARPHRD_ETHER
%4 = icmp eq i32 %3, %1
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = bitcast i8* %0 to %struct.ether_addr*
%7 = tail call i8* @ether_ntoa(%struct.ether_addr* %6)
br label %8
8: ; preds = %2, %5
%9 = phi i8* [ %7, %5 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), %2 ]
ret i8* %9
}
void bork() { char Qux[33] = {0}; }


x86 assembly (clang, -O0):
<bork>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x21,%edx
call   1030 <memset@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bork>:
ret

LLVM IR (-O0):
define void @bork() {
%1 = alloca [33 x i8]
%2 = bitcast [33 x i8]* %1 to i8*
ret void
}

LLVM IR (-O2):
define void @bork() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ handleGdbInput(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
void handleGdbPrompt(char *line) {
  int length = strlen(line);
  if (length == 6) {
  } else {
    char *linewithoutgdb = (char *)malloc(length - 5);
    strcpy(linewithoutgdb, line + 6);
    handleGdbInput(linewithoutgdb);
  }
}


x86 assembly (clang, -O0):
<handleGdbPrompt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x6,-0xc(%rbp)
jne    1167 <handleGdbPrompt+0x27>
jmp    1190 <handleGdbPrompt+0x50>
mov    -0xc(%rbp),%edi
sub    $0x5,%edi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x6,%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
call   1050 <handleGdbInput@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handleGdbPrompt>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <strlen@plt>
cmp    $0x6,%eax
jne    1159 <handleGdbPrompt+0x19>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
add    $0xfffffffb,%eax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,%r14
add    $0x6,%rbx
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <handleGdbInput@plt>

LLVM IR (-O0):
define void @handleGdbPrompt(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 6
br i1 %8, label %9, label %10
9: ; preds = %1
br label %21
10: ; preds = %1
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 5
%13 = call i64 @malloc(i32 %12)
%14 = inttoptr i64 %13 to i8*
store i8* %14, i8** %4
%15 = load i8*, i8** %4
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 6
%18 = call i32 @strcpy(i8* %15, i8* %17)
%19 = load i8*, i8** %4
%20 = call i32 @handleGdbInput(i8* %19)
br label %21
21: ; preds = %10, %9
ret void
}

LLVM IR (-O2):
define void @handleGdbPrompt(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp eq i32 %2, 6
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = add nsw i32 %2, -5
%6 = tail call i64 @malloc(i32 %5)
%7 = inttoptr i64 %6 to i8*
%8 = getelementptr inbounds i8, i8* %0, i64 6
%9 = tail call i32 @strcpy(i8* %7, i8* %8)
%10 = tail call i32 @handleGdbInput(i8* %7)
br label %11
11: ; preds = %1, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Genesis();
int /*<<< orphan*/ SaveCheckpoint(char *, int);
void NewGame(char *name, int *count) {
  Genesis();
  *count = 0;
  SaveCheckpoint(name, *count);
}


x86 assembly (clang, -O0):
<NewGame>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <Genesis@plt>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1040 <SaveCheckpoint@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NewGame>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <Genesis@plt>
movl   $0x0,(%rbx)
mov    %r14,%rdi
xor    %esi,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <SaveCheckpoint@plt>

LLVM IR (-O0):
define void @NewGame(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = call i32 (...) @Genesis()
%6 = load i32*, i32** %4
store i32 0, i32* %6
%7 = load i8*, i8** %3
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = call i32 @SaveCheckpoint(i8* %7, i32 %9)
ret void
}

LLVM IR (-O2):
define void @NewGame(i8* %0, i32* nocapture writeonly %1) {
%3 = tail call i32 (...) @Genesis()
store i32 0, i32* %1
%4 = tail call i32 @SaveCheckpoint(i8* %0, i32 0)
ret void
}
int security_msg_queue_associate(struct msg_queue *msq, int msgid, int msgflg) {
  return 0;
}


x86 assembly (clang, -O0):
<security_msg_queue_associate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<security_msg_queue_associate>:
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.msg_queue = type opaque
define i32 @security_msg_queue_associate(%struct.msg_queue* %0, i32 %1, i32 %2) {
%4 = alloca %struct.msg_queue*
%5 = alloca i32
%6 = alloca i32
store %struct.msg_queue* %0, %struct.msg_queue** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.msg_queue = type opaque
define i32 @security_msg_queue_associate(%struct.msg_queue* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write_src(char *);
void if_handler(void) {
  write_src("{\n");
  write_src("imm_t line = POP();\n");
  write_src("imm_t truth = POP();\n");
  write_src("if(!truth)\n");
  write_src("JUMP(line);\n");
  write_src("}\n");
}


x86 assembly (clang, -O0):
<if_handler>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <write_src@plt>
lea    0xedc(%rip),%rdi
call   1030 <write_src@plt>
lea    0xee5(%rip),%rdi
call   1030 <write_src@plt>
lea    0xeef(%rip),%rdi
call   1030 <write_src@plt>
lea    0xeef(%rip),%rdi
call   1030 <write_src@plt>
lea    0xef0(%rip),%rdi
call   1030 <write_src@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<if_handler>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <write_src@plt>
lea    0xedf(%rip),%rdi
call   1030 <write_src@plt>
lea    0xee8(%rip),%rdi
call   1030 <write_src@plt>
lea    0xef2(%rip),%rdi
call   1030 <write_src@plt>
lea    0xef2(%rip),%rdi
call   1030 <write_src@plt>
lea    0xef3(%rip),%rdi
pop    %rax
jmp    1030 <write_src@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"{\0A\00"
@.str.1 = [21 x i8] c"imm_t line = POP();\0A\00"
@.str.2 = [22 x i8] c"imm_t truth = POP();\0A\00"
@.str.3 = [12 x i8] c"if(!truth)\0A\00"
@.str.4 = [13 x i8] c"JUMP(line);\0A\00"
@.str.5 = [3 x i8] c"}\0A\00"
define void @if_handler() {
%1 = call i32 @write_src(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @write_src(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @write_src(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @write_src(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @write_src(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%6 = call i32 @write_src(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"{\0A\00"
@.str.1 = [21 x i8] c"imm_t line = POP();\0A\00"
@.str.2 = [22 x i8] c"imm_t truth = POP();\0A\00"
@.str.3 = [12 x i8] c"if(!truth)\0A\00"
@.str.4 = [13 x i8] c"JUMP(line);\0A\00"
@.str.5 = [3 x i8] c"}\0A\00"
define void @if_handler() {
%1 = tail call i32 @write_src(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @write_src(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @write_src(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @write_src(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @write_src(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%6 = tail call i32 @write_src(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
ret void
}
/* Variables and functions */
int errno;
int tosError_getCode() { return errno; }


x86 assembly (clang, -O0):
<tosError_getCode>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tosError_getCode>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @tosError_getCode() {
%1 = load i32, i32* @errno
ret i32 %1
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @tosError_getCode() {
%1 = load i32, i32* @errno
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ outb(unsigned short, int);
void serial_cfg_buf(unsigned short com) { outb((com + 2), 0xC7); }


x86 assembly (clang, -O0):
<serial_cfg_buf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
add    $0x2,%eax
mov    $0xc7,%esi
movzwl %ax,%edi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_cfg_buf>:
add    $0x2,%edi
movzwl %di,%edi
mov    $0xc7,%esi
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @serial_cfg_buf(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = add nsw i32 %4, 2
%6 = trunc i32 %5 to i16
%7 = call i32 @outb(i16 zeroext %6, i32 199)
ret void
}

LLVM IR (-O2):
define void @serial_cfg_buf(i16 zeroext %0) {
%2 = add i16 %0, 2
%3 = tail call i32 @outb(i16 zeroext %2, i32 199)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(char const *);
scalar_t__ strcat(char *, char const *);
int trio_append(char *target, const char *source) {
  assert(target);
  assert(source);
  return (strcat(target, source) != 0);
}


x86 assembly (clang, -O0):
<trio_append>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcat@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trio_append>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    %r14,%rdi
call   1030 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcat@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @trio_append(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i32 @assert(i8* %5)
%7 = load i8*, i8** %4
%8 = call i32 @assert(i8* %7)
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = call i64 @strcat(i8* %9, i8* %10)
%12 = icmp ne i64 %11, 0
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @trio_append(i8* %0, i8* %1) {
%3 = tail call i32 @assert(i8* %0)
%4 = tail call i32 @assert(i8* %1)
%5 = tail call i64 @strcat(i8* %0, i8* %1)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
void f(volatile char *p) { char c = p[0]; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    (%rdi),%al
ret

LLVM IR (-O0):
define void @f(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load volatile i8, i8* %5
store i8 %6, i8* %3
ret void
}

LLVM IR (-O2):
define void @f(i8* %0) {
%2 = load volatile i8, i8* %0
ret void
}
int Cyc_Character_isgraph(unsigned char c) { return c >= '!' ? c <= '~' : 0; }


x86 assembly (clang, -O0):
<Cyc_Character_isgraph>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x21,%eax
jl     112e <Cyc_Character_isgraph+0x2e>
movzbl -0x1(%rbp),%eax
cmp    $0x7e,%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
jmp    1138 <Cyc_Character_isgraph+0x38>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1138 <Cyc_Character_isgraph+0x38>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Character_isgraph>:
add    $0xdf,%dil
xor    %eax,%eax
cmp    $0x5e,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @Cyc_Character_isgraph(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp sge i32 %4, 33
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = icmp sle i32 %8, 126
%10 = zext i1 %9 to i32
br label %12
11: ; preds = %1
br label %12
12: ; preds = %11, %6
%13 = phi i32 [ %10, %6 ], [ 0, %11 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @Cyc_Character_isgraph(i8 zeroext %0) {
%2 = add i8 %0, -33
%3 = icmp ult i8 %2, 94
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
void TCASM_write_uint16_zeroarray(uint16_t dst[], size_t pos, size_t count) {
  for (size_t i = 0; i < count; ++i)
    dst[pos + i] = 0;
}


x86 assembly (clang, -O0):
<TCASM_write_uint16_zeroarray>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    114b <TCASM_write_uint16_zeroarray+0x4b>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
add    -0x20(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1118 <TCASM_write_uint16_zeroarray+0x18>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TCASM_write_uint16_zeroarray>:
test   %rdx,%rdx
je     1129 <TCASM_write_uint16_zeroarray+0x19>
push   %rax
lea    (%rdi,%rsi,8),%rdi
shl    $0x3,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @TCASM_write_uint16_zeroarray(i64* %0, i64 %1, i64 %2) {
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64* %0, i64** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
store i64 0, i64* %7
br label %8
8: ; preds = %18, %3
%9 = load i64, i64* %7
%10 = load i64, i64* %6
%11 = icmp ult i64 %9, %10
br i1 %11, label %12, label %21
12: ; preds = %8
%13 = load i64*, i64** %4
%14 = load i64, i64* %5
%15 = load i64, i64* %7
%16 = add i64 %14, %15
%17 = getelementptr inbounds i64, i64* %13, i64 %16
store i64 0, i64* %17
br label %18
18: ; preds = %12
%19 = load i64, i64* %7
%20 = add i64 %19, 1
store i64 %20, i64* %7
br label %8
21: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @TCASM_write_uint16_zeroarray(i64* nocapture writeonly %0, i64 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = getelementptr i64, i64* %0, i64 %1
%7 = bitcast i64* %6 to i8*
%8 = shl nuw i64 %2, 3
br label %9
9: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_str(void *str) { printf("%s", (char *)str); }


x86 assembly (clang, -O0):
<print_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_str>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @print_str(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @print_str(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  scanf("%d", &a);
  printf("\n%d ", a * a);
  printf("\n%d\n", a * a * a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
imul   -0x8(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
imul   -0x8(%rbp),%esi
imul   -0x8(%rbp),%esi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
imul   %esi,%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    0x4(%rsp),%eax
mov    %eax,%esi
imul   %eax,%esi
imul   %eax,%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"\0A%d \00"
@.str.2 = [5 x i8] c"\0A%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = mul nsw i32 %4, %5
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %2
%9 = load i32, i32* %2
%10 = mul nsw i32 %8, %9
%11 = load i32, i32* %2
%12 = mul nsw i32 %10, %11
%13 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"\0A%d \00"
@.str.2 = [5 x i8] c"\0A%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = mul nsw i32 %7, %7
%9 = mul nsw i32 %8, %7
%10 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}
void av_hwdevice_get_type_name() {}


x86 assembly (clang, -O0):
<av_hwdevice_get_type_name>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_hwdevice_get_type_name>:
ret

LLVM IR (-O0):
define void @av_hwdevice_get_type_name() {
ret void
}

LLVM IR (-O2):
define void @av_hwdevice_get_type_name() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ CLOCK_SYS_GetFixedFreqClockFreq();
uint32_t CLOCK_SYS_GetFtmFixedFreq(uint32_t instance) {
  (void)instance;
  return CLOCK_SYS_GetFixedFreqClockFreq();
}


x86 assembly (clang, -O0):
<CLOCK_SYS_GetFtmFixedFreq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <CLOCK_SYS_GetFixedFreqClockFreq@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CLOCK_SYS_GetFtmFixedFreq>:
xor    %eax,%eax
jmp    1030 <CLOCK_SYS_GetFixedFreqClockFreq@plt>

LLVM IR (-O0):
define i32 @CLOCK_SYS_GetFtmFixedFreq(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (...) @CLOCK_SYS_GetFixedFreqClockFreq()
ret i32 %4
}

LLVM IR (-O2):
define i32 @CLOCK_SYS_GetFtmFixedFreq(i32 %0) {
%2 = tail call i32 (...) @CLOCK_SYS_GetFixedFreqClockFreq()
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  char myFirstString[6] = {'H', 'e', 'l', 'l', 'o', '\0'};
  char *mySecondString = "Hello World";
  printf("Here is my first String: %s\n", myFirstString);
  printf("Here is my second String: %s\n", mySecondString);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xed4(%rip),%eax
mov    %eax,-0x16(%rbp)
mov    0xece(%rip),%ax
mov    %ax,-0x12(%rbp)
lea    0xec5(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    -0x16(%rbp),%rsi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rsi
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movw   $0x6f,0x4(%rsp)
movl   $0x6c6c6548,(%rsp)
lea    0xeec(%rip),%rdi
mov    %rsp,%rsi
call   1030 <printf@plt>
lea    0xefa(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.myFirstString = [6 x i8] c"Hello\00"
@.str = [12 x i8] c"Hello World\00"
@.str.1 = [29 x i8] c"Here is my first String: %s\0A\00"
@.str.2 = [30 x i8] c"Here is my second String: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [6 x i8]
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [6 x i8]* %6 to i8*
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %7
%9 = getelementptr inbounds [6 x i8], [6 x i8]* %6, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = load i8*, i8** %7
%12 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* %11)
ret i32 0
}

LLVM IR (-O2):
@__const.main.myFirstString = [6 x i8] c"Hello\00"
@.str = [12 x i8] c"Hello World\00"
@.str.1 = [29 x i8] c"Here is my first String: %s\0A\00"
@.str.2 = [30 x i8] c"Here is my second String: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [6 x i8]
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ MCSDL_RESETB_SET_INPUT();
int /*<<< orphan*/ MCSDL_VDD_SET_HIGH();
int /*<<< orphan*/ MCSDL_VDD_SET_LOW();
int /*<<< orphan*/ mcsdl_delay(int);
void mms100_ISC_set_ready(void) {
  MCSDL_VDD_SET_LOW();
  MCSDL_RESETB_SET_INPUT();
  mcsdl_delay(100000);
  MCSDL_VDD_SET_HIGH();
  mcsdl_delay(500000);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <MCSDL_VDD_SET_LOW@plt>
mov    $0x0,%al
call   1050 <MCSDL_RESETB_SET_INPUT@plt>
mov    $0x186a0,%edi
call   1060 <mcsdl_delay@plt>
mov    $0x0,%al
call   1040 <MCSDL_VDD_SET_HIGH@plt>
mov    $0x7a120,%edi
call   1060 <mcsdl_delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
xor    %eax,%eax
call   1030 <MCSDL_VDD_SET_LOW@plt>
xor    %eax,%eax
call   1050 <MCSDL_RESETB_SET_INPUT@plt>
mov    $0x186a0,%edi
call   1060 <mcsdl_delay@plt>
xor    %eax,%eax
call   1040 <MCSDL_VDD_SET_HIGH@plt>
mov    $0x7a120,%edi
pop    %rax
jmp    1060 <mcsdl_delay@plt>

LLVM IR (-O0):
define void @mms100_ISC_set_ready() {
%1 = call i32 (...) @MCSDL_VDD_SET_LOW()
%2 = call i32 (...) @MCSDL_RESETB_SET_INPUT()
%3 = call i32 @mcsdl_delay(i32 100000)
%4 = call i32 (...) @MCSDL_VDD_SET_HIGH()
%5 = call i32 @mcsdl_delay(i32 500000)
ret void
}

LLVM IR (-O2):
define void @mms100_ISC_set_ready() {
%1 = tail call i32 (...) @MCSDL_VDD_SET_LOW()
%2 = tail call i32 (...) @MCSDL_RESETB_SET_INPUT()
%3 = tail call i32 @mcsdl_delay(i32 100000)
%4 = tail call i32 (...) @MCSDL_VDD_SET_HIGH()
%5 = tail call i32 @mcsdl_delay(i32 500000)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DMA0_DriverIRQHandler();
__attribute__((weak, section(".after_vectors"))) void DMA0_IRQHandler(void) {
  DMA0_DriverIRQHandler();
}


x86 assembly (clang, -O0):
<DMA0_IRQHandler>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <DMA0_DriverIRQHandler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DMA0_IRQHandler>:
xor    %eax,%eax
jmp    1030 <DMA0_DriverIRQHandler@plt>

LLVM IR (-O0):
define weak void @DMA0_IRQHandler() section ".after_vectors" {
%1 = call i32 (...) @DMA0_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @DMA0_IRQHandler() section ".after_vectors" {
%1 = tail call i32 (...) @DMA0_DriverIRQHandler()
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void st_u16_be(void *x, uint16_t u) {
  ((((uint8_t *)x)[0]) = ((u) >> 8) % 256, (((uint8_t *)x)[1]) = ((u) % 256));
}


x86 assembly (clang, -O0):
<st_u16_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
mov    %edx,(%rax)
mov    -0xc(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
mov    %edx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<st_u16_be>:
mov    %esi,%eax
sar    $0x8,%eax
lea    0xff(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffffff00,%ecx
sub    %ecx,%eax
lea    0xff(%rsi),%ecx
test   %esi,%esi
cmovns %esi,%ecx
mov    %eax,(%rdi)
and    $0xffffff00,%ecx
sub    %ecx,%esi
mov    %esi,0x4(%rdi)
ret

LLVM IR (-O0):
define void @st_u16_be(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 8
%7 = srem i32 %6, 256
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i32*
%10 = getelementptr inbounds i32, i32* %9, i64 0
store i32 %7, i32* %10
%11 = load i32, i32* %4
%12 = srem i32 %11, 256
%13 = load i8*, i8** %3
%14 = bitcast i8* %13 to i32*
%15 = getelementptr inbounds i32, i32* %14, i64 1
store i32 %12, i32* %15
ret void
}

LLVM IR (-O2):
define void @st_u16_be(i8* nocapture writeonly %0, i32 %1) {
%3 = ashr i32 %1, 8
%4 = srem i32 %3, 256
%5 = bitcast i8* %0 to i32*
store i32 %4, i32* %5
%6 = srem i32 %1, 256
%7 = getelementptr inbounds i8, i8* %0, i64 4
%8 = bitcast i8* %7 to i32*
store i32 %6, i32* %8
ret void
}
int main(int argc, char *argv[]) {
  unsigned char gate = 0;
#pragma omp parallel shared(gate)
  {
#pragma omp master
    {
      int i, j;
      for (i = 0; i < 100; i++) {
        for (j = 0; j < 100; j++) {
        }
      }
      gate = 1;
#pragma omp flush
    }
    while (gate == 0)
      ;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x0,-0x11(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x64,-0x18(%rbp)
jge    115e <main+0x5e>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x64,-0x1c(%rbp)
jge    114b <main+0x4b>
jmp    113d <main+0x3d>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112e <main+0x2e>
jmp    1150 <main+0x50>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    111d <main+0x1d>
movb   $0x1,-0x11(%rbp)
movzbl -0x11(%rbp),%eax
cmp    $0x0,%eax
jne    1174 <main+0x74>
jmp    1162 <main+0x62>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8 0, i8* %6
store i32 0, i32* %7
br label %9
9: ; preds = %21, %2
%10 = load i32, i32* %7
%11 = icmp slt i32 %10, 100
br i1 %11, label %12, label %24
12: ; preds = %9
store i32 0, i32* %8
br label %13
13: ; preds = %17, %12
%14 = load i32, i32* %8
%15 = icmp slt i32 %14, 100
br i1 %15, label %16, label %20
16: ; preds = %13
br label %17
17: ; preds = %16
%18 = load i32, i32* %8
%19 = add nsw i32 %18, 1
store i32 %19, i32* %8
br label %13
20: ; preds = %13
br label %21
21: ; preds = %20
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 1
store i32 %23, i32* %7
br label %9
24: ; preds = %9
store i8 1, i8* %6
br label %25
25: ; preds = %29, %24
%26 = load i8, i8* %6
%27 = zext i8 %26 to i32
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %30
29: ; preds = %25
br label %25
30: ; preds = %25
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int, unsigned int,
                          char const *);
void do_sync_ls_cb(unsigned mode, unsigned size, unsigned time,
                   const char *name, void *cookie) {
  printf("%08x %08x %08x %s\n", mode, size, time, name);
}


x86 assembly (clang, -O0):
<do_sync_ls_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_sync_ls_cb>:
mov    %rcx,%r8
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
lea    0xee0(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"%08x %08x %08x %s\0A\00"
define void @do_sync_ls_cb(i32 %0, i32 %1, i32 %2, i8* %3, i8* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i8*, i8** %9
%15 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12, i32 %13, i8* %14)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"%08x %08x %08x %s\0A\00"
define void @do_sync_ls_cb(i32 %0, i32 %1, i32 %2, i8* %3, i8* nocapture readnone %4) {
%6 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2, i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ createdir(char *);
int main() { createdir("./data/test"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <createdir@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <createdir@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"./data/test\00"
define i32 @main() {
%1 = call i32 @createdir(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"./data/test\00"
define i32 @main() {
%1 = tail call i32 @createdir(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}