xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int);
void drawLine(int x1, int x2, int x3, int x4) {
  printf("DL %i %i %i %i\n", x1, x2, x3, x4);
}


x86 assembly (clang, -O0):
<drawLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"DL %i %i %i %i\0A\00"
define void @drawLine(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* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"DL %i %i %i %i\0A\00"
define void @drawLine(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2, i32 %3)
ret void
}
int NotImplemented(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @NotImplemented() {
ret i32 0
}
void rop3_172_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = *D ^ S;
  stk2 = T & stk3;
  stk1 = S ^ stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_172_0_0>:
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 -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_172_0_0>:
mov    (%rdi),%al
xor    %sil,%al
and    %dl,%al
xor    %sil,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_172_0_0(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* %5
%14 = zext i8 %13 to i32
%15 = xor i32 %12, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
%17 = load i8, i8* %6
%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* %5
%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 = load i8*, i8** %4
store i8 %29, i8* %30
ret void
}

LLVM IR (-O2):
define void @rop3_172_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %1
%6 = and i8 %5, %2
%7 = xor i8 %6, %1
store i8 %7, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *);
int strcmp(char *, char *);
int main(void) {
  char buffer[1024] = "";
  sprintf(buffer, "%s", "1234567890abcdefghijklmno");
  return strcmp(buffer, "1234567890abcdefghijklmno");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x410(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1030 <memset@plt>
lea    -0x410(%rbp),%rdi
lea    0xe9d(%rip),%rsi
lea    0xe99(%rip),%rdx
call   1050 <sprintf@plt>
lea    -0x410(%rbp),%rdi
lea    0xe86(%rip),%rsi
call   1040 <strcmp@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x408,%rsp
lea    0x1a(%rsp),%rdi
mov    $0x3e6,%edx
xor    %esi,%esi
call   1030 <memset@plt>
movups 0xec1(%rip),%xmm0
movaps %xmm0,(%rsp)
movups 0xec0(%rip),%xmm0
movups %xmm0,0xa(%rsp)
lea    0xeaa(%rip),%rsi
mov    %rsp,%rdi
call   1040 <strcmp@plt>
add    $0x408,%rsp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [26 x i8] c"1234567890abcdefghijklmno\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1024 x i8]
store i32 0, i32* %1
%3 = bitcast [1024 x i8]* %2 to i8*
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%7 = call i32 @strcmp(i8* %6, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret i32 %7
}

LLVM IR (-O2):
@.str.1 = [26 x i8] c"1234567890abcdefghijklmno\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 26
%4 = call i32 @strcmp(i8* %2, i8* dereferenceable(26) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_VALUE;
typedef int /*<<< orphan*/ ASN1_GENERALIZEDTIME;

/* Variables and functions */
int /*<<< orphan*/ ASN1_GENERALIZEDTIME_it;
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
ASN1_GENERALIZEDTIME *d2i_ASN1_GENERALIZEDTIME(ASN1_GENERALIZEDTIME **a,
                                               const unsigned char **in,
                                               long len) {
  return (ASN1_GENERALIZEDTIME *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
                                               &ASN1_GENERALIZEDTIME_it);
}


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

x86 assembly (clang, -O2):
<d2i_ASN1_GENERALIZEDTIME>:
mov    0x2ec1(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@ASN1_GENERALIZEDTIME_it = global i32 0
define i32* @d2i_ASN1_GENERALIZEDTIME(i32** %0, i8** %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i8**
%6 = alloca i64
store i32** %0, i32*** %4
store i8** %1, i8*** %5
store i64 %2, i64* %6
%7 = load i32**, i32*** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @ASN1_GENERALIZEDTIME_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@ASN1_GENERALIZEDTIME_it = global i32 0
define i32* @d2i_ASN1_GENERALIZEDTIME(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @ASN1_GENERALIZEDTIME_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
void jhc_alloc_init(void) {}


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

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

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

LLVM IR (-O2):
define void @jhc_alloc_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ stdout;
void charOut(char c) {
  putchar(c);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<charOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<charOut>:
push   %rax
call   1030 <putchar@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @charOut(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @putchar(i8 signext %3)
%5 = load i32, i32* @stdout
%6 = call i32 @fflush(i32 %5)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @charOut(i8 signext %0) {
%2 = tail call i32 @putchar(i8 signext %0)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
ret void
}
int do_905() { return 905; }


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

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

LLVM IR (-O0):
define i32 @do_905() {
ret i32 905
}

LLVM IR (-O2):
define i32 @do_905() {
ret i32 905
}
/* Variables and functions */
int /*<<< orphan*/ gui_flush();
int /*<<< orphan*/ gui_gotoxy(int, int);
int /*<<< orphan*/ printf(char *, char *);
void gui_draw_message(char *msg) {
  gui_gotoxy(1, 22);
  printf("%s", msg);
  gui_flush();
}


x86 assembly (clang, -O0):
<gui_draw_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
mov    $0x16,%esi
call   1030 <gui_gotoxy@plt>
mov    -0x8(%rbp),%rsi
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <gui_flush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_draw_message>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%edi
mov    $0x16,%esi
call   1030 <gui_gotoxy@plt>
lea    0xeb6(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <gui_flush@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @gui_draw_message(i8* %0) {
%2 = tail call i32 @gui_gotoxy(i32 1, i32 22)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @gui_flush()
ret void
}
int PES2HeaderBytes(int bHasPts, int bHasDts) {
  return 6 + 3 + (bHasPts ? 5 : 0) + ((bHasPts && bHasDts) ? 5 : 0);
}


x86 assembly (clang, -O0):
<PES2HeaderBytes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
xor    %eax,%eax
mov    $0x5,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
add    $0x9,%eax
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
je     1139 <PES2HeaderBytes+0x39>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x9(%rbp),%sil
xor    %ecx,%ecx
mov    $0x5,%edx
test   $0x1,%sil
cmovne %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PES2HeaderBytes>:
xor    %eax,%eax
test   %esi,%esi
setne  %al
xor    %ecx,%ecx
test   %edi,%edi
setne  %cl
lea    (%rcx,%rcx,4),%ecx
lea    (%rax,%rax,4),%eax
cmove  %edi,%eax
add    %ecx,%eax
add    $0x9,%eax
ret

LLVM IR (-O0):
define i32 @PES2HeaderBytes(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 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 5, i32 0
%9 = add nsw i32 9, %8
%10 = load i32, i32* %3
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load i32, i32* %4
%14 = icmp ne i32 %13, 0
br label %15
15: ; preds = %12, %2
%16 = phi i1 [ false, %2 ], [ %14, %12 ]
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 5, i32 0
%19 = add nsw i32 %9, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @PES2HeaderBytes(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, 0
%4 = select i1 %3, i32 14, i32 9
%5 = icmp ne i32 %1, 0
%6 = and i1 %3, %5
%7 = select i1 %6, i32 5, i32 0
%8 = add nuw nsw i32 %7, %4
ret i32 %8
}
int IntMax(int x, int y) {
  if (x > y)
    return (x);
  else
    return (y);
}


x86 assembly (clang, -O0):
<IntMax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1121 <IntMax+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <IntMax+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IntMax>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @IntMax(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int __print_status(char **, int, int);
int print_alt_status(char **args, int num_args) {
  return __print_status(args, num_args, 1);
}


x86 assembly (clang, -O0):
<print_alt_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x1,%edx
call   1030 <__print_status@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_alt_status>:
mov    $0x1,%edx
jmp    1030 <__print_status@plt>

LLVM IR (-O0):
define i32 @print_alt_status(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 = call i32 @__print_status(i8** %5, i32 %6, i32 1)
ret i32 %7
}

LLVM IR (-O2):
define i32 @print_alt_status(i8** %0, i32 %1) {
%3 = tail call i32 @__print_status(i8** %0, i32 %1, i32 1)
ret i32 %3
}
/* Variables and functions */
char *strchr(char *, char);
char *strtok(int /*<<< orphan*/ *, char *);
char *next_arg_char() {
  char *buf = strtok(NULL, " ");
  char *eol = NULL;
  if ((eol = strchr(buf, '\n')) != NULL) {
    *eol = '\0';
  }
  return buf;
}


x86 assembly (clang, -O0):
<next_arg_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
lea    0xecd(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1167 <next_arg_char+0x47>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_arg_char>:
push   %rbx
lea    0xed8(%rip),%rsi
xor    %edi,%edi
call   1040 <strtok@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1147 <next_arg_char+0x27>
movb   $0x0,(%rax)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define i8* @next_arg_char() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* @strtok(i32* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %3, i8** %1
store i8* null, i8** %2
%4 = load i8*, i8** %1
%5 = call i8* @strchr(i8* %4, i8 signext 10)
store i8* %5, i8** %2
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = load i8*, i8** %2
store i8 0, i8* %8
br label %9
9: ; preds = %7, %0
%10 = load i8*, i8** %1
ret i8* %10
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define i8* @next_arg_char() {
%1 = tail call i8* @strtok(i32* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = tail call i8* @strchr(i8* dereferenceable(1) %1, i8 signext 10)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %0
store i8 0, i8* %2
br label %5
5: ; preds = %4, %0
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ kdAssert(int, char const *);
scalar_t__ strcmp(char const *, char const *);
void kdAssertStringEquals(const char *expected, const char *actual,
                          const char *message) {
  kdAssert(strcmp(expected, actual) == 0, message);
}


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

x86 assembly (clang, -O2):
<kdAssertStringEquals>:
push   %rbx
mov    %rdx,%rbx
call   1040 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <kdAssert@plt>

LLVM IR (-O0):
define void @kdAssertStringEquals(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** %4
%8 = load i8*, i8** %5
%9 = call i64 @strcmp(i8* %7, i8* %8)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
%12 = load i8*, i8** %6
%13 = call i32 @kdAssert(i32 %11, i8* %12)
ret void
}

LLVM IR (-O2):
define void @kdAssertStringEquals(i8* %0, i8* %1, i8* %2) {
%4 = tail call i64 @strcmp(i8* %0, i8* %1)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @kdAssert(i32 %6, i8* %2)
ret void
}
int pintlen(int n) {
  int l = 0;
  while (n > 0) {
    l++;
    n /= 10;
  }
  return l;
}


x86 assembly (clang, -O0):
<pintlen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1134 <pintlen+0x34>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <pintlen+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pintlen>:
xor    %eax,%eax
test   %edi,%edi
jle    1124 <pintlen+0x24>
mov    $0xcccccccd,%ecx
nopl   0x0(%rax,%rax,1)
add    $0x1,%eax
mov    %edi,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <pintlen+0x10>
ret

LLVM IR (-O0):
define i32 @pintlen(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %7, %1
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 1
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = sdiv i32 %10, 10
store i32 %11, i32* %2
br label %4
12: ; preds = %4
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @pintlen(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = udiv i32 %5, 10
%8 = icmp ult i32 %5, 10
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %10
}
/* Variables and functions */
scalar_t__ isspace(char);
void str_term(char *cp) {
  do {
    cp--;
  } while (isspace(*cp));
  *(++cp) = '\0';
  return;
}


x86 assembly (clang, -O0):
<str_term>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
jne    111c <str_term+0xc>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x0,0x1(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_term>:
push   %rbx
mov    %rdi,%rbx
add    $0x1,%rbx
nopl   0x0(%rax,%rax,1)
movsbl -0x2(%rbx),%edi
call   1030 <isspace@plt>
add    $0xffffffffffffffff,%rbx
test   %rax,%rax
jne    1120 <str_term+0x10>
movb   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @str_term(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 -1
%5 = load i8, i8* %4
%6 = tail call i64 @isspace(i8 signext %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %2
8: ; preds = %2
store i8 0, i8* %3
ret void
}
/* Type definitions */
struct timespec {
  int dummy;
};
typedef int int64_t;

/* Variables and functions */
int timespec_sub_to_nsec(struct timespec const *, struct timespec const *);
int64_t timespec_sub_to_msec(const struct timespec *a,
                             const struct timespec *b) {
  return timespec_sub_to_nsec(a, b) / 1000000;
}


x86 assembly (clang, -O0):
<timespec_sub_to_msec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <timespec_sub_to_nsec@plt>
mov    $0xf4240,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespec_sub_to_msec>:
push   %rax
call   1030 <timespec_sub_to_nsec@plt>
cltq
imul   $0x431bde83,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x32,%rax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
define i32 @timespec_sub_to_msec(%struct.timespec* %0, %struct.timespec* %1) {
%3 = alloca %struct.timespec*
%4 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load %struct.timespec*, %struct.timespec** %3
%6 = load %struct.timespec*, %struct.timespec** %4
%7 = call i32 @timespec_sub_to_nsec(%struct.timespec* %5, %struct.timespec* %6)
%8 = sdiv i32 %7, 1000000
ret i32 %8
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define i32 @timespec_sub_to_msec(%struct.timespec* %0, %struct.timespec* %1) {
%3 = tail call i32 @timespec_sub_to_nsec(%struct.timespec* %0, %struct.timespec* %1)
%4 = sdiv i32 %3, 1000000
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main() {
  int area;
  area = 10 * 5;
  printf("value of area : %d", area);
  printf("%c", '\n');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x32,-0x8(%rbp)
mov    -0x8(%rbp),%eax
lea    0xed0(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [19 x i8] c"value of area : %d\00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 50, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
%5 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8 signext %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"value of area : %d\00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8 signext 50)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext 10)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int eqi(uint32_t *env) {
  uint32_t *context = (uint32_t *)*(uint32_t **)(env + 1);
  int a = (int)*(int *)(context);
  int b = (int)*(int *)(context + 1);
  return a == b;
}


x86 assembly (clang, -O0):
<eqi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eqi>:
mov    0x4(%rdi),%rcx
mov    (%rcx),%edx
xor    %eax,%eax
cmp    0x4(%rcx),%edx
sete   %al
ret

LLVM IR (-O0):
define i32 @eqi(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = bitcast i32* %7 to i32**
%9 = load i32*, i32** %8
store i32* %9, i32** %3
%10 = load i32*, i32** %3
%11 = load i32, i32* %10
store i32 %11, i32* %4
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 1
%14 = load i32, i32* %13
store i32 %14, i32* %5
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = icmp eq i32 %15, %16
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @eqi(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = bitcast i32* %2 to i32**
%4 = load i32*, i32** %3
%5 = load i32, i32* %4
%6 = getelementptr inbounds i32, i32* %4, i64 1
%7 = load i32, i32* %6
%8 = icmp eq i32 %5, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Type definitions */
struct term {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct term *);
void free_term(struct term *mon) {
  free(mon);
  mon = NULL;
}


x86 assembly (clang, -O0):
<free_term>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_term>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.term = type { i32 }
define void @free_term(%struct.term* %0) {
%2 = alloca %struct.term*
store %struct.term* %0, %struct.term** %2
%3 = load %struct.term*, %struct.term** %2
%4 = call i32 @free(%struct.term* %3)
store %struct.term* null, %struct.term** %2
ret void
}

LLVM IR (-O2):
%struct.term = type { i32 }
define void @free_term(%struct.term* nocapture %0) {
%2 = tail call i32 @free(%struct.term* %0)
ret void
}
double linear_transfer_function(double x, double n, double k) { return (x); }


x86 assembly (clang, -O0):
<linear_transfer_function>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @linear_transfer_function(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
ret double %7
}

LLVM IR (-O2):
define double @linear_transfer_function(double returned %0, double %1, double %2) {
ret double %0
}
int set_tail(int c) {
  switch (c) {
  case '<':
    return '>';
    break;
  case '[':
    return ']';
    break;
  case '(':
    return ')';
    break;
  default:
    return (0);
  }
}


x86 assembly (clang, -O0):
<set_tail>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x28,%eax
je     1155 <set_tail+0x55>
jmp    111b <set_tail+0x1b>
mov    -0xc(%rbp),%eax
sub    $0x3c,%eax
je     113d <set_tail+0x3d>
jmp    112c <set_tail+0x2c>
mov    -0xc(%rbp),%eax
sub    $0x5b,%eax
je     1149 <set_tail+0x49>
jmp    1161 <set_tail+0x61>
movl   $0x3e,-0x4(%rbp)
jmp    1168 <set_tail+0x68>
movl   $0x5d,-0x4(%rbp)
jmp    1168 <set_tail+0x68>
movl   $0x29,-0x4(%rbp)
jmp    1168 <set_tail+0x68>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_tail>:
cmp    $0x28,%edi
je     1115 <set_tail+0x15>
cmp    $0x3c,%edi
je     111b <set_tail+0x1b>
cmp    $0x5b,%edi
jne    1121 <set_tail+0x21>
mov    $0x5d,%eax
ret
mov    $0x29,%eax
ret
mov    $0x3e,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @set_tail(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 60, label %5
i32 91, label %6
i32 40, label %7
]
5: ; preds = %1
store i32 62, i32* %2
br label %9
6: ; preds = %1
store i32 93, i32* %2
br label %9
7: ; preds = %1
store i32 41, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @set_tail(i32 %0) {
switch i32 %0, label %4 [
i32 60, label %5
i32 91, label %2
i32 40, label %3
]
2: ; preds = %1
br label %5
3: ; preds = %1
br label %5
4: ; preds = %1
br label %5
5: ; preds = %1, %4, %3, %2
%6 = phi i32 [ 0, %4 ], [ 41, %3 ], [ 93, %2 ], [ 62, %1 ]
ret i32 %6
}
int foo(int **b) { return **b; }


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

x86 assembly (clang, -O2):
<foo>:
mov    (%rdi),%rax
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = load i32, i32* %2
ret i32 %3
}
void foo368(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo368(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int strncmp(char *, char *, int);
int main() {
  int comparison;
  char string1[] = "dogberry";
  char string2[] = "aaawood";
  comparison = strncmp(string1, string2, 3);
  printf("%d\n", comparison);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x11(%rbp)
mov    0xec8(%rip),%al
mov    %al,-0x9(%rbp)
mov    0xebf(%rip),%rax
mov    %rax,-0x19(%rbp)
lea    -0x11(%rbp),%rdi
lea    -0x19(%rbp),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xea4(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x7972726562676f64,%rax
72 72 79
mov    %rax,(%rsp)
movb   $0x0,0x8(%rsp)
movabs $0x646f6f77616161,%rax
mov    %rax,0x10(%rsp)
mov    %rsp,%rdi
lea    0x10(%rsp),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
lea    0xeaa(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.string1 = [9 x i8] c"dogberry\00"
@__const.main.string2 = [8 x i8] c"aaawood\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [9 x i8]
%4 = alloca [8 x i8]
store i32 0, i32* %1
%5 = bitcast [9 x i8]* %3 to i8*
%6 = bitcast [8 x i8]* %4 to i8*
%7 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [8 x i8], [8 x i8]* %4, i64 0, i64 0
%9 = call i32 @strncmp(i8* %7, i8* %8, i32 3)
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.string1 = [9 x i8] c"dogberry\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [9 x i8]
%2 = alloca i64
%3 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
%4 = bitcast i64* %2 to i8*
store i64 28270022205989217, i64* %2
%5 = call i32 @strncmp(i8* %3, i8* %4, i32 3)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int main() {
  char *s = (char *)malloc(15);
  FILE *file = fopen("/dev/null", "w");
  free(s);
  fprintf(file, "hello world\n");
  exit(0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xf,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
lea    0xe8c(%rip),%rdi
lea    0xe8f(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
lea    0xe74(%rip),%rsi
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xf,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xe98(%rip),%rdi
lea    0xe9b(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
lea    0xe86(%rip),%rdi
mov    $0xc,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1070 <fwrite@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"/dev/null\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [13 x i8] c"hello world\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32*
store i32 0, i32* %1
%4 = call i64 @malloc(i32 15)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %2
%6 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %6, i32** %3
%7 = load i8*, i8** %2
%8 = call i32 @free(i8* %7)
%9 = load i32*, i32** %3
%10 = call i32 @fprintf(i32* %9, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [10 x i8] c"/dev/null\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [13 x i8] c"hello world\0A\00"
define i32 @main() {
%1 = tail call i64 @malloc(i32 15)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @free(i8* %2)
%5 = tail call i64 @fwrite(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i64 12, i64 1, i32* %3)
%6 = tail call i32 @exit(i32 0)
unreachable
}
int main() {
  int a, b, c;
  if (a) {
    b = 0;
    c = 0;
    return 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112f <main+0x2f>
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x4(%rbp)
jmp    1136 <main+0x36>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ stat(char *, struct stat *);
int file_exist(char *fp) {
  struct stat buffer;
  return (stat(fp, &buffer) == 0);
}


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

x86 assembly (clang, -O2):
<file_exist>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @file_exist(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @file_exist(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
struct ohci_device {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ kfree(struct ohci_device *);
void dev_free(struct ohci_device *dev) { kfree(dev); }


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

x86 assembly (clang, -O2):
<dev_free>:
jmp    1030 <kfree@plt>

LLVM IR (-O0):
%struct.ohci_device = type { i32 }
define void @dev_free(%struct.ohci_device* %0) {
%2 = alloca %struct.ohci_device*
store %struct.ohci_device* %0, %struct.ohci_device** %2
%3 = load %struct.ohci_device*, %struct.ohci_device** %2
%4 = call i32 @kfree(%struct.ohci_device* %3)
ret void
}

LLVM IR (-O2):
%struct.ohci_device = type { i32 }
define void @dev_free(%struct.ohci_device* %0) {
%2 = tail call i32 @kfree(%struct.ohci_device* %0)
ret void
}
/* Type definitions */
struct btf_type {
  int dummy;
};

/* Variables and functions */
scalar_t__ BTF_KIND_ARRAY;
scalar_t__ btf_kind(struct btf_type const *);
bool btf_is_array(const struct btf_type *t) {
  return btf_kind(t) == BTF_KIND_ARRAY;
}


x86 assembly (clang, -O0):
<btf_is_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <btf_kind@plt>
mov    0x2eb4(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<btf_is_array>:
push   %rax
call   1030 <btf_kind@plt>
mov    0x2ec3(%rip),%rdx
xor    %ecx,%ecx
cmp    (%rdx),%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.btf_type = type { i32 }
@BTF_KIND_ARRAY = global i64 0
define i32 @btf_is_array(%struct.btf_type* %0) {
%2 = alloca %struct.btf_type*
store %struct.btf_type* %0, %struct.btf_type** %2
%3 = load %struct.btf_type*, %struct.btf_type** %2
%4 = call i64 @btf_kind(%struct.btf_type* %3)
%5 = load i64, i64* @BTF_KIND_ARRAY
%6 = icmp eq i64 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.btf_type = type { i32 }
@BTF_KIND_ARRAY = global i64 0
define i32 @btf_is_array(%struct.btf_type* %0) {
%2 = tail call i64 @btf_kind(%struct.btf_type* %0)
%3 = load i64, i64* @BTF_KIND_ARRAY
%4 = icmp eq i64 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
void genbgezl_idle() {}


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

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

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

LLVM IR (-O2):
define void @genbgezl_idle() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint64_t getCurrentTime(void) {
  struct timeval tp;
  gettimeofday(&tp, NULL);
  return tp.tv_usec + (tp.tv_sec * 1000000);
}


x86 assembly (clang, -O0):
<getCurrentTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rax
imul   $0xf4240,-0x10(%rbp),%ecx
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i64 @getCurrentTime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000000
%8 = sext i32 %7 to i64
%9 = add nsw i64 %4, %8
ret i64 %9
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i64 @getCurrentTime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%7 = load i32, i32* %6
%8 = mul nsw i32 %7, 1000000
%9 = sext i32 %8 to i64
%10 = add nsw i64 %5, %9
ret i64 %10
}
long double powl(long double x, long double y) {
  long double res;
  __asm__ __volatile__("fld1;"
                       "fxch;"
                       "fyl2x;"
                       "fmulp;"
                       "f2xm1;"
                       "fld1;"
                       "faddp"
                       : "=t"(res)
                       : "0"(x), "u"(y));
  return res;
}


x86 assembly (clang, -O0):
<powl>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fxch   %st(1)
fld1
fxch   %st(1)
fyl2x
fmulp  %st,%st(1)
f2xm1
fld1
faddp  %st,%st(1)
fstp   %st(1)
fstpt  -0x30(%rbp)
fldt   -0x30(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<powl>:
fldt   0x8(%rsp)
fldt   0x18(%rsp)
fxch   %st(1)
fld1
fxch   %st(1)
fyl2x
fmulp  %st,%st(1)
f2xm1
fld1
faddp  %st,%st(1)
fstp   %st(1)
ret

LLVM IR (-O0):
define x86_fp80 @powl(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
%5 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%6 = load x86_fp80, x86_fp80* %3
%7 = load x86_fp80, x86_fp80* %4
%8 = call x86_fp80 asm sideeffect "fld1;fxch;fyl2x;fmulp;f2xm1;fld1;faddp", "={st},0,{st(1)},~{dirflag},~{fpsr},~{flags}"(x86_fp80 %6, x86_fp80 %7)
store x86_fp80 %8, x86_fp80* %5
%9 = load x86_fp80, x86_fp80* %5
ret x86_fp80 %9
}

LLVM IR (-O2):
define x86_fp80 @powl(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call x86_fp80 asm sideeffect "fld1;fxch;fyl2x;fmulp;f2xm1;fld1;faddp", "={st},0,{st(1)},~{dirflag},~{fpsr},~{flags}"(x86_fp80 %0, x86_fp80 %1)
ret x86_fp80 %3
}
/* Type definitions */
struct lvar_leaf_entry {
  int dummy;
};
struct iam_key {
  int dummy;
};

/* Variables and functions */
scalar_t__ e_char(struct lvar_leaf_entry const *);
struct iam_key *e_key(const struct lvar_leaf_entry *ent) {
  return (struct iam_key *)e_char(ent);
}


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

x86 assembly (clang, -O2):
<e_key>:
jmp    1030 <e_char@plt>

LLVM IR (-O0):
%struct.iam_key = type { i32 }
%struct.lvar_leaf_entry = type { i32 }
define %struct.iam_key* @e_key(%struct.lvar_leaf_entry* %0) {
%2 = alloca %struct.lvar_leaf_entry*
store %struct.lvar_leaf_entry* %0, %struct.lvar_leaf_entry** %2
%3 = load %struct.lvar_leaf_entry*, %struct.lvar_leaf_entry** %2
%4 = call i64 @e_char(%struct.lvar_leaf_entry* %3)
%5 = inttoptr i64 %4 to %struct.iam_key*
ret %struct.iam_key* %5
}

LLVM IR (-O2):
%struct.iam_key = type { i32 }
%struct.lvar_leaf_entry = type { i32 }
define %struct.iam_key* @e_key(%struct.lvar_leaf_entry* %0) {
%2 = tail call i64 @e_char(%struct.lvar_leaf_entry* %0)
%3 = inttoptr i64 %2 to %struct.iam_key*
ret %struct.iam_key* %3
}
int exam_grade(int points) {
  if (points < 0 || points > 50) {
    return -1;
  } else if (points > 37) {
    return 2;
  } else if (points > 24) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<exam_grade>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     111b <exam_grade+0x1b>
cmpl   $0x32,-0x8(%rbp)
jle    1127 <exam_grade+0x27>
movl   $0xffffffff,-0x4(%rbp)
jmp    1164 <exam_grade+0x64>
cmpl   $0x25,-0x8(%rbp)
jle    113d <exam_grade+0x3d>
movl   $0x2,-0x4(%rbp)
jmp    1164 <exam_grade+0x64>
cmpl   $0x18,-0x8(%rbp)
jle    1153 <exam_grade+0x53>
movl   $0x1,-0x4(%rbp)
jmp    1164 <exam_grade+0x64>
jmp    1158 <exam_grade+0x58>
jmp    115d <exam_grade+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<exam_grade>:
mov    $0xffffffff,%eax
cmp    $0x32,%edi
ja     111c <exam_grade+0x1c>
mov    $0x2,%eax
cmp    $0x25,%edi
ja     111c <exam_grade+0x1c>
xor    %eax,%eax
cmp    $0x19,%edi
setae  %al
ret

LLVM IR (-O0):
define i32 @exam_grade(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 50
br i1 %8, label %9, label %10
9: ; preds = %6, %1
store i32 -1, i32* %2
br label %21
10: ; preds = %6
%11 = load i32, i32* %3
%12 = icmp sgt i32 %11, 37
br i1 %12, label %13, label %14
13: ; preds = %10
store i32 2, i32* %2
br label %21
14: ; preds = %10
%15 = load i32, i32* %3
%16 = icmp sgt i32 %15, 24
br i1 %16, label %17, label %18
17: ; preds = %14
store i32 1, i32* %2
br label %21
18: ; preds = %14
br label %19
19: ; preds = %18
br label %20
20: ; preds = %19
store i32 0, i32* %2
br label %21
21: ; preds = %20, %17, %13, %9
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @exam_grade(i32 %0) {
%2 = icmp ugt i32 %0, 50
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = icmp ugt i32 %0, 37
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = icmp ugt i32 %0, 24
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %5, %3, %1
%9 = phi i32 [ -1, %1 ], [ 2, %3 ], [ %7, %5 ]
ret i32 %9
}
int addr_in_net(unsigned long addr, unsigned long net, unsigned long mask) {
  return (addr & mask) == (net & mask);
}


x86 assembly (clang, -O0):
<addr_in_net>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
and    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
and    -0x18(%rbp),%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<addr_in_net>:
xor    %rsi,%rdi
xor    %eax,%eax
test   %rdx,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @addr_in_net(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = load i64, i64* %6
%9 = and i64 %7, %8
%10 = load i64, i64* %5
%11 = load i64, i64* %6
%12 = and i64 %10, %11
%13 = icmp eq i64 %9, %12
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @addr_in_net(i64 %0, i64 %1, i64 %2) {
%4 = xor i64 %1, %0
%5 = and i64 %4, %2
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
double GetTime();
double GetElapsedTime(double begin) { return GetTime() - begin; }


x86 assembly (clang, -O0):
<GetElapsedTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <GetTime@plt>
subsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetElapsedTime>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <GetTime@plt>
subsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @GetElapsedTime(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double (...) @GetTime()
%4 = load double, double* %2
%5 = fsub double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @GetElapsedTime(double %0) {
%2 = tail call double (...) @GetTime()
%3 = fsub double %2, %0
ret double %3
}