xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ execvp(char *, char **);
scalar_t__ fork();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int spawn(char *program, char **arg_list) {
  pid_t pid;
  pid = fork();
  if (pid != 0) {
    return pid;
  } else {
    execvp(program, arg_list);
    fprintf(stderr, "an error occurred in execvp\n");
    abort();
  }
}


x86 assembly (clang, -O0):
<spawn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1060 <fork@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1170 <spawn+0x30>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <execvp@plt>
mov    0x2e5c(%rip),%rax
mov    (%rax),%edi
lea    0xe73(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<spawn>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1060 <fork@plt>
test   %rax,%rax
je     115e <spawn+0x1e>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <execvp@plt>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
lea    0xe87(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"an error occurred in execvp\0A\00"
define i32 @spawn(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca i64
store i8* %0, i8** %3
store i8** %1, i8*** %4
%6 = call i64 (...) @fork()
store i64 %6, i64* %5
%7 = load i64, i64* %5
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i64, i64* %5
%11 = trunc i64 %10 to i32
ret i32 %11
12: ; preds = %2
%13 = load i8*, i8** %3
%14 = load i8**, i8*** %4
%15 = call i32 @execvp(i8* %13, i8** %14)
%16 = load i32, i32* @stderr
%17 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%18 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"an error occurred in execvp\0A\00"
define i32 @spawn(i8* %0, i8** %1) {
%3 = tail call i64 (...) @fork()
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = trunc i64 %3 to i32
ret i32 %6
7: ; preds = %2
%8 = tail call i32 @execvp(i8* %0, i8** %1)
%9 = load i32, i32* @stderr
%10 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%11 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ GL_UNIFORM_BUFFER;
int /*<<< orphan*/ glBufferSubData(int /*<<< orphan*/, int, unsigned long,
                                   void *);
void V_setuniform(int uoff, unsigned long size, void *dat) {
  glBufferSubData(GL_UNIFORM_BUFFER, uoff, size, dat);
}


x86 assembly (clang, -O0):
<V_setuniform>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <glBufferSubData@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<V_setuniform>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <glBufferSubData@plt>

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

LLVM IR (-O2):
@GL_UNIFORM_BUFFER = global i32 0
define void @V_setuniform(i32 %0, i64 %1, i8* %2) {
%4 = load i32, i32* @GL_UNIFORM_BUFFER
%5 = tail call i32 @glBufferSubData(i32 %4, i32 %0, i64 %1, i8* %2)
ret void
}
__attribute__((__weak__)) int uart_rxChar(void) { return 0; }


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

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

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

LLVM IR (-O2):
define weak i32 @uart_rxChar() {
ret i32 0
}
void _M2_Transform3D_init(__attribute__((unused)) int argc,
                          __attribute__((unused)) char *argv[]) {}


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

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

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

LLVM IR (-O2):
define void @_M2_Transform3D_init(i32 %0, i8** nocapture %1) {
ret void
}
float GetPercentageI(int startVal, int endVal, int middleVal) {
  return (float)(middleVal - startVal) / (float)(endVal - startVal);
}


x86 assembly (clang, -O0):
<GetPercentageI>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x4(%rbp),%eax
cvtsi2ss %eax,%xmm0
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
cvtsi2ss %eax,%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetPercentageI>:
sub    %edi,%edx
cvtsi2ss %edx,%xmm0
sub    %edi,%esi
cvtsi2ss %esi,%xmm1
divss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @GetPercentageI(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* %6
%8 = load i32, i32* %4
%9 = sub nsw i32 %7, %8
%10 = sitofp i32 %9 to float
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = sub nsw i32 %11, %12
%14 = sitofp i32 %13 to float
%15 = fdiv float %10, %14
ret float %15
}

LLVM IR (-O2):
define float @GetPercentageI(i32 %0, i32 %1, i32 %2) {
%4 = sub nsw i32 %2, %0
%5 = sitofp i32 %4 to float
%6 = sub nsw i32 %1, %0
%7 = sitofp i32 %6 to float
%8 = fdiv float %5, %7
ret float %8
}
/* Type definitions */
typedef int gid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
gid_t getgid(void) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<getgid>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec4(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getgid>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @getgid() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @getgid() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret i32 -1
}
void ext2_clear_bit(void *addr, unsigned int i) {
  unsigned char *v = addr;
  v += i >> 3;
  *v &= ~(1 << (7 - (i % 8)));
}


x86 assembly (clang, -O0):
<ext2_clear_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
shr    $0x3,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,%ecx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
and    $0x7,%eax
mov    $0x7,%ecx
sub    %eax,%ecx
mov    $0x1,%edx
shl    %cl,%edx
xor    $0xffffffff,%edx
mov    -0x18(%rbp),%rax
movzbl (%rax),%ecx
and    %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ext2_clear_bit>:
mov    %esi,%ecx
mov    %esi,%eax
shr    $0x3,%rax
not    %cl
and    $0x7,%cl
mov    $0x1,%edx
shl    %cl,%edx
not    %dl
and    %dl,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @ext2_clear_bit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
%7 = load i32, i32* %4
%8 = lshr i32 %7, 3
%9 = load i8*, i8** %5
%10 = zext i32 %8 to i64
%11 = getelementptr inbounds i8, i8* %9, i64 %10
store i8* %11, i8** %5
%12 = load i32, i32* %4
%13 = urem i32 %12, 8
%14 = sub i32 7, %13
%15 = shl i32 1, %14
%16 = xor i32 %15, -1
%17 = load i8*, i8** %5
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = and i32 %19, %16
%21 = trunc i32 %20 to i8
store i8 %21, i8* %17
ret void
}

LLVM IR (-O2):
define void @ext2_clear_bit(i8* nocapture %0, i32 %1) {
%3 = lshr i32 %1, 3
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = and i32 %1, 7
%7 = xor i32 %6, 7
%8 = shl nuw i32 1, %7
%9 = load i8, i8* %5
%10 = trunc i32 %8 to i8
%11 = xor i8 %10, -1
%12 = and i8 %9, %11
store i8 %12, i8* %5
ret void
}
int test_imm_88uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x88 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_88uint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x10,%rdx
and    $0x88,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_88uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 8912896
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
void Usage() {
  fprintf(
      stdout, "%s",
      "usage:\n"
      "  webclient [options]\n"
      "options:\n"
      "  -s [server_addr]    Server address (Default: 0.0.0.0)\n"
      "  -p [server_port]    Server port (Default: 8888)\n"
      "  -w [workload_path]  Path to workload file (Default: workload.txt)\n"
      "  -t [nthreads]       Number of threads (Default 1)\n"
      "  -n [num_requests]   Requests download per thread (Default: 1)\n"
      "  -h                  Show this help message\n");
}


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

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

LLVM IR (-O0):
@stdout = global i32 0
@.str = [3 x i8] c"%s\00"
@.str.1 = [374 x i8] c"usage:\0A webclient [options]\0Aoptions:\0A -s [server_addr] Server address (Default: 0.0.0.0)\0A -p [server_port] Server port (Default: 8888)\0A -w [workload_path] Path to workload file (Default: workload.txt)\0A -t [nthreads] Number of threads (Default 1)\0A -n [num_requests] Requests download per thread (Default: 1)\0A -h Show this help message\0A\00"
define void @Usage() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([374 x i8], [374 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [3 x i8] c"%s\00"
@.str.1 = [374 x i8] c"usage:\0A webclient [options]\0Aoptions:\0A -s [server_addr] Server address (Default: 0.0.0.0)\0A -p [server_port] Server port (Default: 8888)\0A -w [workload_path] Path to workload file (Default: workload.txt)\0A -t [nthreads] Number of threads (Default 1)\0A -n [num_requests] Requests download per thread (Default: 1)\0A -h Show this help message\0A\00"
define void @Usage() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([374 x i8], [374 x i8]* @.str.1, i64 0, i64 0))
ret void
}
float test_fmodf(float x, float y) { return __builtin_fmodf(x, y); }


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

x86 assembly (clang, -O2):
<test_fmodf>:
jmp    1030 <fmodf@plt>

LLVM IR (-O0):
define float @test_fmodf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @fmodf(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @test_fmodf(float %0, float %1) {
%3 = tail call float @fmodf(float %0, float %1)
ret float %3
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t xadd_reg2reg(uint64_t new, uint64_t *loc) {
  uint64_t out;
  asm("xadd %1, %0  \n\t" : "=r"(*loc), "=r"(out) : "1"(new), "0"(*loc));
  return out;
}


x86 assembly (clang, -O0):
<xadd_reg2reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdx
mov    (%rdx),%rdx
xadd   %rax,%rdx
mov    %rdx,(%rcx)
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xadd_reg2reg>:
mov    %rdi,%rax
mov    (%rsi),%rcx
xadd   %rax,%rcx
mov    %rcx,(%rsi)
ret

LLVM IR (-O0):
define i8* @xadd_reg2reg(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca i8*
store i8* %0, i8** %3
store i8** %1, i8*** %4
%6 = load i8**, i8*** %4
%7 = load i8*, i8** %3
%8 = load i8**, i8*** %4
%9 = load i8*, i8** %8
%10 = call { i8*, i8* } asm "xadd $1, $0 \0A\09", "=r,=r,1,0,~{dirflag},~{fpsr},~{flags}"(i8* %7, i8* %9)
%11 = extractvalue { i8*, i8* } %10, 0
%12 = extractvalue { i8*, i8* } %10, 1
store i8* %11, i8** %6
store i8* %12, i8** %5
%13 = load i8*, i8** %5
ret i8* %13
}

LLVM IR (-O2):
define i8* @xadd_reg2reg(i8* %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call { i8*, i8* } asm "xadd $1, $0 \0A\09", "=r,=r,1,0,~{dirflag},~{fpsr},~{flags}"(i8* %0, i8* %3)
%5 = extractvalue { i8*, i8* } %4, 0
%6 = extractvalue { i8*, i8* } %4, 1
store i8* %5, i8** %1
ret i8* %6
}
/* Variables and functions */
double EvalAngCor_p0_2plus_12minus_14926_L3(double);
double funcAngCor_p0_2plus_12minus_14926_L3(double *x, double *par) {
  double result;
  result = par[0] * EvalAngCor_p0_2plus_12minus_14926_L3(x[0]);
  return result;
}


x86 assembly (clang, -O0):
<funcAngCor_p0_2plus_12minus_14926_L3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <EvalAngCor_p0_2plus_12minus_14926_L3@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funcAngCor_p0_2plus_12minus_14926_L3>:
push   %rax
movsd  (%rsi),%xmm0
movsd  %xmm0,(%rsp)
movsd  (%rdi),%xmm0
call   1030 <EvalAngCor_p0_2plus_12minus_14926_L3@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @funcAngCor_p0_2plus_12minus_14926_L3(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %4
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load double*, double** %3
%10 = getelementptr inbounds double, double* %9, i64 0
%11 = load double, double* %10
%12 = call double @EvalAngCor_p0_2plus_12minus_14926_L3(double %11)
%13 = fmul double %8, %12
store double %13, double* %5
%14 = load double, double* %5
ret double %14
}

LLVM IR (-O2):
define double @funcAngCor_p0_2plus_12minus_14926_L3(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = load double, double* %0
%5 = tail call double @EvalAngCor_p0_2plus_12minus_14926_L3(double %4)
%6 = fmul double %3, %5
ret double %6
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int /*<<< orphan*/ g(int);
int main() {
  int x = __VERIFIER_nondet_int();
  if (x < 0)
    return 0;
  g(x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    114f <main+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1157 <main+0x37>
mov    -0x8(%rbp),%edi
call   1040 <g@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
js     1133 <main+0x13>
mov    %eax,%edi
call   1040 <g@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = icmp slt i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @g(i32 %1)
br label %5
5: ; preds = %0, %3
ret i32 0
}
int fun(int x) { return ++x; }


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

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

LLVM IR (-O0):
define i32 @fun(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
ret i32 %4
}

LLVM IR (-O2):
define i32 @fun(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
float floor(float);
float max(double, float);
float integral(float t, float nedge) {
  return ((1.0 - nedge) * floor(t) + max(0.0, t - floor(t) - nedge));
}


x86 assembly (clang, -O0):
<integral>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xebd(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <floor@plt>
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <floor@plt>
movss  -0x1c(%rbp),%xmm1
subss  %xmm0,%xmm1
subss  -0x8(%rbp),%xmm1
xorps  %xmm0,%xmm0
call   1030 <max@plt>
movsd  -0x18(%rbp),%xmm2
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
cvtss2sd %xmm1,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<integral>:
sub    $0x18,%rsp
movss  %xmm1,0x14(%rsp)
movss  %xmm0,0x10(%rsp)
cvtss2sd %xmm1,%xmm1
movsd  0xec4(%rip),%xmm2
subsd  %xmm1,%xmm2
movsd  %xmm2,0x8(%rsp)
call   1040 <floorf@plt>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
mulsd  0x8(%rsp),%xmm1
movsd  %xmm1,0x8(%rsp)
movss  0x10(%rsp),%xmm1
subss  %xmm0,%xmm1
subss  0x14(%rsp),%xmm1
xorps  %xmm0,%xmm0
call   1030 <max@plt>
cvtss2sd %xmm0,%xmm0
addsd  0x8(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @integral(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = fpext float %5 to double
%7 = fsub double 1.000000e+00, %6
%8 = load float, float* %3
%9 = call float @floor(float %8)
%10 = fpext float %9 to double
%11 = load float, float* %3
%12 = load float, float* %3
%13 = call float @floor(float %12)
%14 = fsub float %11, %13
%15 = load float, float* %4
%16 = fsub float %14, %15
%17 = call float @max(double 0.000000e+00, float %16)
%18 = fpext float %17 to double
%19 = call double @llvm.fmuladd.f64(double %7, double %10, double %18)
%20 = fptrunc double %19 to float
ret float %20
}

LLVM IR (-O2):
define float @integral(float %0, float %1) {
%3 = fpext float %1 to double
%4 = fsub double 1.000000e+00, %3
%5 = tail call float @llvm.floor.f32(float %0)
%6 = fpext float %5 to double
%7 = fsub float %0, %5
%8 = fsub float %7, %1
%9 = tail call float @max(double 0.000000e+00, float %8)
%10 = fpext float %9 to double
%11 = tail call double @llvm.fmuladd.f64(double %4, double %6, double %10)
%12 = fptrunc double %11 to float
ret float %12
}
int ilog2(int n) {
  int nn, lg;
  if (n == 1) {
    return 0;
  }
  lg = 1;
  nn = 2;
  while (nn < n) {
    nn = nn << 1;
    lg++;
  }
  return lg;
}


x86 assembly (clang, -O0):
<ilog2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    111d <ilog2+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1154 <ilog2+0x54>
movl   $0x1,-0x10(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    114e <ilog2+0x4e>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112b <ilog2+0x2b>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ilog2>:
xor    %eax,%eax
cmp    $0x1,%edi
je     1129 <ilog2+0x29>
mov    $0x1,%eax
cmp    $0x3,%edi
jl     1129 <ilog2+0x29>
mov    $0x2,%ecx
mov    $0x1,%eax
nopl   0x0(%rax,%rax,1)
add    %ecx,%ecx
add    $0x1,%eax
cmp    %edi,%ecx
jl     1120 <ilog2+0x20>
ret

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

LLVM IR (-O2):
define i32 @ilog2(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = icmp sgt i32 %0, 2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ 1, %3 ]
%7 = phi i32 [ %8, %5 ], [ 2, %3 ]
%8 = shl i32 %7, 1
%9 = add nuw nsw i32 %6, 1
%10 = icmp slt i32 %8, %0
br i1 %10, label %5, label %11
11: ; preds = %5, %3, %1
%12 = phi i32 [ 0, %1 ], [ 1, %3 ], [ %9, %5 ]
ret i32 %12
}
int numIsMember(int n, int *array) {
  int i;
  int size;
  size = sizeof(array) / sizeof(array[0]);
  for (i = 0; i < size; i++) {
    if (n == array[i]) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<numIsMember>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x2,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1158 <numIsMember+0x58>
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jne    1145 <numIsMember+0x45>
movl   $0x1,-0x4(%rbp)
jmp    115f <numIsMember+0x5f>
jmp    114a <numIsMember+0x4a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1119 <numIsMember+0x19>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numIsMember>:
mov    $0x1,%eax
cmp    %edi,(%rsi)
je     1111 <numIsMember+0x11>
xor    %eax,%eax
cmp    %edi,0x4(%rsi)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @numIsMember(i32 %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, %0
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = getelementptr inbounds i32, i32* %1, i64 1
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, %0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %5, %2
%11 = phi i32 [ 1, %2 ], [ %9, %5 ]
ret i32 %11
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint8_t *ctr128_inc(uint8_t counter[16]) {
  uint32_t n = 16;
  uint8_t c;
  do {
    --n;
    c = counter[n];
    ++c;
    counter[n] = c;
    if (c)
      return counter;
  } while (n);
  return counter;
}


x86 assembly (clang, -O0):
<ctr128_inc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x10,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
cmpq   $0x0,-0x20(%rbp)
je     115c <ctr128_inc+0x5c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1173 <ctr128_inc+0x73>
jmp    1161 <ctr128_inc+0x61>
cmpl   $0x0,-0x14(%rbp)
jne    110f <ctr128_inc+0xf>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctr128_inc>:
mov    %rdi,%rax
mov    $0x78,%ecx
nopl   0x0(%rax,%rax,1)
addq   $0x1,(%rax,%rcx,1)
jne    1123 <ctr128_inc+0x23>
lea    -0x8(%rcx),%rdx
test   %rcx,%rcx
mov    %rdx,%rcx
jne    1110 <ctr128_inc+0x10>
ret

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

LLVM IR (-O2):
define i64* @ctr128_inc(i64* returned %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %4, %2 ], [ 16, %1 ]
%4 = add nsw i64 %3, -1
%5 = getelementptr inbounds i64, i64* %0, i64 %4
%6 = load i64, i64* %5
%7 = add nsw i64 %6, 1
store i64 %7, i64* %5
%8 = icmp ne i64 %7, 0
%9 = icmp eq i64 %4, 0
%10 = select i1 %8, i1 true, i1 %9
br i1 %10, label %11, label %2
11: ; preds = %2
ret i64* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, long *, long *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
void read_uptime_fields(FILE *fp, long int *uptime, long int *idle) {
  fflush(fp);
  fseek(fp, 0, SEEK_SET);
  fscanf(fp, "%ld %ld", uptime, idle);
  return;
}


x86 assembly (clang, -O0):
<read_uptime_fields>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fflush@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e88(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1050 <fseek@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xe8c(%rip),%rsi
call   1030 <fscanf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_uptime_fields>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1040 <fflush@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <fseek@plt>
lea    0xea3(%rip),%rsi
mov    %rbx,%rdi
mov    %r15,%rdx
mov    %r14,%rcx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <fscanf@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
@.str = [8 x i8] c"%ld %ld\00"
define void @read_uptime_fields(i32* %0, i64* %1, i64* %2) {
%4 = alloca i32*
%5 = alloca i64*
%6 = alloca i64*
store i32* %0, i32** %4
store i64* %1, i64** %5
store i64* %2, i64** %6
%7 = load i32*, i32** %4
%8 = call i32 @fflush(i32* %7)
%9 = load i32*, i32** %4
%10 = load i32, i32* @SEEK_SET
%11 = call i32 @fseek(i32* %9, i32 0, i32 %10)
%12 = load i32*, i32** %4
%13 = load i64*, i64** %5
%14 = load i64*, i64** %6
%15 = call i32 @fscanf(i32* %12, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64* %13, i64* %14)
ret void
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
@.str = [8 x i8] c"%ld %ld\00"
define void @read_uptime_fields(i32* nocapture %0, i64* %1, i64* %2) {
%4 = tail call i32 @fflush(i32* %0)
%5 = load i32, i32* @SEEK_SET
%6 = tail call i32 @fseek(i32* %0, i32 0, i32 %5)
%7 = tail call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64* %1, i64* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void utest_init_RNG() {
  static unsigned char init = 0;
  if (init)
    return;
  srand(time(NULL));
  init = 1;
}


x86 assembly (clang, -O0):
<utest_init_RNG>:
push   %rbp
mov    %rsp,%rbp
cmpb   $0x0,0x2f06(%rip)
je     1136 <utest_init_RNG+0x16>
jmp    114d <utest_init_RNG+0x2d>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
movb   $0x1,0x2ee4(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<utest_init_RNG>:
push   %rax
cmpb   $0x0,0x2f09(%rip)
jne    113f <utest_init_RNG+0x1f>
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
movb   $0x1,0x2ef2(%rip)
pop    %rax
ret

LLVM IR (-O0):
@utest_init_RNG.init = internal global i8 0
define void @utest_init_RNG() {
%1 = load i8, i8* @utest_init_RNG.init
%2 = icmp ne i8 %1, 0
br i1 %2, label %3, label %4
3: ; preds = %0
br label %7
4: ; preds = %0
%5 = call i32 @time(i32* null)
%6 = call i32 @srand(i32 %5)
store i8 1, i8* @utest_init_RNG.init
br label %7
7: ; preds = %4, %3
ret void
}

LLVM IR (-O2):
@utest_init_RNG.init = internal unnamed_addr global i1 false
define void @utest_init_RNG() {
%1 = load i1, i1* @utest_init_RNG.init
br i1 %1, label %5, label %2
2: ; preds = %0
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srand(i32 %3)
store i1 true, i1* @utest_init_RNG.init
br label %5
5: ; preds = %0, %2
ret void
}
int EntGetNumBotFollowers(int entNum) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @EntGetNumBotFollowers(i32 %0) {
ret i32 0
}
int main(void) {
  int i = 0;
  do {
    i++;
  } while (i < 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jl     1112 <main+0x12>
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
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
store i32 %5, i32* %2
br label %6
6: ; preds = %3
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 10
br i1 %8, label %3, label %9
9: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int rotl64(int, int);
int rotr64(int, int);
int shiftl64(int, int);
int shiftr64(int, int);
uint64_t bmw_large_s2(uint64_t x) {
  uint64_t r;
  r = shiftr64(x, 2) ^ shiftl64(x, 1) ^ rotl64(x, 19) ^ rotr64(x, 64 - 53);
  return r;
}


x86 assembly (clang, -O0):
<bmw_large_s2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x2,%esi
call   1060 <shiftr64@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1040 <shiftl64@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
xor    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x13,%esi
call   1030 <rotl64@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
xor    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xb,%esi
call   1050 <rotr64@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
xor    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bmw_large_s2>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
mov    $0x2,%esi
call   1060 <shiftr64@plt>
mov    %eax,%r14d
mov    %ebx,%edi
mov    $0x1,%esi
call   1040 <shiftl64@plt>
mov    %eax,%ebp
xor    %r14d,%ebp
mov    %ebx,%edi
mov    $0x13,%esi
call   1030 <rotl64@plt>
mov    %eax,%r14d
mov    %ebx,%edi
mov    $0xb,%esi
call   1050 <rotr64@plt>
xor    %r14d,%eax
xor    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @bmw_large_s2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @shiftr64(i32 %4, i32 2)
%6 = load i32, i32* %2
%7 = call i32 @shiftl64(i32 %6, i32 1)
%8 = xor i32 %5, %7
%9 = load i32, i32* %2
%10 = call i32 @rotl64(i32 %9, i32 19)
%11 = xor i32 %8, %10
%12 = load i32, i32* %2
%13 = call i32 @rotr64(i32 %12, i32 11)
%14 = xor i32 %11, %13
store i32 %14, i32* %3
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @bmw_large_s2(i32 %0) {
%2 = tail call i32 @shiftr64(i32 %0, i32 2)
%3 = tail call i32 @shiftl64(i32 %0, i32 1)
%4 = xor i32 %3, %2
%5 = tail call i32 @rotl64(i32 %0, i32 19)
%6 = xor i32 %4, %5
%7 = tail call i32 @rotr64(i32 %0, i32 11)
%8 = xor i32 %6, %7
ret i32 %8
}
int int_max(int i1, int i2) {
  if (i2 < i1)
    return i1;
  else
    return i2;
}


x86 assembly (clang, -O0):
<int_max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <int_max+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <int_max+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_max>:
mov    %esi,%eax
cmp    %edi,%esi
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @int_max(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, %0
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int acc_upsize(char ch) {
  int size;
  switch (ch) {
  case '=':
    size = 8;
    break;
  case '^':
    size = 8;
    break;
  case '_':
    size = 9;
    break;
  default:
    size = 0;
    break;
  };
  return (size);
}


x86 assembly (clang, -O0):
<acc_upsize>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x3d,%eax
je     1141 <acc_upsize+0x41>
jmp    111f <acc_upsize+0x1f>
mov    -0xc(%rbp),%eax
sub    $0x5e,%eax
je     114d <acc_upsize+0x4d>
jmp    1130 <acc_upsize+0x30>
mov    -0xc(%rbp),%eax
sub    $0x5f,%eax
je     1159 <acc_upsize+0x59>
jmp    1165 <acc_upsize+0x65>
movl   $0x8,-0x8(%rbp)
jmp    116c <acc_upsize+0x6c>
movl   $0x8,-0x8(%rbp)
jmp    116c <acc_upsize+0x6c>
movl   $0x9,-0x8(%rbp)
jmp    116c <acc_upsize+0x6c>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<acc_upsize>:
mov    $0x8,%eax
cmp    $0x3d,%edi
je     111c <acc_upsize+0x1c>
cmp    $0x5e,%edi
je     111c <acc_upsize+0x1c>
cmp    $0x5f,%edi
jne    111a <acc_upsize+0x1a>
mov    $0x9,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @acc_upsize(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
switch i32 %5, label %9 [
i32 61, label %6
i32 94, label %7
i32 95, label %8
]
6: ; preds = %1
store i32 8, i32* %3
br label %10
7: ; preds = %1
store i32 8, i32* %3
br label %10
8: ; preds = %1
store i32 9, i32* %3
br label %10
9: ; preds = %1
store i32 0, i32* %3
br label %10
10: ; preds = %9, %8, %7, %6
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @acc_upsize(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %4 [
i32 61, label %5
i32 94, label %5
i32 95, label %3
]
3: ; preds = %1
br label %5
4: ; preds = %1
br label %5
5: ; preds = %1, %1, %4, %3
%6 = phi i32 [ 0, %4 ], [ 9, %3 ], [ 8, %1 ], [ 8, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ test1();
int /*<<< orphan*/ test2();
int /*<<< orphan*/ test3();
int /*<<< orphan*/ test4();
int /*<<< orphan*/ test5();
int /*<<< orphan*/ test6();
int /*<<< orphan*/ test7();
int /*<<< orphan*/ test8();
int /*<<< orphan*/ test9();
int main(void) {
  test1();
  test2();
  test3();
  test4();
  test5();
  test6();
  test7();
  test8();
  test9();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <test1@plt>
mov    $0x0,%al
call   10a0 <test2@plt>
mov    $0x0,%al
call   1050 <test3@plt>
mov    $0x0,%al
call   1090 <test4@plt>
mov    $0x0,%al
call   1040 <test5@plt>
mov    $0x0,%al
call   1080 <test6@plt>
mov    $0x0,%al
call   1030 <test7@plt>
mov    $0x0,%al
call   10b0 <test8@plt>
mov    $0x0,%al
call   1070 <test9@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <test1@plt>
xor    %eax,%eax
call   10a0 <test2@plt>
xor    %eax,%eax
call   1050 <test3@plt>
xor    %eax,%eax
call   1090 <test4@plt>
xor    %eax,%eax
call   1040 <test5@plt>
xor    %eax,%eax
call   1080 <test6@plt>
xor    %eax,%eax
call   1030 <test7@plt>
xor    %eax,%eax
call   10b0 <test8@plt>
xor    %eax,%eax
call   1070 <test9@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test1()
%3 = call i32 (...) @test2()
%4 = call i32 (...) @test3()
%5 = call i32 (...) @test4()
%6 = call i32 (...) @test5()
%7 = call i32 (...) @test6()
%8 = call i32 (...) @test7()
%9 = call i32 (...) @test8()
%10 = call i32 (...) @test9()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test1()
%2 = tail call i32 (...) @test2()
%3 = tail call i32 (...) @test3()
%4 = tail call i32 (...) @test4()
%5 = tail call i32 (...) @test5()
%6 = tail call i32 (...) @test6()
%7 = tail call i32 (...) @test7()
%8 = tail call i32 (...) @test8()
%9 = tail call i32 (...) @test9()
ret i32 0
}
void r00t_me() {
  asm("nop; nop; nop; nop;"
      "movq   %%gs:0x00000008, %%rax;"
      "movq   0x00000348(%%rax), %%rax;"
      "movq   0x000002d8(%%rax),%%rax;"
      "movq   0x000000d0(%%rax),%%rax;"
      "xorl   %%edi, %%edi;"
      "movl   %%edi, 0x0000001c(%%rax);"
      "movl   %%edi, 0x00000020(%%rax);"
      "movq   $13, %%rax;"
      "addq   $0x00000308,%%rsp;"
      "popq   %%rbx;"
      "popq   %%r12;"
      "popq   %%r13;"
      "popq   %%r14;"
      "popq   %%r15;"
      "popq   %%rbp;"
      "ret;" ::
          : "%rax");
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
nop
nop
nop
nop
mov    %gs:0x8,%rax
mov    0x348(%rax),%rax
mov    0x2d8(%rax),%rax
mov    0xd0(%rax),%rax
xor    %edi,%edi
mov    %edi,0x1c(%rax)
mov    %edi,0x20(%rax)
mov    $0xd,%rax
add    $0x308,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
pop    %rbp
ret

x86 assembly (clang, -O2):
nop
nop
nop
nop
mov    %gs:0x8,%rax
mov    0x348(%rax),%rax
mov    0x2d8(%rax),%rax
mov    0xd0(%rax),%rax
xor    %edi,%edi
mov    %edi,0x1c(%rax)
mov    %edi,0x20(%rax)
mov    $0xd,%rax
add    $0x308,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
ret

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

LLVM IR (-O2):
define void @r00t_me() {
tail call void asm sideeffect "nop; nop; nop; nop;movq %gs:0x00000008, %rax;movq 0x00000348(%rax), %rax;movq 0x000002d8(%rax),%rax;movq 0x000000d0(%rax),%rax;xorl %edi, %edi;movl %edi, 0x0000001c(%rax);movl %edi, 0x00000020(%rax);movq $$13, %rax;addq $$0x00000308,%rsp;popq %rbx;popq %r12;popq %r13;popq %r14;popq %r15;popq %rbp;ret;", "~{rax},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Direct(int);
int /*<<< orphan*/ ROR8(int /*<<< orphan*/);
void Op66M1(void) { ROR8(Direct(3)); }


x86 assembly (clang, -O0):
<Op66M1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <Direct@plt>
mov    %eax,%edi
call   1040 <ROR8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op66M1>:
push   %rax
mov    $0x3,%edi
call   1030 <Direct@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <ROR8@plt>

LLVM IR (-O0):
define void @Op66M1() {
%1 = call i32 @Direct(i32 3)
%2 = call i32 @ROR8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @Op66M1() {
%1 = tail call i32 @Direct(i32 3)
%2 = tail call i32 @ROR8(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int NSIG;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __sigismember(int /*<<< orphan*/ const *, int);
int sigismember(const sigset_t *set, int signo) {
  if (set == NULL || signo <= 0 || signo >= NSIG) {
    __set_errno(EINVAL);
    return -1;
  }
  return __sigismember(set, signo);
}


x86 assembly (clang, -O0):
<sigismember>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1156 <sigismember+0x36>
cmpl   $0x0,-0x14(%rbp)
jle    1156 <sigismember+0x36>
mov    -0x14(%rbp),%eax
mov    0x2e8a(%rip),%rcx
cmp    (%rcx),%eax
jl     1170 <sigismember+0x50>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    117f <sigismember+0x5f>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <__sigismember@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigismember>:
push   %rax
test   %rdi,%rdi
je     113b <sigismember+0x1b>
test   %esi,%esi
jle    113b <sigismember+0x1b>
mov    0x2ea7(%rip),%rax
cmp    %esi,(%rax)
jle    113b <sigismember+0x1b>
pop    %rax
jmp    1040 <__sigismember@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@NSIG = global i32 0
@EINVAL = global i32 0
define i32 @sigismember(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 = icmp eq i32* %6, null
br i1 %7, label %15, label %8
8: ; preds = %2
%9 = load i32, i32* %5
%10 = icmp sle i32 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %8
%12 = load i32, i32* %5
%13 = load i32, i32* @NSIG
%14 = icmp sge i32 %12, %13
br i1 %14, label %15, label %18
15: ; preds = %11, %8, %2
%16 = load i32, i32* @EINVAL
%17 = call i32 @__set_errno(i32 %16)
store i32 -1, i32* %3
br label %22
18: ; preds = %11
%19 = load i32*, i32** %4
%20 = load i32, i32* %5
%21 = call i32 @__sigismember(i32* %19, i32 %20)
store i32 %21, i32* %3
br label %22
22: ; preds = %18, %15
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
@NSIG = global i32 0
@EINVAL = global i32 0
define i32 @sigismember(i32* %0, i32 %1) {
%3 = icmp ne i32* %0, null
%4 = icmp sgt i32 %1, 0
%5 = and i1 %3, %4
%6 = load i32, i32* @NSIG
%7 = icmp sgt i32 %6, %1
%8 = select i1 %5, i1 %7, i1 false
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = load i32, i32* @EINVAL
%11 = tail call i32 @__set_errno(i32 %10)
br label %14
12: ; preds = %2
%13 = tail call i32 @__sigismember(i32* %0, i32 %1)
br label %14
14: ; preds = %12, %9
%15 = phi i32 [ -1, %9 ], [ %13, %12 ]
ret i32 %15
}
void art_init() { ; }


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

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

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

LLVM IR (-O2):
define void @art_init() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int extract_int(uint8_t *buf) { return *(int *)buf; }


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

x86 assembly (clang, -O2):
<extract_int>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @extract_int(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_153() {
  Assert_real((isqrt(153) == 12),
              "/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/stdlib/isqrt.c",
              770, ("Integer square root of 153 should be 12"));
}


x86 assembly (clang, -O0):
<t_sqrt_153>:
push   %rbp
mov    %rsp,%rbp
mov    $0x99,%edi
call   1030 <isqrt@plt>
cmp    $0xc,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x302,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_153>:
push   %rax
mov    $0x99,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xc,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x302,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 153 should be 12\00"
define void @t_sqrt_153() {
%1 = call i32 @isqrt(i32 153)
%2 = icmp eq i32 %1, 12
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 770, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 153 should be 12\00"
define void @t_sqrt_153() {
%1 = tail call i32 @isqrt(i32 153)
%2 = icmp eq i32 %1, 12
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 770, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}