xunge/DecIR huggingface dataset:
/* Type definitions */
struct target {
  int dummy;
};

/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ snprintf(char *, int, char *);
char *dump_sys_pause(int depth, struct target *target) {
  char *param_str = malloc(5);
  snprintf(param_str, 5, "void");
  return param_str;
}


x86 assembly (clang, -O0):
<dump_sys_pause>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x5,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x5,%esi
lea    0xeb3(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_sys_pause>:
push   %rbx
mov    $0x5,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rdx
mov    %rax,%rdi
mov    $0x5,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.target = type { i32 }
@.str = [5 x i8] c"void\00"
define i8* @dump_sys_pause(i32 %0, %struct.target* %1) {
%3 = alloca i32
%4 = alloca %struct.target*
%5 = alloca i8*
store i32 %0, i32* %3
store %struct.target* %1, %struct.target** %4
%6 = call i8* @malloc(i32 5)
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = call i32 @snprintf(i8* %7, i32 5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%9 = load i8*, i8** %5
ret i8* %9
}

LLVM IR (-O2):
%struct.target = type { i32 }
@.str = [5 x i8] c"void\00"
define i8* @dump_sys_pause(i32 %0, %struct.target* nocapture readnone %1) {
%3 = tail call dereferenceable_or_null(5) i8* @malloc(i32 5)
%4 = tail call i32 @snprintf(i8* %3, i32 5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
int do_802() { return 802; }


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

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

LLVM IR (-O0):
define i32 @do_802() {
ret i32 802
}

LLVM IR (-O2):
define i32 @do_802() {
ret i32 802
}
putusage(s) char *s;
{
  printf("usage: %s file ... host:target, or\n", s);
  printf("       %s file ... target (when already connected)\n", s);
}


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

x86 assembly (clang, -O2):
<putusage>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef8(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"usage: %s file ... host:target, or\0A\00"
@.str.1 = [52 x i8] c" %s file ... target (when already connected)\0A\00"
define i32 @putusage(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %3
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
@.str = [36 x i8] c"usage: %s file ... host:target, or\0A\00"
@.str.1 = [52 x i8] c" %s file ... target (when already connected)\0A\00"
define i32 @putusage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 undef
}
__attribute__((__unused__)) int isspace(int c) { return ((c) == ' '); }


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
xor    %eax,%eax
cmp    $0x20,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isspace(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 32
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
%2 = icmp eq i32 %0, 32
%3 = zext i1 %2 to i32
ret i32 %3
}
void break_two() {}


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

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

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

LLVM IR (-O2):
define void @break_two() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ n32016_dumpregs(char *);
void HandleTrap(void) { n32016_dumpregs("HandleTrap() called"); }


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"HandleTrap() called\00"
define void @HandleTrap() {
%1 = call i32 @n32016_dumpregs(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"HandleTrap() called\00"
define void @HandleTrap() {
%1 = tail call i32 @n32016_dumpregs(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ FUTEX_WAIT;
int /*<<< orphan*/ FUTEX_WAIT_PRIVATE;
int __futex(void volatile *, int /*<<< orphan*/, int, struct timespec const *);
int __futex_wait_ex(volatile void *ftx, bool shared, int value,
                    const struct timespec *timeout) {
  return __futex(ftx, shared ? FUTEX_WAIT : FUTEX_WAIT_PRIVATE, value, timeout);
}


x86 assembly (clang, -O0):
<__futex_wait_ex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1149 <__futex_wait_ex+0x39>
mov    0x2ea9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
jmp    1155 <__futex_wait_ex+0x45>
mov    0x2e88(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1030 <__futex@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__futex_wait_ex>:
test   %esi,%esi
jne    1122 <__futex_wait_ex+0x12>
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
jmp    1030 <__futex@plt>
mov    0x2ebf(%rip),%rax
mov    (%rax),%esi
jmp    1030 <__futex@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
@FUTEX_WAIT = global i32 0
@FUTEX_WAIT_PRIVATE = global i32 0
define i32 @__futex_wait_ex(i8* %0, i32 %1, i32 %2, %struct.timespec* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.timespec*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store %struct.timespec* %3, %struct.timespec** %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %4
%13 = load i32, i32* @FUTEX_WAIT
br label %16
14: ; preds = %4
%15 = load i32, i32* @FUTEX_WAIT_PRIVATE
br label %16
16: ; preds = %14, %12
%17 = phi i32 [ %13, %12 ], [ %15, %14 ]
%18 = load i32, i32* %7
%19 = load %struct.timespec*, %struct.timespec** %8
%20 = call i32 @__futex(i8* %9, i32 %17, i32 %18, %struct.timespec* %19)
ret i32 %20
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@FUTEX_WAIT = global i32 0
@FUTEX_WAIT_PRIVATE = global i32 0
define i32 @__futex_wait_ex(i8* %0, i32 %1, i32 %2, %struct.timespec* %3) {
%5 = icmp eq i32 %1, 0
%6 = load i32, i32* @FUTEX_WAIT
%7 = load i32, i32* @FUTEX_WAIT_PRIVATE
%8 = select i1 %5, i32 %7, i32 %6
%9 = tail call i32 @__futex(i8* %0, i32 %8, i32 %2, %struct.timespec* %3)
ret i32 %9
}
int ss_do_sum(int a, int b) { return a + b; }


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

x86 assembly (clang, -O2):
<ss_do_sum>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @ss_do_sum(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @ss_do_sum(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
void lgtd_jsonrpc_start_send_response(struct lgtd_client *client) {
  (void)client;
}


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

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

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

LLVM IR (-O2):
%struct.lgtd_client = type opaque
define void @lgtd_jsonrpc_start_send_response(%struct.lgtd_client* nocapture %0) {
ret void
}
int roundRobin(int pIndex, int numProcs) {
  if (numProcs <= 0) {
    return -1;
  }
  return ((pIndex + 1) % numProcs);
}


x86 assembly (clang, -O0):
<roundRobin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jg     1120 <roundRobin+0x20>
movl   $0xffffffff,-0x4(%rbp)
jmp    112d <roundRobin+0x2d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundRobin>:
test   %esi,%esi
jle    110f <roundRobin+0xf>
add    $0x1,%edi
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @roundRobin(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 1
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = add nsw i32 %0, 1
%6 = srem i32 %5, %1
br label %7
7: ; preds = %2, %4
%8 = phi i32 [ %6, %4 ], [ -1, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *, int);
void die(char *s, int i) {
  printf("--> %s numero %i\n", s, i);
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"--> %s numero %i\0A\00"
define void @die(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 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [18 x i8] c"--> %s numero %i\0A\00"
define void @die(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%4 = tail call i32 @exit(i32 1)
unreachable
}
int GetFX(int mx, int x, int nw) {
  float xp = (float)x * (float)mx / (float)nw;
  return (int)xp;
}


x86 assembly (clang, -O0):
<GetFX>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
cvtsi2ssl -0x4(%rbp),%xmm1
mulss  %xmm1,%xmm0
cvtsi2ssl -0xc(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
cvttss2si -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetFX>:
cvtsi2ss %esi,%xmm0
cvtsi2ss %edi,%xmm1
cvtsi2ss %edx,%xmm2
mulss  %xmm0,%xmm1
divss  %xmm2,%xmm1
cvttss2si %xmm1,%eax
ret

LLVM IR (-O0):
define i32 @GetFX(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = sitofp i32 %8 to float
%10 = load i32, i32* %4
%11 = sitofp i32 %10 to float
%12 = fmul float %9, %11
%13 = load i32, i32* %6
%14 = sitofp i32 %13 to float
%15 = fdiv float %12, %14
store float %15, float* %7
%16 = load float, float* %7
%17 = fptosi float %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @GetFX(i32 %0, i32 %1, i32 %2) {
%4 = sitofp i32 %1 to float
%5 = sitofp i32 %0 to float
%6 = fmul float %5, %4
%7 = sitofp i32 %2 to float
%8 = fdiv float %6, %7
%9 = fptosi float %8 to i32
ret i32 %9
}
/* Variables and functions */
char *strdup(char const *);
int /*<<< orphan*/ xnomem();
char *xstrdup(const char *str) {
  char *ptr;
  if (!(ptr = strdup(str)))
    xnomem();
  return (ptr);
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    114a <xstrdup+0x2a>
mov    $0x0,%al
call   1030 <xnomem@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <xstrdup+0x15>
xor    %eax,%eax
call   1030 <xnomem@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @xnomem()
br label %6
6: ; preds = %4, %1
ret i8* %2
}
int f(int c, int s) {
  int x1, x2, y1, y2;
  y1 = c + 2;
  x1 = s * y1;
  y2 = y1 + 2;
  x2 = s * y2;
  return x1 + x2;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x14(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x18(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
lea    (%rdi,%rdi,1),%eax
add    $0x6,%eax
imul   %esi,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 2
store i32 %10, i32* %7
%11 = load i32, i32* %4
%12 = load i32, i32* %7
%13 = mul nsw i32 %11, %12
store i32 %13, i32* %5
%14 = load i32, i32* %7
%15 = add nsw i32 %14, 2
store i32 %15, i32* %8
%16 = load i32, i32* %4
%17 = load i32, i32* %8
%18 = mul nsw i32 %16, %17
store i32 %18, i32* %6
%19 = load i32, i32* %5
%20 = load i32, i32* %6
%21 = add nsw i32 %19, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = shl i32 %0, 1
%4 = add i32 %3, 6
%5 = mul i32 %4, %1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ increment_value(int /*<<< orphan*/ *);
void increment_value_fail(void **state) { increment_value(NULL); }


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

x86 assembly (clang, -O2):
<increment_value_fail>:
xor    %edi,%edi
jmp    1030 <increment_value@plt>

LLVM IR (-O0):
define void @increment_value_fail(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @increment_value(i32* null)
ret void
}

LLVM IR (-O2):
define void @increment_value_fail(i8** nocapture readnone %0) {
%2 = tail call i32 @increment_value(i32* null)
ret void
}
void glutStopVideoResizing(void) {}


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

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

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

LLVM IR (-O2):
define void @glutStopVideoResizing() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x87() {
  Assert_real((ispunct(135) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_ispunct.c",
              680, ("ispunct should be 0 for 0x87"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x87>:
push   %rax
mov    $0x87,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2a8,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x87\00"
define void @t_ispunct_0x87() {
%1 = tail call i64 @ispunct(i32 135)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 680, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void stopJob(int signum) {}


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

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

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

LLVM IR (-O2):
define void @stopJob(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void erase_latency_file(FILE *f) { fprintf(f, "erase\n"); }


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

x86 assembly (clang, -O2):
<erase_latency_file>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x6,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"erase\0A\00"
define void @erase_latency_file(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"erase\0A\00"
define void @erase_latency_file(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 6, i64 1, i32* %0)
ret void
}
void occampi_guardexphook_free(void *chook) { return; }


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

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

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

LLVM IR (-O2):
define void @occampi_guardexphook_free(i8* nocapture %0) {
ret void
}
/* Type definitions */
struct bfdsessiondata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bfd_echo_handle_recv(struct bfdsessiondata *);
int /*<<< orphan*/ bfd_echo_update(struct bfdsessiondata *);
void bfd_echo_process(struct bfdsessiondata *pb) {
  bfd_echo_update(pb);
  bfd_echo_handle_recv(pb);
}


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

x86 assembly (clang, -O2):
<bfd_echo_process>:
push   %rbx
mov    %rdi,%rbx
call   1040 <bfd_echo_update@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <bfd_echo_handle_recv@plt>

LLVM IR (-O0):
%struct.bfdsessiondata = type { i32 }
define void @bfd_echo_process(%struct.bfdsessiondata* %0) {
%2 = alloca %struct.bfdsessiondata*
store %struct.bfdsessiondata* %0, %struct.bfdsessiondata** %2
%3 = load %struct.bfdsessiondata*, %struct.bfdsessiondata** %2
%4 = call i32 @bfd_echo_update(%struct.bfdsessiondata* %3)
%5 = load %struct.bfdsessiondata*, %struct.bfdsessiondata** %2
%6 = call i32 @bfd_echo_handle_recv(%struct.bfdsessiondata* %5)
ret void
}

LLVM IR (-O2):
%struct.bfdsessiondata = type { i32 }
define void @bfd_echo_process(%struct.bfdsessiondata* %0) {
%2 = tail call i32 @bfd_echo_update(%struct.bfdsessiondata* %0)
%3 = tail call i32 @bfd_echo_handle_recv(%struct.bfdsessiondata* %0)
ret void
}
void foo605() {}


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

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

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

LLVM IR (-O2):
define void @foo605() {
ret void
}
unsigned int bit32conversion(unsigned int num) {
  return ((num >> 24) & 0xff) | ((num << 8) & 0xff0000) |
         ((num >> 8) & 0xff00) | ((num << 24) & 0xff000000);
}


x86 assembly (clang, -O0):
<bit32conversion>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x18,%eax
and    $0xff,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
and    $0xff0000,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shr    $0x8,%ecx
and    $0xff00,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x18,%ecx
and    $0xff000000,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @bit32conversion(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 24
%5 = and i32 %4, 255
%6 = load i32, i32* %2
%7 = shl i32 %6, 8
%8 = and i32 %7, 16711680
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = lshr i32 %10, 8
%12 = and i32 %11, 65280
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = shl i32 %14, 24
%16 = and i32 %15, -16777216
%17 = or i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @bit32conversion(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int bs_get_info(int, char *, char **);
int /*<<< orphan*/ snprintf(char *, int, char *);
int bs_list_tubes_watched(int fd, char **yaml) {
  char command[64];
  snprintf(command, 64, "list-tubes-watched\r\n");
  return bs_get_info(fd, command, yaml);
}


x86 assembly (clang, -O0):
<bs_list_tubes_watched>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
mov    $0x40,%esi
lea    0xec1(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x4(%rbp),%edi
lea    -0x50(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <bs_get_info@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bs_list_tubes_watched>:
push   %rbp
push   %r14
push   %rbx
sub    $0x40,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xecc(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x40,%esi
call   1040 <snprintf@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <bs_get_info@plt>
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"list-tubes-watched\0D\0A\00"
define i32 @bs_list_tubes_watched(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [64 x i8]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%7 = call i32 @snprintf(i8* %6, i32 64, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %3
%9 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%10 = load i8**, i8*** %4
%11 = call i32 @bs_get_info(i32 %8, i8* %9, i8** %10)
ret i32 %11
}

LLVM IR (-O2):
@.str = [21 x i8] c"list-tubes-watched\0D\0A\00"
define i32 @bs_list_tubes_watched(i32 %0, i8** %1) {
%3 = alloca [64 x i8]
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 64, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @bs_get_info(i32 %0, i8* %4, i8** %1)
ret i32 %6
}
/* Variables and functions */
scalar_t__ malloc(int);
char *strdup(char *);
char *strtok(char *, char *);
char *parser_get_nick(char *data) {
  char *buf = (char *)malloc(100 * sizeof(char));
  char *delimit = ":!";
  char *buf1 = strdup(data);
  buf = strtok(buf1, delimit);
  return (char *)buf;
}


x86 assembly (clang, -O0):
<parser_get_nick>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x64,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
lea    0xeaf(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parser_get_nick>:
push   %rbx
mov    %rdi,%rbx
mov    $0x64,%edi
call   1030 <malloc@plt>
mov    %rbx,%rdi
call   1050 <strdup@plt>
lea    0xeb3(%rip),%rsi
mov    %rax,%rdi
pop    %rbx
jmp    1040 <strtok@plt>

LLVM IR (-O0):
@.str = [3 x i8] c":!\00"
define i8* @parser_get_nick(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %2
%6 = call i64 @malloc(i32 100)
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %3
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %4
%8 = load i8*, i8** %2
%9 = call i8* @strdup(i8* %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = load i8*, i8** %4
%12 = call i8* @strtok(i8* %10, i8* %11)
store i8* %12, i8** %3
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [3 x i8] c":!\00"
define i8* @parser_get_nick(i8* nocapture %0) {
%2 = tail call i64 @malloc(i32 100)
%3 = tail call i8* @strdup(i8* %0)
%4 = tail call i8* @strtok(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ clear_rhs_vars();
int /*<<< orphan*/ rul__sem_init_temp_rhs_vars();
int /*<<< orphan*/ sem_clear_rhs_used_lhs_vars();
void rul__sem_initialize_rhs_vars(void) {
  rul__sem_init_temp_rhs_vars();
  clear_rhs_vars();
  sem_clear_rhs_used_lhs_vars();
}


x86 assembly (clang, -O0):
<rul__sem_initialize_rhs_vars>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rul__sem_init_temp_rhs_vars@plt>
mov    $0x0,%al
call   1050 <clear_rhs_vars@plt>
mov    $0x0,%al
call   1040 <sem_clear_rhs_used_lhs_vars@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rul__sem_initialize_rhs_vars>:
push   %rax
xor    %eax,%eax
call   1030 <rul__sem_init_temp_rhs_vars@plt>
xor    %eax,%eax
call   1050 <clear_rhs_vars@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <sem_clear_rhs_used_lhs_vars@plt>

LLVM IR (-O0):
define void @rul__sem_initialize_rhs_vars() {
%1 = call i32 (...) @rul__sem_init_temp_rhs_vars()
%2 = call i32 (...) @clear_rhs_vars()
%3 = call i32 (...) @sem_clear_rhs_used_lhs_vars()
ret void
}

LLVM IR (-O2):
define void @rul__sem_initialize_rhs_vars() {
%1 = tail call i32 (...) @rul__sem_init_temp_rhs_vars()
%2 = tail call i32 (...) @clear_rhs_vars()
%3 = tail call i32 (...) @sem_clear_rhs_used_lhs_vars()
ret void
}
void proc_tty_unregister_driver(struct tty_driver *driver) {}


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

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

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

LLVM IR (-O2):
%struct.tty_driver = type opaque
define void @proc_tty_unregister_driver(%struct.tty_driver* nocapture %0) {
ret void
}
/* Variables and functions */
long gethostid();
long elg_pform_node_id() { return gethostid(); }


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

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

LLVM IR (-O0):
define i64 @elg_pform_node_id() {
%1 = call i64 (...) @gethostid()
ret i64 %1
}

LLVM IR (-O2):
define i64 @elg_pform_node_id() {
%1 = tail call i64 (...) @gethostid()
ret i64 %1
}
unsigned long long generative(unsigned long long max) {
  unsigned long long n = 0;
  unsigned long long prev_1 = 1;
  unsigned long long prev_2 = 0;
  unsigned long long sum = 0;
  while (n < max) {
    n = prev_1 + prev_2;
    if (n % 2 == 0) {
      sum += n;
    }
    prev_2 = prev_1;
    prev_1 = n;
  }
  return sum;
}


x86 assembly (clang, -O0):
<generative>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1175 <generative+0x75>
mov    -0x18(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
jne    1160 <generative+0x60>
mov    -0x10(%rbp),%rax
add    -0x28(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <generative+0x28>
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<generative>:
test   %rdi,%rdi
je     1132 <generative+0x32>
mov    $0x1,%ecx
xor    %eax,%eax
xor    %edx,%edx
xchg   %ax,%ax
mov    %rdx,%rsi
add    %rcx,%rsi
test   $0x1,%sil
mov    $0x0,%edx
cmove  %rsi,%rdx
add    %rdx,%rax
mov    %rcx,%rdx
mov    %rsi,%rcx
cmp    %rdi,%rsi
jb     1110 <generative+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @generative(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %2
store i64 0, i64* %3
store i64 1, i64* %4
store i64 0, i64* %5
store i64 0, i64* %6
br label %7
7: ; preds = %22, %1
%8 = load i64, i64* %3
%9 = load i64, i64* %2
%10 = icmp ult i64 %8, %9
br i1 %10, label %11, label %25
11: ; preds = %7
%12 = load i64, i64* %4
%13 = load i64, i64* %5
%14 = add i64 %12, %13
store i64 %14, i64* %3
%15 = load i64, i64* %3
%16 = urem i64 %15, 2
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %22
18: ; preds = %11
%19 = load i64, i64* %3
%20 = load i64, i64* %6
%21 = add i64 %20, %19
store i64 %21, i64* %6
br label %22
22: ; preds = %18, %11
%23 = load i64, i64* %4
store i64 %23, i64* %5
%24 = load i64, i64* %3
store i64 %24, i64* %4
br label %7
25: ; preds = %7
%26 = load i64, i64* %6
ret i64 %26
}

LLVM IR (-O2):
define i64 @generative(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %11, %3 ], [ 0, %1 ]
%5 = phi i64 [ %6, %3 ], [ 0, %1 ]
%6 = phi i64 [ %7, %3 ], [ 1, %1 ]
%7 = add i64 %5, %6
%8 = and i64 %7, 1
%9 = icmp eq i64 %8, 0
%10 = select i1 %9, i64 %7, i64 0
%11 = add i64 %10, %4
%12 = icmp ult i64 %7, %0
br i1 %12, label %3, label %13
13: ; preds = %3, %1
%14 = phi i64 [ 0, %1 ], [ %11, %3 ]
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ forwardCDeclaration();
void normalCDeclaration1() { forwardCDeclaration(); }


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

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

LLVM IR (-O0):
define void @normalCDeclaration1() {
%1 = call i32 (...) @forwardCDeclaration()
ret void
}

LLVM IR (-O2):
define void @normalCDeclaration1() {
%1 = tail call i32 (...) @forwardCDeclaration()
ret void
}
extern double n1s1n2s2(int n1, float s1, int n2, float s2) {
  return n1 + s1 + n2 + s2;
}


x86 assembly (clang, -O0):
<n1s1n2s2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
cvtsi2ssl -0xc(%rbp),%xmm1
addss  %xmm1,%xmm0
addss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<n1s1n2s2>:
cvtsi2ss %edi,%xmm2
cvtsi2ss %esi,%xmm3
addss  %xmm0,%xmm2
addss  %xmm2,%xmm3
addss  %xmm1,%xmm3
xorps  %xmm0,%xmm0
cvtss2sd %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @n1s1n2s2(i32 %0, float %1, i32 %2, float %3) {
%5 = alloca i32
%6 = alloca float
%7 = alloca i32
%8 = alloca float
store i32 %0, i32* %5
store float %1, float* %6
store i32 %2, i32* %7
store float %3, float* %8
%9 = load i32, i32* %5
%10 = sitofp i32 %9 to float
%11 = load float, float* %6
%12 = fadd float %10, %11
%13 = load i32, i32* %7
%14 = sitofp i32 %13 to float
%15 = fadd float %12, %14
%16 = load float, float* %8
%17 = fadd float %15, %16
%18 = fpext float %17 to double
ret double %18
}

LLVM IR (-O2):
define double @n1s1n2s2(i32 %0, float %1, i32 %2, float %3) {
%5 = sitofp i32 %0 to float
%6 = fadd float %5, %1
%7 = sitofp i32 %2 to float
%8 = fadd float %6, %7
%9 = fadd float %8, %3
%10 = fpext float %9 to double
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ strcasecmp(char *, char *);
void strcasecmp_null_0() {
  char *x = 0;
  char *y = "123";
  strcasecmp(x, y);
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"123\00"
define void @strcasecmp_null_0() {
%1 = alloca i8*
%2 = alloca i8*
store i8* null, i8** %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %1
%4 = load i8*, i8** %2
%5 = call i32 @strcasecmp(i8* %3, i8* %4)
ret void
}

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


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

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

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

LLVM IR (-O2):
define i32 @execute_shmat() {
ret i32 0
}
void init_put_console(int c) {
  if (c == '\n')
    init_put_console('\r');
}


x86 assembly (clang, -O0):
<init_put_console>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jne    112f <init_put_console+0x1f>
mov    $0xd,%edi
call   1030 <init_put_console@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @init_put_console(i32 %0) {
ret void
}
int isEmpty(int *top) {
  if (*top == -1)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isEmpty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0xffffffff,(%rax)
jne    1121 <isEmpty+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1128 <isEmpty+0x28>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isEmpty>:
xor    %eax,%eax
cmpl   $0xffffffff,(%rdi)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isEmpty(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, -1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *, double);
int /*<<< orphan*/ stdout;
void sequence_element_display(void *x, void *arg) {
  { arg = arg; }
  if (NULL != x)
    fprintf(stdout, "\tdisplay element -> {object=>0x%p, value=>%.3f}\n", x,
            *(double *)x);
}


x86 assembly (clang, -O0):
<sequence_element_display>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
je     1155 <sequence_element_display+0x45>
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sequence_element_display>:
test   %rdi,%rdi
je     1131 <sequence_element_display+0x21>
mov    %rdi,%rdx
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
movsd  (%rdx),%xmm0
lea    0xed4(%rip),%rsi
jmp    1030 <fprintf@plt>
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [49 x i8] c"\09display element -> {object=>0x%p, value=>%.3f}\0A\00"
define void @sequence_element_display(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
store i8* %5, i8** %4
%6 = load i8*, i8** %3
%7 = icmp ne i8* null, %6
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load i32, i32* @stdout
%10 = load i8*, i8** %3
%11 = load i8*, i8** %3
%12 = bitcast i8* %11 to double*
%13 = load double, double* %12
%14 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %10, double %13)
br label %15
15: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [49 x i8] c"\09display element -> {object=>0x%p, value=>%.3f}\0A\00"
define void @sequence_element_display(i8* %0, i8* nocapture readnone %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = load i32, i32* @stdout
%6 = bitcast i8* %0 to double*
%7 = load double, double* %6
%8 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %0, double %7)
br label %9
9: ; preds = %4, %2
ret void
}
/* Variables and functions */
int yahoo_M1ObfuscatedTableCommon(int, int, unsigned char *);
int yahoo_f01_03(int Salt, int Parameter) {
  static unsigned char LUT[32] = {
      0x19, 0x05, 0x09, 0x1C, 0x0B, 0x1A, 0x12, 0x03, 0x06, 0x04, 0x0D,
      0x1D, 0x15, 0x0E, 0x1B, 0x18, 0x00, 0x07, 0x08, 0x02, 0x13, 0x1F,
      0x0C, 0x1E, 0x16, 0x0A, 0x10, 0x0F, 0x01, 0x14, 0x11, 0x17,
  };
  return yahoo_M1ObfuscatedTableCommon(Salt, Parameter, LUT);
}


x86 assembly (clang, -O0):
<yahoo_f01_03>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    0x2f05(%rip),%rdx
call   1030 <yahoo_M1ObfuscatedTableCommon@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yahoo_f01_03>:
lea    0x2f19(%rip),%rdx
jmp    1030 <yahoo_M1ObfuscatedTableCommon@plt>

LLVM IR (-O0):
@yahoo_f01_03.LUT = internal global [32 x i8] c"\19\05\09\1C\0B\1A\12\03\06\04\0D\1D\15\0E\1B\18\00\07\08\02\13\1F\0C\1E\16\0A\10\0F\01\14\11\17"
define i32 @yahoo_f01_03(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 = call i32 @yahoo_M1ObfuscatedTableCommon(i32 %5, i32 %6, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @yahoo_f01_03.LUT, i64 0, i64 0))
ret i32 %7
}

LLVM IR (-O2):
@yahoo_f01_03.LUT = internal global [32 x i8] c"\19\05\09\1C\0B\1A\12\03\06\04\0D\1D\15\0E\1B\18\00\07\08\02\13\1F\0C\1E\16\0A\10\0F\01\14\11\17"
define i32 @yahoo_f01_03(i32 %0, i32 %1) {
%3 = tail call i32 @yahoo_M1ObfuscatedTableCommon(i32 %0, i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @yahoo_f01_03.LUT, i64 0, i64 0))
ret i32 %3
}
void vzero(float *v) {
  v[(signed long int)0] = (float)0.000000;
  v[(signed long int)1] = (float)0.000000;
  v[(signed long int)2] = (float)0.000000;
}


x86 assembly (clang, -O0):
<vzero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vzero>:
movq   $0x0,(%rdi)
movl   $0x0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @vzero(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
store float 0.000000e+00, float* %4
%5 = load float*, float** %2
%6 = getelementptr inbounds float, float* %5, i64 1
store float 0.000000e+00, float* %6
%7 = load float*, float** %2
%8 = getelementptr inbounds float, float* %7, i64 2
store float 0.000000e+00, float* %8
ret void
}

LLVM IR (-O2):
define void @vzero(float* nocapture writeonly %0) {
store float 0.000000e+00, float* %0
%2 = getelementptr inbounds float, float* %0, i64 1
store float 0.000000e+00, float* %2
%3 = getelementptr inbounds float, float* %0, i64 2
store float 0.000000e+00, float* %3
ret void
}
/* Variables and functions */
char *calloc(int, int);
int /*<<< orphan*/ sprintf(char *, char *, int);
int zz_inttohex(int i) {
  char *q = calloc(20, sizeof(char));
  sprintf(q, "0x%x\0", i);
  return (int)q;
}


x86 assembly (clang, -O0):
<zz_inttohex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x14,%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeb4(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zz_inttohex>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x14,%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,%rbx
lea    0xec2(%rip),%rsi
mov    %rax,%rdi
mov    %ebp,%edx
call   1040 <sprintf@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"0x%x\00\00"
define i32 @zz_inttohex(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = call i8* @calloc(i32 20, i32 1)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load i32, i32* %2
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i8*, i8** %3
%9 = ptrtoint i8* %8 to i32
ret i32 %9
}

LLVM IR (-O2):
@.str = [6 x i8] c"0x%x\00\00"
define i32 @zz_inttohex(i32 %0) {
%2 = tail call dereferenceable_or_null(20) i8* @calloc(i32 20, i32 1)
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %2, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = ptrtoint i8* %2 to i64
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void die(char *f) {
  perror(f);
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
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):
<die>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @die(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 @die(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ pem_password_cb;
typedef int /*<<< orphan*/ RSA;
typedef int /*<<< orphan*/ FILE;
typedef int /*<<< orphan*/ EVP_PKEY;

/* Variables and functions */
int /*<<< orphan*/ *PEM_read_PrivateKey(int /*<<< orphan*/ *,
                                        int /*<<< orphan*/ *,
                                        int /*<<< orphan*/ *, void *);
int /*<<< orphan*/ *pkey_get_rsa(int /*<<< orphan*/ *, int /*<<< orphan*/ **);
RSA *PEM_read_RSAPrivateKey(FILE *fp, RSA **rsa, pem_password_cb *cb, void *u) {
  EVP_PKEY *pktmp;
  pktmp = PEM_read_PrivateKey(fp, NULL, cb, u);
  return pkey_get_rsa(pktmp, rsa);
}


x86 assembly (clang, -O0):
<PEM_read_RSAPrivateKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%esi
call   1040 <PEM_read_PrivateKey@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <pkey_get_rsa@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PEM_read_RSAPrivateKey>:
push   %rbx
mov    %rsi,%rbx
xor    %esi,%esi
call   1040 <PEM_read_PrivateKey@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <pkey_get_rsa@plt>

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

LLVM IR (-O2):
define i32* @PEM_read_RSAPrivateKey(i32* %0, i32** %1, i32* %2, i8* %3) {
%5 = tail call i32* @PEM_read_PrivateKey(i32* %0, i32* null, i32* %2, i8* %3)
%6 = tail call i32* @pkey_get_rsa(i32* %5, i32** %1)
ret i32* %6
}
void _set_off(unsigned char *u) { u[3] |= (1 << 4); }


x86 assembly (clang, -O0):
<_set_off>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%ecx
or     $0x10,%ecx
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_set_off>:
orb    $0x10,0x3(%rdi)
ret

LLVM IR (-O0):
define void @_set_off(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 3
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = or i32 %6, 16
%8 = trunc i32 %7 to i8
store i8 %8, i8* %4
ret void
}

LLVM IR (-O2):
define void @_set_off(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = or i8 %3, 16
store i8 %4, i8* %2
ret void
}