xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ null_pruning_symbols(unsigned int, int /*<<< orphan*/);
scalar_t__ unknown_function();
void call_null_pruning_symbols_3_Good_FP() {
  unsigned int c;
  if (unknown_function()) {
    c = 0;
  } else {
    c = 10;
  }
  null_pruning_symbols(c, 0);
}


x86 assembly (clang, -O0):
<call_null_pruning_symbols_3_Good_FP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <unknown_function@plt>
cmp    $0x0,%rax
je     1145 <call_null_pruning_symbols_3_Good_FP+0x25>
movl   $0x0,-0x4(%rbp)
jmp    114c <call_null_pruning_symbols_3_Good_FP+0x2c>
movl   $0xa,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <null_pruning_symbols@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_null_pruning_symbols_3_Good_FP>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <unknown_function@plt>
test   %rax,%rax
mov    $0xa,%edi
cmovne %ebx,%edi
xor    %esi,%esi
pop    %rbx
jmp    1030 <null_pruning_symbols@plt>

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

LLVM IR (-O2):
define void @call_null_pruning_symbols_3_Good_FP() {
%1 = tail call i64 (...) @unknown_function()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i32 10, i32 0
%4 = tail call i32 @null_pruning_symbols(i32 %3, i32 0)
ret void
}
unsigned char getDebugChar(void) {
  while (((*(volatile unsigned char *)(0x7f38)) & 0x02) == 0)
    ;
  return (*(volatile unsigned int *)((0x7f38) + 2));
}


x86 assembly (clang, -O0):
<getDebugChar>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <getDebugChar+0x9>
mov    $0x7f38,%eax
mov    (%rax),%al
movzbl %al,%eax
and    $0x2,%eax
cmp    $0x0,%eax
jne    1124 <getDebugChar+0x24>
jmp    1109 <getDebugChar+0x9>
mov    $0x7f3a,%eax
mov    (%rax),%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDebugChar>:
testb  $0x2,0x7f38
02
je     1100 <getDebugChar>
mov    0x7f3a,%eax
ret

LLVM IR (-O0):
define zeroext i8 @getDebugChar() {
br label %1
1: ; preds = %6, %0
%2 = load volatile i8, i8* inttoptr (i64 32568 to i8*)
%3 = zext i8 %2 to i32
%4 = and i32 %3, 2
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %1
7: ; preds = %1
%8 = load volatile i32, i32* inttoptr (i64 32570 to i32*)
%9 = trunc i32 %8 to i8
ret i8 %9
}

LLVM IR (-O2):
define zeroext i8 @getDebugChar() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i8, i8* inttoptr (i64 32568 to i8*)
%3 = and i8 %2, 2
%4 = icmp eq i8 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = load volatile i32, i32* inttoptr (i64 32570 to i32*)
%7 = trunc i32 %6 to i8
ret i8 %7
}
/* Variables and functions */
double __infer_nondet_double();
double fmod(double x, double y) { return __infer_nondet_double(); }


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

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

LLVM IR (-O0):
define double @fmod(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call double (...) @__infer_nondet_double()
ret double %5
}

LLVM IR (-O2):
define double @fmod(double %0, double %1) {
%3 = tail call double (...) @__infer_nondet_double()
ret double %3
}
/* Variables and functions */
float lerp(float, float, float);
float lerpp(float p1, float p2, float amount) { return lerp(p1, p2, amount); }


x86 assembly (clang, -O0):
<lerpp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1030 <lerp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lerpp>:
jmp    1030 <lerp@plt>

LLVM IR (-O0):
define float @lerpp(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = call float @lerp(float %7, float %8, float %9)
ret float %10
}

LLVM IR (-O2):
define float @lerpp(float %0, float %1, float %2) {
%4 = tail call float @lerp(float %0, float %1, float %2)
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
void *exit1(void *arg) {
  sleep(1);
  exit(0);
  return NULL;
}


x86 assembly (clang, -O0):
<exit1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
call   1040 <sleep@plt>
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O0):
define i8* @exit1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @sleep(i32 1)
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define noalias i8* @exit1(i8* nocapture readnone %0) {
%2 = tail call i32 @sleep(i32 1)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int pthread_setcancelstate(int, int *);
int setcancelstate(int state, int *oldstate) {
  if (pthread_setcancelstate)
    return pthread_setcancelstate(state, oldstate);
  return 0;
}


x86 assembly (clang, -O0):
<setcancelstate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    112e <setcancelstate+0x1e>
jmp    1142 <setcancelstate+0x32>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <pthread_setcancelstate@plt>
mov    %eax,-0x4(%rbp)
jmp    1149 <setcancelstate+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setcancelstate>:
jmp    1030 <pthread_setcancelstate@plt>

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

LLVM IR (-O2):
define i32 @setcancelstate(i32 %0, i32* %1) {
%3 = tail call i32 @pthread_setcancelstate(i32 %0, i32* %1)
ret i32 %3
}
int use_default_colors() { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @use_default_colors() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *, int, int);
void check_overflow(int len, int space) {
  if (len > space)
    fatal("buffer overflow %d %d\n", len, space);
}


x86 assembly (clang, -O0):
<check_overflow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    113c <check_overflow+0x2c>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec9(%rip),%rdi
call   1030 <fatal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_overflow>:
mov    %esi,%edx
cmp    %esi,%edi
jle    1124 <check_overflow+0x14>
mov    %edi,%esi
lea    0xee1(%rip),%rdi
jmp    1030 <fatal@plt>
ret

LLVM IR (-O0):
@.str = [23 x i8] c"buffer overflow %d %d\0A\00"
define void @check_overflow(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 = load i32, i32* %4
%7 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @fatal(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
br label %12
12: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"buffer overflow %d %d\0A\00"
define void @check_overflow(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @fatal(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
br label %6
6: ; preds = %4, %2
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int type;
};
typedef TYPE_1__ XEnterWindowEvent;

/* Variables and functions */
void set_XEnterWindowEvent_type(void *_p, int _v) {
  ((XEnterWindowEvent *)_p)->type = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XEnterWindowEvent_type>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XEnterWindowEvent_type(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 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XEnterWindowEvent_type(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
int main(void) {
  int i;
  i = *((volatile unsigned int *)2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%eax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = load volatile i32, i32* inttoptr (i64 2 to i32*)
store i32 %2, i32* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = load volatile i32, i32* inttoptr (i64 2 to i32*)
ret i32 0
}
/* Variables and functions */
int _IOLBF;
int scalanative_libc_iolbf() { return _IOLBF; }


x86 assembly (clang, -O0):
<scalanative_libc_iolbf>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scalanative_libc_iolbf>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@_IOLBF = global i32 0
define i32 @scalanative_libc_iolbf() {
%1 = load i32, i32* @_IOLBF
ret i32 %1
}

LLVM IR (-O2):
@_IOLBF = global i32 0
define i32 @scalanative_libc_iolbf() {
%1 = load i32, i32* @_IOLBF
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ dbgPrintAllDebugInfo();
int /*<<< orphan*/ dbgprintf(char *);
void sigusr2Hdlr(int __attribute__((unused)) signum) {
  dbgprintf("SIGUSR2 received, dumping debug information\n");
  dbgPrintAllDebugInfo();
}


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

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

LLVM IR (-O0):
@.str = [45 x i8] c"SIGUSR2 received, dumping debug information\0A\00"
define void @sigusr2Hdlr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @dbgprintf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @dbgPrintAllDebugInfo()
ret void
}

LLVM IR (-O2):
@.str = [45 x i8] c"SIGUSR2 received, dumping debug information\0A\00"
define void @sigusr2Hdlr(i32 %0) {
%2 = tail call i32 @dbgprintf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @dbgPrintAllDebugInfo()
ret void
}
void gencvt_d_l() {}


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

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

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

LLVM IR (-O2):
define void @gencvt_d_l() {
ret void
}
/* Variables and functions */
char EOF;
char getchar();
int /*<<< orphan*/ putchar(char);
int main() {
  char c;
  while ((c = getchar()) != EOF) {
    if (c == ' ')
      c = '\n';
    putchar(c);
  }
  putchar(EOF);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
mov    0x2ea5(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     116d <main+0x4d>
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
jne    115f <main+0x3f>
movb   $0xa,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <putchar@plt>
jmp    112f <main+0xf>
mov    0x2e74(%rip),%rax
movsbl (%rax),%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb7(%rip),%rbx
cmp    (%rbx),%al
je     115b <main+0x3b>
mov    $0xa,%ebp
nopw   0x0(%rax,%rax,1)
cmp    $0x20,%al
movzbl %al,%eax
cmove  %ebp,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%al
jne    1140 <main+0x20>
movsbl %al,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i8 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
br label %3
3: ; preds = %14, %0
%4 = call signext i8 (...) @getchar()
store i8 %4, i8* %2
%5 = sext i8 %4 to i32
%6 = load i8, i8* @EOF
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %5, %7
br i1 %8, label %9, label %17
9: ; preds = %3
%10 = load i8, i8* %2
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 32
br i1 %12, label %13, label %14
13: ; preds = %9
store i8 10, i8* %2
br label %14
14: ; preds = %13, %9
%15 = load i8, i8* %2
%16 = call i32 @putchar(i8 signext %15)
br label %3
17: ; preds = %3
%18 = load i8, i8* @EOF
%19 = call i32 @putchar(i8 signext %18)
ret i32 0
}

LLVM IR (-O2):
@EOF = global i8 0
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = load i8, i8* @EOF
%3 = icmp eq i8 %1, %2
br i1 %3, label %12, label %4
4: ; preds = %0, %4
%5 = phi i8 [ %9, %4 ], [ %1, %0 ]
%6 = icmp eq i8 %5, 32
%7 = select i1 %6, i8 10, i8 %5
%8 = tail call i32 @putchar(i8 signext %7)
%9 = tail call signext i8 (...) @getchar()
%10 = load i8, i8* @EOF
%11 = icmp eq i8 %9, %10
br i1 %11, label %12, label %4
12: ; preds = %4, %0
%13 = phi i8 [ %1, %0 ], [ %9, %4 ]
%14 = tail call i32 @putchar(i8 signext %13)
ret i32 0
}
/* Variables and functions */
void *calloc(size_t, size_t);
void *xcalloc(size_t nmemb, size_t size) {
  void *p = calloc(nmemb, size);
  if (p == NULL) {
    ;
  }
  return p;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1141 <xcalloc+0x31>
jmp    1141 <xcalloc+0x31>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
jmp    1030 <calloc@plt>

LLVM IR (-O0):
define i8* @xcalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %12
11: ; preds = %2
br label %12
12: ; preds = %11, %2
%13 = load i8*, i8** %5
ret i8* %13
}

LLVM IR (-O2):
define noalias i8* @xcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
ret i8* %3
}
int test_imm_9Cuint16_mem(unsigned short *val) {
  return ((*val) & (0x9C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_9Cuint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0x9c,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_9Cuint16_mem>:
testb  $0x9c,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_9Cuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 156
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int CalcTokenProba(int nb, int total) {
  assert(nb <= total);
  return nb ? (255 - nb * 255 / total) : 255;
}


x86 assembly (clang, -O0):
<CalcTokenProba>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x0,-0x4(%rbp)
je     1157 <CalcTokenProba+0x47>
imul   $0xff,-0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%ecx
mov    $0xff,%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1164 <CalcTokenProba+0x54>
mov    $0xff,%eax
mov    %eax,-0xc(%rbp)
jmp    1164 <CalcTokenProba+0x54>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CalcTokenProba>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
cmp    %esi,%ebp
setle  %dil
call   1030 <assert@plt>
test   %ebp,%ebp
je     113d <CalcTokenProba+0x2d>
mov    %ebp,%eax
shl    $0x8,%eax
sub    %ebp,%eax
cltd
idiv   %ebx
mov    %eax,%ecx
mov    $0xff,%eax
sub    %ecx,%eax
jmp    1142 <CalcTokenProba+0x32>
mov    $0xff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @CalcTokenProba(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 = load i32, i32* %4
%7 = icmp sle i32 %5, %6
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i32, i32* %3
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %2
%13 = load i32, i32* %3
%14 = mul nsw i32 %13, 255
%15 = load i32, i32* %4
%16 = sdiv i32 %14, %15
%17 = sub nsw i32 255, %16
br label %19
18: ; preds = %2
br label %19
19: ; preds = %18, %12
%20 = phi i32 [ %17, %12 ], [ 255, %18 ]
ret i32 %20
}

LLVM IR (-O2):
define i32 @CalcTokenProba(i32 %0, i32 %1) {
%3 = icmp sle i32 %0, %1
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp eq i32 %0, 0
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = mul nsw i32 %0, 255
%9 = sdiv i32 %8, %1
%10 = sub nsw i32 255, %9
br label %11
11: ; preds = %2, %7
%12 = phi i32 [ %10, %7 ], [ 255, %2 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void err_sys(const char *err) {
  perror(err);
  exit(1);
}


x86 assembly (clang, -O0):
<err_sys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
define void @err_sys(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @err_sys(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int stdc_C3E14CBE(void const *, void const *, size_t);
int memcmp(const void *ptr1, const void *ptr2, size_t num) {
  return stdc_C3E14CBE(ptr1, ptr2, num);
}


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

x86 assembly (clang, -O2):
<memcmp>:
jmp    1030 <stdc_C3E14CBE@plt>

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

LLVM IR (-O2):
define i32 @memcmp(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @stdc_C3E14CBE(i8* %0, i8* %1, i64 %2)
ret i32 %4
}
void UI_add_input_boolean(void) {}


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

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

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

LLVM IR (-O2):
define void @UI_add_input_boolean() {
ret void
}
/* Variables and functions */
scalar_t__ CLOCKS_PER_SEC;
scalar_t__ clock();
double ntime() { return ((double)clock()) / ((double)CLOCKS_PER_SEC); }


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

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

LLVM IR (-O0):
@CLOCKS_PER_SEC = global i64 0
define double @ntime() {
%1 = call i64 (...) @clock()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @CLOCKS_PER_SEC
%4 = sitofp i64 %3 to double
%5 = fdiv double %2, %4
ret double %5
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global i64 0
define double @ntime() {
%1 = tail call i64 (...) @clock()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @CLOCKS_PER_SEC
%4 = sitofp i64 %3 to double
%5 = fdiv double %2, %4
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(size_t);
void *malloc(size_t);
int /*<<< orphan*/ perror_and_abort();
void *xmalloc(size_t nbytes) {
  assert(nbytes);
  void *p = malloc(nbytes);
  if (!p)
    perror_and_abort();
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1164 <xmalloc+0x34>
mov    $0x0,%al
call   1050 <perror_and_abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1150 <xmalloc+0x20>
xor    %eax,%eax
call   1050 <perror_and_abort@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i32 @assert(i64 %0)
%3 = tail call i8* @malloc(i64 %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (...) @perror_and_abort()
br label %7
7: ; preds = %5, %1
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ intToHex(unsigned long, char *, int);
int /*<<< orphan*/ strcat(char *, char *);
void addValueU32(char *dst, char *str, unsigned long value) {
  char v[16];
  strcat(dst, str);
  intToHex(value, v, 8);
  strcat(dst, v);
}


x86 assembly (clang, -O0):
<addValueU32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcat@plt>
mov    -0x18(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x8,%edx
call   1030 <intToHex@plt>
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1040 <strcat@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addValueU32>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rdi,%rbx
call   1040 <strcat@plt>
mov    %rsp,%r15
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0x8,%edx
call   1030 <intToHex@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <strcat@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @addValueU32(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca [16 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = call i32 @strcat(i8* %8, i8* %9)
%11 = load i64, i64* %6
%12 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%13 = call i32 @intToHex(i64 %11, i8* %12, i32 8)
%14 = load i8*, i8** %4
%15 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%16 = call i32 @strcat(i8* %14, i8* %15)
ret void
}

LLVM IR (-O2):
define void @addValueU32(i8* %0, i8* %1, i64 %2) {
%4 = alloca [16 x i8]
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%6 = tail call i32 @strcat(i8* %0, i8* %1)
%7 = call i32 @intToHex(i64 %2, i8* %5, i32 8)
%8 = call i32 @strcat(i8* %0, i8* %5)
ret void
}
/* Variables and functions */
scalar_t__ RAND_MAX;
float rand();
float glmRandomNumberf(float min, float max) {
  return min + (max - min) * rand() / (float)RAND_MAX;
}


x86 assembly (clang, -O0):
<glmRandomNumberf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movss  -0x10(%rbp),%xmm1
movaps %xmm0,%xmm2
movss  -0xc(%rbp),%xmm0
mulss  %xmm2,%xmm1
mov    0x2e8e(%rip),%rax
cvtsi2ssq (%rax),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmRandomNumberf>:
push   %rax
movss  %xmm0,0x4(%rsp)
subss  %xmm0,%xmm1
movss  %xmm1,(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2eba(%rip),%rax
xorps  %xmm1,%xmm1
cvtsi2ssq (%rax),%xmm1
mulss  (%rsp),%xmm0
divss  %xmm1,%xmm0
addss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define float @glmRandomNumberf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = load float, float* %3
%8 = fsub float %6, %7
%9 = call float (...) @rand()
%10 = fmul float %8, %9
%11 = load i64, i64* @RAND_MAX
%12 = sitofp i64 %11 to float
%13 = fdiv float %10, %12
%14 = fadd float %5, %13
ret float %14
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define float @glmRandomNumberf(float %0, float %1) {
%3 = fsub float %1, %0
%4 = tail call float (...) @rand()
%5 = fmul float %3, %4
%6 = load i64, i64* @RAND_MAX
%7 = sitofp i64 %6 to float
%8 = fdiv float %5, %7
%9 = fadd float %8, %0
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void liberaSopaLetras() { printf("Libera memoria de una sopa de letras\n"); }


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"Libera memoria de una sopa de letras\0A\00"
define void @liberaSopaLetras() {
%1 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [37 x i8] c"Libera memoria de una sopa de letras\00"
define void @liberaSopaLetras() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret void
}
void target_sound_error(void) {}


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

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

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

LLVM IR (-O2):
define void @target_sound_error() {
ret void
}
/* Variables and functions */
scalar_t__ graphicMode();
int shellementaryPresent(void) {
  static int lShellementaryPresent = -1;
  if (lShellementaryPresent < 0) {
    lShellementaryPresent = 0;
  }
  return lShellementaryPresent && graphicMode();
}


x86 assembly (clang, -O0):
<shellementaryPresent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0x0,0x2f09(%rip)
jge    112f <shellementaryPresent+0x1f>
movl   $0x0,0x2ef9(%rip)
xor    %eax,%eax
cmpl   $0x0,0x2ef0(%rip)
mov    %al,-0x1(%rbp)
je     1152 <shellementaryPresent+0x42>
mov    $0x0,%al
call   1030 <graphicMode@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shellementaryPresent>:
cmpb   $0x0,0x2f1d(%rip)
jne    1110 <shellementaryPresent+0x10>
movb   $0x1,0x2f14(%rip)
xor    %eax,%eax
ret

LLVM IR (-O0):
@shellementaryPresent.lShellementaryPresent = internal global i32 -1
define i32 @shellementaryPresent() {
%1 = load i32, i32* @shellementaryPresent.lShellementaryPresent
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %4
3: ; preds = %0
store i32 0, i32* @shellementaryPresent.lShellementaryPresent
br label %4
4: ; preds = %3, %0
%5 = load i32, i32* @shellementaryPresent.lShellementaryPresent
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = call i64 (...) @graphicMode()
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %7, %4
%11 = phi i1 [ false, %4 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@shellementaryPresent.lShellementaryPresent = internal unnamed_addr global i1 false
define i32 @shellementaryPresent() {
%1 = load i1, i1* @shellementaryPresent.lShellementaryPresent
br i1 %1, label %3, label %2
2: ; preds = %0
store i1 true, i1* @shellementaryPresent.lShellementaryPresent
br label %3
3: ; preds = %0, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void generate_samples(int *samples) {
  srand(time(NULL));
  for (int i = 0; i < 10000000; ++i) {
    samples[i] = rand() % 100000;
  }
  if (0) {
    printf("Sample values:\n");
    for (int i = 0; i < 10000000; ++i) {
      printf("%d", samples[i]);
      if (i != 10000000 - 1) {
        printf(", ");
      }
    }
    printf("\n\n");
  }
}


x86 assembly (clang, -O0):
<generate_samples>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x989680,-0xc(%rbp)
jge    1188 <generate_samples+0x58>
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x186a0,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1153 <generate_samples+0x23>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_samples>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x14f8b589,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x2d,%rcx
add    %edx,%ecx
imul   $0x186a0,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    $0x989680,%rbx
jne    1150 <generate_samples+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @generate_samples(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = call i32 @time(i32* null)
%5 = call i32 @srand(i32 %4)
store i32 0, i32* %3
br label %6
6: ; preds = %16, %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 10000000
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = call i32 (...) @rand()
%11 = srem i32 %10, 100000
%12 = load i32*, i32** %2
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
store i32 %11, i32* %15
br label %16
16: ; preds = %9
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %6
19: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @generate_samples(i32* nocapture writeonly %0) {
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 @srand(i32 %2)
br label %5
4: ; preds = %5
ret void
5: ; preds = %1, %5
%6 = phi i64 [ 0, %1 ], [ %10, %5 ]
%7 = tail call i32 (...) @rand()
%8 = srem i32 %7, 100000
%9 = getelementptr inbounds i32, i32* %0, i64 %6
store i32 %8, i32* %9
%10 = add nuw nsw i64 %6, 1
%11 = icmp eq i64 %10, 10000000
br i1 %11, label %4, label %5
}
/* Variables and functions */
int /*<<< orphan*/ eputc(char);
void printString(char *String) {
  while (*String) {
    eputc(*String);
    String++;
  }
}


x86 assembly (clang, -O0):
<printString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <printString+0x36>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <eputc@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <printString+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printString>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <printString+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <eputc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <printString+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @printString(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @eputc(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gracefulExit();
void intHandler(int nil) { gracefulExit(); }


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

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

LLVM IR (-O0):
define void @intHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @gracefulExit()
ret void
}

LLVM IR (-O2):
define void @intHandler(i32 %0) {
%2 = tail call i32 (...) @gracefulExit()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  printf("Enter 2 digit num: ");
  scanf("%d", &a);
  printf("Number reversed: %d%d", a % 10, a / 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movslq 0x4(%rsp),%rsi
imul   $0x66666667,%rsi,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x22,%rdx
add    %eax,%edx
lea    (%rdx,%rdx,1),%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%esi
lea    0xeac(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Enter 2 digit num: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [22 x i8] c"Number reversed: %d%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = srem i32 %5, 10
%7 = load i32, i32* %2
%8 = sdiv i32 %7, 10
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %6, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Enter 2 digit num: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [22 x i8] c"Number reversed: %d%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = srem i32 %5, 10
%7 = sdiv i32 %5, 10
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %6, i32 %7)
ret i32 0
}
/* Variables and functions */
double pop();
int /*<<< orphan*/ push(double);
void swapItems(void) {
  double item1 = pop();
  double item2 = pop();
  push(item1);
  push(item2);
}


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

x86 assembly (clang, -O2):
<swapItems>:
sub    $0x18,%rsp
xor    %eax,%eax
call   1030 <pop@plt>
movsd  %xmm0,0x10(%rsp)
xor    %eax,%eax
call   1030 <pop@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <push@plt>
movsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
jmp    1040 <push@plt>

LLVM IR (-O0):
define void @swapItems() {
%1 = alloca double
%2 = alloca double
%3 = call double (...) @pop()
store double %3, double* %1
%4 = call double (...) @pop()
store double %4, double* %2
%5 = load double, double* %1
%6 = call i32 @push(double %5)
%7 = load double, double* %2
%8 = call i32 @push(double %7)
ret void
}

LLVM IR (-O2):
define void @swapItems() {
%1 = tail call double (...) @pop()
%2 = tail call double (...) @pop()
%3 = tail call i32 @push(double %1)
%4 = tail call i32 @push(double %2)
ret void
}
int DLCheckForUnresolved(void *mod) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @DLCheckForUnresolved(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: piggyback bits vmlinux.aout System.map fs_img.gz\n");
  fprintf(stderr, "\tKernel image will be modified in place.\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xef0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xefa(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [57 x i8] c"Usage: piggyback bits vmlinux.aout System.map fs_img.gz\0A\00"
@.str.1 = [42 x i8] c"\09Kernel image will be modified in place.\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [57 x i8] c"Usage: piggyback bits vmlinux.aout System.map fs_img.gz\0A\00"
@.str.1 = [42 x i8] c"\09Kernel image will be modified in place.\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
scalar_t__ is_vmalloc_addr(void *);
int /*<<< orphan*/ kfree(void *);
int /*<<< orphan*/ vfree(void *);
void cxgb3i_free_big_mem(void *addr) {
  if (is_vmalloc_addr(addr))
    vfree(addr);
  else
    kfree(addr);
}


x86 assembly (clang, -O0):
<cxgb3i_free_big_mem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <is_vmalloc_addr@plt>
cmp    $0x0,%rax
je     115d <cxgb3i_free_big_mem+0x2d>
mov    -0x8(%rbp),%rdi
call   1050 <vfree@plt>
jmp    1166 <cxgb3i_free_big_mem+0x36>
mov    -0x8(%rbp),%rdi
call   1030 <kfree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cxgb3i_free_big_mem>:
push   %rbx
mov    %rdi,%rbx
call   1040 <is_vmalloc_addr@plt>
mov    %rbx,%rdi
test   %rax,%rax
je     1147 <cxgb3i_free_big_mem+0x17>
pop    %rbx
jmp    1050 <vfree@plt>
pop    %rbx
jmp    1030 <kfree@plt>

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

LLVM IR (-O2):
define void @cxgb3i_free_big_mem(i8* %0) {
%2 = tail call i64 @is_vmalloc_addr(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @vfree(i8* %0)
br label %8
6: ; preds = %1
%7 = tail call i32 @kfree(i8* %0)
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void uws_free(void *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @uws_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int test_imm_43int8_reg(signed char val) {
  return ((val) & (-0x43 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_43int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -67
%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_43int8_reg(i8 signext %0) {
%2 = and i8 %0, -67
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
double P2_z(double, double, double, double);
double P3_y(double sign, double xi, double et, double qq) {
  return P2_z(sign, xi, et, qq);
}


x86 assembly (clang, -O0):
<P3_y>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
call   1030 <P2_z@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<P3_y>:
jmp    1030 <P2_z@plt>

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

LLVM IR (-O2):
define double @P3_y(double %0, double %1, double %2, double %3) {
%5 = tail call double @P2_z(double %0, double %1, double %2, double %3)
ret double %5
}
void ARGBLumaColorTableRow_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @ARGBLumaColorTableRow_SSSE3() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t signum_u32(uint32_t i) {
  if (i > 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<signum_u32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jle    1120 <signum_u32+0x20>
movq   $0x1,-0x8(%rbp)
jmp    1128 <signum_u32+0x28>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signum_u32>:
xor    %eax,%eax
test   %rdi,%rdi
setg   %al
ret

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

LLVM IR (-O2):
define i64 @signum_u32(i64 %0) {
%2 = icmp sgt i64 %0, 0
%3 = zext i1 %2 to i64
ret i64 %3
}
int idris_eqPtr(void *x, void *y) { return x == y; }


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

x86 assembly (clang, -O2):
<idris_eqPtr>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @idris_eqPtr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = icmp eq i8* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @idris_eqPtr(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}