xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_glsl_empty_comments() {
  test_parser_verify_parse(test_parser_sourcefile("glsl", " //\n"), "glsl", "",
                           "//\n", 0);
}


x86 assembly (clang, -O0):
<test_glsl_empty_comments>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed3(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xec2(%rip),%rdx
lea    0xeb8(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_glsl_empty_comments>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xed6(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xecb(%rip),%rdx
lea    0xec1(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"glsl\00"
@.str.1 = [5 x i8] c" //\0A\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [4 x i8] c"//\0A\00"
define void @test_glsl_empty_comments() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"glsl\00"
@.str.1 = [5 x i8] c" //\0A\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [4 x i8] c"//\0A\00"
define void @test_glsl_empty_comments() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __do_global_ctors();
int /*<<< orphan*/ _pei386_runtime_relocator();
int __attribute__((externally_visible)) DllStartup(void *module, int reason) {
  if (reason == 1) {
    _pei386_runtime_relocator();
    __do_global_ctors();
  };
  return 1;
}


x86 assembly (clang, -O0):
<DllStartup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1147 <DllStartup+0x27>
mov    $0x0,%al
call   1040 <_pei386_runtime_relocator@plt>
mov    $0x0,%al
call   1030 <__do_global_ctors@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DllStartup>:
cmp    $0x1,%esi
jne    1138 <DllStartup+0x18>
push   %rax
xor    %eax,%eax
call   1040 <_pei386_runtime_relocator@plt>
xor    %eax,%eax
call   1030 <__do_global_ctors@plt>
add    $0x8,%rsp
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @DllStartup(i8* nocapture readnone %0, i32 %1) {
%3 = icmp eq i32 %1, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 (...) @_pei386_runtime_relocator()
%6 = tail call i32 (...) @__do_global_ctors()
br label %7
7: ; preds = %4, %2
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_128() {
  Assert_real((isqrt(128) == 11),
              "/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/stdlib/isqrt.c",
              645, ("Integer square root of 128 should be 11"));
}


x86 assembly (clang, -O0):
<t_sqrt_128>:
push   %rbp
mov    %rsp,%rbp
mov    $0x80,%edi
call   1030 <isqrt@plt>
cmp    $0xb,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x285,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_128>:
push   %rax
mov    $0x80,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xb,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x285,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 128 should be 11\00"
define void @t_sqrt_128() {
%1 = call i32 @isqrt(i32 128)
%2 = icmp eq i32 %1, 11
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 645, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 128 should be 11\00"
define void @t_sqrt_128() {
%1 = tail call i32 @isqrt(i32 128)
%2 = icmp eq i32 %1, 11
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 645, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
double FRAND() { return (double)rand() / ((double)RAND_MAX + 1); }


x86 assembly (clang, -O0):
<FRAND>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec1(%rip),%rax
cvtsi2sdq (%rax),%xmm1
movsd  0xecc(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<FRAND>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec4(%rip),%rax
cvtsi2sdq (%rax),%xmm1
addsd  0xecf(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @FRAND() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to double
%5 = fadd double %4, 1.000000e+00
%6 = fdiv double %2, %5
ret double %6
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @FRAND() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to double
%5 = fadd double %4, 1.000000e+00
%6 = fdiv double %2, %5
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printHex(unsigned char b[], int lim) {
  int i;
  for (i = 0; i < lim; i++) {
    printf("%02X", (unsigned int)b[i]);
  }
  printf("\n");
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%02X\00"
define void @printHex(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
struct nlmsghdr {
  int dummy;
};

/* Variables and functions */
struct nlmsghdr *kern_get_pool();
int /*<<< orphan*/ kern_pool_hook();
int nl_msg_recv(struct nlmsghdr *);
void nlmsg_poll(void) {
  struct nlmsghdr *nlh = NULL;
  ;
  int ret;
  while (1) {
    if (nlh == NULL) {
      nlh = kern_get_pool();
    }
    ret = nl_msg_recv(nlh);
    if (ret >= 0) {
      kern_pool_hook();
      nlh = NULL;
    }
  }
}


x86 assembly (clang, -O0):
<nlmsg_poll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1156 <nlmsg_poll+0x26>
mov    $0x0,%al
call   1050 <kern_get_pool@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <nl_msg_recv@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     117b <nlmsg_poll+0x4b>
mov    $0x0,%al
call   1030 <kern_pool_hook@plt>
movq   $0x0,-0x8(%rbp)
jmp    1140 <nlmsg_poll+0x10>

x86 assembly (clang, -O2):
<nlmsg_poll>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %ebx,%ebx
test   %rbx,%rbx
jne    1151 <nlmsg_poll+0x21>
xor    %eax,%eax
call   1050 <kern_get_pool@plt>
mov    %rax,%rbx
mov    %rbx,%rdi
call   1040 <nl_msg_recv@plt>
test   %eax,%eax
js     1142 <nlmsg_poll+0x12>
xor    %eax,%eax
call   1030 <kern_pool_hook@plt>
jmp    1140 <nlmsg_poll+0x10>

LLVM IR (-O0):
%struct.nlmsghdr = type { i32 }
define void @nlmsg_poll() {
%1 = alloca %struct.nlmsghdr*
%2 = alloca i32
store %struct.nlmsghdr* null, %struct.nlmsghdr** %1
br label %3
3: ; preds = %0, %15
%4 = load %struct.nlmsghdr*, %struct.nlmsghdr** %1
%5 = icmp eq %struct.nlmsghdr* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = call %struct.nlmsghdr* (...) @kern_get_pool()
store %struct.nlmsghdr* %7, %struct.nlmsghdr** %1
br label %8
8: ; preds = %6, %3
%9 = load %struct.nlmsghdr*, %struct.nlmsghdr** %1
%10 = call i32 @nl_msg_recv(%struct.nlmsghdr* %9)
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = icmp sge i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = call i32 (...) @kern_pool_hook()
store %struct.nlmsghdr* null, %struct.nlmsghdr** %1
br label %15
15: ; preds = %13, %8
br label %3
}

LLVM IR (-O2):
%struct.nlmsghdr = type { i32 }
define void @nlmsg_poll() {
br label %1
1: ; preds = %12, %0
%2 = phi %struct.nlmsghdr* [ null, %0 ], [ %13, %12 ]
%3 = icmp eq %struct.nlmsghdr* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call %struct.nlmsghdr* (...) @kern_get_pool()
br label %6
6: ; preds = %4, %1
%7 = phi %struct.nlmsghdr* [ %5, %4 ], [ %2, %1 ]
%8 = tail call i32 @nl_msg_recv(%struct.nlmsghdr* %7)
%9 = icmp sgt i32 %8, -1
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = tail call i32 (...) @kern_pool_hook()
br label %12
12: ; preds = %10, %6
%13 = phi %struct.nlmsghdr* [ null, %10 ], [ %7, %6 ]
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int distance = 100;
  printf("You ar %d miles away.\n", distance);
  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   $0x64,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [23 x i8] c"You ar %d miles away.\0A\00"
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 100, i32* %6
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"You ar %d miles away.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 100)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ interrupt_handler_unregister(int);
void timer_handler_unregister(void) { interrupt_handler_unregister(66); }


x86 assembly (clang, -O0):
<timer_handler_unregister>:
push   %rbp
mov    %rsp,%rbp
mov    $0x42,%edi
call   1030 <interrupt_handler_unregister@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_handler_unregister>:
mov    $0x42,%edi
jmp    1030 <interrupt_handler_unregister@plt>

LLVM IR (-O0):
define void @timer_handler_unregister() {
%1 = call i32 @interrupt_handler_unregister(i32 66)
ret void
}

LLVM IR (-O2):
define void @timer_handler_unregister() {
%1 = tail call i32 @interrupt_handler_unregister(i32 66)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ screen;
};
typedef TYPE_1__ XVisualInfo;

/* Variables and functions */
int get_XVisualInfo_screen(void *_p) {
  return (int)((XVisualInfo *)_p)->screen;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XVisualInfo_screen(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XVisualInfo_screen(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int syscall(int, char const *, size_t);
int sethostname(const char *name, size_t len) { return syscall(74, name, len); }


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

x86 assembly (clang, -O2):
<sethostname>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x4a,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @sethostname(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 @syscall(i32 74, i8* %5, i64 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @sethostname(i8* %0, i64 %1) {
%3 = tail call i32 @syscall(i32 74, i8* %0, i64 %1)
ret i32 %3
}
int check_hex_str(char *str, int len) {
  int i = 0;
  for (i = 0; i < len; i++) {
    if ((('!' <= str[i]) && (str[i] <= '~'))) {
      ;
    } else {
      return -1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<check_hex_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1177 <check_hex_str+0x77>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
mov    $0x21,%eax
cmp    %ecx,%eax
jg     1158 <check_hex_str+0x58>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x7e,%eax
jg     1158 <check_hex_str+0x58>
jmp    1164 <check_hex_str+0x64>
movl   $0xffffffff,-0x4(%rbp)
jmp    117e <check_hex_str+0x7e>
jmp    1169 <check_hex_str+0x69>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1119 <check_hex_str+0x19>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_hex_str>:
test   %esi,%esi
jle    1125 <check_hex_str+0x25>
mov    %esi,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
movzbl (%rdi,%rcx,1),%edx
add    $0x81,%dl
cmp    $0xa1,%dl
jbe    1128 <check_hex_str+0x28>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <check_hex_str+0x10>
xor    %eax,%eax
ret
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @check_hex_str(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 0, i32* %6
store i32 0, i32* %6
br label %7
7: ; preds = %30, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %33
11: ; preds = %7
%12 = load i8*, i8** %4
%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 = sext i8 %16 to i32
%18 = icmp sle i32 33, %17
br i1 %18, label %19, label %28
19: ; preds = %11
%20 = load i8*, i8** %4
%21 = load i32, i32* %6
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp sle i32 %25, 126
br i1 %26, label %27, label %28
27: ; preds = %19
br label %29
28: ; preds = %19, %11
store i32 -1, i32* %3
br label %34
29: ; preds = %27
br label %30
30: ; preds = %29
%31 = load i32, i32* %6
%32 = add nsw i32 %31, 1
store i32 %32, i32* %6
br label %7
33: ; preds = %7
store i32 0, i32* %3
br label %34
34: ; preds = %33, %28
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
define i32 @check_hex_str(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8
%7 = icmp eq i64 %14, %5
br i1 %7, label %15, label %8
8: ; preds = %4, %6
%9 = phi i64 [ 0, %4 ], [ %14, %6 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = add i8 %11, -127
%13 = icmp ult i8 %12, -94
%14 = add nuw nsw i64 %9, 1
br i1 %13, label %15, label %6
15: ; preds = %8, %6, %2
%16 = phi i32 [ 0, %2 ], [ 0, %6 ], [ -1, %8 ]
ret i32 %16
}
/* Variables and functions */
void *malloc(size_t);
void *safe_malloc_(size_t size) {
  if (!size)
    size++;
  return malloc(size);
}


x86 assembly (clang, -O0):
<safe_malloc_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1133 <safe_malloc_+0x23>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_malloc_>:
test   %rdi,%rdi
mov    $0x1,%eax
cmove  %rax,%rdi
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @safe_malloc_(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = select i1 %2, i64 1, i64 %0
%4 = tail call i8* @malloc(i64 %3)
ret i8* %4
}
char *cgets(s)
char *s;
{
  char *s1 = s;
  int c;
  while ((c = getche()) != '\r' && c != '\n')
    *s++ = c;
  *s = 0;
  if (s == s1)
    return ((char *)0);
  return (s1);
}


x86 assembly (clang, -O0):
<cgets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <getche@plt>
mov    %eax,%ecx
mov    %ecx,-0x1c(%rbp)
xor    %eax,%eax
cmp    $0xd,%ecx
mov    %al,-0x1d(%rbp)
je     1148 <cgets+0x38>
cmpl   $0xa,-0x1c(%rbp)
setne  %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
test   $0x1,%al
jne    1158 <cgets+0x48>
jmp    1173 <cgets+0x63>
mov    -0x1c(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    1124 <cgets+0x14>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    1195 <cgets+0x85>
movq   $0x0,-0x8(%rbp)
jmp    119d <cgets+0x8d>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgets>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <getche@plt>
cmp    $0xa,%eax
je     113b <cgets+0x2b>
cmp    $0xd,%eax
je     113b <cgets+0x2b>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
jmp    1120 <cgets+0x10>
movb   $0x0,(%r14,%rbx,1)
test   %rbx,%rbx
cmove  %rbx,%r14
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @cgets(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
store i8* %6, i8** %4
br label %7
7: ; preds = %15, %1
%8 = call i32 (...) @getche()
store i32 %8, i32* %5
%9 = icmp ne i32 %8, 13
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32, i32* %5
%12 = icmp ne i32 %11, 10
br label %13
13: ; preds = %10, %7
%14 = phi i1 [ false, %7 ], [ %12, %10 ]
br i1 %14, label %15, label %20
15: ; preds = %13
%16 = load i32, i32* %5
%17 = trunc i32 %16 to i8
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %3
store i8 %17, i8* %18
br label %7
20: ; preds = %13
%21 = load i8*, i8** %3
store i8 0, i8* %21
%22 = load i8*, i8** %3
%23 = load i8*, i8** %4
%24 = icmp eq i8* %22, %23
br i1 %24, label %25, label %26
25: ; preds = %20
store i8* null, i8** %2
br label %28
26: ; preds = %20
%27 = load i8*, i8** %4
store i8* %27, i8** %2
br label %28
28: ; preds = %26, %25
%29 = load i8*, i8** %2
ret i8* %29
}

LLVM IR (-O2):
define i8* @cgets(i8* writeonly %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %7, %5 ]
%4 = tail call i32 (...) @getche()
switch i32 %4, label %5 [
i32 13, label %8
i32 10, label %8
]
5: ; preds = %2
%6 = trunc i32 %4 to i8
%7 = getelementptr inbounds i8, i8* %3, i64 1
store i8 %6, i8* %3
br label %2
8: ; preds = %2, %2
store i8 0, i8* %3
%9 = icmp eq i8* %3, %0
%10 = select i1 %9, i8* null, i8* %0
ret i8* %10
}
/* Variables and functions */
int my_sleep(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("The last time:%u\n", my_sleep(5));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
call   1040 <my_sleep@plt>
mov    %eax,%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1040 <my_sleep@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"The last time:%u\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @my_sleep(i32 5)
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"The last time:%u\0A\00"
define i32 @main() {
%1 = tail call i32 @my_sleep(i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
struct zsock_addrinfo {
  int dummy;
};

/* Variables and functions */
int zsock_getaddrinfo(char const *, char const *, struct zsock_addrinfo const *,
                      struct zsock_addrinfo **);
int getaddrinfo(const char *host, const char *service,
                const struct zsock_addrinfo *hints,
                struct zsock_addrinfo **res) {
  return zsock_getaddrinfo(host, service, hints, res);
}


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

x86 assembly (clang, -O2):
<getaddrinfo>:
jmp    1030 <zsock_getaddrinfo@plt>

LLVM IR (-O0):
%struct.zsock_addrinfo = type { i32 }
define i32 @getaddrinfo(i8* %0, i8* %1, %struct.zsock_addrinfo* %2, %struct.zsock_addrinfo** %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca %struct.zsock_addrinfo*
%8 = alloca %struct.zsock_addrinfo**
store i8* %0, i8** %5
store i8* %1, i8** %6
store %struct.zsock_addrinfo* %2, %struct.zsock_addrinfo** %7
store %struct.zsock_addrinfo** %3, %struct.zsock_addrinfo*** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load %struct.zsock_addrinfo*, %struct.zsock_addrinfo** %7
%12 = load %struct.zsock_addrinfo**, %struct.zsock_addrinfo*** %8
%13 = call i32 @zsock_getaddrinfo(i8* %9, i8* %10, %struct.zsock_addrinfo* %11, %struct.zsock_addrinfo** %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.zsock_addrinfo = type { i32 }
define i32 @getaddrinfo(i8* %0, i8* %1, %struct.zsock_addrinfo* %2, %struct.zsock_addrinfo** %3) {
%5 = tail call i32 @zsock_getaddrinfo(i8* %0, i8* %1, %struct.zsock_addrinfo* %2, %struct.zsock_addrinfo** %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ op_write1(int);
void op_enc_inc_a(void) { op_write1(0x3c); }


x86 assembly (clang, -O0):
<op_enc_inc_a>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3c,%edi
call   1030 <op_write1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_enc_inc_a>:
mov    $0x3c,%edi
jmp    1030 <op_write1@plt>

LLVM IR (-O0):
define void @op_enc_inc_a() {
%1 = call i32 @op_write1(i32 60)
ret void
}

LLVM IR (-O2):
define void @op_enc_inc_a() {
%1 = tail call i32 @op_write1(i32 60)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void uDMAChannelEnable(unsigned long ulChannelNum) {
  DEBUG_ASSERT((ulChannelNum & 0xffff) < 32);
  (*((volatile unsigned long *)(0x400FF028))) = 1 << (ulChannelNum & 0x1f);
}


x86 assembly (clang, -O0):
<uDMAChannelEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xffff,%rax
cmp    $0x20,%rax
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
and    $0x1f,%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%rcx
mov    $0x400ff028,%eax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uDMAChannelEnable>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   $0xffe0,%ebx
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    $0x1,%eax
mov    %ebx,%ecx
shl    %cl,%eax
cltq
mov    %rax,0x400ff028
40
pop    %rbx
ret

LLVM IR (-O0):
define void @uDMAChannelEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 65535
%5 = icmp ult i64 %4, 32
%6 = zext i1 %5 to i32
%7 = call i32 @DEBUG_ASSERT(i32 %6)
%8 = load i64, i64* %2
%9 = and i64 %8, 31
%10 = trunc i64 %9 to i32
%11 = shl i32 1, %10
%12 = sext i32 %11 to i64
store volatile i64 %12, i64* inttoptr (i64 1074786344 to i64*)
ret void
}

LLVM IR (-O2):
define void @uDMAChannelEnable(i64 %0) {
%2 = and i64 %0, 65504
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = trunc i64 %0 to i32
%7 = and i32 %6, 31
%8 = shl nuw i32 1, %7
%9 = sext i32 %8 to i64
store volatile i64 %9, i64* inttoptr (i64 1074786344 to i64*)
ret void
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *strdup(const char *s) {
  char *d = malloc(strlen(s) + 1);
  if (d == NULL)
    return NULL;
  strcpy(d, s);
  return d;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116d <strdup+0x3d>
movq   $0x0,-0x8(%rbp)
jmp    1182 <strdup+0x52>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <strdup+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @strlen(i8* %5)
%7 = add nsw i64 %6, 1
%8 = call i8* @malloc(i64 %7)
store i8* %8, i8** %4
%9 = load i8*, i8** %4
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %12
11: ; preds = %1
store i8* null, i8** %2
br label %17
12: ; preds = %1
%13 = load i8*, i8** %4
%14 = load i8*, i8** %3
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %4
store i8* %16, i8** %2
br label %17
17: ; preds = %12, %11
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @strcpy(i8* %4, i8* %0)
br label %8
8: ; preds = %1, %6
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hola Youtube!");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hola Youtube!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hola Youtube!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct utmpx {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ t2p_orig_getutxent();
struct utmpx *time2posix_utmpx(int /*<<< orphan*/);
struct utmpx *getutxent(void) {
  return time2posix_utmpx(t2p_orig_getutxent());
}


x86 assembly (clang, -O0):
<getutxent>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <t2p_orig_getutxent@plt>
mov    %eax,%edi
call   1030 <time2posix_utmpx@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.utmpx = type { i32 }
define %struct.utmpx* @getutxent() {
%1 = call i32 (...) @t2p_orig_getutxent()
%2 = call %struct.utmpx* @time2posix_utmpx(i32 %1)
ret %struct.utmpx* %2
}

LLVM IR (-O2):
%struct.utmpx = type { i32 }
define %struct.utmpx* @getutxent() {
%1 = tail call i32 (...) @t2p_orig_getutxent()
%2 = tail call %struct.utmpx* @time2posix_utmpx(i32 %1)
ret %struct.utmpx* %2
}
int EAC_OBJ_txt2nid(const char *s) { return EAC_OBJ_txt2nid(s); }


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

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

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

LLVM IR (-O2):
define i32 @EAC_OBJ_txt2nid(i8* nocapture readnone %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Type definitions */
struct stat {
  int st_size;
};
typedef int off_t;

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
off_t fsize(const char *path) {
  struct stat st;
  if (stat(path, &st))
    return -1;
  return st.st_size;
}


x86 assembly (clang, -O0):
<fsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
je     113f <fsize+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1145 <fsize+0x35>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsize>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
neg    %rax
sbb    %eax,%eax
or     (%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @fsize(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 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = select i1 %5, i32 %7, i32 -1
ret i32 %8
}
gnargs(d) int d;
{
  ot("movl\t$");
  onum(d);
  outstr(",r6\n");
}


x86 assembly (clang, -O0):
<gnargs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1050 <ot@plt>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1040 <onum@plt>
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <outstr@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gnargs>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1050 <ot@plt>
mov    %ebx,%edi
xor    %eax,%eax
call   1040 <onum@plt>
lea    0xeb6(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <outstr@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"movl\09$\00"
@.str.1 = [5 x i8] c",r6\0A\00"
define i32 @gnargs(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %3
%6 = call i32 (i32, ...) bitcast (i32 (...)* @onum to i32 (i32, ...)*)(i32 %5)
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @outstr to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
@.str = [7 x i8] c"movl\09$\00"
@.str.1 = [5 x i8] c",r6\0A\00"
define i32 @gnargs(i32 %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @onum to i32 (i32, ...)*)(i32 %0)
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @outstr to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
struct uevent {
  int dummy;
};

/* Variables and functions */
char *uevent_get_dm_str(struct uevent const *, char *);
char *uevent_get_dm_action(const struct uevent *uev) {
  return uevent_get_dm_str(uev, "DM_ACTION");
}


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

x86 assembly (clang, -O2):
<uevent_get_dm_action>:
lea    0xee9(%rip),%rsi
jmp    1030 <uevent_get_dm_str@plt>

LLVM IR (-O0):
%struct.uevent = type { i32 }
@.str = [10 x i8] c"DM_ACTION\00"
define i8* @uevent_get_dm_action(%struct.uevent* %0) {
%2 = alloca %struct.uevent*
store %struct.uevent* %0, %struct.uevent** %2
%3 = load %struct.uevent*, %struct.uevent** %2
%4 = call i8* @uevent_get_dm_str(%struct.uevent* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
%struct.uevent = type { i32 }
@.str = [10 x i8] c"DM_ACTION\00"
define i8* @uevent_get_dm_action(%struct.uevent* %0) {
%2 = tail call i8* @uevent_get_dm_str(%struct.uevent* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
int glutBitmapWidth(void *font, int character) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @glutBitmapWidth(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
int bitAnd(int x, int y) { return ~(~x | ~y); }


x86 assembly (clang, -O0):
<bitAnd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
mov    -0x8(%rbp),%ecx
xor    $0xffffffff,%ecx
or     %ecx,%eax
xor    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @bitAnd(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 = xor i32 %5, -1
%7 = load i32, i32* %4
%8 = xor i32 %7, -1
%9 = or i32 %6, %8
%10 = xor i32 %9, -1
ret i32 %10
}

LLVM IR (-O2):
define i32 @bitAnd(i32 %0, i32 %1) {
%3 = and i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ test_loop_simple(int *, int);
void test_call_loop_simple() {
  int x[] = {5, 6, 7};
  test_loop_simple(x, 3);
}


x86 assembly (clang, -O0):
<test_call_loop_simple>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xedf(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0xc(%rbp),%rdi
mov    $0x3,%esi
call   1030 <test_loop_simple@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_call_loop_simple>:
sub    $0x18,%rsp
mov    0xeee(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xedb(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
mov    $0x3,%esi
call   1030 <test_loop_simple@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.test_call_loop_simple.x = [3 x i32] [i32 5, i32 6, i32 7]
define void @test_call_loop_simple() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%4 = call i32 @test_loop_simple(i32* %3, i32 3)
ret void
}

LLVM IR (-O2):
@__const.test_call_loop_simple.x = [3 x i32] [i32 5, i32 6, i32 7]
define void @test_call_loop_simple() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%4 = call i32 @test_loop_simple(i32* %3, i32 3)
ret void
}
/* Variables and functions */
char *strstr(char *, char *);
int /*<<< orphan*/ trace_util_add_option(char *, char *);
void process_plugin_option(char *option) {
  char *name = option;
  char *val = NULL;
  char *p;
  if ((p = strstr(name, "="))) {
    *p = '\0';
    val = p + 1;
  }
  trace_util_add_option(name, val);
}


x86 assembly (clang, -O0):
<process_plugin_option>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1040 <strstr@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     116d <process_plugin_option+0x4d>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <trace_util_add_option@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_plugin_option>:
push   %rbx
mov    %rdi,%rbx
mov    $0x3d,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     113c <process_plugin_option+0x1c>
movb   $0x0,(%rax)
add    $0x1,%rax
jmp    113e <process_plugin_option+0x1e>
xor    %eax,%eax
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1040 <trace_util_add_option@plt>

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

LLVM IR (-O2):
define void @process_plugin_option(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 61)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
store i8 0, i8* %2
%5 = getelementptr inbounds i8, i8* %2, i64 1
br label %6
6: ; preds = %4, %1
%7 = phi i8* [ %5, %4 ], [ null, %1 ]
%8 = tail call i32 @trace_util_add_option(i8* %0, i8* %7)
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int compar(const void *xa, const void *xb) {
  char *a = *(char **)xa;
  char *b = *(char **)xb;
  return strcmp(a, b);
}


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

x86 assembly (clang, -O2):
<compar>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @compar(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
%9 = load i8*, i8** %8
store i8* %9, i8** %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i8**
%12 = load i8*, i8** %11
store i8* %12, i8** %6
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = call i32 @strcmp(i8* %13, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @compar(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
void gtk_combo_box_set_add_tearoffs() {}


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

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

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

LLVM IR (-O2):
define void @gtk_combo_box_set_add_tearoffs() {
ret void
}
int iscntrl(int ch) { return (((ch >= 0) && (ch <= 31)) || (ch == 127)); }


x86 assembly (clang, -O0):
<iscntrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1120 <iscntrl+0x20>
mov    $0x1,%al
cmpl   $0x1f,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    112a <iscntrl+0x2a>
cmpl   $0x7f,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscntrl>:
cmp    $0x20,%edi
setb   %al
cmp    $0x7f,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @iscntrl(i32 %0) {
%2 = icmp ult i32 %0, 32
%3 = icmp eq i32 %0, 127
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
int cpuidle_register_device(struct cpuidle_device *dev) { return -19; }


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

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

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

LLVM IR (-O2):
%struct.cpuidle_device = type opaque
define i32 @cpuidle_register_device(%struct.cpuidle_device* nocapture readnone %0) {
ret i32 -19
}