xunge/DecIR huggingface dataset:
void rop3_56_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = *D | T;
  stk2 = S & stk3;
  stk1 = T ^ stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_56_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_56_1_1>:
or     %edx,%esi
and    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_56_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = load i8, i8* %6
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
%17 = load i8, i8* %5
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = and i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8, i8* %6
%24 = zext i8 %23 to i32
%25 = load i8, i8* %8
%26 = zext i8 %25 to i32
%27 = xor i32 %24, %26
%28 = trunc i32 %27 to i8
store i8 %28, i8* %7
%29 = load i8, i8* %7
%30 = zext i8 %29 to i32
%31 = load i8, i8* %5
%32 = zext i8 %31 to i32
%33 = xor i32 %32, -1
%34 = and i32 %30, %33
%35 = load i8, i8* %6
%36 = zext i8 %35 to i32
%37 = xor i32 %36, -1
%38 = and i32 %34, %37
%39 = load i8*, i8** %4
%40 = load i8, i8* %39
%41 = zext i8 %40 to i32
%42 = load i8, i8* %5
%43 = zext i8 %42 to i32
%44 = and i32 %41, %43
%45 = or i32 %38, %44
%46 = load i8*, i8** %4
%47 = load i8, i8* %46
%48 = zext i8 %47 to i32
%49 = load i8, i8* %6
%50 = zext i8 %49 to i32
%51 = and i32 %48, %50
%52 = or i32 %45, %51
%53 = trunc i32 %52 to i8
%54 = load i8*, i8** %4
store i8 %53, i8* %54
ret void
}

LLVM IR (-O2):
define void @rop3_56_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = and i8 %4, %5
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
int mkdir(char *, int);
int ss_filemkdir(char *path) { return mkdir(path, 0750); }


x86 assembly (clang, -O0):
<ss_filemkdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1e8,%esi
call   1030 <mkdir@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ss_filemkdir>:
mov    $0x1e8,%esi
jmp    1030 <mkdir@plt>

LLVM IR (-O0):
define i32 @ss_filemkdir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @mkdir(i8* %3, i32 488)
ret i32 %4
}

LLVM IR (-O2):
define i32 @ss_filemkdir(i8* nocapture %0) {
%2 = tail call i32 @mkdir(i8* %0, i32 488)
ret i32 %2
}
char *to_string(char *s) {
  if (s)
    return s;
  return "";
}


x86 assembly (clang, -O0):
<to_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1120 <to_string+0x20>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112b <to_string+0x2b>
lea    0xed9(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_string>:
test   %rdi,%rdi
lea    0xef6(%rip),%rax
cmovne %rdi,%rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @to_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i8*, i8** %3
store i8* %7, i8** %2
br label %9
8: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
9: ; preds = %8, %6
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @to_string(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %0
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ udelay(int);
void mdelay(unsigned int n) {
  while (--n)
    udelay(1000);
}


x86 assembly (clang, -O0):
<mdelay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     113c <mdelay+0x2c>
mov    $0x3e8,%edi
call   1030 <udelay@plt>
jmp    111b <mdelay+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mdelay>:
push   %rbx
mov    %edi,%ebx
add    $0xffffffff,%ebx
je     112f <mdelay+0x1f>
nopl   0x0(%rax,%rax,1)
mov    $0x3e8,%edi
call   1030 <udelay@plt>
add    $0xffffffff,%ebx
jne    1120 <mdelay+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @mdelay(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* %2
%5 = add i32 %4, -1
store i32 %5, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 @udelay(i32 1000)
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @mdelay(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp eq i32 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ %2, %1 ]
%6 = tail call i32 @udelay(i32 1000)
%7 = add i32 %5, -1
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OledPutString(char *);
int /*<<< orphan*/ OledSetCursor(int /*<<< orphan*/, int);
void OledPrintLine(char *str, int column) {
  if (!*str)
    return;
  OledSetCursor(0, column);
  OledPutString(str);
}


x86 assembly (clang, -O0):
<OledPrintLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1141 <OledPrintLine+0x21>
jmp    1154 <OledPrintLine+0x34>
mov    -0xc(%rbp),%esi
xor    %edi,%edi
call   1030 <OledSetCursor@plt>
mov    -0x8(%rbp),%rdi
call   1040 <OledPutString@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OledPrintLine>:
push   %rbx
cmpb   $0x0,(%rdi)
je     1139 <OledPrintLine+0x19>
mov    %rdi,%rbx
xor    %edi,%edi
call   1030 <OledSetCursor@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <OledPutString@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @OledPrintLine(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %2
br label %14
9: ; preds = %2
%10 = load i32, i32* %4
%11 = call i32 @OledSetCursor(i32 0, i32 %10)
%12 = load i8*, i8** %3
%13 = call i32 @OledPutString(i8* %12)
br label %14
14: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
define void @OledPrintLine(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @OledSetCursor(i32 0, i32 %1)
%7 = tail call i32 @OledPutString(i8* %0)
br label %8
8: ; preds = %2, %5
ret void
}
void mem_pool_destroy(struct mem_pool_hdr *mem_pool) {}


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

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

LLVM IR (-O0):
%struct.mem_pool_hdr = type opaque
define void @mem_pool_destroy(%struct.mem_pool_hdr* %0) {
%2 = alloca %struct.mem_pool_hdr*
store %struct.mem_pool_hdr* %0, %struct.mem_pool_hdr** %2
ret void
}

LLVM IR (-O2):
%struct.mem_pool_hdr = type opaque
define void @mem_pool_destroy(%struct.mem_pool_hdr* nocapture %0) {
ret void
}
int getbit(const unsigned char *buf, int x) {
  return (buf[x >> 3] >> (7 - (x & 7))) & 1;
}


x86 assembly (clang, -O0):
<getbit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sar    $0x3,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
mov    -0xc(%rbp),%edx
and    $0x7,%edx
mov    $0x7,%ecx
sub    %edx,%ecx
sar    %cl,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getbit>:
mov    %esi,%ecx
mov    %esi,%eax
sar    $0x3,%eax
cltq
movzbl (%rdi,%rax,1),%eax
not    %cl
and    $0x7,%cl
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @getbit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = ashr i32 %6, 3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i32, i32* %4
%13 = and i32 %12, 7
%14 = sub nsw i32 7, %13
%15 = ashr i32 %11, %14
%16 = and i32 %15, 1
ret i32 %16
}

LLVM IR (-O2):
define i32 @getbit(i8* nocapture %0, i32 %1) {
%3 = ashr i32 %1, 3
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = and i32 %1, 7
%9 = xor i32 %8, 7
%10 = lshr i32 %7, %9
%11 = and i32 %10, 1
ret i32 %11
}
double FMAX(const double a, const double b) { return ((a > b) ? a : b); }


x86 assembly (clang, -O0):
<FMAX>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112d <FMAX+0x2d>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <FMAX+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<FMAX>:
maxsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @FMAX(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ogt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @FMAX(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int /*<<< orphan*/ nlogn(int);
void main() {
  int n = __VERIFIER_nondet_int();
  nlogn(n);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <nlogn@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @nlogn(i32 %3)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 @nlogn(i32 %1)
ret void
}
/* Type definitions */
struct timespec {
  size_t tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void world_test_sleep_msec(size_t msec) {
  struct timespec t;
  t.tv_sec = 0;
  t.tv_nsec = msec * 1000000;
  nanosleep(&t, NULL);
}


x86 assembly (clang, -O0):
<world_test_sleep_msec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
imul   $0xf4240,-0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<world_test_sleep_msec>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
imul   $0xf4240,%rdi,%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define void @world_test_sleep_msec(i64 %0) {
%2 = alloca i64
%3 = alloca %struct.timespec
store i64 %0, i64* %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i64 0, i64* %4
%5 = load i64, i64* %2
%6 = mul i64 %5, 1000000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i64 %6, i64* %7
%8 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define void @world_test_sleep_msec(i64 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i64 0, i64* %4
%5 = mul i64 %0, 1000000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i64 %5, i64* %6
%7 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int mkstemps(char *, int);
void no_resourceLeak_mkstemps_01(char *template, int suffixlen) {
  int fp = mkstemps(template, suffixlen);
  close(fp);
}


x86 assembly (clang, -O0):
<no_resourceLeak_mkstemps_01>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <mkstemps@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<no_resourceLeak_mkstemps_01>:
push   %rax
call   1030 <mkstemps@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <close@plt>

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

LLVM IR (-O2):
define void @no_resourceLeak_mkstemps_01(i8* %0, i32 %1) {
%3 = tail call i32 @mkstemps(i8* %0, i32 %1)
%4 = tail call i32 @close(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
char *touch_malloc(int);
char *touch_realloc(char *, int);
int main(void) {
  char *a1, *b1, *a2 __attribute__((unused)), *b2 __attribute__((unused));
  printf("started\n");
  a1 = touch_malloc(1600000);
  b1 = touch_malloc(200000);
  a2 = touch_realloc(a1, 1601600);
  b2 = touch_realloc(b1, 200000);
  printf("success\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    $0x186a00,%edi
call   1050 <touch_malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x30d40,%edi
call   1050 <touch_malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x187040,%esi
call   1040 <touch_realloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x30d40,%esi
call   1040 <touch_realloc@plt>
mov    %rax,-0x28(%rbp)
lea    0xe77(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
mov    $0x186a00,%edi
call   1050 <touch_malloc@plt>
mov    %rax,%r14
mov    $0x30d40,%edi
call   1050 <touch_malloc@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    $0x187040,%esi
call   1040 <touch_realloc@plt>
mov    %rbx,%rdi
mov    $0x30d40,%esi
call   1040 <touch_realloc@plt>
lea    0xe8d(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@str = [8 x i8] c"started\00"
@str.2 = [8 x i8] c"success\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%2 = tail call i8* @touch_malloc(i32 1600000)
%3 = tail call i8* @touch_malloc(i32 200000)
%4 = tail call i8* @touch_realloc(i8* %2, i32 1601600)
%5 = tail call i8* @touch_realloc(i8* %3, i32 200000)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
int fun_a_int_release_so(int x[], int y[]) { return 20 + x[0] + y[0]; }


x86 assembly (clang, -O0):
<fun_a_int_release_so>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0x14,%eax
mov    -0x10(%rbp),%rcx
add    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_a_int_release_so>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
add    %ecx,%eax
add    $0x14,%eax
ret

LLVM IR (-O0):
define i32 @fun_a_int_release_so(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = add nsw i32 20, %7
%9 = load i32*, i32** %4
%10 = getelementptr inbounds i32, i32* %9, i64 0
%11 = load i32, i32* %10
%12 = add nsw i32 %8, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @fun_a_int_release_so(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = add nsw i32 %3, 20
%5 = load i32, i32* %1
%6 = add nsw i32 %4, %5
ret i32 %6
}
void go_south_east(int *lat, int *lon) {
  *lat = *lat - 1;
  *lon = *lon + 1;
}


x86 assembly (clang, -O0):
<go_south_east>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
sub    $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<go_south_east>:
addl   $0xffffffff,(%rdi)
addl   $0x1,(%rsi)
ret

LLVM IR (-O0):
define void @go_south_east(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = sub nsw i32 %6, 1
%8 = load i32*, i32** %3
store i32 %7, i32* %8
%9 = load i32*, i32** %4
%10 = load i32, i32* %9
%11 = add nsw i32 %10, 1
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @go_south_east(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = add nsw i32 %3, -1
store i32 %4, i32* %0
%5 = load i32, i32* %1
%6 = add nsw i32 %5, 1
store i32 %6, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ unlink(char const *);
void _kill_program(const char *path) {
  if (!unlink(path)) {
    printf("Delete file \"%s\" successfully.\n", path);
  } else {
    printf("Delete file \"%s\" failed.\n", path);
  }
}


x86 assembly (clang, -O0):
<_kill_program>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <unlink@plt>
cmp    $0x0,%eax
jne    1153 <_kill_program+0x33>
mov    -0x8(%rbp),%rsi
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
jmp    1163 <_kill_program+0x43>
mov    -0x8(%rbp),%rsi
lea    0xec2(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_kill_program>:
push   %rbx
mov    %rdi,%rbx
call   1030 <unlink@plt>
test   %eax,%eax
lea    0xece(%rip),%rax
lea    0xee7(%rip),%rdi
cmove  %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Delete file \22%s\22 successfully.\0A\00"
@.str.1 = [26 x i8] c"Delete file \22%s\22 failed.\0A\00"
define void @_kill_program(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @unlink(i8* %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %12
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %9, %6
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"Delete file \22%s\22 successfully.\0A\00"
@.str.1 = [26 x i8] c"Delete file \22%s\22 failed.\0A\00"
define void @_kill_program(i8* %0) {
%2 = tail call i32 @unlink(i8* %0)
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0)
%5 = tail call i32 @printf(i8* %4, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ testTrieAgainstDict(char *, char *);
int main() {
  testTrieAgainstDict("data/dat_testdict.txt", "data/dat_testdict.txt");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rsi
mov    %rsi,%rdi
call   1030 <testTrieAgainstDict@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [22 x i8] c"data/dat_testdict.txt\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @testTrieAgainstDict(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"data/dat_testdict.txt\00"
define i32 @main() {
%1 = tail call i32 @testTrieAgainstDict(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ h264nal_init(int /*<<< orphan*/ *);
int /*<<< orphan*/ h264nal_set_ref(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ h264nal_set_type(int /*<<< orphan*/ *, int);
void h264pps_init(uint8_t *p_h264pps) {
  h264nal_init(p_h264pps);
  h264nal_set_ref(p_h264pps, 1);
  h264nal_set_type(p_h264pps, 8);
}


x86 assembly (clang, -O0):
<h264pps_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <h264nal_init@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <h264nal_set_ref@plt>
mov    -0x8(%rbp),%rdi
mov    $0x8,%esi
call   1040 <h264nal_set_type@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h264pps_init>:
push   %rbx
mov    %rdi,%rbx
call   1050 <h264nal_init@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <h264nal_set_ref@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
pop    %rbx
jmp    1040 <h264nal_set_type@plt>

LLVM IR (-O0):
define void @h264pps_init(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @h264nal_init(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @h264nal_set_ref(i32* %5, i32 1)
%7 = load i32*, i32** %2
%8 = call i32 @h264nal_set_type(i32* %7, i32 8)
ret void
}

LLVM IR (-O2):
define void @h264pps_init(i32* %0) {
%2 = tail call i32 @h264nal_init(i32* %0)
%3 = tail call i32 @h264nal_set_ref(i32* %0, i32 1)
%4 = tail call i32 @h264nal_set_type(i32* %0, i32 8)
ret void
}
void pendfunc(int x) {
  asm("    .global "
      "set_point1"
      "\n"
      "set_point1"
      ":\n"
      "    call "
      "x86_trace_dummy"
      "\n");
}


x86 assembly (clang, -O0):
<pendfunc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)

x86 assembly (clang, -O2):
<pendfunc>:
call   1030 <x86_trace_dummy@plt>
ret

LLVM IR (-O0):
define void @pendfunc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @pendfunc(i32 %0) {
tail call void asm sideeffect " .global set_point1\0Aset_point1:\0A call x86_trace_dummy\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
float f(float x) {
  return x - (x * x * x) / 6.0f + (x * x * x * x * x) / 120.0f +
         (x * x * x * x * x * x * x) / 5040.0f;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
movss  0xee3(%rip),%xmm2
divss  %xmm2,%xmm1
subss  %xmm1,%xmm0
movss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
movss  0xeb6(%rip),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
movss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
movss  0xe7f(%rip),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
movaps %xmm1,%xmm2
divss  0xeea(%rip),%xmm2
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
movaps %xmm1,%xmm3
mulss  %xmm0,%xmm3
mulss  %xmm0,%xmm3
unpcklps %xmm3,%xmm1
divps  0xedd(%rip),%xmm1
addss  %xmm0,%xmm2
addss  %xmm1,%xmm2
shufps $0x55,%xmm1,%xmm1
addss  %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = load float, float* %2
%6 = fmul float %4, %5
%7 = load float, float* %2
%8 = fmul float %6, %7
%9 = fdiv float %8, 6.000000e+00
%10 = fsub float %3, %9
%11 = load float, float* %2
%12 = load float, float* %2
%13 = fmul float %11, %12
%14 = load float, float* %2
%15 = fmul float %13, %14
%16 = load float, float* %2
%17 = fmul float %15, %16
%18 = load float, float* %2
%19 = fmul float %17, %18
%20 = fdiv float %19, 1.200000e+02
%21 = fadd float %10, %20
%22 = load float, float* %2
%23 = load float, float* %2
%24 = fmul float %22, %23
%25 = load float, float* %2
%26 = fmul float %24, %25
%27 = load float, float* %2
%28 = fmul float %26, %27
%29 = load float, float* %2
%30 = fmul float %28, %29
%31 = load float, float* %2
%32 = fmul float %30, %31
%33 = load float, float* %2
%34 = fmul float %32, %33
%35 = fdiv float %34, 5.040000e+03
%36 = fadd float %21, %35
ret float %36
}

LLVM IR (-O2):
define float @f(float %0) {
%2 = fmul float %0, %0
%3 = fmul float %2, %0
%4 = fdiv float %3, 6.000000e+00
%5 = fsub float %0, %4
%6 = fmul float %3, %0
%7 = fmul float %6, %0
%8 = fmul float %7, %0
%9 = fmul float %8, %0
%10 = insertelement <2 x float> poison, float %7, i64 0
%11 = insertelement <2 x float> %10, float %9, i64 1
%12 = fdiv <2 x float> %11, <float 1.200000e+02, float 5.040000e+03>
%13 = extractelement <2 x float> %12, i64 0
%14 = fadd float %5, %13
%15 = extractelement <2 x float> %12, i64 1
%16 = fadd float %14, %15
ret float %16
}
void *test_anti_range_51(short n) {
  extern void *alloc_anti_range_51(short) __attribute__((alloc_size(1)));
  if (0x7fff - 1 <= n && n <= 0x7fff - 1)
    n = 0x7fff - 1 - 1;
  return alloc_anti_range_51(n);
}


x86 assembly (clang, -O0):
<test_anti_range_51>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%ecx
mov    $0x7ffe,%eax
cmp    %ecx,%eax
jg     1145 <test_anti_range_51+0x35>
movswl -0x2(%rbp),%eax
cmp    $0x7ffe,%eax
jg     1145 <test_anti_range_51+0x35>
movw   $0x7ffd,-0x2(%rbp)
movswl -0x2(%rbp),%edi
call   1030 <alloc_anti_range_51@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_51>:
cmp    $0x7ffe,%edi
mov    $0x7ffd,%eax
cmove  %eax,%edi
jmp    1030 <alloc_anti_range_51@plt>

LLVM IR (-O0):
define i8* @test_anti_range_51(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = icmp sle i32 32766, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i16, i16* %2
%8 = sext i16 %7 to i32
%9 = icmp sle i32 %8, 32766
br i1 %9, label %10, label %11
10: ; preds = %6
store i16 32765, i16* %2
br label %11
11: ; preds = %10, %6, %1
%12 = load i16, i16* %2
%13 = call i8* @alloc_anti_range_51(i16 signext %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @test_anti_range_51(i16 signext %0) {
%2 = icmp eq i16 %0, 32766
%3 = select i1 %2, i16 32765, i16 %0
%4 = tail call i8* @alloc_anti_range_51(i16 signext %3)
ret i8* %4
}
/* Type definitions */
typedef scalar_t__ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void print_times(char c, ssize_t times) {
  ssize_t i;
  for (i = 0; i < times; i++)
    printf("%c", c);
}


x86 assembly (clang, -O0):
<print_times>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1159 <print_times+0x49>
lea    0xec1(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    112a <print_times+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_times>:
push   %rbp
push   %r14
push   %rbx
test   %rsi,%rsi
jle    1140 <print_times+0x30>
mov    %rsi,%rbx
movsbl %dil,%ebp
lea    0xed9(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    $0xffffffffffffffff,%rbx
jne    1130 <print_times+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @print_times(i8 signext %0, i64 %1) {
%3 = alloca i8
%4 = alloca i64
%5 = alloca i64
store i8 %0, i8* %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %13, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp slt i64 %7, %8
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i8, i8* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %11)
br label %13
13: ; preds = %10
%14 = load i64, i64* %5
%15 = add nsw i64 %14, 1
store i64 %15, i64* %5
br label %6
16: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @print_times(i8 signext %0, i64 %1) {
%3 = icmp sgt i64 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i64 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%7 = add nuw nsw i64 %5, 1
%8 = icmp eq i64 %7, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
void SobelRow_Any_NEON() {}


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

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

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

LLVM IR (-O2):
define void @SobelRow_Any_NEON() {
ret void
}
int main() {
  main();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printhex(unsigned char *buf, int len) {
  int i;
  for (i = 0; i < len; i++) {
    printf("%02x ", buf[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printhex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <printhex+0x4a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printhex+0x16>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printhex>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1158 <printhex+0x38>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movzbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printhex+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%02x \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @printhex(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %10
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%02x \00"
define void @printhex(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  int rollingdice;
  int x;
  srand(time(NULL));
  rollingdice = rand() % 6;
  x = rand() % 6 + 1;
  printf("You rolled a %d\n", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x6,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x6,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe70(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
xor    %eax,%eax
call   1060 <rand@plt>
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1,%esi
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"You rolled a %d\0A\00"
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @rand()
%4 = tail call i32 (...) @rand()
%5 = srem i32 %4, 6
%6 = add nsw i32 %5, 1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int);
int main() {
  int side1 = 10;
  int side2 = 30;
  int area = side1 * side2;
  int circumference = (side1 * 2) + (side2 * 2);
  printf("Rektanglen har sidorna %d och %d, vilket gör att arean blir %d och "
         "omkretsen %d\n",
         side1, side2, area, circumference);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x1e,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0xa,%esi
mov    $0x1e,%edx
mov    $0x12c,%ecx
mov    $0x50,%r8d
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [82 x i8] c"Rektanglen har sidorna %d och %d, vilket g\C3\B6r att arean blir %d och omkretsen %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 30, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = mul nsw i32 %6, %7
store i32 %8, i32* %4
%9 = load i32, i32* %2
%10 = mul nsw i32 %9, 2
%11 = load i32, i32* %3
%12 = mul nsw i32 %11, 2
%13 = add nsw i32 %10, %12
store i32 %13, i32* %5
%14 = load i32, i32* %2
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = call i32 @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %15, i32 %16, i32 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [82 x i8] c"Rektanglen har sidorna %d och %d, vilket g\C3\B6r att arean blir %d och omkretsen %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0), i32 10, i32 30, i32 300, i32 80)
ret i32 0
}
/* Variables and functions */
char *copyin(char *src, char **space) {
  char *cp, *top;
  top = cp = *space;
  while ((*cp++ = *src++) != '\0')
    ;
  *space = cp;
  return (top);
}


x86 assembly (clang, -O0):
<copyin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     114e <copyin+0x4e>
jmp    111b <copyin+0x1b>
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyin>:
mov    (%rsi),%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rdi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <copyin+0x10>
add    %rax,%rcx
mov    %rcx,(%rsi)
ret

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

LLVM IR (-O2):
define i8* @copyin(i8* nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
br label %4
4: ; preds = %4, %2
%5 = phi i8* [ %3, %2 ], [ %9, %4 ]
%6 = phi i8* [ %0, %2 ], [ %7, %4 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %6
%9 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %8, i8* %5
%10 = icmp eq i8 %8, 0
br i1 %10, label %11, label %4
11: ; preds = %4
store i8* %9, i8** %1
ret i8* %3
}
__attribute__((weak)) int _getpid(void) { return -1; }


x86 assembly (clang, -O0):
<_getpid>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_getpid>:
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define weak i32 @_getpid() {
ret i32 -1
}

LLVM IR (-O2):
define weak i32 @_getpid() {
ret i32 -1
}
void kvmppc_enable_h_page_init(void) {}


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

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

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

LLVM IR (-O2):
define void @kvmppc_enable_h_page_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: atbash [-d]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"usage: atbash [-d]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"usage: atbash [-d]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_label(void *unused, char *key, void *value) {
  free(key);
  free(value);
}


x86 assembly (clang, -O0):
<free_label>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_label>:
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_label(i8* nocapture readnone %0, i8* nocapture %1, i8* nocapture %2) {
%4 = tail call i32 @free(i8* %1)
%5 = tail call i32 @free(i8* %2)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void fprint_xch_direct(FILE *stream, uint8_t direct) {
  fprintf(stream,
          "XCH   A, "
          "0x%02X"
          "                   ",
          direct);
}


x86 assembly (clang, -O0):
<fprint_xch_direct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fprint_xch_direct>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"XCH A, 0x%02X \00"
define void @fprint_xch_direct(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"XCH A, 0x%02X \00"
define void @fprint_xch_direct(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
int getWideStringSize(void *in) {
  short *src = (short *)in;
  int result = 0;
  while (*src++)
    result++;
  return result;
}


x86 assembly (clang, -O0):
<getWideStringSize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x2,%rcx
mov    %rcx,-0x10(%rbp)
cmpw   $0x0,(%rax)
je     113e <getWideStringSize+0x3e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <getWideStringSize+0x17>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getWideStringSize>:
cmpw   $0x0,(%rdi)
je     111d <getWideStringSize+0x1d>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
cmpw   $0x0,0x2(%rdi,%rax,2)
lea    0x1(%rax),%rax
jne    1110 <getWideStringSize+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @getWideStringSize(i8* %0) {
%2 = alloca i8*
%3 = alloca i16*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i16*
store i16* %6, i16** %3
store i32 0, i32* %4
br label %7
7: ; preds = %12, %1
%8 = load i16*, i16** %3
%9 = getelementptr inbounds i16, i16* %8, i32 1
store i16* %9, i16** %3
%10 = load i16, i16* %8
%11 = icmp ne i16 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 1
store i32 %14, i32* %4
br label %7
15: ; preds = %7
%16 = load i32, i32* %4
ret i32 %16
}

LLVM IR (-O2):
define i32 @getWideStringSize(i8* nocapture %0) {
%2 = bitcast i8* %0 to i16*
%3 = load i16, i16* %2
%4 = icmp eq i16 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %9, %5 ], [ 0, %1 ]
%7 = phi i16* [ %8, %5 ], [ %2, %1 ]
%8 = getelementptr inbounds i16, i16* %7, i64 1
%9 = add nuw nsw i32 %6, 1
%10 = load i16, i16* %8
%11 = icmp eq i16 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %1
%13 = phi i32 [ 0, %1 ], [ %9, %5 ]
ret i32 %13
}
int test_imm_68int64_midword_reg(long long val) {
  return ((val >> 16) & (0x68 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_68int64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0x68,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_68int64_midword_reg>:
test   $0x680000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_68int64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 104
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_68int64_midword_reg(i64 %0) {
%2 = and i64 %0, 6815744
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}