xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ test();
int main(int argc, char **argv) {
  test();
  return argc * 10;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <test@plt>
add    %ebx,%ebx
lea    (%rbx,%rbx,4),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @test()
%7 = load i32, i32* %4
%8 = mul nsw i32 %7, 10
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test()
%4 = mul nsw i32 %0, 10
ret i32 %4
}
void testTortureExecute(void) {
  int i = 42, i1 = 66, i2 = 1, i3 = -1, i4 = 55;
  int *ip = &i;
  int *i3p = &i3;
  int *i4p = &i4;
}


x86 assembly (clang, -O0):
<testTortureExecute>:
push   %rbp
mov    %rsp,%rbp
movl   $0x2a,-0x4(%rbp)
movl   $0x42,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0xffffffff,-0x10(%rbp)
movl   $0x37,-0x14(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x30(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @testTortureExecute() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32 42, i32* %1
store i32 66, i32* %2
store i32 1, i32* %3
store i32 -1, i32* %4
store i32 55, i32* %5
store i32* %1, i32** %6
store i32* %4, i32** %7
store i32* %5, i32** %8
ret void
}

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


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

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

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

LLVM IR (-O2):
define i32 @get_voice_status() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ htobe64(int /*<<< orphan*/);
void st_i64_be(void *x, int64_t i) { ((int64_t *)x)[0] = htobe64(i); }


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

x86 assembly (clang, -O2):
<st_i64_be>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <htobe64@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @st_i64_be(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 = call i32 @htobe64(i32 %5)
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 %6, i32* %9
ret void
}

LLVM IR (-O2):
define void @st_i64_be(i8* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @htobe64(i32 %1)
%4 = bitcast i8* %0 to i32*
store i32 %3, i32* %4
ret void
}
int main() {
  int x;
  int y;
  y = 0;
  x = ((y) + 1);
  if (x != 1)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     1131 <main+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1138 <main+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void I2C4_EV_IRQHandler() { default_handler(); }


x86 assembly (clang, -O0):
<I2C4_EV_IRQHandler>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <default_handler@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define weak void @I2C4_EV_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @I2C4_EV_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
int /*<<< orphan*/ ft_putstr(char *);
int main(int argc, char **argv) {
  int j;
  j = argc - 1;
  while (j > 0) {
    ft_putstr(argv[j]);
    ft_putchar('\n');
    j--;
  }
  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)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1172 <main+0x52>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <ft_putstr@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    113f <main+0x1f>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     1160 <main+0x40>
mov    %rsi,%r14
mov    %edi,%ebx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x2(%rbx),%eax
mov    (%r14,%rax,8),%rdi
call   1040 <ft_putstr@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x2,%rbx
ja     1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = and i64 %8, 4294967295
%10 = getelementptr inbounds i8*, i8** %1, i64 %9
%11 = load i8*, i8** %10
%12 = tail call i32 @ft_putstr(i8* %11)
%13 = tail call i32 @ft_putchar(i8 signext 10)
%14 = icmp ugt i64 %7, 2
br i1 %14, label %6, label %15
15: ; preds = %6, %2
ret i32 0
}
/* Type definitions */
struct proxy_worker {
  int dummy;
};

/* Variables and functions */
int proxy_worker_resolve(struct proxy_worker *);
int proxy_worker_try_connect(struct proxy_worker *);
int proxy_worker_connect(struct proxy_worker *worker) {
  int status = proxy_worker_resolve(worker);
  if (status)
    return status;
  return proxy_worker_try_connect(worker);
}


x86 assembly (clang, -O0):
<proxy_worker_connect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <proxy_worker_resolve@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     114d <proxy_worker_connect+0x2d>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1159 <proxy_worker_connect+0x39>
mov    -0x10(%rbp),%rdi
call   1040 <proxy_worker_try_connect@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<proxy_worker_connect>:
push   %rbx
mov    %rdi,%rbx
call   1030 <proxy_worker_resolve@plt>
test   %eax,%eax
je     112f <proxy_worker_connect+0xf>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <proxy_worker_try_connect@plt>

LLVM IR (-O0):
%struct.proxy_worker = type { i32 }
define i32 @proxy_worker_connect(%struct.proxy_worker* %0) {
%2 = alloca i32
%3 = alloca %struct.proxy_worker*
%4 = alloca i32
store %struct.proxy_worker* %0, %struct.proxy_worker** %3
%5 = load %struct.proxy_worker*, %struct.proxy_worker** %3
%6 = call i32 @proxy_worker_resolve(%struct.proxy_worker* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i32, i32* %4
store i32 %10, i32* %2
br label %14
11: ; preds = %1
%12 = load %struct.proxy_worker*, %struct.proxy_worker** %3
%13 = call i32 @proxy_worker_try_connect(%struct.proxy_worker* %12)
store i32 %13, i32* %2
br label %14
14: ; preds = %11, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
%struct.proxy_worker = type { i32 }
define i32 @proxy_worker_connect(%struct.proxy_worker* %0) {
%2 = tail call i32 @proxy_worker_resolve(%struct.proxy_worker* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @proxy_worker_try_connect(%struct.proxy_worker* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ %2, %1 ]
ret i32 %7
}
/* Variables and functions */
int isfinite(float);
int finitef(float x) { return isfinite(x); }


x86 assembly (clang, -O0):
<finitef>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <isfinite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<finitef>:
jmp    1030 <isfinite@plt>

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

LLVM IR (-O2):
define i32 @finitef(float %0) {
%2 = tail call i32 @isfinite(float %0)
ret i32 %2
}
void __attribute__((destructor)) finalize2() {
  printf(__func__);
  printf("\n");
}


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

x86 assembly (clang, -O2):
<finalize2>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@__func__.finalize2 = [10 x i8] c"finalize2\00"
@.str = [2 x i8] c"\0A\00"
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @finalize2, i8* null }]
define void @finalize2() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.finalize2, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.finalize2 = [10 x i8] c"finalize2\00"
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @finalize2, i8* null }]
define void @finalize2() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.finalize2, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
void *realloc(void *p, int size) { return p; }


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

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

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

LLVM IR (-O2):
define i8* @realloc(i8* readnone returned %0, i32 %1) {
ret i8* %0
}
void foo(volatile int *some_other_var) {
  while (*some_other_var == 0) {
    ;
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
cmp    $0x0,%eax
jne    111c <foo+0x1c>
jmp    1108 <foo+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
cmpl   $0x0,(%rdi)
je     1100 <foo>
ret

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

LLVM IR (-O2):
define void @foo(i32* %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i32, i32* %0
%4 = icmp eq i32 %3, 0
br i1 %4, label %2, label %5
5: ; preds = %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ Window;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int /*<<< orphan*/ XGetGeometry(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                int /*<<< orphan*/ *, int *, int *,
                                unsigned int *, unsigned int *, unsigned int *,
                                unsigned int *);
void get_window_size(Display *dpy, Window window, unsigned *width,
                     unsigned *height) {
  unsigned u;
  int i;
  Window r;
  XGetGeometry(dpy, window, &r, &i, &i, width, height, &u, &u);
}


x86 assembly (clang, -O0):
<get_window_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%r9
mov    -0x20(%rbp),%r10
lea    -0x2c(%rbp),%rdx
lea    -0x28(%rbp),%r8
lea    -0x24(%rbp),%rax
mov    %r8,%rcx
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1030 <XGetGeometry@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_window_size>:
sub    $0x18,%rsp
mov    %rcx,%rax
mov    %rdx,%r9
sub    $0x8,%rsp
lea    0x1c(%rsp),%r10
lea    0x14(%rsp),%rdx
lea    0x18(%rsp),%rcx
mov    %rcx,%r8
push   %r10
push   %r10
push   %rax
call   1030 <XGetGeometry@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
define void @get_window_size(i32* %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%12 = load i32*, i32** %5
%13 = load i32, i32* %6
%14 = load i32*, i32** %7
%15 = load i32*, i32** %8
%16 = call i32 @XGetGeometry(i32* %12, i32 %13, i32* %11, i32* %10, i32* %10, i32* %14, i32* %15, i32* %9, i32* %9)
ret void
}

LLVM IR (-O2):
define void @get_window_size(i32* %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = bitcast i32* %5 to i8*
%9 = bitcast i32* %6 to i8*
%10 = bitcast i32* %7 to i8*
%11 = call i32 @XGetGeometry(i32* %0, i32 %1, i32* %7, i32* %6, i32* %6, i32* %2, i32* %3, i32* %5, i32* %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ s;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse(char *, int);
int main(int argc, char *argv[]) {
  char s[] = "hello, world";
  reverse(s, sizeof(s) - 1);
  printf("s = %s\n", s);
  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)
mov    0xec3(%rip),%rax
mov    %rax,-0x1d(%rbp)
mov    0xec1(%rip),%eax
mov    %eax,-0x15(%rbp)
mov    0xebc(%rip),%al
mov    %al,-0x11(%rbp)
lea    -0x1d(%rbp),%rdi
mov    $0xc,%esi
call   1030 <reverse@plt>
lea    -0x1d(%rbp),%rsi
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x646c726f77202c,%rax
mov    %rax,0x5(%rsp)
movabs $0x77202c6f6c6c6568,%rax
2c 20 77
mov    %rax,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xc,%esi
call   1030 <reverse@plt>
lea    0xeb4(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@__const.main.s = [13 x i8] c"hello, world\00"
@.str = [8 x i8] c"s = %s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [13 x i8]
%4 = getelementptr inbounds [13 x i8], [13 x i8]* %3, i64 0, i64 0
%5 = call i32 @reverse(i8* %4, i32 12)
%6 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ my_log(char *);
int /*<<< orphan*/ quit();
void sig_term(int dummy) {
  my_log("POLYGLOT *** SIGTERM Received ***\n");
  quit();
}


x86 assembly (clang, -O0):
<sig_term>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1040 <my_log@plt>
mov    $0x0,%al
call   1030 <quit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_term>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <my_log@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <quit@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"POLYGLOT *** SIGTERM Received ***\0A\00"
define void @sig_term(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @my_log(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @quit()
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"POLYGLOT *** SIGTERM Received ***\0A\00"
define void @sig_term(i32 %0) {
%2 = tail call i32 @my_log(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @quit()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_raise_priority() {
  printf("NOT IMPLEMENTED:"
         "pa_raise_priority"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"NOT IMPLEMENTED:pa_raise_priority\0A\00"
define i32 @pa_raise_priority() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [34 x i8] c"NOT IMPLEMENTED:pa_raise_priority\00"
define i32 @pa_raise_priority() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void caml_js_external() { exit(1); }


x86 assembly (clang, -O0):
<caml_js_external>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<caml_js_external>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @caml_js_external() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @caml_js_external() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
scalar_t__ isupper(unsigned char);
char tolower(unsigned char);
void makelower(char *s) {
  while (*s) {
    if (isupper((unsigned char)*s)) {
      *s = tolower((unsigned char)*s);
    }
    s++;
  }
}


x86 assembly (clang, -O0):
<makelower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1174 <makelower+0x54>
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1040 <isupper@plt>
cmp    $0x0,%rax
je     1163 <makelower+0x43>
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    112c <makelower+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makelower>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1155 <makelower+0x35>
mov    %rdi,%rbx
jmp    113c <makelower+0x1c>
nopl   0x0(%rax)
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1155 <makelower+0x35>
movzbl %al,%edi
call   1040 <isupper@plt>
test   %rax,%rax
je     1130 <makelower+0x10>
movzbl (%rbx),%edi
call   1030 <tolower@plt>
mov    %al,(%rbx)
jmp    1130 <makelower+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @makelower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %12
%5 = phi i8 [ %14, %12 ], [ %2, %1 ]
%6 = phi i8* [ %13, %12 ], [ %0, %1 ]
%7 = tail call i64 @isupper(i8 zeroext %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %4
%10 = load i8, i8* %6
%11 = tail call signext i8 @tolower(i8 zeroext %10)
store i8 %11, i8* %6
br label %12
12: ; preds = %9, %4
%13 = getelementptr inbounds i8, i8* %6, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %12, %1
ret void
}
int putchar(int c) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @putchar(i32 %0) {
ret i32 -1
}
int test_imm_D1uint16_reg(unsigned short val) {
  return ((val) & (-0xD1 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D1uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffff2f,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_D1uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -209
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ glutInit(int *, char **);
int /*<<< orphan*/ glutMainLoop();
int /*<<< orphan*/ init_xbox(int, char **);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ start_impressions(int, char **);
int main(int argc, char **argv) {
  printf("Hello, World to OpenGL experiments!\n");
  glutInit(&argc, argv);
  init_xbox(argc, argv);
  start_impressions(argc, argv);
  glutMainLoop();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe93(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    -0x8(%rbp),%rdi
call   1070 <glutInit@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1060 <init_xbox@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <start_impressions@plt>
mov    $0x0,%al
call   1030 <glutMainLoop@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %edi,0xc(%rsp)
lea    0xe9d(%rip),%rdi
call   1040 <puts@plt>
lea    0xc(%rsp),%rdi
mov    %rbx,%rsi
call   1070 <glutInit@plt>
mov    0xc(%rsp),%edi
mov    %rbx,%rsi
call   1060 <init_xbox@plt>
mov    0xc(%rsp),%edi
mov    %rbx,%rsi
call   1050 <start_impressions@plt>
xor    %eax,%eax
call   1030 <glutMainLoop@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Hello, World to OpenGL experiments!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%7 = load i8**, i8*** %5
%8 = call i32 @glutInit(i32* %4, i8** %7)
%9 = load i32, i32* %4
%10 = load i8**, i8*** %5
%11 = call i32 @init_xbox(i32 %9, i8** %10)
%12 = load i32, i32* %4
%13 = load i8**, i8*** %5
%14 = call i32 @start_impressions(i32 %12, i8** %13)
%15 = call i32 (...) @glutMainLoop()
ret i32 0
}

LLVM IR (-O2):
@str = [36 x i8] c"Hello, World to OpenGL experiments!\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%5 = call i32 @glutInit(i32* %3, i8** %1)
%6 = load i32, i32* %3
%7 = call i32 @init_xbox(i32 %6, i8** %1)
%8 = load i32, i32* %3
%9 = call i32 @start_impressions(i32 %8, i8** %1)
%10 = call i32 (...) @glutMainLoop()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *);
char *strdup(char *);
char *latex_invoice_header_education_format_line(void) {
  char format_line[1024];
  sprintf(format_line, "\\begin{longtable}[t]{|p{4.2in}|r|} \\hline\n"
                       "\\hline\n");
  return strdup(format_line);
}


x86 assembly (clang, -O0):
<latex_invoice_header_education_format_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
lea    -0x400(%rbp),%rdi
lea    0xec7(%rip),%rsi
call   1030 <sprintf@plt>
lea    -0x400(%rbp),%rdi
call   1040 <strdup@plt>
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<latex_invoice_header_education_format_line>:
sub    $0x408,%rsp
movups 0xf02(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movups 0xee6(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movups 0xeca(%rip),%xmm0
movaps %xmm0,(%rsp)
movw   $0xa,0x30(%rsp)
mov    %rsp,%rdi
call   1030 <strdup@plt>
add    $0x408,%rsp
ret

LLVM IR (-O0):
@.str = [50 x i8] c"\\begin{longtable}[t]{|p{4.2in}|r|} \\hline\0A\\hline\0A\00"
define i8* @latex_invoice_header_education_format_line() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%5 = call i8* @strdup(i8* %4)
ret i8* %5
}

LLVM IR (-O2):
@.str = [50 x i8] c"\\begin{longtable}[t]{|p{4.2in}|r|} \\hline\0A\\hline\0A\00"
define noalias i8* @latex_invoice_header_education_format_line() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i8* @strdup(i8* %2)
ret i8* %3
}
/* Variables and functions */
int getpid();
int main(void) { return getpid(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @getpid()
ret i32 %1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void uDMAIntSwEventEnable(uint32_t ui32Base, uint32_t ui32IntChannel) {
  ;
  ;
  (*((volatile unsigned long
          *)(((unsigned long)(ui32Base + 0x00000520) & 0xF0000000) |
             0x02000000 |
             (((unsigned long)(ui32Base + 0x00000520) & 0x000FFFFF) << 5) |
             ((ui32IntChannel) << 2)))) = 1;
}


x86 assembly (clang, -O0):
<uDMAIntSwEventEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x520,%eax
cltq
movabs $0xf0000000,%rcx
and    %rcx,%rax
or     $0x2000000,%rax
mov    -0x4(%rbp),%ecx
add    $0x520,%ecx
movslq %ecx,%rcx
and    $0xfffff,%rcx
shl    $0x5,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
or     %rcx,%rax
movq   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uDMAIntSwEventEnable>:
add    $0x520,%edi
mov    %edi,%eax
and    $0xf0000000,%eax
shl    $0x5,%edi
and    $0x1ffffe0,%edi
shl    $0x2,%esi
movslq %esi,%rcx
or     %rax,%rcx
or     %rdi,%rcx
or     $0x2000000,%rcx
movq   $0x1,(%rcx)
ret

LLVM IR (-O0):
define void @uDMAIntSwEventEnable(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 = add nsw i32 %5, 1312
%7 = sext i32 %6 to i64
%8 = and i64 %7, 4026531840
%9 = or i64 %8, 33554432
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1312
%12 = sext i32 %11 to i64
%13 = and i64 %12, 1048575
%14 = shl i64 %13, 5
%15 = or i64 %9, %14
%16 = load i32, i32* %4
%17 = shl i32 %16, 2
%18 = sext i32 %17 to i64
%19 = or i64 %15, %18
%20 = inttoptr i64 %19 to i64*
store volatile i64 1, i64* %20
ret void
}

LLVM IR (-O2):
define void @uDMAIntSwEventEnable(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 1312
%4 = sext i32 %3 to i64
%5 = and i64 %4, 4026531840
%6 = shl nsw i64 %4, 5
%7 = and i64 %6, 33554400
%8 = shl i32 %1, 2
%9 = sext i32 %8 to i64
%10 = or i64 %5, %9
%11 = or i64 %10, %7
%12 = or i64 %11, 33554432
%13 = inttoptr i64 %12 to i64*
store volatile i64 1, i64* %13
ret void
}
/* Variables and functions */
char __io_getchar();
int _read(int f, char *pointer, int length) {
  int i = 0;
  while (i < length) {
    *(pointer + i) = __io_getchar();
    i++;
  }
  return length;
}


x86 assembly (clang, -O0):
<_read>:
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    1157 <_read+0x47>
mov    $0x0,%al
call   1030 <__io_getchar@plt>
mov    %al,%dl
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1129 <_read+0x19>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @_read(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 = %12, %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 = call signext i8 (...) @__io_getchar()
%14 = load i8*, i8** %5
%15 = load i32, i32* %7
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
store i8 %13, i8* %17
%18 = load i32, i32* %7
%19 = add nsw i32 %18, 1
store i32 %19, i32* %7
br label %8
20: ; preds = %8
%21 = load i32, i32* %6
ret i32 %21
}

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

/* Variables and functions */
__attribute__((visibility("hidden"))) uint8_t Char2Int(char hex) {
  if ('0' <= hex <= '9')
    return hex - '0';
  else if ('A' <= hex <= 'F')
    return hex - 'A' + 10;
  else if ('a' <= hex <= 'f')
    return hex - 'a' + 10;
  else
    return 255;
}


x86 assembly (clang, -O0):
<Char2Int>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%ecx
mov    $0x30,%eax
cmp    %ecx,%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x39,%eax
jg     1135 <Char2Int+0x35>
movsbl -0x2(%rbp),%eax
sub    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1195 <Char2Int+0x95>
movsbl -0x2(%rbp),%ecx
mov    $0x41,%eax
cmp    %ecx,%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x46,%eax
jg     1163 <Char2Int+0x63>
movsbl -0x2(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %al,-0x1(%rbp)
jmp    1195 <Char2Int+0x95>
movsbl -0x2(%rbp),%ecx
mov    $0x61,%eax
cmp    %ecx,%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x66,%eax
jg     1191 <Char2Int+0x91>
movsbl -0x2(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %al,-0x1(%rbp)
jmp    1195 <Char2Int+0x95>
movb   $0xff,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Char2Int>:
lea    -0x30(%rdi),%eax
ret

LLVM IR (-O0):
define hidden signext i8 @Char2Int(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sle i32 48, %5
%7 = zext i1 %6 to i32
%8 = icmp sle i32 %7, 57
br i1 %8, label %9, label %14
9: ; preds = %1
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = sub nsw i32 %11, 48
%13 = trunc i32 %12 to i8
store i8 %13, i8* %2
br label %39
14: ; preds = %1
%15 = load i8, i8* %3
%16 = sext i8 %15 to i32
%17 = icmp sle i32 65, %16
%18 = zext i1 %17 to i32
%19 = icmp sle i32 %18, 70
br i1 %19, label %20, label %26
20: ; preds = %14
%21 = load i8, i8* %3
%22 = sext i8 %21 to i32
%23 = sub nsw i32 %22, 65
%24 = add nsw i32 %23, 10
%25 = trunc i32 %24 to i8
store i8 %25, i8* %2
br label %39
26: ; preds = %14
%27 = load i8, i8* %3
%28 = sext i8 %27 to i32
%29 = icmp sle i32 97, %28
%30 = zext i1 %29 to i32
%31 = icmp sle i32 %30, 102
br i1 %31, label %32, label %38
32: ; preds = %26
%33 = load i8, i8* %3
%34 = sext i8 %33 to i32
%35 = sub nsw i32 %34, 97
%36 = add nsw i32 %35, 10
%37 = trunc i32 %36 to i8
store i8 %37, i8* %2
br label %39
38: ; preds = %26
store i8 -1, i8* %2
br label %39
39: ; preds = %38, %32, %20, %9
%40 = load i8, i8* %2
ret i8 %40
}

LLVM IR (-O2):
define hidden signext i8 @Char2Int(i8 signext %0) {
%2 = add i8 %0, -48
ret i8 %2
}
/* Variables and functions */
int dump_config(size_t width, int (*__printf)(const char *__restrict, ...)) {
  if (width < 0 || width >= (16)) {
    return -1;
  }
  if (__printf == NULL) {
    return -2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<dump_config>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jb     1122 <dump_config+0x22>
cmpq   $0x10,-0x10(%rbp)
jb     112e <dump_config+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    114c <dump_config+0x4c>
cmpq   $0x0,-0x18(%rbp)
jne    1145 <dump_config+0x45>
movl   $0xfffffffe,-0x4(%rbp)
jmp    114c <dump_config+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_config>:
xor    %eax,%eax
test   %rsi,%rsi
setne  %al
cmp    $0x10,%rdi
lea    -0x2(%rax,%rax,1),%ecx
mov    $0xffffffff,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @dump_config(i64 %0, i32 (i8*, ...)* readnone %1) {
%3 = icmp ugt i64 %0, 15
%4 = icmp eq i32 (i8*, ...)* %1, null
%5 = select i1 %4, i32 -2, i32 0
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ FixedWingPathFollowerSettingsHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void FixedWingPathFollowerSettingsLogging() {
  UAVObjLogging(FixedWingPathFollowerSettingsHandle());
}


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

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

LLVM IR (-O0):
define void @FixedWingPathFollowerSettingsLogging() {
%1 = call i32 (...) @FixedWingPathFollowerSettingsHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @FixedWingPathFollowerSettingsLogging() {
%1 = tail call i32 (...) @FixedWingPathFollowerSettingsHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
void BIO_dump(void) {}


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

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

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

LLVM IR (-O2):
define void @BIO_dump() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ stalloc(size_t);
void grabstackblock(size_t len) { stalloc(len); }


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

x86 assembly (clang, -O2):
<grabstackblock>:
jmp    1030 <stalloc@plt>

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

LLVM IR (-O2):
define void @grabstackblock(i64 %0) {
%2 = tail call i32 @stalloc(i64 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ ftell(int /*<<< orphan*/ *);
void uninit_ftell(void) {
  FILE *fp;
  ftell(fp);
}


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

x86 assembly (clang, -O2):
<uninit_ftell>:
jmp    1030 <ftell@plt>

LLVM IR (-O0):
define void @uninit_ftell() {
%1 = alloca i32*
%2 = load i32*, i32** %1
%3 = call i32 @ftell(i32* %2)
ret void
}

LLVM IR (-O2):
define void @uninit_ftell() {
%1 = tail call i32 @ftell(i32* undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
scalar_t__ rename(char *, char *);
int main(int argc, char **argv) {
  if (0 != rename(argv[1], argv[2])) {
    perror("test2");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1040 <rename@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     1165 <main+0x45>
lea    0xea0(%rip),%rdi
call   1030 <perror@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
call   1040 <rename@plt>
test   %rax,%rax
jne    1137 <main+0x17>
xor    %eax,%eax
pop    %rcx
ret
lea    0xec2(%rip),%rdi
call   1030 <perror@plt>
jmp    1133 <main+0x13>

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

LLVM IR (-O2):
@.str = [6 x i8] c"test2\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8*, i8** %1, i64 2
%6 = load i8*, i8** %5
%7 = tail call i64 @rename(i8* %4, i8* %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %2
%10 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void native_example() { printf("Hello from C!\n"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"Hello from C!\0A\00"
define void @native_example() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"Hello from C!\00"
define void @native_example() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
char atTopC(char *stack, int top) { return stack[top]; }


x86 assembly (clang, -O0):
<atTopC>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atTopC>:
movslq %esi,%rax
mov    (%rdi,%rax,1),%al
ret

LLVM IR (-O0):
define signext i8 @atTopC(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @atTopC(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
ret i8 %5
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
scalar_t__ strlen(char *);
void CTYPE(char *type) {
  char *c_type;
  c_type = malloc(15 + strlen(type));
  sprintf(c_type, "Content-Type: %s", type);
  puts(c_type);
}


x86 assembly (clang, -O0):
<CTYPE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0xf,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe8c(%rip),%rsi
call   1060 <sprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CTYPE>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0xf(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xea1(%rip),%rsi
mov    %rax,%rdi
mov    %r14,%rdx
call   1060 <sprintf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Content-Type: %s\00"
define void @CTYPE(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 15, %5
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i8*, i8** %3
%12 = call i32 @puts(i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Content-Type: %s\00"
define void @CTYPE(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 15
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %4, i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = tail call i32 @puts(i8* dereferenceable(1) %4)
ret void
}
/* Variables and functions */
float tanf(float);
float _tan(float n) { return tanf(n); }


x86 assembly (clang, -O0):
<_tan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <tanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_tan>:
jmp    1030 <tanf@plt>

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

LLVM IR (-O2):
define float @_tan(float %0) {
%2 = tail call float @tanf(float %0)
ret float %2
}
/* Variables and functions */
int _memcmp(void const *, void const *, size_t, void *);
int hfuzz_memcmp(const void *m1, const void *m2, size_t n, void *addr) {
  return _memcmp(m1, m2, n, addr);
}


x86 assembly (clang, -O0):
<hfuzz_memcmp>:
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 <_memcmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hfuzz_memcmp>:
jmp    1030 <_memcmp@plt>

LLVM IR (-O0):
define i32 @hfuzz_memcmp(i8* %0, i8* %1, i64 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i64, i64* %7
%12 = load i8*, i8** %8
%13 = call i32 @_memcmp(i8* %9, i8* %10, i64 %11, i8* %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @hfuzz_memcmp(i8* %0, i8* %1, i64 %2, i8* %3) {
%5 = tail call i32 @_memcmp(i8* %0, i8* %1, i64 %2, i8* %3)
ret i32 %5
}
void foo774(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo774(i32 %0) {
ret void
}
void uCre_ClearCoeff(void) {}


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

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

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

LLVM IR (-O2):
define void @uCre_ClearCoeff() {
ret void
}