xunge/DecIR huggingface dataset:
/* Type definitions */
struct stat {
  int st_size;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fileno(int /*<<< orphan*/ *);
int fstat(int, struct stat *);
int filesize(FILE *fd) {
  int fn;
  struct stat st;
  fn = fileno(fd);
  if (fn == -1)
    return -1;
  if (fstat(fn, &st) == -1)
    return -1;
  return st.st_size;
}


x86 assembly (clang, -O0):
<filesize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fileno@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    114e <filesize+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1175 <filesize+0x55>
mov    -0x14(%rbp),%edi
lea    -0x18(%rbp),%rsi
call   1040 <fstat@plt>
cmp    $0xffffffff,%eax
jne    116f <filesize+0x4f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1175 <filesize+0x55>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filesize>:
push   %rbx
sub    $0x10,%rsp
call   1030 <fileno@plt>
mov    $0xffffffff,%ebx
cmp    $0xffffffff,%eax
je     1149 <filesize+0x29>
lea    0x8(%rsp),%rsi
mov    %eax,%edi
call   1040 <fstat@plt>
cmp    $0xffffffff,%eax
je     1149 <filesize+0x29>
mov    0x8(%rsp),%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @filesize(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca %struct.stat
store i32* %0, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @fileno(i32* %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 -1, i32* %2
br label %19
11: ; preds = %1
%12 = load i32, i32* %4
%13 = call i32 @fstat(i32 %12, %struct.stat* %5)
%14 = icmp eq i32 %13, -1
br i1 %14, label %15, label %16
15: ; preds = %11
store i32 -1, i32* %2
br label %19
16: ; preds = %11
%17 = getelementptr inbounds %struct.stat, %struct.stat* %5, i32 0, i32 0
%18 = load i32, i32* %17
store i32 %18, i32* %2
br label %19
19: ; preds = %16, %15, %10
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @filesize(i32* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = tail call i32 @fileno(i32* %0)
%5 = icmp eq i32 %4, -1
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = call i32 @fstat(i32 %4, %struct.stat* %2)
%8 = icmp eq i32 %7, -1
br i1 %8, label %12, label %9
9: ; preds = %6
%10 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%11 = load i32, i32* %10
br label %12
12: ; preds = %6, %1, %9
%13 = phi i32 [ %11, %9 ], [ -1, %1 ], [ -1, %6 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void from_fini(void) { puts("called from fini"); }


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

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

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

LLVM IR (-O2):
@.str = [17 x i8] c"called from fini\00"
define void @from_fini() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
unsigned long get_timestamp(void) {
  struct timeval tv;
  unsigned long ret;
  gettimeofday(&tv, NULL);
  ret = tv.tv_sec * 1000000 + tv.tv_usec;
  return ret;
}


x86 assembly (clang, -O0):
<get_timestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x8(%rbp),%eax
add    -0x4(%rbp),%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_timestamp>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq (%rsp),%rax
imul   $0xf4240,%rax,%rcx
movslq 0x4(%rsp),%rax
add    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i64 @get_timestamp() {
%1 = alloca %struct.timeval
%2 = alloca i64
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
%10 = sext i32 %9 to i64
store i64 %10, i64* %2
%11 = load i64, i64* %2
ret i64 %11
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i64 @get_timestamp() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
%10 = sext i32 %9 to i64
ret i64 %10
}
void socfpga_cyclone5_timer_init(void) { return; }


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

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

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

LLVM IR (-O2):
define void @socfpga_cyclone5_timer_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pb_update();
int /*<<< orphan*/ printf(char *);
void pb_dispose() {
  pb_update();
  printf("\nc\n");
}


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

x86 assembly (clang, -O2):
<pb_dispose>:
push   %rax
xor    %eax,%eax
call   1030 <pb_update@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"\0Ac\0A\00"
define void @pb_dispose() {
%1 = call i32 (...) @pb_update()
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [3 x i8] c"\0Ac\00"
define void @pb_dispose() {
%1 = tail call i32 (...) @pb_update()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int SIGKILL;
int SIGUSR1;
int /*<<< orphan*/ printf(char *);
void sig_handler(int signo) {
  if (signo == SIGUSR1)
    printf("received SIGUSR1\n");
  else if (signo == SIGKILL)
    printf("received SIGKILL\n");
  else
    printf("received SIGSTOP\n");
}


x86 assembly (clang, -O0):
<sig_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ec3(%rip),%rcx
cmp    (%rcx),%eax
jne    113e <sig_handler+0x2e>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
jmp    1172 <sig_handler+0x62>
mov    -0x4(%rbp),%eax
mov    0x2e90(%rip),%rcx
cmp    (%rcx),%eax
jne    1161 <sig_handler+0x51>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
jmp    116d <sig_handler+0x5d>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
jmp    1172 <sig_handler+0x62>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_handler>:
mov    0x2ed1(%rip),%rax
mov    0x2eba(%rip),%rcx
cmp    %edi,(%rcx)
lea    0xeea(%rip),%rcx
lea    0xed2(%rip),%rdx
cmove  %rcx,%rdx
cmp    %edi,(%rax)
lea    0xee7(%rip),%rdi
cmovne %rdx,%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@SIGUSR1 = global i32 0
@.str = [18 x i8] c"received SIGUSR1\0A\00"
@SIGKILL = global i32 0
@.str.1 = [18 x i8] c"received SIGKILL\0A\00"
@.str.2 = [18 x i8] c"received SIGSTOP\0A\00"
define void @sig_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGUSR1
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %17
8: ; preds = %1
%9 = load i32, i32* %2
%10 = load i32, i32* @SIGKILL
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %16
14: ; preds = %8
%15 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
br label %16
16: ; preds = %14, %12
br label %17
17: ; preds = %16, %6
ret void
}

LLVM IR (-O2):
@SIGUSR1 = global i32 0
@SIGKILL = global i32 0
@str = [17 x i8] c"received SIGSTOP\00"
@str.3 = [17 x i8] c"received SIGKILL\00"
@str.4 = [17 x i8] c"received SIGUSR1\00"
define void @sig_handler(i32 %0) {
%2 = load i32, i32* @SIGUSR1
%3 = icmp eq i32 %2, %0
%4 = load i32, i32* @SIGKILL
%5 = icmp eq i32 %4, %0
%6 = select i1 %5, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0)
%7 = select i1 %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @str.4, i64 0, i64 0), i8* %6
%8 = tail call i32 @puts(i8* dereferenceable(1) %7)
ret void
}
void RandomFunc(unsigned int input[1], unsigned int output[1]) {
  unsigned int state[1];
  unsigned int local1;
  {
    state[0UL] = input[0UL] + 4284877637U;
    local1 = 0UL;
    while (local1 < 1UL) {
      state[local1] += state[local1];
      local1 += 2UL;
    }
    output[0UL] = state[0UL] + 809088178UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0xff660b45,%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    $0x1,%rax
jae    114f <RandomFunc+0x4f>
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp,%rax,4),%ecx
mov    -0x18(%rbp),%eax
add    -0x14(%rbp,%rax,4),%ecx
mov    %ecx,-0x14(%rbp,%rax,4)
mov    -0x18(%rbp),%eax
add    $0x2,%rax
mov    %eax,-0x18(%rbp)
jmp    1121 <RandomFunc+0x21>
mov    -0x14(%rbp),%eax
add    $0x3039b4b2,%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    (%rdi),%eax
add    %eax,%eax
add    $0x2f05cb3c,%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [1 x i32]
%6 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
%10 = add i32 %9, -10089659
%11 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
store i32 %10, i32* %11
store i32 0, i32* %6
br label %12
12: ; preds = %16, %2
%13 = load i32, i32* %6
%14 = zext i32 %13 to i64
%15 = icmp ult i64 %14, 1
br i1 %15, label %16, label %30
16: ; preds = %12
%17 = load i32, i32* %6
%18 = zext i32 %17 to i64
%19 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 %18
%20 = load i32, i32* %19
%21 = load i32, i32* %6
%22 = zext i32 %21 to i64
%23 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 %22
%24 = load i32, i32* %23
%25 = add i32 %24, %20
store i32 %25, i32* %23
%26 = load i32, i32* %6
%27 = zext i32 %26 to i64
%28 = add i64 %27, 2
%29 = trunc i64 %28 to i32
store i32 %29, i32* %6
br label %12
30: ; preds = %12
%31 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%32 = load i32, i32* %31
%33 = zext i32 %32 to i64
%34 = add i64 %33, 809088178
%35 = trunc i64 %34 to i32
%36 = load i32*, i32** %4
%37 = getelementptr inbounds i32, i32* %36, i64 0
store i32 %35, i32* %37
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = shl i32 %3, 1
%5 = add i32 %4, 788908860
store i32 %5, i32* %1
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int f(int);
int main() {
  int x = __VERIFIER_nondet_int();
  int count = f(x);
  return count;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 @f(i32 %1)
ret i32 %2
}
/* Variables and functions */
int inp_emulate(int);
char TOSH_READ_RFM_CTL1_PIN() { return 0x01 & (inp_emulate(0x44) >> 6); }


x86 assembly (clang, -O0):
<TOSH_READ_RFM_CTL1_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x44,%edi
call   1030 <inp_emulate@plt>
sar    $0x6,%eax
and    $0x1,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_READ_RFM_CTL1_PIN>:
push   %rax
mov    $0x44,%edi
call   1030 <inp_emulate@plt>
shr    $0x6,%al
and    $0x1,%al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @TOSH_READ_RFM_CTL1_PIN() {
%1 = call i32 @inp_emulate(i32 68)
%2 = ashr i32 %1, 6
%3 = and i32 1, %2
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @TOSH_READ_RFM_CTL1_PIN() {
%1 = tail call i32 @inp_emulate(i32 68)
%2 = trunc i32 %1 to i8
%3 = lshr i8 %2, 6
%4 = and i8 %3, 1
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ print_ftime(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sleep(int);
int main(int argc, char *argv[]) {
  printf("argv[0] = %s\n", argv[0]);
  sleep(2);
  print_ftime(argv[0]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1050 <sleep@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <print_ftime@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
mov    (%rsi),%rsi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1050 <sleep@plt>
mov    (%rbx),%rdi
call   1040 <print_ftime@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"argv[0] = %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 @sleep(i32 2)
%6 = load i8*, i8** %1
%7 = tail call i32 @print_ftime(i8* %6)
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int *ivector(int nl, int nh) {
  int *v;
  v = (int *)malloc((size_t)((nh - nl + 1) * sizeof(int)));
  if (!v)
    return NULL;
  return v - nl;
}


x86 assembly (clang, -O0):
<ivector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rdi
shl    $0x2,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    114f <ivector+0x3f>
movq   $0x0,-0x8(%rbp)
jmp    1167 <ivector+0x57>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ivector>:
push   %rbx
mov    %edi,%ebx
sub    %edi,%esi
add    $0x1,%esi
movslq %esi,%rdi
shl    $0x2,%rdi
call   1030 <malloc@plt>
movslq %ebx,%rcx
shl    $0x2,%rcx
mov    %rax,%rdx
sub    %rcx,%rdx
test   %rax,%rax
cmovne %rdx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i32* @ivector(i32 %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = sub nsw i32 %7, %8
%10 = add nsw i32 %9, 1
%11 = sext i32 %10 to i64
%12 = mul i64 %11, 4
%13 = call i64 @malloc(i64 %12)
%14 = inttoptr i64 %13 to i32*
store i32* %14, i32** %6
%15 = load i32*, i32** %6
%16 = icmp ne i32* %15, null
br i1 %16, label %18, label %17
17: ; preds = %2
store i32* null, i32** %3
br label %24
18: ; preds = %2
%19 = load i32*, i32** %6
%20 = load i32, i32* %4
%21 = sext i32 %20 to i64
%22 = sub i64 0, %21
%23 = getelementptr inbounds i32, i32* %19, i64 %22
store i32* %23, i32** %3
br label %24
24: ; preds = %18, %17
%25 = load i32*, i32** %3
ret i32* %25
}

LLVM IR (-O2):
define i32* @ivector(i32 %0, i32 %1) {
%3 = sub i32 1, %0
%4 = add i32 %3, %1
%5 = sext i32 %4 to i64
%6 = shl nsw i64 %5, 2
%7 = tail call i64 @malloc(i64 %6)
%8 = icmp eq i64 %7, 0
%9 = inttoptr i64 %7 to i32*
%10 = sext i32 %0 to i64
%11 = sub nsw i64 0, %10
%12 = getelementptr inbounds i32, i32* %9, i64 %11
%13 = select i1 %8, i32* null, i32* %12
ret i32* %13
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void coredump_handler(int signum) {
  void *array[10];
  size_t size;
  fprintf(stderr, "Error: signal %d:\n", signum);
  exit(1);
}


x86 assembly (clang, -O0):
<coredump_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<coredump_handler>:
push   %rax
mov    %edi,%edx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"Error: signal %d:\0A\00"
define void @coredump_handler(i32 %0) {
%2 = alloca i32
%3 = alloca [10 x i8*]
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* @stderr
%6 = load i32, i32* %2
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"Error: signal %d:\0A\00"
define void @coredump_handler(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
yyErr(n, l) { yyAbort(n, "actions", l); }


x86 assembly (clang, -O0):
<yyErr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%edx
lea    0xed5(%rip),%rsi
mov    $0x0,%al
call   1030 <yyAbort@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yyErr>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
xor    %eax,%eax
jmp    1030 <yyAbort@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"actions\00"
define i32 @yyErr(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* %4
%7 = load i32, i32* %5
%8 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @yyAbort to i32 (i32, i8*, i32, ...)*)(i32 %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
@.str = [8 x i8] c"actions\00"
define i32 @yyErr(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @yyAbort to i32 (i32, i8*, i32, ...)*)(i32 %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_poly1305_sub(uintptr_t, uintptr_t, uintptr_t);
void fiat_poly1305_sub(uint64_t out1[3], const uint64_t arg1[3],
                       const uint64_t arg2[3]) {
  internal_fiat_poly1305_sub((uintptr_t)out1, (uintptr_t)arg1, (uintptr_t)arg2);
}


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

x86 assembly (clang, -O2):
<fiat_poly1305_sub>:
jmp    1030 <internal_fiat_poly1305_sub@plt>

LLVM IR (-O0):
define void @fiat_poly1305_sub(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = load i32*, i32** %5
%10 = ptrtoint i32* %9 to i64
%11 = load i32*, i32** %6
%12 = ptrtoint i32* %11 to i64
%13 = call i32 @internal_fiat_poly1305_sub(i64 %8, i64 %10, i64 %12)
ret void
}

LLVM IR (-O2):
define void @fiat_poly1305_sub(i32* %0, i32* %1, i32* %2) {
%4 = ptrtoint i32* %0 to i64
%5 = ptrtoint i32* %1 to i64
%6 = ptrtoint i32* %2 to i64
%7 = tail call i32 @internal_fiat_poly1305_sub(i64 %4, i64 %5, i64 %6)
ret void
}
/* Variables and functions */
scalar_t__ Pmember();
scalar_t__ PnameRef();
PnetNameRef() {
  int b = -1;
  ;
  b = PnameRef() || Pmember();
  return (b);
}


x86 assembly (clang, -O0):
<PnetNameRef>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffffff,-0x4(%rbp)
mov    $0x0,%al
call   1040 <PnameRef@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1159 <PnetNameRef+0x39>
mov    $0x0,%al
call   1030 <Pmember@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PnetNameRef>:
push   %rax
xor    %eax,%eax
call   1040 <PnameRef@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <PnetNameRef+0x17>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <Pmember@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @PnetNameRef() {
%1 = alloca i32
store i32 -1, i32* %1
%2 = call i64 (...) @PnameRef()
%3 = icmp ne i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = call i64 (...) @Pmember()
%6 = icmp ne i64 %5, 0
br label %7
7: ; preds = %4, %0
%8 = phi i1 [ true, %0 ], [ %6, %4 ]
%9 = zext i1 %8 to i32
store i32 %9, i32* %1
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @PnetNameRef() {
%1 = tail call i64 (...) @PnameRef()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i64 (...) @Pmember()
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 1, %0 ], [ %6, %3 ]
ret i32 %8
}
double _dneg(int bh, int bl) {
  int aa[2];
  if (bh == 0 && bl == 0)
    aa[0] = aa[1] = 0;
  else {
    aa[0] = bh ^ 0x80000000;
    aa[1] = bl;
  }
  return *(double *)aa;
}


x86 assembly (clang, -O0):
<_dneg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1131 <_dneg+0x31>
cmpl   $0x0,-0x8(%rbp)
jne    1131 <_dneg+0x31>
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
jmp    1142 <_dneg+0x42>
mov    -0x4(%rbp),%eax
xor    $0x80000000,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dneg>:
mov    %esi,%eax
or     %edi,%eax
pxor   %xmm0,%xmm0
je     111c <_dneg+0x1c>
xor    $0x80000000,%edi
shl    $0x20,%rsi
or     %rdi,%rsi
movq   %rsi,%xmm0
ret

LLVM IR (-O0):
define double @_dneg(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [2 x i32]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
store i32 0, i32* %12
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
store i32 0, i32* %13
br label %20
14: ; preds = %8, %2
%15 = load i32, i32* %3
%16 = xor i32 %15, -2147483648
%17 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
store i32 %16, i32* %17
%18 = load i32, i32* %4
%19 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
store i32 %18, i32* %19
br label %20
20: ; preds = %14, %11
%21 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%22 = bitcast i32* %21 to double*
%23 = load double, double* %22
ret double %23
}

LLVM IR (-O2):
define double @_dneg(i32 %0, i32 %1) {
%3 = or i32 %1, %0
%4 = icmp eq i32 %3, 0
%5 = xor i32 %0, -2147483648
%6 = zext i32 %5 to i64
%7 = zext i32 %1 to i64
%8 = shl nuw i64 %7, 32
%9 = or i64 %8, %6
%10 = bitcast i64 %9 to double
%11 = select i1 %4, double 0.000000e+00, double %10
ret double %11
}
f(cp, end) char *cp;
char *end;
{ return (cp < end); }


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

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

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

LLVM IR (-O2):
define i32 @f(i8* readnone %0, i8* readnone %1) {
%3 = icmp ult i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
size_t cyoBaseXXDecodeGetLength(size_t size, size_t inputBytes,
                                size_t outputBytes) {
  if (size % inputBytes != 0)
    return 0;
  return (((size + inputBytes - 1) / inputBytes) * outputBytes) + 1;
}


x86 assembly (clang, -O0):
<cyoBaseXXDecodeGetLength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
cmp    $0x0,%rdx
je     1133 <cyoBaseXXDecodeGetLength+0x33>
movq   $0x0,-0x8(%rbp)
jmp    1154 <cyoBaseXXDecodeGetLength+0x54>
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
sub    $0x1,%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
imul   -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cyoBaseXXDecodeGetLength>:
mov    %rdx,%rcx
mov    %rdi,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     111f <cyoBaseXXDecodeGetLength+0x1f>
mov    %rdi,%rax
xor    %edx,%edx
div    %rsi
test   %rdx,%rdx
je     112a <cyoBaseXXDecodeGetLength+0x2a>
xor    %eax,%eax
ret
mov    %edi,%eax
xor    %edx,%edx
div    %esi
test   %rdx,%rdx
jne    111c <cyoBaseXXDecodeGetLength+0x1c>
lea    (%rdi,%rsi,1),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,%rdx
or     %rsi,%rdx
shr    $0x20,%rdx
je     1145 <cyoBaseXXDecodeGetLength+0x45>
xor    %edx,%edx
div    %rsi
jmp    1149 <cyoBaseXXDecodeGetLength+0x49>
xor    %edx,%edx
div    %esi
imul   %rcx,%rax
add    $0x1,%rax
ret

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

LLVM IR (-O2):
define i64 @cyoBaseXXDecodeGetLength(i64 %0, i64 %1, i64 %2) {
%4 = urem i64 %0, %1
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = add i64 %0, -1
%8 = add i64 %7, %1
%9 = udiv i64 %8, %1
%10 = mul i64 %9, %2
%11 = add i64 %10, 1
br label %12
12: ; preds = %3, %6
%13 = phi i64 [ %11, %6 ], [ 0, %3 ]
ret i64 %13
}
/* Variables and functions */
int unwatch_listen();
int unwatch_oids(int, char **);
int cmd_unwatch(int argc, char **argv) {
  if (argc)
    return unwatch_oids(argc, argv);
  else
    return unwatch_listen();
}


x86 assembly (clang, -O0):
<cmd_unwatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     114d <cmd_unwatch+0x2d>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <unwatch_oids@plt>
mov    %eax,-0x4(%rbp)
jmp    1157 <cmd_unwatch+0x37>
mov    $0x0,%al
call   1030 <unwatch_listen@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_unwatch>:
test   %edi,%edi
je     1129 <cmd_unwatch+0x9>
jmp    1040 <unwatch_oids@plt>
xor    %eax,%eax
jmp    1030 <unwatch_listen@plt>

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

LLVM IR (-O2):
define i32 @cmd_unwatch(i32 %0, i8** %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @unwatch_oids(i32 %0, i8** %1)
br label %8
6: ; preds = %2
%7 = tail call i32 (...) @unwatch_listen()
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ %5, %4 ], [ %7, %6 ]
ret i32 %9
}
/* Variables and functions */
int addUser(int, char *);
int /*<<< orphan*/ handleAckNack(int, char);
int handleLogIn(int fd, char *msg) {
  if (addUser(fd, msg) == 0)
    handleAckNack(fd, '2');
  else if (addUser(fd, msg) == 1)
    handleAckNack(fd, '1');
  else
    handleAckNack(fd, '4');
}


x86 assembly (clang, -O0):
<handleLogIn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <addUser@plt>
cmp    $0x0,%eax
jne    1156 <handleLogIn+0x36>
mov    -0x8(%rbp),%edi
mov    $0x32,%esi
call   1040 <handleAckNack@plt>
jmp    118f <handleLogIn+0x6f>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <addUser@plt>
cmp    $0x1,%eax
jne    117d <handleLogIn+0x5d>
mov    -0x8(%rbp),%edi
mov    $0x31,%esi
call   1040 <handleAckNack@plt>
jmp    118a <handleLogIn+0x6a>
mov    -0x8(%rbp),%edi
mov    $0x34,%esi
call   1040 <handleAckNack@plt>
jmp    118f <handleLogIn+0x6f>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handleLogIn>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1030 <addUser@plt>
test   %eax,%eax
je     114b <handleLogIn+0x2b>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <addUser@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
setne  %cl
lea    (%rcx,%rcx,2),%eax
add    $0x31,%eax
jmp    114d <handleLogIn+0x2d>
mov    $0x32,%al
movsbl %al,%esi
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <handleAckNack@plt>

LLVM IR (-O0):
define i32 @handleLogIn(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
%6 = load i32, i32* %4
%7 = load i8*, i8** %5
%8 = call i32 @addUser(i32 %6, i8* %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* %4
%12 = call i32 @handleAckNack(i32 %11, i8 signext 50)
br label %25
13: ; preds = %2
%14 = load i32, i32* %4
%15 = load i8*, i8** %5
%16 = call i32 @addUser(i32 %14, i8* %15)
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %21
18: ; preds = %13
%19 = load i32, i32* %4
%20 = call i32 @handleAckNack(i32 %19, i8 signext 49)
br label %24
21: ; preds = %13
%22 = load i32, i32* %4
%23 = call i32 @handleAckNack(i32 %22, i8 signext 52)
br label %24
24: ; preds = %21, %18
br label %25
25: ; preds = %24, %10
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @handleLogIn(i32 %0, i8* %1) {
%3 = tail call i32 @addUser(i32 %0, i8* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @addUser(i32 %0, i8* %1)
%7 = icmp eq i32 %6, 1
%8 = select i1 %7, i8 49, i8 52
br label %9
9: ; preds = %5, %2
%10 = phi i8 [ 50, %2 ], [ %8, %5 ]
%11 = tail call i32 @handleAckNack(i32 %0, i8 signext %10)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ ftp_module_destr();
int /*<<< orphan*/ http_module_destr();
void preprocessor_destr() {
  http_module_destr();
  ftp_module_destr();
}


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

x86 assembly (clang, -O2):
<preprocessor_destr>:
push   %rax
xor    %eax,%eax
call   1040 <http_module_destr@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <ftp_module_destr@plt>

LLVM IR (-O0):
define void @preprocessor_destr() {
%1 = call i32 (...) @http_module_destr()
%2 = call i32 (...) @ftp_module_destr()
ret void
}

LLVM IR (-O2):
define void @preprocessor_destr() {
%1 = tail call i32 (...) @http_module_destr()
%2 = tail call i32 (...) @ftp_module_destr()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putc(int);
void puts(char *s) {
  while (*s)
    putc(*s++);
  putc(10);
}


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

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

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

LLVM IR (-O2):
define void @puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @putc(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
%13 = tail call i32 @putc(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void print_help() {
  fprintf(stdout,
          "fastq-qualadj [OPTION]... OFFSET [FILE]...\n"
          "The given offset is added to each and every quality score, where\n"
          "the offset may be negative.\n"
          "Options:\n"
          "  -h, --help              print this message\n"
          "  -V, --version           output version information and exit\n");
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_help>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [253 x i8] c"fastq-qualadj [OPTION]... OFFSET [FILE]...\0AThe given offset is added to each and every quality score, where\0Athe offset may be negative.\0AOptions:\0A -h, --help print this message\0A -V, --version output version information and exit\0A\00"
define void @print_help() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([253 x i8], [253 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [253 x i8] c"fastq-qualadj [OPTION]... OFFSET [FILE]...\0AThe given offset is added to each and every quality score, where\0Athe offset may be negative.\0AOptions:\0A -h, --help print this message\0A -V, --version output version information and exit\0A\00"
define void @print_help() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([253 x i8], [253 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ root;
};
struct TYPE_4__ {
  TYPE_1__ xkey;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned long get_XEvent_xkey_root(void *_p) {
  return (unsigned long)((XEvent *)_p)->xkey.root;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i64 @get_XEvent_xkey_root(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @get_XEvent_xkey_root(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Type definitions */
typedef int uint64_t;
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
uint64_t _now64_us(void) {
  struct timespec now;
  clock_gettime(CLOCK_MONOTONIC, &now);
  return now.tv_sec * 1000000 + now.tv_nsec / 1000;
}


x86 assembly (clang, -O0):
<_now64_us>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
imul   $0xf4240,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_now64_us>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
imul   $0xf4240,(%rsp),%ecx
movslq 0x4(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
@CLOCK_MONOTONIC = global i32 0
define i32 @_now64_us() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
@CLOCK_MONOTONIC = global i32 0
define i32 @_now64_us() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 1000
%11 = add nsw i32 %10, %7
ret i32 %11
}
int is_set(volatile unsigned char reg, unsigned char flag) {
  unsigned char tmp = reg & flag;
  return flag == tmp;
}


x86 assembly (clang, -O0):
<is_set>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
movzbl %al,%eax
movzbl -0x2(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0x3(%rbp)
movzbl -0x2(%rbp),%eax
movzbl -0x3(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_set>:
mov    %dil,-0x1(%rsp)
mov    -0x1(%rsp),%cl
not    %cl
xor    %eax,%eax
test   %cl,%sil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_set(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
store volatile i8 %0, i8* %3
store i8 %1, i8* %4
%6 = load volatile i8, i8* %3
%7 = zext i8 %6 to i32
%8 = load i8, i8* %4
%9 = zext i8 %8 to i32
%10 = and i32 %7, %9
%11 = trunc i32 %10 to i8
store i8 %11, i8* %5
%12 = load i8, i8* %4
%13 = zext i8 %12 to i32
%14 = load i8, i8* %5
%15 = zext i8 %14 to i32
%16 = icmp eq i32 %13, %15
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @is_set(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
store volatile i8 %0, i8* %3
%4 = load volatile i8, i8* %3
%5 = and i8 %4, %1
%6 = icmp eq i8 %5, %1
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ printerr(int, char *, int);
void qword_printint(FILE *f, int num) {
  fprintf(f, "%d ", num);
  printerr(2, "%d ", num);
}


x86 assembly (clang, -O0):
<qword_printint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xec3(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0xc(%rbp),%edx
mov    $0x2,%edi
lea    0xeaf(%rip),%rsi
call   1030 <printerr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qword_printint>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
lea    0xed3(%rip),%r14
mov    %r14,%rsi
mov    %ebx,%edx
call   1040 <fprintf@plt>
mov    $0x2,%edi
mov    %r14,%rsi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printerr@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
define void @qword_printint(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 @fprintf(i32* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %4
%9 = call i32 @printerr(i32 2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @qword_printint(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = tail call i32 @printerr(i32 2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
int toupper(int ch) { return ch - (((ch > 96) && (ch < 123)) ? 32 : 0); }


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x60,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1126 <toupper+0x26>
cmpl   $0x7b,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x5(%rbp),%sil
xor    %ecx,%ecx
mov    $0x20,%edx
test   $0x1,%sil
cmovne %edx,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
lea    -0x61(%rdi),%eax
xor    %ecx,%ecx
cmp    $0x1a,%eax
setae  %cl
shl    $0x5,%ecx
lea    (%rcx,%rdi,1),%eax
add    $0xffffffe0,%eax
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 96
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 123
br label %9
9: ; preds = %6, %1
%10 = phi i1 [ false, %1 ], [ %8, %6 ]
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 32, i32 0
%13 = sub nsw i32 %3, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = select i1 %3, i32 -32, i32 0
%5 = add i32 %4, %0
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fwrite(char const *, int, unsigned long,
                          int /*<<< orphan*/ *);
void file_put_contents(const char *filename, const char *value,
                       unsigned long val_len) {
  FILE *fp;
  fp = fopen(filename, "a+");
  fwrite(value, sizeof(char), val_len, fp);
  fclose(fp);
}


x86 assembly (clang, -O0):
<file_put_contents>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1,%esi
call   1050 <fwrite@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_put_contents>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
lea    0xebe(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    $0x1,%esi
mov    %r14,%rdx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"a+\00"
define void @file_put_contents(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = call i32* @fopen(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %9, i32** %7
%10 = load i8*, i8** %5
%11 = load i64, i64* %6
%12 = load i32*, i32** %7
%13 = call i32 @fwrite(i8* %10, i32 1, i64 %11, i32* %12)
%14 = load i32*, i32** %7
%15 = call i32 @fclose(i32* %14)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"a+\00"
define void @file_put_contents(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @fwrite(i8* %1, i32 1, i64 %2, i32* %4)
%6 = tail call i32 @fclose(i32* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen_op_store_ctr();
void spr_write_ctr(void *opaque, int sprn) { gen_op_store_ctr(); }


x86 assembly (clang, -O0):
<spr_write_ctr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <gen_op_store_ctr@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @spr_write_ctr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 (...) @gen_op_store_ctr()
ret void
}

LLVM IR (-O2):
define void @spr_write_ctr(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 (...) @gen_op_store_ctr()
ret void
}