xunge/DecIR huggingface dataset:
unsigned int READ_CHAR_AS_INT(unsigned char *ptr, unsigned int offset) {
  return (ptr[offset] + ((unsigned int)ptr[offset + 1] << 8) +
          ((unsigned int)ptr[offset + 2] << 16) +
          ((unsigned int)ptr[offset + 3] << 24));
}


x86 assembly (clang, -O0):
<READ_CHAR_AS_INT>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movzbl (%rax,%rcx,1),%eax
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%edx
add    $0x1,%edx
mov    %edx,%edx
movzbl (%rcx,%rdx,1),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%edx
add    $0x2,%edx
mov    %edx,%edx
movzbl (%rcx,%rdx,1),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%edx
add    $0x3,%edx
mov    %edx,%edx
movzbl (%rcx,%rdx,1),%ecx
shl    $0x18,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<READ_CHAR_AS_INT>:
mov    %esi,%eax
movzbl (%rdi,%rax,1),%eax
lea    0x1(%rsi),%ecx
movzbl (%rdi,%rcx,1),%ecx
shl    $0x8,%ecx
or     %eax,%ecx
lea    0x2(%rsi),%eax
movzbl (%rdi,%rax,1),%edx
shl    $0x10,%edx
or     %ecx,%edx
add    $0x3,%esi
movzbl (%rdi,%rsi,1),%eax
shl    $0x18,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @READ_CHAR_AS_INT(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 = zext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = load i8*, i8** %3
%12 = load i32, i32* %4
%13 = add i32 %12, 1
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %11, i64 %14
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = add i32 %10, %18
%20 = load i8*, i8** %3
%21 = load i32, i32* %4
%22 = add i32 %21, 2
%23 = zext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %20, i64 %23
%25 = load i8, i8* %24
%26 = zext i8 %25 to i32
%27 = shl i32 %26, 16
%28 = add i32 %19, %27
%29 = load i8*, i8** %3
%30 = load i32, i32* %4
%31 = add i32 %30, 3
%32 = zext i32 %31 to i64
%33 = getelementptr inbounds i8, i8* %29, i64 %32
%34 = load i8, i8* %33
%35 = zext i8 %34 to i32
%36 = shl i32 %35, 24
%37 = add i32 %28, %36
ret i32 %37
}

LLVM IR (-O2):
define i32 @READ_CHAR_AS_INT(i8* nocapture %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = add i32 %1, 1
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 8
%13 = or i32 %12, %6
%14 = add i32 %1, 2
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %0, i64 %15
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = shl nuw nsw i32 %18, 16
%20 = or i32 %13, %19
%21 = add i32 %1, 3
%22 = zext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %0, i64 %22
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = shl nuw i32 %25, 24
%27 = or i32 %20, %26
ret i32 %27
}
int *some_function(int *x) { return x; }


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

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

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

LLVM IR (-O2):
define i32* @some_function(i32* readnone returned %0) {
ret i32* %0
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
void input(int c[], int size) {
  int i;
  for (i = 0; i < size; i++)
    scanf("%d ", &c[i]);
}


x86 assembly (clang, -O0):
<input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115b <input+0x4b>
mov    -0x8(%rbp),%rsi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xeb8(%rip),%rdi
call   1030 <scanf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <input+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<input>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1145 <input+0x35>
mov    %rdi,%rbx
mov    %esi,%r15d
lea    0xeda(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <scanf@plt>
add    $0x4,%rbx
add    $0xffffffffffffffff,%r15
jne    1130 <input+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @input(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = tail call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %8)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}
float *retract_vector(v, old_nl, old_nh, new_nh)
float *v;
register int old_nl, old_nh, new_nh;
{
  register float *new_v;
  new_v = (float *)gp_realloc(
      (void *)(v + old_nl),
      (unsigned long)(new_nh - old_nl + 1) * sizeof(float), "retract vector");
  return new_v - old_nl;
}


x86 assembly (clang, -O0):
<retract_vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x14(%rbp),%eax
sub    -0xc(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rsi
shl    $0x2,%rsi
lea    0xeb5(%rip),%rdx
mov    $0x0,%al
call   1030 <gp_realloc@plt>
cltq
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movslq -0xc(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<retract_vector>:
push   %rbx
movslq %esi,%rax
lea    (%rdi,%rax,4),%rdi
lea    0x0(,%rax,4),%rbx
sub    %eax,%ecx
add    $0x1,%ecx
movslq %ecx,%rsi
shl    $0x2,%rsi
lea    0xecd(%rip),%rdx
xor    %eax,%eax
call   1030 <gp_realloc@plt>
cltq
sub    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"retract vector\00"
define float* @retract_vector(float* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca float*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca float*
store float* %0, float** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load float*, float** %5
%11 = load i32, i32* %6
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds float, float* %10, i64 %12
%14 = bitcast float* %13 to i8*
%15 = load i32, i32* %8
%16 = load i32, i32* %6
%17 = sub nsw i32 %15, %16
%18 = add nsw i32 %17, 1
%19 = sext i32 %18 to i64
%20 = mul i64 %19, 4
%21 = call i32 (i8*, i64, i8*, ...) bitcast (i32 (...)* @gp_realloc to i32 (i8*, i64, i8*, ...)*)(i8* %14, i64 %20, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%22 = sext i32 %21 to i64
%23 = inttoptr i64 %22 to float*
store float* %23, float** %9
%24 = load float*, float** %9
%25 = load i32, i32* %6
%26 = sext i32 %25 to i64
%27 = sub i64 0, %26
%28 = getelementptr inbounds float, float* %24, i64 %27
ret float* %28
}

LLVM IR (-O2):
@.str = [15 x i8] c"retract vector\00"
define float* @retract_vector(float* %0, i32 %1, i32 %2, i32 %3) {
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds float, float* %0, i64 %5
%7 = bitcast float* %6 to i8*
%8 = sub i32 1, %1
%9 = add i32 %8, %3
%10 = sext i32 %9 to i64
%11 = shl nsw i64 %10, 2
%12 = tail call i32 (i8*, i64, i8*, ...) bitcast (i32 (...)* @gp_realloc to i32 (i8*, i64, i8*, ...)*)(i8* %7, i64 %11, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to float*
%15 = sub nsw i64 0, %5
%16 = getelementptr inbounds float, float* %14, i64 %15
ret float* %16
}
__attribute__((weak)) void fd_nrf8001_write_dynamic_data_continue(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define weak void @fd_nrf8001_write_dynamic_data_continue() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *name) {
  fprintf(stderr,
          "usage: %s [OPTION]... LINE\n"
          "\n"
          "Do an incremental search on the given line and write the index of "
          "the first\n"
          "match to stdout.\n"
          "\n"
          "  -b, --bash     output Bash shell commands to stdout\n"
          "  -z, --zsh      output Zsh shell commands to stdout\n"
          "  -k, --key=KEY  specify a key for --bash and --zsh\n"
          "  -h, --help     display this help and exit\n",
          name);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [326 x i8] c"usage: %s [OPTION]... LINE\0A\0ADo an incremental search on the given line and write the index of the first\0Amatch to stdout.\0A\0A -b, --bash output Bash shell commands to stdout\0A -z, --zsh output Zsh shell commands to stdout\0A -k, --key=KEY specify a key for --bash and --zsh\0A -h, --help display this help and exit\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([326 x i8], [326 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [326 x i8] c"usage: %s [OPTION]... LINE\0A\0ADo an incremental search on the given line and write the index of the first\0Amatch to stdout.\0A\0A -b, --bash output Bash shell commands to stdout\0A -z, --zsh output Zsh shell commands to stdout\0A -k, --key=KEY specify a key for --bash and --zsh\0A -h, --help display this help and exit\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([326 x i8], [326 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int bitcount(unsigned x) {
  int b = 0;
  while (x != 0) {
    x &= (x - 1);
    b++;
  }
  return b;
}


x86 assembly (clang, -O0):
<bitcount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1132 <bitcount+0x32>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <bitcount+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitcount>:
xor    %eax,%eax
test   %edi,%edi
je     111c <bitcount+0x1c>
cs nopw 0x0(%rax,%rax,1)
lea    -0x1(%rdi),%ecx
add    $0x1,%eax
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <bitcount+0x10>
ret

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

LLVM IR (-O2):
define i32 @bitcount(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add i32 %5, -1
%7 = and i32 %6, %5
%8 = add nuw nsw i32 %4, 1
%9 = icmp eq i32 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ cpu_to_le64(int /*<<< orphan*/);
void cpu_to_le64w(uint64_t *p, uint64_t v) { *p = cpu_to_le64(v); }


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

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

LLVM IR (-O0):
define void @cpu_to_le64w(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @cpu_to_le64(i32 %5)
%7 = load i32*, i32** %3
store i32 %6, i32* %7
ret void
}

LLVM IR (-O2):
define void @cpu_to_le64w(i32* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @cpu_to_le64(i32 %1)
store i32 %3, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *);
int fflush(void **f) {
  printk("Write fflush()\n");
  return 0;
}


x86 assembly (clang, -O0):
<fflush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <printk@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"Write fflush()\0A\00"
define i32 @fflush(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @printk(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Write fflush()\0A\00"
define i32 @fflush(i8** nocapture readnone %0) {
%2 = tail call i32 @printk(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char *CG_ConfigString(int);
int /*<<< orphan*/ CG_NewClientInfo(int);
void CG_RegisterClients(void) {
  int i;
  for (i = 0; i < 64; i++) {
    const char *clientInfo;
    clientInfo =
        CG_ConfigString(((((((64 + 256) + 256) + 32) + 1) + 64) + 16) + i);
    if (!clientInfo[0]) {
      continue;
    }
    CG_NewClientInfo(i);
  }
}


x86 assembly (clang, -O0):
<CG_RegisterClients>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x40,-0x4(%rbp)
jge    1173 <CG_RegisterClients+0x53>
mov    -0x4(%rbp),%edi
add    $0x2b1,%edi
call   1040 <CG_ConfigString@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    115d <CG_RegisterClients+0x3d>
jmp    1165 <CG_RegisterClients+0x45>
mov    -0x4(%rbp),%edi
call   1030 <CG_NewClientInfo@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <CG_RegisterClients+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_RegisterClients>:
push   %rbx
xor    %ebx,%ebx
jmp    1138 <CG_RegisterClients+0x18>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ebx
cmp    $0x40,%ebx
je     1151 <CG_RegisterClients+0x31>
lea    0x2b1(%rbx),%edi
call   1040 <CG_ConfigString@plt>
cmpb   $0x0,(%rax)
je     1130 <CG_RegisterClients+0x10>
mov    %ebx,%edi
call   1030 <CG_NewClientInfo@plt>
jmp    1130 <CG_RegisterClients+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @CG_RegisterClients() {
br label %1
1: ; preds = %0, %9
%2 = phi i32 [ 0, %0 ], [ %10, %9 ]
%3 = add nuw nsw i32 %2, 689
%4 = tail call i8* @CG_ConfigString(i32 %3)
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @CG_NewClientInfo(i32 %2)
br label %9
9: ; preds = %1, %7
%10 = add nuw nsw i32 %2, 1
%11 = icmp eq i32 %10, 64
br i1 %11, label %12, label %1
12: ; preds = %9
ret void
}
/* Variables and functions */
int core3_safe(char const *);
int U_EMRSETBKMODE_safe(const char *record) { return (core3_safe(record)); }


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

x86 assembly (clang, -O2):
<U_EMRSETBKMODE_safe>:
jmp    1030 <core3_safe@plt>

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

LLVM IR (-O2):
define i32 @U_EMRSETBKMODE_safe(i8* %0) {
%2 = tail call i32 @core3_safe(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "chkdirs [-n] dir ...\n");
  exit(255);
}


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    $0xff,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"chkdirs [-n] dir ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 255)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"chkdirs [-n] dir ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 255)
unreachable
}
int subtracao(int one_parameter, int second_paramater) {
  int resultado = 0;
  resultado = one_parameter - second_paramater;
  return resultado;
}


x86 assembly (clang, -O0):
<subtracao>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @subtracao(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = sub nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @subtracao(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int rand();
int dices(int quantity, int faces, int modifiers) {
  int i, temp = 0;
  for (i = 0; i < quantity; i++) {
    temp += ((rand() % faces) + 1);
  }
  return temp + modifiers;
}


x86 assembly (clang, -O0):
<dices>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115f <dices+0x4f>
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
add    $0x1,%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112f <dices+0x1f>
mov    -0x14(%rbp),%eax
add    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dices>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
test   %edi,%edi
jle    1147 <dices+0x37>
mov    %esi,%r15d
mov    %edi,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %r15d
add    %edx,%ebx
add    $0x1,%ebx
add    $0xffffffff,%ebp
jne    1130 <dices+0x20>
jmp    1149 <dices+0x39>
xor    %ebx,%ebx
add    %r14d,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @dices(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %14
5: ; preds = %3, %5
%6 = phi i32 [ %11, %5 ], [ 0, %3 ]
%7 = phi i32 [ %12, %5 ], [ 0, %3 ]
%8 = tail call i32 (...) @rand()
%9 = srem i32 %8, %1
%10 = add i32 %6, 1
%11 = add i32 %10, %9
%12 = add nuw nsw i32 %7, 1
%13 = icmp eq i32 %12, %0
br i1 %13, label %14, label %5
14: ; preds = %5, %3
%15 = phi i32 [ 0, %3 ], [ %11, %5 ]
%16 = add nsw i32 %15, %2
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ islower(int);
void t_islower_0x67() {
  Assert_real((islower(103)),
              "/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_islower.c",
              520, ("islower should be 1 for g"));
}


x86 assembly (clang, -O0):
<t_islower_0x67>:
push   %rbp
mov    %rsp,%rbp
mov    $0x67,%edi
call   1030 <islower@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x208,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_islower_0x67>:
push   %rax
mov    $0x67,%edi
call   1030 <islower@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x208,%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_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 1 for g\00"
define void @t_islower_0x67() {
%1 = call i32 @islower(i32 103)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 520, i8* getelementptr inbounds ([26 x i8], [26 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_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 1 for g\00"
define void @t_islower_0x67() {
%1 = tail call i32 @islower(i32 103)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 520, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
const char *mb_ver_string(void) { return "1.0.0042"; }


x86 assembly (clang, -O0):
<mb_ver_string>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mb_ver_string>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [9 x i8] c"1.0.0042\00"
define i8* @mb_ver_string() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [9 x i8] c"1.0.0042\00"
define i8* @mb_ver_string() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
int bitAndInvertwith(int sourceWord, int destinationWord) {
  return sourceWord & (~destinationWord);
}


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

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

LLVM IR (-O0):
define i32 @bitAndInvertwith(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 = xor i32 %6, -1
%8 = and i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @bitAndInvertwith(i32 %0, i32 %1) {
%3 = xor i32 %1, -1
%4 = and i32 %3, %0
ret i32 %4
}
/* Variables and functions */
double sqrt(double);
double ml_sqrt(double x) { return sqrt(x); }


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

x86 assembly (clang, -O2):
<ml_sqrt>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     111f <ml_sqrt+0xf>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define double @ml_sqrt(double %0) {
%2 = tail call double @sqrt(double %0)
ret double %2
}
int main() {
  int i = 123, j = 5, k;
  if (i == 1) {
    while (i <= 2) {
      while (j <= 3) {
        while (k <= 4) {
          if (i == 5) {
            while (i <= 6) {
              while (j <= 7) {
                while (k <= 8) {
                }
              }
            }
          }
        }
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x7b,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    11af <main+0xaf>
jmp    1128 <main+0x28>
cmpl   $0x2,-0x8(%rbp)
jg     11aa <main+0xaa>
jmp    1137 <main+0x37>
cmpl   $0x3,-0xc(%rbp)
jg     11a5 <main+0xa5>
jmp    1146 <main+0x46>
cmpl   $0x4,-0x10(%rbp)
jg     11a0 <main+0xa0>
cmpl   $0x5,-0x8(%rbp)
jne    119b <main+0x9b>
jmp    115f <main+0x5f>
cmpl   $0x6,-0x8(%rbp)
jg     1196 <main+0x96>
jmp    116e <main+0x6e>
cmpl   $0x7,-0xc(%rbp)
jg     1191 <main+0x91>
jmp    117d <main+0x7d>
cmpl   $0x8,-0x10(%rbp)
jg     118c <main+0x8c>
jmp    117d <main+0x7d>
jmp    116e <main+0x6e>
jmp    115f <main+0x5f>
jmp    119b <main+0x9b>
jmp    1146 <main+0x46>
jmp    1137 <main+0x37>
jmp    1128 <main+0x28>
jmp    11af <main+0xaf>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 123, i32* %2
store i32 5, i32* %3
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %42
7: ; preds = %0
br label %8
8: ; preds = %40, %7
%9 = load i32, i32* %2
%10 = icmp sle i32 %9, 2
br i1 %10, label %11, label %41
11: ; preds = %8
br label %12
12: ; preds = %39, %11
%13 = load i32, i32* %3
%14 = icmp sle i32 %13, 3
br i1 %14, label %15, label %40
15: ; preds = %12
br label %16
16: ; preds = %38, %15
%17 = load i32, i32* %4
%18 = icmp sle i32 %17, 4
br i1 %18, label %19, label %39
19: ; preds = %16
%20 = load i32, i32* %2
%21 = icmp eq i32 %20, 5
br i1 %21, label %22, label %38
22: ; preds = %19
br label %23
23: ; preds = %36, %22
%24 = load i32, i32* %2
%25 = icmp sle i32 %24, 6
br i1 %25, label %26, label %37
26: ; preds = %23
br label %27
27: ; preds = %35, %26
%28 = load i32, i32* %3
%29 = icmp sle i32 %28, 7
br i1 %29, label %30, label %36
30: ; preds = %27
br label %31
31: ; preds = %34, %30
%32 = load i32, i32* %4
%33 = icmp sle i32 %32, 8
br i1 %33, label %34, label %35
34: ; preds = %31
br label %31
35: ; preds = %31
br label %27
36: ; preds = %27
br label %23
37: ; preds = %23
br label %38
38: ; preds = %37, %19
br label %16
39: ; preds = %16
br label %12
40: ; preds = %12
br label %8
41: ; preds = %8
br label %42
42: ; preds = %41, %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void daemonFunc() {}


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

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

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

LLVM IR (-O2):
define void @daemonFunc() {
ret void
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ printf(char *);
int user_vlan_validation_callback(char *vlan_id) {
  int vlan_no = atoi(vlan_id);
  if (vlan_no > 0 && vlan_no < 4096)
    return 0;
  printf("Invalid vlan. Pls follow Help\n");
  return -1;
}


x86 assembly (clang, -O0):
<user_vlan_validation_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    115b <user_vlan_validation_callback+0x3b>
cmpl   $0x1000,-0x14(%rbp)
jge    115b <user_vlan_validation_callback+0x3b>
movl   $0x0,-0x4(%rbp)
jmp    116e <user_vlan_validation_callback+0x4e>
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<user_vlan_validation_callback>:
push   %rax
call   1040 <atoi@plt>
mov    %eax,%ecx
add    $0xffffffff,%ecx
xor    %eax,%eax
cmp    $0xfff,%ecx
jb     1146 <user_vlan_validation_callback+0x26>
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Invalid vlan. Pls follow Help\0A\00"
define i32 @user_vlan_validation_callback(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @atoi(i8* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 4096
br i1 %11, label %12, label %13
12: ; preds = %9
store i32 0, i32* %2
br label %15
13: ; preds = %9, %1
%14 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %15
15: ; preds = %13, %12
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@str = [30 x i8] c"Invalid vlan. Pls follow Help\00"
define i32 @user_vlan_validation_callback(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
%3 = add i32 %2, -1
%4 = icmp ult i32 %3, 4095
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
br label %7
7: ; preds = %1, %5
%8 = phi i32 [ -1, %5 ], [ 0, %1 ]
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
extern float secnds_vms(float *start) {
  struct tm *t;
  time_t hms;
}


x86 assembly (clang, -O0):
<secnds_vms>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.tm = type { i32 }
define float @secnds_vms(float* %0) {
%2 = alloca float
%3 = alloca float*
%4 = alloca %struct.tm*
%5 = alloca i32
store float* %0, float** %3
%6 = load float, float* %2
ret float %6
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define float @secnds_vms(float* nocapture readnone %0) {
ret float undef
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ execl(char *, char *, char *, char *, int /*<<< orphan*/);
int fork();
int spawn(char *cmd) {
  int pid;
  pid = fork();
  if (pid == 0) {
    execl("/bin/sh", "sh", "-c", cmd, 0);
    _exit(EXIT_FAILURE);
  }
  return pid;
}


x86 assembly (clang, -O0):
<spawn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <fork@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    117f <spawn+0x4f>
mov    -0x8(%rbp),%rcx
lea    0xea5(%rip),%rdi
lea    0xea3(%rip),%rsi
lea    0xe9f(%rip),%rdx
xor    %r8d,%r8d
call   1040 <execl@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1030 <_exit@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spawn>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <fork@plt>
test   %eax,%eax
je     1141 <spawn+0x11>
pop    %rbx
ret
lea    0xeb8(%rip),%rdi
lea    0xeb6(%rip),%rsi
lea    0xeb2(%rip),%rdx
mov    %rbx,%rcx
xor    %r8d,%r8d
call   1040 <execl@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"/bin/sh\00"
@.str.1 = [3 x i8] c"sh\00"
@.str.2 = [3 x i8] c"-c\00"
@EXIT_FAILURE = global i32 0
define i32 @spawn(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i32 (...) @fork()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @execl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %8, i32 0)
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @_exit(i32 %10)
unreachable
12: ; preds = %1
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@.str = [8 x i8] c"/bin/sh\00"
@.str.1 = [3 x i8] c"sh\00"
@.str.2 = [3 x i8] c"-c\00"
@EXIT_FAILURE = global i32 0
define i32 @spawn(i8* %0) {
%2 = tail call i32 (...) @fork()
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @execl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %0, i32 0)
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @_exit(i32 %6)
unreachable
8: ; preds = %1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/
UpnpResponse_RemoteIOClient_ChannelManager_RegisterChannel(void *);
int /*<<< orphan*/ printf(char *, char *, char *, int);
void UpnpRemoteIOClient_ChannelManager_RegisterChannel(void *upnptoken,
                                                       char *Name,
                                                       char *PeerConnection,
                                                       int Timeout) {
  printf("Invoke: "
         "UpnpRemoteIOClient_ChannelManager_RegisterChannel(%s,%s,%d);\r\n",
         Name, PeerConnection, Timeout);
  UpnpResponse_RemoteIOClient_ChannelManager_RegisterChannel(upnptoken);
}


x86 assembly (clang, -O0):
<UpnpRemoteIOClient_ChannelManager_RegisterChannel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <UpnpResponse_RemoteIOClient_ChannelManager_RegisterChannel@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UpnpRemoteIOClient_ChannelManager_RegisterChannel>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <UpnpResponse_RemoteIOClient_ChannelManager_RegisterChannel@plt>

LLVM IR (-O0):
@.str = [71 x i8] c"Invoke: UpnpRemoteIOClient_ChannelManager_RegisterChannel(%s,%s,%d);\0D\0A\00"
define void @UpnpRemoteIOClient_ChannelManager_RegisterChannel(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %6
%10 = load i8*, i8** %7
%11 = load i32, i32* %8
%12 = call i32 @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10, i32 %11)
%13 = load i8*, i8** %5
%14 = call i32 @UpnpResponse_RemoteIOClient_ChannelManager_RegisterChannel(i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [71 x i8] c"Invoke: UpnpRemoteIOClient_ChannelManager_RegisterChannel(%s,%s,%d);\0D\0A\00"
define void @UpnpRemoteIOClient_ChannelManager_RegisterChannel(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i32 %3)
%6 = tail call i32 @UpnpResponse_RemoteIOClient_ChannelManager_RegisterChannel(i8* %0)
ret void
}
/* Type definitions */
struct ByteStream {
  int dummy;
};

/* Variables and functions */
int initByteStreamWithSize(struct ByteStream *, int);
int initByteStream(struct ByteStream *stream) {
  return initByteStreamWithSize(stream, 1024);
}


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

x86 assembly (clang, -O2):
<initByteStream>:
mov    $0x400,%esi
jmp    1030 <initByteStreamWithSize@plt>

LLVM IR (-O0):
%struct.ByteStream = type { i32 }
define i32 @initByteStream(%struct.ByteStream* %0) {
%2 = alloca %struct.ByteStream*
store %struct.ByteStream* %0, %struct.ByteStream** %2
%3 = load %struct.ByteStream*, %struct.ByteStream** %2
%4 = call i32 @initByteStreamWithSize(%struct.ByteStream* %3, i32 1024)
ret i32 %4
}

LLVM IR (-O2):
%struct.ByteStream = type { i32 }
define i32 @initByteStream(%struct.ByteStream* %0) {
%2 = tail call i32 @initByteStreamWithSize(%struct.ByteStream* %0, i32 1024)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int G58_f(char *s) {
  debug("G58_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<G58_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<G58_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf05(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"G58_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G58_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [46 x i8] c"G58_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G58_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
int val_seg(int val) {
  int r = 0;
  val >>= 7;
  if (val & 0xf0) {
    val >>= 4;
    r += 4;
  }
  if (val & 0x0c) {
    val >>= 2;
    r += 2;
  }
  if (val & 0x02)
    r += 1;
  return r;
}


x86 assembly (clang, -O0):
<val_seg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x7,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf0,%eax
cmp    $0x0,%eax
je     113a <val_seg+0x3a>
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xc,%eax
cmp    $0x0,%eax
je     115b <val_seg+0x5b>
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     1173 <val_seg+0x73>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<val_seg>:
xor    %edx,%edx
test   $0x7800,%edi
setne  %dl
lea    0x0(,%rdx,4),%ecx
add    $0x7,%cl
sar    %cl,%edi
lea    0x0(,%rdx,4),%ecx
mov    %edi,%eax
shr    $0x2,%eax
test   $0xc,%dil
lea    0x2(,%rdx,4),%edx
cmove  %edi,%eax
cmove  %ecx,%edx
shr    %eax
and    $0x1,%eax
or     %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @val_seg(i32 %0) {
%2 = and i32 %0, 30720
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 7, i32 11
%5 = ashr i32 %0, %4
%6 = select i1 %3, i32 0, i32 4
%7 = and i32 %5, 12
%8 = icmp eq i32 %7, 0
%9 = lshr i32 %5, 2
%10 = or i32 %6, 2
%11 = select i1 %8, i32 %5, i32 %9
%12 = select i1 %8, i32 %6, i32 %10
%13 = lshr i32 %11, 1
%14 = and i32 %13, 1
%15 = or i32 %14, %12
ret i32 %15
}
void glTexParameterf(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glTexParameterf() {
ret void
}
/* Variables and functions */
int conveyMain(int, char **);
int main(int argc, char **argv) { return (conveyMain(argc, argv)); }


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <conveyMain@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @conveyMain(i32 %0, i8** %1)
ret i32 %3
}
int iscntrl(int ch) { return (ch >= 0x00 && ch <= 0x1F) || ch == 0x7F; }


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

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

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

LLVM IR (-O2):
define i32 @iscntrl(i32 %0) {
%2 = icmp ult i32 %0, 32
%3 = icmp eq i32 %0, 127
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ UpnpResponse_ContentDirectory_GetSearchCapabilities(void *,
                                                                       char *);
int /*<<< orphan*/ printf(char *);
void UpnpContentDirectory_GetSearchCapabilities(void *upnptoken) {
  printf("UPnP Invoke: UpnpContentDirectory_GetSearchCapabilities();\r\n");
  UpnpResponse_ContentDirectory_GetSearchCapabilities(upnptoken, "");
}


x86 assembly (clang, -O0):
<UpnpContentDirectory_GetSearchCapabilities>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
lea    0xef9(%rip),%rsi
call   1030 <UpnpResponse_ContentDirectory_GetSearchCapabilities@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UpnpContentDirectory_GetSearchCapabilities>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1040 <puts@plt>
lea    0xf04(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <UpnpResponse_ContentDirectory_GetSearchCapabilities@plt>

LLVM IR (-O0):
@.str = [61 x i8] c"UPnP Invoke: UpnpContentDirectory_GetSearchCapabilities();\0D\0A\00"
@.str.1 = [1 x i8] zeroinitializer
define void @UpnpContentDirectory_GetSearchCapabilities(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @UpnpResponse_ContentDirectory_GetSearchCapabilities(i8* %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [1 x i8] zeroinitializer
@str = [60 x i8] c"UPnP Invoke: UpnpContentDirectory_GetSearchCapabilities();\0D\00"
define void @UpnpContentDirectory_GetSearchCapabilities(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @UpnpResponse_ContentDirectory_GetSearchCapabilities(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void newUserFileCreator(char *userName) {
  printf("Inside new user file creator fun\n");
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"Inside new user file creator fun\0A\00"
define void @newUserFileCreator(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [33 x i8] c"Inside new user file creator fun\00"
define void @newUserFileCreator(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret void
}