xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ a_barrier();
int a_ll(int volatile *);
int /*<<< orphan*/ a_post_llsc();
int /*<<< orphan*/ a_sc(int volatile *, int);
int a_fetch_and(volatile int *p, int v) {
  int old;
  a_barrier();
  do
    old = a_ll(p);
  while (!a_sc(p, old & v));
  a_post_llsc();
  return old;
}


x86 assembly (clang, -O0):
<a_fetch_and>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1040 <a_barrier@plt>
mov    -0x8(%rbp),%rdi
call   1060 <a_ll@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
and    -0xc(%rbp),%esi
call   1050 <a_sc@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1156 <a_fetch_and+0x16>
mov    $0x0,%al
call   1030 <a_post_llsc@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_fetch_and>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <a_barrier@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1060 <a_ll@plt>
mov    %eax,%ebp
mov    %eax,%esi
and    %r14d,%esi
mov    %rbx,%rdi
call   1050 <a_sc@plt>
test   %eax,%eax
je     1160 <a_fetch_and+0x20>
xor    %eax,%eax
call   1030 <a_post_llsc@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @a_fetch_and(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = call i32 (...) @a_barrier()
br label %7
7: ; preds = %10, %2
%8 = load i32*, i32** %3
%9 = call i32 @a_ll(i32* %8)
store i32 %9, i32* %5
br label %10
10: ; preds = %7
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = load i32, i32* %4
%14 = and i32 %12, %13
%15 = call i32 @a_sc(i32* %11, i32 %14)
%16 = icmp ne i32 %15, 0
%17 = xor i1 %16, true
br i1 %17, label %7, label %18
18: ; preds = %10
%19 = call i32 (...) @a_post_llsc()
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
define i32 @a_fetch_and(i32* %0, i32 %1) {
%3 = tail call i32 (...) @a_barrier()
br label %4
4: ; preds = %4, %2
%5 = tail call i32 @a_ll(i32* %0)
%6 = and i32 %5, %1
%7 = tail call i32 @a_sc(i32* %0, i32 %6)
%8 = icmp eq i32 %7, 0
br i1 %8, label %4, label %9
9: ; preds = %4
%10 = tail call i32 (...) @a_post_llsc()
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *progname) {
  fprintf(stderr,
          "Usage: %s -d NUMDIR -f NUMFILES -h -t NUMTHRD\n"
          "\t -h Help!\n"
          "\t -l Number of repatetions to execute:       Default: 1000\n"
          "\t -t Number of threads to generate:          Default: 30\n",
          progname);
  exit(-1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [174 x i8] c"Usage: %s -d NUMDIR -f NUMFILES -h -t NUMTHRD\0A\09 -h Help!\0A\09 -l Number of repatetions to execute: Default: 1000\0A\09 -t Number of threads to generate: Default: 30\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([174 x i8], [174 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [174 x i8] c"Usage: %s -d NUMDIR -f NUMFILES -h -t NUMTHRD\0A\09 -h Help!\0A\09 -l Number of repatetions to execute: Default: 1000\0A\09 -t Number of threads to generate: Default: 30\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([174 x i8], [174 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
int _otherbox_error(char const *message, int ret) {
  fputs("otherbox"
        ": ",
        stderr);
  perror(message);
  return ret;
}


x86 assembly (clang, -O0):
<_otherbox_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_otherbox_error>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1030 <fputs@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"otherbox: \00"
@stderr = global i32 0
define i32 @_otherbox_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @perror(i8* %7)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
@.str = [11 x i8] c"otherbox: \00"
@stderr = global i32 0
define i32 @_otherbox_error(i8* nocapture %0, i32 returned %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @perror(i8* %0)
ret i32 %1
}
int lws_is_cgi(struct lws *wsi) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.lws = type opaque
define i32 @lws_is_cgi(%struct.lws* nocapture readnone %0) {
ret i32 0
}
int foo(void) {
  { return (0); }
}


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

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

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

LLVM IR (-O2):
define i32 @foo() {
ret i32 0
}
int max(int const a, int const b, const int c) {
  if (a > b)
    return (a > c ? a : c);
  return (b > c ? b : c);
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1141 <max+0x41>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1130 <max+0x30>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1136 <max+0x36>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1164 <max+0x64>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1158 <max+0x58>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    115e <max+0x5e>
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @max(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp sgt i32 %8, %9
br i1 %10, label %11, label %21
11: ; preds = %3
%12 = load i32, i32* %5
%13 = load i32, i32* %7
%14 = icmp sgt i32 %12, %13
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = load i32, i32* %5
br label %19
17: ; preds = %11
%18 = load i32, i32* %7
br label %19
19: ; preds = %17, %15
%20 = phi i32 [ %16, %15 ], [ %18, %17 ]
store i32 %20, i32* %4
br label %31
21: ; preds = %3
%22 = load i32, i32* %6
%23 = load i32, i32* %7
%24 = icmp sgt i32 %22, %23
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = load i32, i32* %6
br label %29
27: ; preds = %21
%28 = load i32, i32* %7
br label %29
29: ; preds = %27, %25
%30 = phi i32 [ %26, %25 ], [ %28, %27 ]
store i32 %30, i32* %4
br label %31
31: ; preds = %29, %19
%32 = load i32, i32* %4
ret i32 %32
}

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, %2
%5 = select i1 %4, i32 %0, i32 %2
%6 = icmp sgt i32 %5, %1
%7 = select i1 %6, i32 %5, i32 %1
ret i32 %7
}
/* Type definitions */
struct module {
  int dummy;
};
struct device {
  int dummy;
};

/* Variables and functions */
struct device *__root_device_register(char const *, struct module *);
__attribute__((always_)) struct device *root_device_register(const char *name) {
  return __root_device_register(name, ((struct module *)0));
}


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

x86 assembly (clang, -O2):
<root_device_register>:
xor    %esi,%esi
jmp    1030 <__root_device_register@plt>

LLVM IR (-O0):
%struct.device = type { i32 }
%struct.module = type { i32 }
define %struct.device* @root_device_register(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call %struct.device* @__root_device_register(i8* %3, %struct.module* null)
ret %struct.device* %4
}

LLVM IR (-O2):
%struct.device = type { i32 }
%struct.module = type { i32 }
define %struct.device* @root_device_register(i8* %0) {
%2 = tail call %struct.device* @__root_device_register(i8* %0, %struct.module* null)
ret %struct.device* %2
}
/* Variables and functions */
double sqrt(float);
float _finalize_for_vector_length(float total) { return (1.0 / sqrt(total)); }


x86 assembly (clang, -O0):
<_finalize_for_vector_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xece(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_finalize_for_vector_length>:
push   %rax
call   1030 <sqrt@plt>
movsd  0xee2(%rip),%xmm1
divsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @_finalize_for_vector_length(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call double @sqrt(float %3)
%5 = fdiv double 1.000000e+00, %4
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @_finalize_for_vector_length(float %0) {
%2 = tail call double @sqrt(float %0)
%3 = fdiv double 1.000000e+00, %2
%4 = fptrunc double %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void Usage(char *Filename) {
  fprintf(stderr, "Usage: %s [-t] diskimage\n", Filename);
  fprintf(stderr, "  -t = test -- do not actually extract.\n");
  fprintf(stderr, "  -v = Verbose.\n");
}


x86 assembly (clang, -O0):
<Usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xed3(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
lea    0xee5(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rbx
mov    (%rbx),%edi
lea    0xedc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xee6(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeff(%rip),%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"Usage: %s [-t] diskimage\0A\00"
@.str.1 = [41 x i8] c" -t = test -- do not actually extract.\0A\00"
@.str.2 = [17 x i8] c" -v = Verbose.\0A\00"
define void @Usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @stderr
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"Usage: %s [-t] diskimage\0A\00"
@.str.1 = [41 x i8] c" -t = test -- do not actually extract.\0A\00"
@.str.2 = [17 x i8] c" -v = Verbose.\0A\00"
define void @Usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void get_time(char *fecha, char *hora) {
  time_t rawtime;
  struct tm *timeinfo;
  time(&rawtime);
  timeinfo = localtime(&rawtime);
  strftime(fecha, 9, "%Y%m%d", timeinfo);
  strftime(hora, 5, "%H%M", timeinfo);
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x14(%rbp),%rdi
call   1040 <time@plt>
lea    -0x14(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rcx
mov    $0x9,%esi
lea    0xe96(%rip),%rdx
call   1050 <strftime@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rcx
mov    $0x5,%esi
lea    0xe84(%rip),%rdx
call   1050 <strftime@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
lea    0x4(%rsp),%r15
mov    %r15,%rdi
call   1040 <time@plt>
mov    %r15,%rdi
call   1030 <localtime@plt>
mov    %rax,%rbx
lea    0xea3(%rip),%rdx
mov    %r12,%rdi
mov    $0x9,%esi
mov    %rax,%rcx
call   1050 <strftime@plt>
lea    0xe93(%rip),%rdx
mov    %r14,%rdi
mov    $0x5,%esi
mov    %rbx,%rcx
call   1050 <strftime@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [7 x i8] c"%Y%m%d\00"
@.str.1 = [5 x i8] c"%H%M\00"
define void @get_time(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca %struct.tm*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = call i32 @time(i32* %5)
%8 = call %struct.tm* @localtime(i32* %5)
store %struct.tm* %8, %struct.tm** %6
%9 = load i8*, i8** %3
%10 = load %struct.tm*, %struct.tm** %6
%11 = call i32 @strftime(i8* %9, i32 9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), %struct.tm* %10)
%12 = load i8*, i8** %4
%13 = load %struct.tm*, %struct.tm** %6
%14 = call i32 @strftime(i8* %12, i32 5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %struct.tm* %13)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [7 x i8] c"%Y%m%d\00"
@.str.1 = [5 x i8] c"%H%M\00"
define void @get_time(i8* %0, i8* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @time(i32* %3)
%6 = call %struct.tm* @localtime(i32* %3)
%7 = call i32 @strftime(i8* %0, i32 9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), %struct.tm* %6)
%8 = call i32 @strftime(i8* %1, i32 5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %struct.tm* %6)
ret void
}
int DRV_SET_UPDATA_FLAG(int flag) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @DRV_SET_UPDATA_FLAG(i32 %0) {
ret i32 0
}
/* Variables and functions */
unsigned long binomial_Coeff(int, unsigned int);
unsigned long int catalan(unsigned int n) {
  unsigned long int c = binomial_Coeff(2 * n, n);
  return (c / (n + 1));
}


x86 assembly (clang, -O0):
<catalan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
shl    $0x1,%edi
mov    -0x4(%rbp),%esi
call   1030 <binomial_Coeff@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,%ecx
xor    %edx,%edx
div    %rcx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<catalan>:
push   %rbx
mov    %edi,%ebx
lea    (%rbx,%rbx,1),%edi
mov    %ebx,%esi
call   1030 <binomial_Coeff@plt>
add    $0x1,%ebx
mov    %rax,%rcx
shr    $0x20,%rcx
je     1130 <catalan+0x20>
xor    %edx,%edx
div    %rbx
pop    %rbx
ret
xor    %edx,%edx
div    %ebx
pop    %rbx
ret

LLVM IR (-O0):
define i64 @catalan(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = mul i32 2, %4
%6 = load i32, i32* %2
%7 = call i64 @binomial_Coeff(i32 %5, i32 %6)
store i64 %7, i64* %3
%8 = load i64, i64* %3
%9 = load i32, i32* %2
%10 = add i32 %9, 1
%11 = zext i32 %10 to i64
%12 = udiv i64 %8, %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @catalan(i32 %0) {
%2 = shl i32 %0, 1
%3 = tail call i64 @binomial_Coeff(i32 %2, i32 %0)
%4 = add i32 %0, 1
%5 = zext i32 %4 to i64
%6 = udiv i64 %3, %5
ret i64 %6
}
void glBegin(int a) {}


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

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

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

LLVM IR (-O2):
define void @glBegin(i32 %0) {
ret void
}
char test_170_12(char *mem) {
  char newval = 5;
  char prevval;
  __atomic_exchange(mem + 0, &newval, &prevval, 4);
  return prevval;
}


x86 assembly (clang, -O0):
<test_170_12>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movb   $0x5,-0x9(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x9(%rbp),%al
xchg   %al,(%rcx)
mov    %al,-0xa(%rbp)
movsbl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_170_12>:
mov    $0x5,%al
xchg   %al,(%rdi)
ret

LLVM IR (-O0):
define signext i8 @test_170_12(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8
store i8* %0, i8** %2
store i8 5, i8* %3
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %3
%8 = atomicrmw xchg i8* %6, i8 %7 acq_rel
store i8 %8, i8* %4
%9 = load i8, i8* %4
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @test_170_12(i8* nocapture %0) {
%2 = atomicrmw xchg i8* %0, i8 5 acq_rel
ret i8 %2
}
/* Variables and functions */
size_t keyhash(char *k) {
  unsigned char *p = (void *)k;
  size_t h = 0;
  while (*p)
    h = 31 * h + *p++;
  return h;
}


x86 assembly (clang, -O0):
<keyhash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1148 <keyhash+0x48>
imul   $0x1f,-0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
movzbl (%rcx),%ecx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
jmp    1118 <keyhash+0x18>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyhash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112c <keyhash+0x2c>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
mov    %rax,%rdx
shl    $0x5,%rdx
sub    %rax,%rdx
movzbl %cl,%eax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <keyhash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @keyhash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i64 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = mul i64 %6, 31
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = zext i8 %5 to i64
%11 = add i64 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 0, %1 ], [ %11, %4 ]
ret i64 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello World/n");
  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"Hello World/n\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"Hello World/n\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
}
/* Variables and functions */
int serial_read(int *, int);
int serial_read_int32(int *buf) {
  if (serial_read(buf, 4) != 4)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<serial_read_int32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x4,%esi
call   1030 <serial_read@plt>
cmp    $0x4,%eax
je     113f <serial_read_int32+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1146 <serial_read_int32+0x36>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_read_int32>:
push   %rax
mov    $0x4,%esi
call   1030 <serial_read@plt>
xor    %ecx,%ecx
cmp    $0x4,%eax
setne  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @serial_read_int32(i32* %0) {
%2 = tail call i32 @serial_read(i32* %0, i32 4)
%3 = icmp ne i32 %2, 4
%4 = sext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ perror(char const *);
void st_perror(const char *s) { perror(s); }


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

x86 assembly (clang, -O2):
<st_perror>:
jmp    1030 <perror@plt>

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

LLVM IR (-O2):
define void @st_perror(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
ret void
}
int gcd_recursive(int a, int b) {
  return (b == 0) ? a : gcd_recursive(b, a % b);
}


x86 assembly (clang, -O0):
<gcd_recursive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1133 <gcd_recursive+0x23>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1147 <gcd_recursive+0x37>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%esi
call   1030 <gcd_recursive@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd_recursive>:
mov    %edi,%eax
test   %esi,%esi
je     111d <gcd_recursive+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd_recursive+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @gcd_recursive(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i32, i32* %3
br label %15
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = srem i32 %11, %12
%14 = call i32 @gcd_recursive(i32 %10, i32 %13)
br label %15
15: ; preds = %9, %7
%16 = phi i32 [ %8, %7 ], [ %14, %9 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @gcd_recursive(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int /*<<< orphan*/ subxy(int, int);
int main() {
  int x = __VERIFIER_nondet_int();
  int y = __VERIFIER_nondet_int();
  subxy(x, y);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1040 <subxy@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = tail call i32 @subxy(i32 %1, i32 %2)
ret i32 0
}
/* Type definitions */
struct stats_results {
  int dummy;
};

/* Variables and functions */
unsigned long isqrt(int /*<<< orphan*/);
int /*<<< orphan*/ stats_var(struct stats_results *, int);
unsigned long stats_std(struct stats_results *results, int percentile) {
  return isqrt(stats_var(results, percentile));
}


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

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

LLVM IR (-O0):
%struct.stats_results = type { i32 }
define i64 @stats_std(%struct.stats_results* %0, i32 %1) {
%3 = alloca %struct.stats_results*
%4 = alloca i32
store %struct.stats_results* %0, %struct.stats_results** %3
store i32 %1, i32* %4
%5 = load %struct.stats_results*, %struct.stats_results** %3
%6 = load i32, i32* %4
%7 = call i32 @stats_var(%struct.stats_results* %5, i32 %6)
%8 = call i64 @isqrt(i32 %7)
ret i64 %8
}

LLVM IR (-O2):
%struct.stats_results = type { i32 }
define i64 @stats_std(%struct.stats_results* %0, i32 %1) {
%3 = tail call i32 @stats_var(%struct.stats_results* %0, i32 %1)
%4 = tail call i64 @isqrt(i32 %3)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stderr;
int main() {
  fprintf(stderr, "This is stderr\n");
  printf("This is stdout\n");
  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 <fprintf@plt>
lea    0xec5(%rip),%rdi
call   1030 <printf@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 <fprintf@plt>
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"This is stderr\0A\00"
@.str.1 = [16 x i8] c"This is stdout\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stderr
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"This is stderr\0A\00"
@str = [15 x i8] c"This is stdout\00"
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int ArrayList_listSize(void **list) {
  int size = 0;
  while (list[size] != NULL)
    size++;
  return size;
}


x86 assembly (clang, -O0):
<ArrayList_listSize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1130 <ArrayList_listSize+0x30>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <ArrayList_listSize+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ArrayList_listSize>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpq   $0x0,(%rdi)
lea    0x8(%rdi),%rdi
jne    1110 <ArrayList_listSize+0x10>
ret

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

LLVM IR (-O2):
define i32 @ArrayList_listSize(i8** nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8*, i8** %0, i64 %3
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
void feed_syntax_parser_cleanup(
    struct feed_syntax_parser *const p_syntax_parser) {
  (void)(p_syntax_parser);
}


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

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

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

LLVM IR (-O2):
%struct.feed_syntax_parser = type opaque
define void @feed_syntax_parser_cleanup(%struct.feed_syntax_parser* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help() {
  printf("-h : Help\n");
  printf("-d <delay> : Delay in useconds\n");
}


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

x86 assembly (clang, -O2):
<print_help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee6(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"-h : Help\0A\00"
@.str.1 = [32 x i8] c"-d <delay> : Delay in useconds\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [10 x i8] c"-h : Help\00"
@str.2 = [31 x i8] c"-d <delay> : Delay in useconds\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef char uint8_t;

/* Variables and functions */
extern int _write(int file, char *ptr, int len) {
  extern void UART0_TX(uint8_t uc_data);
  int i;
  for (i = 0; i < len; i++, ptr++)
    UART0_TX(*ptr);
  return i;
}


x86 assembly (clang, -O0):
<_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115b <_write+0x4b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <UART0_TX@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1129 <_write+0x19>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_write>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edx,%edx
jle    1144 <_write+0x34>
mov    %edx,%r14d
mov    %rsi,%r15
mov    %edx,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl (%r15,%rbx,1),%edi
call   1030 <UART0_TX@plt>
add    $0x1,%rbx
cmp    %ebx,%ebp
jne    1130 <_write+0x20>
jmp    1147 <_write+0x37>
xor    %r14d,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @_write(i32 %0, i8* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %12
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ 0, %3 ]
%7 = phi i8* [ %10, %5 ], [ %1, %3 ]
%8 = load i8, i8* %7
tail call void @UART0_TX(i8 signext %8)
%9 = add nuw nsw i32 %6, 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = icmp eq i32 %9, %2
br i1 %11, label %12, label %5
12: ; preds = %5, %3
%13 = phi i32 [ 0, %3 ], [ %2, %5 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ free(int *);
void spidev_interface_close(void *handle) {
  int *fd = (int *)handle;
  close(*fd);
  free(fd);
}


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

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

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

LLVM IR (-O2):
define void @spidev_interface_close(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @close(i32 %3)
%5 = tail call i32 @free(i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ glutPostRedisplay();
void Key(unsigned char key, int x, int y) {
  switch (key) {
  case 27:
    exit(1);
  default:
    glutPostRedisplay();
    return;
  }
}


x86 assembly (clang, -O0):
<Key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x1(%rbp),%al
sub    $0x1b,%al
jne    114e <Key+0x2e>
jmp    1144 <Key+0x24>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    $0x0,%al
call   1030 <glutPostRedisplay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Key>:
cmp    $0x1b,%dil
je     112d <Key+0xd>
xor    %eax,%eax
jmp    1030 <glutPostRedisplay@plt>
push   %rax
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @Key(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
switch i32 %8, label %11 [
i32 27, label %9
]
9: ; preds = %3
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %3
%12 = call i32 (...) @glutPostRedisplay()
ret void
}

LLVM IR (-O2):
define void @Key(i8 zeroext %0, i32 %1, i32 %2) {
%4 = icmp eq i8 %0, 27
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %3
%8 = tail call i32 (...) @glutPostRedisplay()
ret void
}
/* Variables and functions */
int partition(char **, int const, int const);
void quicksort(char *v[], const int low, const int high) {
  int part;
  if (low < high) {
    part = partition(v, low, high);
    quicksort(v, low, part - 1);
    quicksort(v, part + 1, high);
  }
}


x86 assembly (clang, -O0):
<quicksort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <quicksort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quicksort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quicksort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quicksort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quicksort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quicksort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @quicksort(i8** %0, i32 %1, i32 %2) {
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8** %0, i8*** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %24
11: ; preds = %3
%12 = load i8**, i8*** %4
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = call i32 @partition(i8** %12, i32 %13, i32 %14)
store i32 %15, i32* %7
%16 = load i8**, i8*** %4
%17 = load i32, i32* %5
%18 = load i32, i32* %7
%19 = sub nsw i32 %18, 1
%20 = load i8**, i8*** %4
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 1
%23 = load i32, i32* %6
br label %24
24: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @quicksort(i8** %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i8** %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quicksort(i8** %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
void RTFileWrite(void) {}


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

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

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

LLVM IR (-O2):
define void @RTFileWrite() {
ret void
}
long double _f_rintl(long double x) {
  long double _result;
  asm("frndint" : "=t"(_result) : "0"(x));
  return _result;
}


x86 assembly (clang, -O0):
<_f_rintl>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
frndint
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_f_rintl>:
fldt   0x8(%rsp)
frndint
ret

LLVM IR (-O0):
define x86_fp80 @_f_rintl(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%4 = load x86_fp80, x86_fp80* %2
%5 = call x86_fp80 asm "frndint", "={st},0,~{dirflag},~{fpsr},~{flags}"(x86_fp80 %4)
store x86_fp80 %5, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %3
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @_f_rintl(x86_fp80 %0) {
%2 = tail call x86_fp80 asm "frndint", "={st},0,~{dirflag},~{fpsr},~{flags}"(x86_fp80 %0)
ret x86_fp80 %2
}
/* Variables and functions */
long long __infer_nondet_long_long_int();
long long int llrintl(long double x) { return __infer_nondet_long_long_int(); }


x86 assembly (clang, -O0):
<llrintl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_long_long_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @llrintl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = call i64 (...) @__infer_nondet_long_long_int()
ret i64 %3
}

LLVM IR (-O2):
define i64 @llrintl(x86_fp80 %0) {
%2 = tail call i64 (...) @__infer_nondet_long_long_int()
ret i64 %2
}
int RemoveAnE(word)
char *word;
{ return ((1 == WordSize(word)) && !EndsWithCVC(word)); }


x86 assembly (clang, -O0):
<RemoveAnE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <WordSize@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %edx,%ecx
mov    %al,-0x9(%rbp)
jne    1161 <RemoveAnE+0x41>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <EndsWithCVC@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RemoveAnE>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <WordSize@plt>
cmp    $0x1,%eax
jne    1146 <RemoveAnE+0x26>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <EndsWithCVC@plt>
xor    %ebx,%ebx
test   %eax,%eax
sete   %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @RemoveAnE(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @WordSize to i32 (i8*, ...)*)(i8* %3)
%5 = icmp eq i32 1, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @EndsWithCVC to i32 (i8*, ...)*)(i8* %7)
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
br label %11
11: ; preds = %6, %1
%12 = phi i1 [ false, %1 ], [ %10, %6 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @RemoveAnE(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @WordSize to i32 (i8*, ...)*)(i8* %0)
%3 = icmp eq i32 %2, 1
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @EndsWithCVC to i32 (i8*, ...)*)(i8* %0)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
int vh_get_list_length(void *list) {
  void **l = list;
  int n = 0;
  while (l && *l++)
    n++;
  return n;
}


x86 assembly (clang, -O0):
<vh_get_list_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x15(%rbp)
je     1140 <vh_get_list_length+0x40>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
cmpq   $0x0,(%rax)
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1150 <vh_get_list_length+0x50>
jmp    115e <vh_get_list_length+0x5e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <vh_get_list_length+0x17>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vh_get_list_length>:
xor    %eax,%eax
test   %rdi,%rdi
je     111c <vh_get_list_length+0x1c>
cmpq   $0x0,(%rdi)
je     111c <vh_get_list_length+0x1c>
xor    %eax,%eax
nop
cmpq   $0x0,0x8(%rdi,%rax,8)
lea    0x1(%rax),%rax
jne    1110 <vh_get_list_length+0x10>
ret

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

LLVM IR (-O2):
define i32 @vh_get_list_length(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = bitcast i8* %0 to i8**
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
br i1 %6, label %14, label %7
7: ; preds = %3, %7
%8 = phi i8** [ %10, %7 ], [ %4, %3 ]
%9 = phi i32 [ %11, %7 ], [ 0, %3 ]
%10 = getelementptr inbounds i8*, i8** %8, i64 1
%11 = add nuw nsw i32 %9, 1
%12 = load i8*, i8** %10
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %7
14: ; preds = %7, %3, %1
%15 = phi i32 [ 0, %1 ], [ 0, %3 ], [ %11, %7 ]
ret i32 %15
}