xunge/DecIR huggingface dataset:
int main(void) {
  asm(" # a = 1 {");
  int a = 1;
  asm(" # } a = 1");
  asm(" # a = a*2 {");
  a = a * 2;
  asm(" # } a = a*2");
  asm(" # a = a*3 {");
  a = a * 3;
  asm(" # } a = a*3");
  asm(" # a = a*4 {");
  a = a * 4;
  asm(" # } a = a*4");
  asm(" # a = a*5 {");
  a = a * 5;
  asm(" # } a = a*5");
  asm(" # a = a*6 {");
  a = a * 6;
  asm(" # } a = a*6");
  asm(" # a = a*7 {");
  a = a * 7;
  asm(" # } a = a*7");
  asm(" # a = a*8 {");
  a = a * 8;
  asm(" # } a = a*8");
  asm(" # return 0 {");
  return 0;
  asm(" # } return 0");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
imul   $0x3,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0x8(%rbp)
imul   $0x5,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
imul   $0x6,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
imul   $0x7,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x3,%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%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
store i32 0, i32* %1
store i32 1, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 2
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = mul nsw i32 %5, 3
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = mul nsw i32 %7, 4
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = mul nsw i32 %9, 5
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = mul nsw i32 %11, 6
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = mul nsw i32 %13, 7
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = mul nsw i32 %15, 8
store i32 %16, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
tail call void asm sideeffect " # a = 1 {", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect " # } a = 1", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect " # a = a*2 {", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect " # } a = a*2", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect " # a = a*3 {", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect " # } a = a*3", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect " # a = a*4 {", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect " # } a = a*4", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect " # a = a*5 {", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect " # } a = a*5", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect " # a = a*6 {", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect " # } a = a*6", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect " # a = a*7 {", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect " # } a = a*7", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect " # a = a*8 {", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect " # } a = a*8", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect " # return 0 {", "~{dirflag},~{fpsr},~{flags}"()
ret i32 0
}
/* Variables and functions */
char *my_strdup(char *);
scalar_t__ strcmp(char *, char *);
char *a_not(char *pcL, char *pcR) {
  if (strcmp(pcR, "TRUE") == 0)
    return my_strdup("FALSE");
  else
    return my_strdup("TRUE");
}


x86 assembly (clang, -O0):
<a_not>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xec5(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    115f <a_not+0x3f>
lea    0xeb4(%rip),%rdi
call   1040 <my_strdup@plt>
mov    %rax,-0x8(%rbp)
jmp    116f <a_not+0x4f>
lea    0xe9a(%rip),%rdi
call   1040 <my_strdup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_not>:
push   %rbx
mov    %rsi,%rdi
lea    0xed5(%rip),%rbx
mov    %rbx,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
lea    0xec8(%rip),%rdi
cmovne %rbx,%rdi
pop    %rbx
jmp    1040 <my_strdup@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"TRUE\00"
@.str.1 = [6 x i8] c"FALSE\00"
define i8* @a_not(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %5
%7 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i8* @my_strdup(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
store i8* %10, i8** %3
br label %13
11: ; preds = %2
%12 = call i8* @my_strdup(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %12, i8** %3
br label %13
13: ; preds = %11, %9
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@.str = [5 x i8] c"TRUE\00"
@.str.1 = [6 x i8] c"FALSE\00"
define i8* @a_not(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
%6 = tail call i8* @my_strdup(i8* %5)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ _IO(unsigned char, int);
long ioctl(int, int /*<<< orphan*/);
long redo_munmap(int fd_spec) {
  long retval = ioctl(fd_spec, _IO('u', 27));
  return retval;
}


x86 assembly (clang, -O0):
<redo_munmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x75,%edi
mov    $0x1b,%esi
call   1030 <_IO@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
call   1040 <ioctl@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<redo_munmap>:
push   %rbx
mov    %edi,%ebx
mov    $0x75,%edi
mov    $0x1b,%esi
call   1030 <_IO@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i64 @redo_munmap(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @_IO(i8 zeroext 117, i32 27)
%6 = call i64 @ioctl(i32 %4, i32 %5)
store i64 %6, i64* %3
%7 = load i64, i64* %3
ret i64 %7
}

LLVM IR (-O2):
define i64 @redo_munmap(i32 %0) {
%2 = tail call i32 @_IO(i8 zeroext 117, i32 27)
%3 = tail call i64 @ioctl(i32 %0, i32 %2)
ret i64 %3
}
int get_version_major() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @get_version_major() {
ret i32 1
}
/* Variables and functions */
void **vamore(void **, int /*<<< orphan*/);
void **vadup(void *argv[]) {
  void **dup = NULL;
  if (argv)
    while (*argv)
      dup = vamore(dup, *argv++);
  return dup;
}


x86 assembly (clang, -O0):
<vadup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116d <vadup+0x5d>
jmp    1134 <vadup+0x24>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1168 <vadup+0x58>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%rax
mov    %eax,%esi
call   1030 <vamore@plt>
mov    %rax,-0x10(%rbp)
jmp    1134 <vadup+0x24>
jmp    116d <vadup+0x5d>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vadup>:
push   %rbx
test   %rdi,%rdi
je     1146 <vadup+0x36>
mov    %rdi,%rbx
mov    (%rdi),%rsi
test   %rsi,%rsi
je     1146 <vadup+0x36>
add    $0x8,%rbx
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
mov    %rax,%rdi
call   1030 <vamore@plt>
mov    (%rbx),%rsi
add    $0x8,%rbx
test   %rsi,%rsi
jne    1130 <vadup+0x20>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8** @vadup(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %16, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %16, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %14, %6 ], [ %4, %3 ]
%8 = phi i8** [ %13, %6 ], [ null, %3 ]
%9 = phi i8** [ %10, %6 ], [ %0, %3 ]
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = ptrtoint i8* %7 to i64
%12 = trunc i64 %11 to i32
%13 = tail call i8** @vamore(i8** %8, i32 %12)
%14 = load i8*, i8** %10
%15 = icmp eq i8* %14, null
br i1 %15, label %16, label %6
16: ; preds = %6, %3, %1
%17 = phi i8** [ null, %1 ], [ null, %3 ], [ %13, %6 ]
ret i8** %17
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0xf5() {
  Assert_real((isxdigit(245) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              1230, ("isxdigit should be 0 for 0xf5"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0xf5>:
push   %rax
mov    $0xf5,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x4ce,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xf5\00"
define void @t_isxdigit_0xf5() {
%1 = tail call i64 @isxdigit(i32 245)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1230, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void somefun2(void) { printf("\n somefun2() printed this. \n"); }


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

x86 assembly (clang, -O2):
<somefun2>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"\0A somefun2() printed this. \0A\00"
define void @somefun2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [28 x i8] c"\0A somefun2() printed this. \00"
define void @somefun2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int accept(int, struct sockaddr *, int *);
int socket_accept(int sock, struct sockaddr_in *sa) {
  int len = 0;
  return accept(sock, (struct sockaddr *)sa, &len);
}


x86 assembly (clang, -O0):
<socket_accept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1030 <accept@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_accept>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdx
call   1030 <accept@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @socket_accept(i32 %0, %struct.sockaddr_in* %1) {
%3 = alloca i32
%4 = alloca %struct.sockaddr_in*
%5 = alloca i32
store i32 %0, i32* %3
store %struct.sockaddr_in* %1, %struct.sockaddr_in** %4
store i32 0, i32* %5
%6 = load i32, i32* %3
%7 = load %struct.sockaddr_in*, %struct.sockaddr_in** %4
%8 = bitcast %struct.sockaddr_in* %7 to %struct.sockaddr*
%9 = call i32 @accept(i32 %6, %struct.sockaddr* %8, i32* %5)
ret i32 %9
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @socket_accept(i32 %0, %struct.sockaddr_in* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = bitcast %struct.sockaddr_in* %1 to %struct.sockaddr*
%6 = call i32 @accept(i32 %0, %struct.sockaddr* %5, i32* %3)
ret i32 %6
}
/* Type definitions */
struct __test_metadata {
  int dummy;
};
struct __fixture_variant_metadata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ epoll19(struct __test_metadata *);
void wrapper_epoll19(struct __test_metadata *_metadata,
                     struct __fixture_variant_metadata *variant) {
  epoll19(_metadata);
}


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

x86 assembly (clang, -O2):
<wrapper_epoll19>:
jmp    1030 <epoll19@plt>

LLVM IR (-O0):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_epoll19(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* %1) {
%3 = alloca %struct.__test_metadata*
%4 = alloca %struct.__fixture_variant_metadata*
store %struct.__test_metadata* %0, %struct.__test_metadata** %3
store %struct.__fixture_variant_metadata* %1, %struct.__fixture_variant_metadata** %4
%5 = load %struct.__test_metadata*, %struct.__test_metadata** %3
%6 = call i32 @epoll19(%struct.__test_metadata* %5)
ret void
}

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_epoll19(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* nocapture readnone %1) {
%3 = tail call i32 @epoll19(%struct.__test_metadata* %0)
ret void
}
int do_270() { return 270; }


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

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

LLVM IR (-O0):
define i32 @do_270() {
ret i32 270
}

LLVM IR (-O2):
define i32 @do_270() {
ret i32 270
}
int pbl_LongSize(unsigned long value) {
  if (value <= 0x7f) {
    return (1);
  }
  if (value <= 0x3fff) {
    return (2);
  }
  if (value <= 0x1fffff) {
    return (3);
  }
  if (value <= 0x0fffffff) {
    return (4);
  }
  return (5);
}


x86 assembly (clang, -O0):
<pbl_LongSize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x7f,-0x10(%rbp)
ja     111f <pbl_LongSize+0x1f>
movl   $0x1,-0x4(%rbp)
jmp    1174 <pbl_LongSize+0x74>
cmpq   $0x3fff,-0x10(%rbp)
ja     1139 <pbl_LongSize+0x39>
movl   $0x2,-0x4(%rbp)
jmp    1174 <pbl_LongSize+0x74>
cmpq   $0x1fffff,-0x10(%rbp)
ja     1153 <pbl_LongSize+0x53>
movl   $0x3,-0x4(%rbp)
jmp    1174 <pbl_LongSize+0x74>
cmpq   $0xfffffff,-0x10(%rbp)
0f
ja     116d <pbl_LongSize+0x6d>
movl   $0x4,-0x4(%rbp)
jmp    1174 <pbl_LongSize+0x74>
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pbl_LongSize>:
mov    $0x1,%eax
cmp    $0x80,%rdi
jb     1139 <pbl_LongSize+0x39>
mov    $0x2,%eax
cmp    $0x4000,%rdi
jb     1139 <pbl_LongSize+0x39>
mov    $0x3,%eax
cmp    $0x200000,%rdi
jb     1139 <pbl_LongSize+0x39>
cmp    $0x10000000,%rdi
mov    $0x5,%eax
sbb    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @pbl_LongSize(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp ule i64 %4, 127
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %20
7: ; preds = %1
%8 = load i64, i64* %3
%9 = icmp ule i64 %8, 16383
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 2, i32* %2
br label %20
11: ; preds = %7
%12 = load i64, i64* %3
%13 = icmp ule i64 %12, 2097151
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 3, i32* %2
br label %20
15: ; preds = %11
%16 = load i64, i64* %3
%17 = icmp ule i64 %16, 268435455
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 4, i32* %2
br label %20
19: ; preds = %15
store i32 5, i32* %2
br label %20
20: ; preds = %19, %18, %14, %10, %6
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @pbl_LongSize(i64 %0) {
%2 = icmp ult i64 %0, 128
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = icmp ult i64 %0, 16384
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = icmp ult i64 %0, 2097152
br i1 %6, label %10, label %7
7: ; preds = %5
%8 = icmp ult i64 %0, 268435456
%9 = select i1 %8, i32 4, i32 5
br label %10
10: ; preds = %7, %5, %3, %1
%11 = phi i32 [ 1, %1 ], [ 2, %3 ], [ 3, %5 ], [ %9, %7 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fread(char *, int, int, int /*<<< orphan*/ *);
int fgetc(FILE *stream) {
  char ret;
  fread(&ret, 1, 1, stream);
  return ret;
}


x86 assembly (clang, -O0):
<fgetc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0x9(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fread@plt>
movsbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgetc>:
push   %rax
mov    %rdi,%rcx
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
movsbl 0x7(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fgetc(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fread(i8* %3, i32 1, i32 1, i32* %4)
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @fgetc(i32* nocapture %0) {
%2 = alloca i8
%3 = call i32 @fread(i8* %2, i32 1, i32 1, i32* %0)
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
ret i32 %5
}
/* Variables and functions */
char *itoa(int, char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char *argv[]) {
  int num;
  char str[1024];
  scanf("%d", &num);
  printf("%s\n", itoa(num, str));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb0(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%edi
lea    -0x420(%rbp),%rsi
call   1050 <itoa@plt>
mov    %rax,%rsi
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x418,%rsp
lea    0xec2(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%edi
lea    0x10(%rsp),%rsi
call   1050 <itoa@plt>
lea    0xea6(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x418,%rsp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca [1024 x i8]
%5 = bitcast i32* %3 to i8*
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%8 = load i32, i32* %3
%9 = call i8* @itoa(i32 %8, i8* %6)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %9)
ret i32 0
}
/* Variables and functions */
int *malloc(int);
int *copy_integer(int integer) {
  int *p;
  p = malloc(sizeof(int));
  *p = integer;
  return p;
}


x86 assembly (clang, -O0):
<copy_integer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_integer>:
push   %rbx
mov    %edi,%ebx
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %ebx,(%rax)
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i32* @copy_integer(i32 %0) {
%2 = tail call i32* @malloc(i32 4)
store i32 %0, i32* %2
ret i32* %2
}
/* Type definitions */
struct pipeline {
  int dummy;
};

/* Variables and functions */
struct pipeline *pipelineOpenFd(char ***, unsigned int, int, int);
struct pipeline *pipelineOpenFd1(char **cmd, unsigned opts, int otherEndFd,
                                 int stderrFd) {
  char **cmds[2];
  cmds[0] = cmd;
  cmds[1] = NULL;
  return pipelineOpenFd(cmds, opts, otherEndFd, stderrFd);
}


x86 assembly (clang, -O0):
<pipelineOpenFd1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
movq   $0x0,-0x28(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1030 <pipelineOpenFd@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pipelineOpenFd1>:
sub    $0x18,%rsp
mov    %rdi,(%rsp)
movq   $0x0,0x8(%rsp)
mov    %rsp,%rdi
call   1030 <pipelineOpenFd@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.pipeline = type { i32 }
define %struct.pipeline* @pipelineOpenFd1(i8** %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [2 x i8**]
store i8** %0, i8*** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds [2 x i8**], [2 x i8**]* %9, i64 0, i64 0
store i8** %10, i8*** %11
%12 = getelementptr inbounds [2 x i8**], [2 x i8**]* %9, i64 0, i64 1
store i8** null, i8*** %12
%13 = getelementptr inbounds [2 x i8**], [2 x i8**]* %9, i64 0, i64 0
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = load i32, i32* %8
%17 = call %struct.pipeline* @pipelineOpenFd(i8*** %13, i32 %14, i32 %15, i32 %16)
ret %struct.pipeline* %17
}

LLVM IR (-O2):
%struct.pipeline = type { i32 }
define %struct.pipeline* @pipelineOpenFd1(i8** %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca [2 x i8**]
%6 = bitcast [2 x i8**]* %5 to i8*
%7 = getelementptr inbounds [2 x i8**], [2 x i8**]* %5, i64 0, i64 0
store i8** %0, i8*** %7
%8 = getelementptr inbounds [2 x i8**], [2 x i8**]* %5, i64 0, i64 1
store i8** null, i8*** %8
%9 = call %struct.pipeline* @pipelineOpenFd(i8*** %7, i32 %1, i32 %2, i32 %3)
ret %struct.pipeline* %9
}
void g_file_error_from_errno() {}


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

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

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

LLVM IR (-O2):
define void @g_file_error_from_errno() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ memory_reset(void *);
void memory_free(void *memory) {
  memory_reset(memory);
  free(memory);
}


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

x86 assembly (clang, -O2):
<memory_free>:
push   %rbx
mov    %rdi,%rbx
call   1040 <memory_reset@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @memory_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @memory_reset(i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @free(i8* %5)
ret void
}

LLVM IR (-O2):
define void @memory_free(i8* %0) {
%2 = tail call i32 @memory_reset(i8* %0)
%3 = tail call i32 @free(i8* %0)
ret void
}
int test_imm_6Buint8_reg(unsigned char val) {
  return ((val) & (-0x6B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_6Buint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff95,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_6Buint8_reg>:
test   $0x95,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_6Buint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -107
%6 = icmp ne i32 %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_6Buint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -107
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(int ret) {
  printf("Usage: usf_test [TEST_TYPE]...\n"
         "Runs the user space tests specified by the TEST_TYPE\n"
         "parameters.  If no TEST_TYPE is specified, then the nominal\n"
         " test is run.\n"
         "\n"
         "TEST_TYPE can be:\n"
         "  -n, --nominal         run standard functionality tests\n"
         "  -a, --adversarial     run tests that try to break the \n"
         "                          driver\n"
         "  -s, --stress          run tests that try to maximize the \n"
         "                          capacity of the driver\n"
         "  -r, --repeatability   run 5 iterations of both the \n"
         "                          nominal and adversarial tests\n"
         "  -h, --help            print this help message and exit\n");
  exit(ret);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [601 x i8] c"Usage: usf_test [TEST_TYPE]...\0ARuns the user space tests specified by the TEST_TYPE\0Aparameters. If no TEST_TYPE is specified, then the nominal\0A test is run.\0A\0ATEST_TYPE can be:\0A -n, --nominal run standard functionality tests\0A -a, --adversarial run tests that try to break the \0A driver\0A -s, --stress run tests that try to maximize the \0A capacity of the driver\0A -r, --repeatability run 5 iterations of both the \0A nominal and adversarial tests\0A -h, --help print this help message and exit\0A\00"
define void @usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([601 x i8], [601 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@str = [600 x i8] c"Usage: usf_test [TEST_TYPE]...\0ARuns the user space tests specified by the TEST_TYPE\0Aparameters. If no TEST_TYPE is specified, then the nominal\0A test is run.\0A\0ATEST_TYPE can be:\0A -n, --nominal run standard functionality tests\0A -a, --adversarial run tests that try to break the \0A driver\0A -s, --stress run tests that try to maximize the \0A capacity of the driver\0A -r, --repeatability run 5 iterations of both the \0A nominal and adversarial tests\0A -h, --help print this help message and exit\00"
define void @usage(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([600 x i8], [600 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 %0)
unreachable
}
void video_bind_context(struct host *base, struct render_backend *r) {}


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

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

LLVM IR (-O0):
%struct.host = type opaque
%struct.render_backend = type opaque
define void @video_bind_context(%struct.host* %0, %struct.render_backend* %1) {
%3 = alloca %struct.host*
%4 = alloca %struct.render_backend*
store %struct.host* %0, %struct.host** %3
store %struct.render_backend* %1, %struct.render_backend** %4
ret void
}

LLVM IR (-O2):
%struct.host = type opaque
%struct.render_backend = type opaque
define void @video_bind_context(%struct.host* nocapture %0, %struct.render_backend* nocapture %1) {
ret void
}
int rockchip_drm_fbdev_init(struct drm_device *dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.drm_device = type opaque
define i32 @rockchip_drm_fbdev_init(%struct.drm_device* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ start_server(int);
int main(int argc, char *argv[]) {
  start_server(80);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x50,%edi
call   1030 <start_server@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @start_server(i32 80)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @start_server(i32 80)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LC_ALL;
int /*<<< orphan*/ decrescente(int, int /*<<< orphan*/);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int main() {
  setlocale(LC_ALL, "");
  decrescente(11, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
lea    0xec1(%rip),%rsi
call   1040 <setlocale@plt>
mov    $0xb,%edi
xor    %esi,%esi
call   1030 <decrescente@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <setlocale@plt>
mov    $0xb,%edi
xor    %esi,%esi
call   1030 <decrescente@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @LC_ALL
%3 = call i32 @setlocale(i32 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @decrescente(i32 11, i32 0)
ret i32 0
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
define i32 @main() {
%1 = load i32, i32* @LC_ALL
%2 = tail call i32 @setlocale(i32 %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @decrescente(i32 11, i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ExitApp(int /*<<< orphan*/);
int /*<<< orphan*/ Token(char *);
int /*<<< orphan*/ printf(char *, char *);
void NeedToken(char *token) {
  if (!Token(token)) {
    printf("Expected '%s'", token);
    ExitApp(0);
  }
}


x86 assembly (clang, -O0):
<NeedToken>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <Token@plt>
cmp    $0x0,%eax
jne    1165 <NeedToken+0x35>
mov    -0x8(%rbp),%rsi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <ExitApp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NeedToken>:
push   %rbx
mov    %rdi,%rbx
call   1040 <Token@plt>
test   %eax,%eax
je     113f <NeedToken+0xf>
pop    %rbx
ret
lea    0xeba(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %edi,%edi
pop    %rbx
jmp    1050 <ExitApp@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Expected '%s'\00"
define void @NeedToken(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @Token(i8* %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = call i32 @ExitApp(i32 0)
br label %10
10: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"Expected '%s'\00"
define void @NeedToken(i8* %0) {
%2 = tail call i32 @Token(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = tail call i32 @ExitApp(i32 0)
br label %7
7: ; preds = %4, %1
ret void
}
int lan2_send_ctlaltdel(void *rsp) { return (-8); }


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

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

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

LLVM IR (-O2):
define i32 @lan2_send_ctlaltdel(i8* nocapture readnone %0) {
ret i32 -8
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char const *);
double strtod(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ to_locale(char *);
double os_strtod(const char *str) {
  char buf[64];
  snprintf(buf, 64, "%s", str);
  to_locale(buf);
  return strtod(buf, NULL);
}


x86 assembly (clang, -O0):
<os_strtod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x40,%esi
lea    0xeb0(%rip),%rdx
call   1050 <snprintf@plt>
lea    -0x50(%rbp),%rdi
call   1030 <to_locale@plt>
lea    -0x50(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <strtod@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_strtod>:
push   %rbx
sub    $0x40,%rsp
mov    %rdi,%rcx
lea    0xec1(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x40,%esi
call   1050 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <to_locale@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <strtod@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define double @os_strtod(i8* %0) {
%2 = alloca i8*
%3 = alloca [64 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @snprintf(i8* %4, i32 64, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%8 = call i32 @to_locale(i8* %7)
%9 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%10 = call double @strtod(i8* %9, i32* null)
ret double %10
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define double @os_strtod(i8* %0) {
%2 = alloca [64 x i8]
%3 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 64, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @to_locale(i8* %3)
%6 = call double @strtod(i8* nocapture %3, i32* null)
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ e_abs();
int /*<<< orphan*/ e_inc();
int /*<<< orphan*/ e_writeback();
void e_inc_abs() {
  e_abs();
  e_inc();
  e_writeback();
}


x86 assembly (clang, -O0):
<e_inc_abs>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <e_abs@plt>
mov    $0x0,%al
call   1040 <e_inc@plt>
mov    $0x0,%al
call   1030 <e_writeback@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_inc_abs>:
push   %rax
xor    %eax,%eax
call   1050 <e_abs@plt>
xor    %eax,%eax
call   1040 <e_inc@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <e_writeback@plt>

LLVM IR (-O0):
define void @e_inc_abs() {
%1 = call i32 (...) @e_abs()
%2 = call i32 (...) @e_inc()
%3 = call i32 (...) @e_writeback()
ret void
}

LLVM IR (-O2):
define void @e_inc_abs() {
%1 = tail call i32 (...) @e_abs()
%2 = tail call i32 (...) @e_inc()
%3 = tail call i32 (...) @e_writeback()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
long double strtold(char const *, char **);
long double strtold_l(const char *nptr, char **endptr, locale_t loc) {
  return strtold(nptr, endptr);
}


x86 assembly (clang, -O0):
<strtold_l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strtold@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtold_l>:
jmp    1030 <strtold@plt>

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

LLVM IR (-O2):
define x86_fp80 @strtold_l(i8* %0, i8** nocapture %1, i32 %2) {
%4 = tail call x86_fp80 @strtold(i8* %0, i8** %1)
ret x86_fp80 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ nlink_t;

/* Variables and functions */
nlink_t ret_nlink_t(nlink_t arg1) { return arg1; }


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

x86 assembly (clang, -O2):
<ret_nlink_t>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @ret_nlink_t(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int m_len(int);
scalar_t__ mls(int, int);
int s_strlen(int m) {
  int p = m_len(m);
  return p && (*(char *)mls((m), (p - 1))) == 0 ? p - 1 : p;
}


x86 assembly (clang, -O0):
<s_strlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <m_len@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1168 <s_strlen+0x48>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
call   1040 <mls@plt>
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1168 <s_strlen+0x48>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    116e <s_strlen+0x4e>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_strlen>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%r14d
call   1030 <m_len@plt>
mov    %eax,%ebx
test   %eax,%eax
je     1144 <s_strlen+0x24>
lea    -0x1(%rbx),%ebp
mov    %r14d,%edi
mov    %ebp,%esi
call   1040 <mls@plt>
cmpb   $0x0,(%rax)
je     1146 <s_strlen+0x26>
mov    %ebx,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @s_strlen(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @m_len(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %20
8: ; preds = %1
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 1
%12 = call i64 @mls(i32 %9, i32 %11)
%13 = inttoptr i64 %12 to i8*
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %8
%18 = load i32, i32* %3
%19 = sub nsw i32 %18, 1
br label %22
20: ; preds = %8, %1
%21 = load i32, i32* %3
br label %22
22: ; preds = %20, %17
%23 = phi i32 [ %19, %17 ], [ %21, %20 ]
ret i32 %23
}

LLVM IR (-O2):
define i32 @s_strlen(i32 %0) {
%2 = tail call i32 @m_len(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = add nsw i32 %2, -1
%6 = tail call i64 @mls(i32 %0, i32 %5)
%7 = inttoptr i64 %6 to i8*
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %4, %1
br label %11
11: ; preds = %4, %10
%12 = phi i32 [ %2, %10 ], [ %5, %4 ]
ret i32 %12
}
OP(fd, c9) { op_c9(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <op_c9@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @op_c9()
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_c9()
ret i32 undef
}
void INT_Excep_CMPB1_CMPB3(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_CMPB1_CMPB3() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ expand(char *);
int main(int argc, char **argv) {
  for (int i = 1; i < argc; i++)
    expand(argv[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1158 <main+0x48>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <expand@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%edi
jl     1142 <main+0x32>
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14,%rbx,8),%rdi
call   1030 <expand@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %7
6: ; preds = %7, %2
ret i32 0
7: ; preds = %4, %7
%8 = phi i64 [ 1, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i32 @expand(i8* %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ SEEK_CUR;
scalar_t__ lseek(int, int, int /*<<< orphan*/);
int seek_to_next(int fd, uint8_t *header_buffer, int skipped) {
  skipped += 3;
  int seek_skip = ((header_buffer[4] << 8) | header_buffer[5]) - skipped;
  if (lseek(fd, seek_skip, SEEK_CUR) < 0)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<seek_to_next>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%eax
shl    $0x8,%eax
mov    -0x10(%rbp),%rcx
or     0x14(%rcx),%eax
sub    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    0x2e99(%rip),%rax
mov    (%rax),%edx
call   1030 <lseek@plt>
cmp    $0x0,%rax
jge    116c <seek_to_next+0x5c>
movl   $0x0,-0x4(%rbp)
jmp    1173 <seek_to_next+0x63>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seek_to_next>:
push   %rax
mov    0x10(%rsi),%eax
shl    $0x8,%eax
or     0x14(%rsi),%eax
sub    %edx,%eax
add    $0xfffffffd,%eax
mov    0x2ec2(%rip),%rcx
mov    (%rcx),%edx
mov    %eax,%esi
call   1030 <lseek@plt>
shr    $0x3f,%rax
xor    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SEEK_CUR = global i32 0
define i32 @seek_to_next(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%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
%9 = load i32, i32* %7
%10 = add nsw i32 %9, 3
store i32 %10, i32* %7
%11 = load i32*, i32** %6
%12 = getelementptr inbounds i32, i32* %11, i64 4
%13 = load i32, i32* %12
%14 = shl i32 %13, 8
%15 = load i32*, i32** %6
%16 = getelementptr inbounds i32, i32* %15, i64 5
%17 = load i32, i32* %16
%18 = or i32 %14, %17
%19 = load i32, i32* %7
%20 = sub nsw i32 %18, %19
store i32 %20, i32* %8
%21 = load i32, i32* %5
%22 = load i32, i32* %8
%23 = load i32, i32* @SEEK_CUR
%24 = call i64 @lseek(i32 %21, i32 %22, i32 %23)
%25 = icmp slt i64 %24, 0
br i1 %25, label %26, label %27
26: ; preds = %3
store i32 0, i32* %4
br label %28
27: ; preds = %3
store i32 1, i32* %4
br label %28
28: ; preds = %27, %26
%29 = load i32, i32* %4
ret i32 %29
}

LLVM IR (-O2):
@SEEK_CUR = global i32 0
define i32 @seek_to_next(i32 %0, i32* nocapture %1, i32 %2) {
%4 = getelementptr inbounds i32, i32* %1, i64 4
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = getelementptr inbounds i32, i32* %1, i64 5
%8 = load i32, i32* %7
%9 = or i32 %6, %8
%10 = sub i32 -3, %2
%11 = add i32 %10, %9
%12 = load i32, i32* @SEEK_CUR
%13 = tail call i64 @lseek(i32 %0, i32 %11, i32 %12)
%14 = lshr i64 %13, 63
%15 = trunc i64 %14 to i32
%16 = xor i32 %15, 1
ret i32 %16
}