xunge/DecIR huggingface dataset:
float getpix(float *x, int w, int h, int i, int j) {
  if (i < 0)
    i = 0;
  if (j < 0)
    j = 0;
  if (i >= w)
    i = w - 1;
  if (j >= h)
    j = h - 1;
  return x[j * w + i];
}


x86 assembly (clang, -O0):
<getpix>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1126 <getpix+0x26>
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    1137 <getpix+0x37>
movl   $0x0,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     114c <getpix+0x4c>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1161 <getpix+0x61>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
imul   -0xc(%rbp),%ecx
add    -0x14(%rbp),%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpix>:
xor    %eax,%eax
test   %ecx,%ecx
cmovs  %eax,%ecx
test   %r8d,%r8d
cmovns %r8d,%eax
lea    -0x1(%rsi),%r8d
cmp    %esi,%ecx
cmovl  %ecx,%r8d
lea    -0x1(%rdx),%ecx
cmp    %edx,%eax
cmovl  %eax,%ecx
imul   %esi,%ecx
add    %r8d,%ecx
movslq %ecx,%rax
movss  (%rdi,%rax,4),%xmm0
ret

LLVM IR (-O0):
define float @getpix(float* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca float*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store float* %0, float** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %9
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %5
store i32 0, i32* %9
br label %14
14: ; preds = %13, %5
%15 = load i32, i32* %10
%16 = icmp slt i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %14
store i32 0, i32* %10
br label %18
18: ; preds = %17, %14
%19 = load i32, i32* %9
%20 = load i32, i32* %7
%21 = icmp sge i32 %19, %20
br i1 %21, label %22, label %25
22: ; preds = %18
%23 = load i32, i32* %7
%24 = sub nsw i32 %23, 1
store i32 %24, i32* %9
br label %25
25: ; preds = %22, %18
%26 = load i32, i32* %10
%27 = load i32, i32* %8
%28 = icmp sge i32 %26, %27
br i1 %28, label %29, label %32
29: ; preds = %25
%30 = load i32, i32* %8
%31 = sub nsw i32 %30, 1
store i32 %31, i32* %10
br label %32
32: ; preds = %29, %25
%33 = load float*, float** %6
%34 = load i32, i32* %10
%35 = load i32, i32* %7
%36 = mul nsw i32 %34, %35
%37 = load i32, i32* %9
%38 = add nsw i32 %36, %37
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds float, float* %33, i64 %39
%41 = load float, float* %40
ret float %41
}

LLVM IR (-O2):
define float @getpix(float* nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = icmp sgt i32 %3, 0
%7 = select i1 %6, i32 %3, i32 0
%8 = icmp sgt i32 %4, 0
%9 = select i1 %8, i32 %4, i32 0
%10 = icmp slt i32 %7, %1
%11 = add nsw i32 %1, -1
%12 = select i1 %10, i32 %7, i32 %11
%13 = icmp slt i32 %9, %2
%14 = add nsw i32 %2, -1
%15 = select i1 %13, i32 %9, i32 %14
%16 = mul nsw i32 %15, %1
%17 = add nsw i32 %16, %12
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds float, float* %0, i64 %18
%20 = load float, float* %19
ret float %20
}
/* Type definitions */
struct sockaddr_in {
  int /*<<< orphan*/ sin_addr;
};
struct sockaddr {
  int dummy;
};
typedef int socklen_t;
typedef int /*<<< orphan*/ addr;

/* Variables and functions */
scalar_t__ getpeername(int const, struct sockaddr *, int *);
char *inet_ntoa(int /*<<< orphan*/);
char *getcliip(const int client_sock) {
  char *cliip = NULL;
  struct sockaddr_in addr;
  socklen_t len = sizeof(addr);
  if (getpeername(client_sock, (struct sockaddr *)&addr, &len) == 0)
    cliip = inet_ntoa(addr.sin_addr);
  return cliip;
}


x86 assembly (clang, -O0):
<getcliip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x4,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1040 <getpeername@plt>
cmp    $0x0,%rax
jne    1160 <getcliip+0x40>
mov    -0x18(%rbp),%edi
call   1030 <inet_ntoa@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getcliip>:
push   %rax
movl   $0x4,0x4(%rsp)
mov    %rsp,%rsi
lea    0x4(%rsp),%rdx
call   1040 <getpeername@plt>
test   %rax,%rax
je     113f <getcliip+0x1f>
xor    %eax,%eax
pop    %rcx
ret
mov    (%rsp),%edi
call   1030 <inet_ntoa@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define i8* @getcliip(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.sockaddr_in
%5 = alloca i32
store i32 %0, i32* %2
store i8* null, i8** %3
store i32 4, i32* %5
%6 = load i32, i32* %2
%7 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%8 = call i64 @getpeername(i32 %6, %struct.sockaddr* %7, i32* %5)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i8* @inet_ntoa(i32 %12)
store i8* %13, i8** %3
br label %14
14: ; preds = %10, %1
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define i8* @getcliip(i32 %0) {
%2 = alloca %struct.sockaddr_in
%3 = alloca i32
%4 = bitcast %struct.sockaddr_in* %2 to i8*
%5 = bitcast i32* %3 to i8*
store i32 4, i32* %3
%6 = bitcast %struct.sockaddr_in* %2 to %struct.sockaddr*
%7 = call i64 @getpeername(i32 %0, %struct.sockaddr* %6, i32* %3)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i64 0, i32 0
%11 = load i32, i32* %10
%12 = call i8* @inet_ntoa(i32 %11)
br label %13
13: ; preds = %9, %1
%14 = phi i8* [ %12, %9 ], [ null, %1 ]
ret i8* %14
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};
typedef int /*<<< orphan*/ nowstr;
typedef int /*<<< orphan*/ nowgmt_tm;

/* Variables and functions */
int /*<<< orphan*/ bzero(struct tm *, int);
char *fmt_tm(struct tm *, int, char *);
int /*<<< orphan*/ gmtime_r(int /*<<< orphan*/ *, struct tm *);
char *fmtctime_gmt(time_t gmt) {
  struct tm nowgmt_tm;
  static char nowstr[32];
  bzero(&nowgmt_tm, sizeof(nowgmt_tm));
  gmtime_r(&gmt, &nowgmt_tm);
  return (fmt_tm(&nowgmt_tm, sizeof(nowstr), nowstr));
}


x86 assembly (clang, -O0):
<fmtctime_gmt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
mov    $0x4,%esi
call   1050 <bzero@plt>
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <gmtime_r@plt>
lea    -0x8(%rbp),%rdi
mov    $0x20,%esi
lea    0x2eea(%rip),%rdx
call   1040 <fmt_tm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmtctime_gmt>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,0x4(%rsp)
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
call   1050 <bzero@plt>
lea    0x4(%rsp),%rdi
mov    %rbx,%rsi
call   1030 <gmtime_r@plt>
lea    0x2ef1(%rip),%rdx
mov    %rbx,%rdi
mov    $0x20,%esi
call   1040 <fmt_tm@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@fmtctime_gmt.nowstr = internal global [32 x i8] zeroinitializer
define i8* @fmtctime_gmt(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.tm
store i32 %0, i32* %2
%4 = call i32 @bzero(%struct.tm* %3, i32 4)
%5 = call i32 @gmtime_r(i32* %2, %struct.tm* %3)
%6 = call i8* @fmt_tm(%struct.tm* %3, i32 32, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @fmtctime_gmt.nowstr, i64 0, i64 0))
ret i8* %6
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@fmtctime_gmt.nowstr = internal global [32 x i8] zeroinitializer
define i8* @fmtctime_gmt(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.tm
store i32 %0, i32* %2
%4 = bitcast %struct.tm* %3 to i8*
%5 = call i32 @bzero(%struct.tm* %3, i32 4)
%6 = call i32 @gmtime_r(i32* %2, %struct.tm* %3)
%7 = call i8* @fmt_tm(%struct.tm* %3, i32 32, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @fmtctime_gmt.nowstr, i64 0, i64 0))
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int dec = 17;
  printf("Dec = %d\n", dec);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x11,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x11,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Dec = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 17, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"Dec = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 17)
ret i32 0
}
/* Variables and functions */
int remove(char const *);
int File_Remove(const char *fileName) {
  ((void)0);
  return remove(fileName);
}


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

x86 assembly (clang, -O2):
<File_Remove>:
jmp    1030 <remove@plt>

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

LLVM IR (-O2):
define i32 @File_Remove(i8* nocapture %0) {
%2 = tail call i32 @remove(i8* %0)
ret i32 %2
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  int tv_sec;
  unsigned int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, struct timezone *);
unsigned int GetTimer() {
  struct timeval tv;
  struct timezone tz;
  gettimeofday(&tv, &tz);
  return (tv.tv_sec * 1000000 + tv.tv_usec);
}


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

x86 assembly (clang, -O2):
<GetTimer>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x8(%rsp),%eax
add    0xc(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
%struct.timezone = type { i32 }
define i32 @GetTimer() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%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 i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
%struct.timezone = type { i32 }
define i32 @GetTimer() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = bitcast %struct.timeval* %1 to i8*
%4 = bitcast %struct.timezone* %2 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%7 = load i32, i32* %6
%8 = mul nsw i32 %7, 1000000
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%10 = load i32, i32* %9
%11 = add i32 %8, %10
ret i32 %11
}
/* Variables and functions */
int opencurry(int, char **);
int main(int argc, char **argv) { return opencurry(argc, argv); }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @opencurry(i32 %0, i8** %1)
ret i32 %3
}
void g_tree_replace() {}


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

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

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

LLVM IR (-O2):
define void @g_tree_replace() {
ret void
}
float soma(float a, int b) {
  float result;
  result = a + b;
  return result;
}


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

x86 assembly (clang, -O2):
<soma>:
cvtsi2ss %edi,%xmm1
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @soma(float %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
%5 = alloca float
store float %0, float* %3
store i32 %1, i32* %4
%6 = load float, float* %3
%7 = load i32, i32* %4
%8 = sitofp i32 %7 to float
%9 = fadd float %6, %8
store float %9, float* %5
%10 = load float, float* %5
ret float %10
}

LLVM IR (-O2):
define float @soma(float %0, i32 %1) {
%3 = sitofp i32 %1 to float
%4 = fadd float %3, %0
ret float %4
}
int *zero_array(int *a, int length) {
  int i = 0;
  for (; i < length; i++) {
    *(a + i) = 0;
  }
}


x86 assembly (clang, -O0):
<zero_array>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    113b <zero_array+0x3b>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <zero_array+0x12>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero_array>:
test   %esi,%esi
jle    1126 <zero_array+0x16>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32* @zero_array(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
store i32 0, i32* %6
br label %7
7: ; preds = %16, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %19
11: ; preds = %7
%12 = load i32*, i32** %4
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
store i32 0, i32* %15
br label %16
16: ; preds = %11
%17 = load i32, i32* %6
%18 = add nsw i32 %17, 1
store i32 %18, i32* %6
br label %7
19: ; preds = %7
%20 = load i32*, i32** %3
ret i32* %20
}

LLVM IR (-O2):
define noalias i32* @zero_array(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret i32* undef
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ my_file_size(char const *, int *);
unsigned char *my_fread_from_position(char const *, int /*<<< orphan*/,
                                      int /*<<< orphan*/, char const *);
unsigned char *my_fread_whole_file(const char *path, const char *item,
                                   off_t *size) {
  int err;
  *size = my_file_size(path, &err);
  if (err == -1)
    exit(1);
  return my_fread_from_position(path, 0, *size, item);
}


x86 assembly (clang, -O0):
<my_fread_whole_file>:
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    -0x1c(%rbp),%rsi
call   1040 <my_file_size@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
cmpl   $0xffffffff,-0x1c(%rbp)
jne    116d <my_fread_whole_file+0x3d>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rcx
xor    %esi,%esi
call   1030 <my_fread_from_position@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_fread_whole_file>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xc(%rsp),%rsi
call   1040 <my_file_size@plt>
mov    %eax,(%r15)
cmpl   $0xffffffff,0xc(%rsp)
je     116f <my_fread_whole_file+0x3f>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %eax,%edx
mov    %r14,%rcx
call   1030 <my_fread_from_position@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i8* @my_fread_whole_file(i8* %0, i8* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%8 = load i8*, i8** %4
%9 = call i32 @my_file_size(i8* %8, i32* %7)
%10 = load i32*, i32** %6
store i32 %9, i32* %10
%11 = load i32, i32* %7
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %15
13: ; preds = %3
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %3
%16 = load i8*, i8** %4
%17 = load i32*, i32** %6
%18 = load i32, i32* %17
%19 = load i8*, i8** %5
%20 = call i8* @my_fread_from_position(i8* %16, i32 0, i32 %18, i8* %19)
ret i8* %20
}

LLVM IR (-O2):
define i8* @my_fread_whole_file(i8* %0, i8* %1, i32* nocapture writeonly %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = call i32 @my_file_size(i8* %0, i32* %4)
store i32 %6, i32* %2
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %3
%12 = call i8* @my_fread_from_position(i8* %0, i32 0, i32 %6, i8* %1)
ret i8* %12
}
char *langDbgDevScc() { return "SCC"; }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"SCC\00"
define i8* @langDbgDevScc() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int celcon_number_of_cells(int *length) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(82, length, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<celcon_number_of_cells>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x52,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<celcon_number_of_cells>:
mov    %rdi,%rsi
mov    $0x52,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @celcon_number_of_cells(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = load i32*, i32** %3
%8 = load double*, double** %5
%9 = call i32 @_ada_use_c2phc4c(i32 82, i32* %6, i32* %7, double* %8, i32 0)
store i32 %9, i32* %4
%10 = load i32, i32* %4
ret i32 %10
}

LLVM IR (-O2):
define i32 @celcon_number_of_cells(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc4c(i32 82, i32* %0, i32* undef, double* undef, i32 0)
ret i32 %2
}
void ASN1_GENERALIZEDTIME_set(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_GENERALIZEDTIME_set() {
ret void
}
/* Variables and functions */
int kerl_make_argcv_escape(char const *, size_t *, char ***,
                           int /*<<< orphan*/);
int kerl_make_argcv(const char *argstring, size_t *argcOut, char ***argvOut) {
  return kerl_make_argcv_escape(argstring, argcOut, argvOut, 0);
}


x86 assembly (clang, -O0):
<kerl_make_argcv>:
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
xor    %ecx,%ecx
call   1030 <kerl_make_argcv_escape@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kerl_make_argcv>:
xor    %ecx,%ecx
jmp    1030 <kerl_make_argcv_escape@plt>

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

LLVM IR (-O2):
define i32 @kerl_make_argcv(i8* %0, i64* %1, i8*** %2) {
%4 = tail call i32 @kerl_make_argcv_escape(i8* %0, i64* %1, i8*** %2, i32 0)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ calc_parity(int /*<<< orphan*/ *, int, int,
                               int /*<<< orphan*/, int, int);
void calc_q_parity(uint8_t *sector) {
  calc_parity(sector, 43 * 4, 26, 0, 2 * 44, 2 * 43);
}


x86 assembly (clang, -O0):
<calc_q_parity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xac,%esi
mov    $0x1a,%edx
xor    %ecx,%ecx
mov    $0x58,%r8d
mov    $0x56,%r9d
call   1030 <calc_parity@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_q_parity>:
mov    $0xac,%esi
mov    $0x1a,%edx
xor    %ecx,%ecx
mov    $0x58,%r8d
mov    $0x56,%r9d
jmp    1030 <calc_parity@plt>

LLVM IR (-O0):
define void @calc_q_parity(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @calc_parity(i32* %3, i32 172, i32 26, i32 0, i32 88, i32 86)
ret void
}

LLVM IR (-O2):
define void @calc_q_parity(i32* %0) {
%2 = tail call i32 @calc_parity(i32* %0, i32 172, i32 26, i32 0, i32 88, i32 86)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
main() { puts("pong"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"pong\00"
define i32 @main() {
%1 = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"pong\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int, unsigned long);
void set_n_bits(char *bit_map, unsigned long n_bits) {
  if (n_bits > 8) {
    memset(bit_map, 0xFF, n_bits / 8);
    *(bit_map + n_bits / 8) = (0xFF >> (8 - (n_bits % 8)));
  }
}


x86 assembly (clang, -O0):
<set_n_bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x8,-0x10(%rbp)
jbe    116b <set_n_bits+0x5b>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
shr    $0x3,%rdx
mov    $0xff,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rcx
and    $0x7,%rcx
mov    $0x8,%eax
sub    %rcx,%rax
mov    %eax,%ecx
mov    $0xff,%eax
sar    %cl,%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shr    $0x3,%rcx
mov    %dl,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_n_bits>:
cmp    $0x9,%rsi
jb     1153 <set_n_bits+0x43>
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%r15
shr    $0x3,%r15
mov    $0xff,%ebp
mov    $0xff,%esi
mov    %r15,%rdx
call   1030 <memset@plt>
and    $0x7,%bl
mov    $0x8,%cl
sub    %bl,%cl
shr    %cl,%ebp
mov    %bpl,(%r14,%r15,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @set_n_bits(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = icmp ugt i64 %5, 8
br i1 %6, label %7, label %22
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = load i64, i64* %4
%10 = udiv i64 %9, 8
%11 = call i32 @memset(i8* %8, i32 255, i64 %10)
%12 = load i64, i64* %4
%13 = urem i64 %12, 8
%14 = sub i64 8, %13
%15 = trunc i64 %14 to i32
%16 = ashr i32 255, %15
%17 = trunc i32 %16 to i8
%18 = load i8*, i8** %3
%19 = load i64, i64* %4
%20 = udiv i64 %19, 8
%21 = getelementptr inbounds i8, i8* %18, i64 %20
store i8 %17, i8* %21
br label %22
22: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
define void @set_n_bits(i8* %0, i64 %1) {
%3 = icmp ugt i64 %1, 8
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = lshr i64 %1, 3
%6 = tail call i32 @memset(i8* %0, i32 255, i64 %5)
%7 = trunc i64 %1 to i16
%8 = and i16 %7, 7
%9 = sub nuw nsw i16 8, %8
%10 = lshr i16 255, %9
%11 = trunc i16 %10 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 %11, i8* %12
br label %13
13: ; preds = %4, %2
ret void
}
/* Type definitions */
struct suffix_mult {
  int dummy;
};

/* Variables and functions */
unsigned long xatoull_sfx(char const *, struct suffix_mult const *);
__attribute__((always_)) unsigned long
xatoul_sfx(const char *str, const struct suffix_mult *sfx) {
  return xatoull_sfx(str, sfx);
}


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

x86 assembly (clang, -O2):
<xatoul_sfx>:
jmp    1030 <xatoull_sfx@plt>

LLVM IR (-O0):
%struct.suffix_mult = type { i32 }
define i64 @xatoul_sfx(i8* %0, %struct.suffix_mult* %1) {
%3 = alloca i8*
%4 = alloca %struct.suffix_mult*
store i8* %0, i8** %3
store %struct.suffix_mult* %1, %struct.suffix_mult** %4
%5 = load i8*, i8** %3
%6 = load %struct.suffix_mult*, %struct.suffix_mult** %4
%7 = call i64 @xatoull_sfx(i8* %5, %struct.suffix_mult* %6)
ret i64 %7
}

LLVM IR (-O2):
%struct.suffix_mult = type { i32 }
define i64 @xatoul_sfx(i8* %0, %struct.suffix_mult* %1) {
%3 = tail call i64 @xatoull_sfx(i8* %0, %struct.suffix_mult* %1)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x55() {
  Assert_real((iscntrl(85) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              430, ("iscntrl should be 0 for U"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for U\00"
define void @t_iscntrl_0x55() {
%1 = tail call i64 @iscntrl(i32 85)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 430, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void swapiindex(struct iindexFormat **a, struct iindexFormat **b) {
  struct iindexFormat *tmp;
  tmp = *a;
  *a = *b;
  *b = tmp;
}


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

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

LLVM IR (-O0):
%struct.iindexFormat = type opaque
define void @swapiindex(%struct.iindexFormat** %0, %struct.iindexFormat** %1) {
%3 = alloca %struct.iindexFormat**
%4 = alloca %struct.iindexFormat**
%5 = alloca %struct.iindexFormat*
store %struct.iindexFormat** %0, %struct.iindexFormat*** %3
store %struct.iindexFormat** %1, %struct.iindexFormat*** %4
%6 = load %struct.iindexFormat**, %struct.iindexFormat*** %3
%7 = load %struct.iindexFormat*, %struct.iindexFormat** %6
store %struct.iindexFormat* %7, %struct.iindexFormat** %5
%8 = load %struct.iindexFormat**, %struct.iindexFormat*** %4
%9 = load %struct.iindexFormat*, %struct.iindexFormat** %8
%10 = load %struct.iindexFormat**, %struct.iindexFormat*** %3
store %struct.iindexFormat* %9, %struct.iindexFormat** %10
%11 = load %struct.iindexFormat*, %struct.iindexFormat** %5
%12 = load %struct.iindexFormat**, %struct.iindexFormat*** %4
store %struct.iindexFormat* %11, %struct.iindexFormat** %12
ret void
}

LLVM IR (-O2):
%struct.iindexFormat = type opaque
define void @swapiindex(%struct.iindexFormat** nocapture %0, %struct.iindexFormat** nocapture %1) {
%3 = load %struct.iindexFormat*, %struct.iindexFormat** %0
%4 = load %struct.iindexFormat*, %struct.iindexFormat** %1
store %struct.iindexFormat* %4, %struct.iindexFormat** %0
store %struct.iindexFormat* %3, %struct.iindexFormat** %1
ret void
}
void SIZEOF_FUNCTION() { int SIZEOF = sizeof(int); }


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

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

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

LLVM IR (-O2):
define void @SIZEOF_FUNCTION() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
int __VERIFIER_nondet_int();
int main() {
  int N;
  int x = 0;
  int m = 0;
  int input;
  while (x < N) {
    input = __VERIFIER_nondet_int();
    if (input) {
      m = x;
    }
    x = x + 1;
  }
  if (N > 0) {
    __VERIFIER_assert((0 <= m) && (m < N));
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1171 <main+0x51>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1163 <main+0x43>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113d <main+0x1d>
cmpl   $0x0,-0x8(%rbp)
jle    11a4 <main+0x84>
xor    %eax,%eax
xor    %ecx,%ecx
cmp    -0x10(%rbp),%ecx
mov    %al,-0x15(%rbp)
jg     1197 <main+0x77>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
setl   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %4
br label %6
6: ; preds = %16, %0
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = load i32, i32* %3
store i32 %15, i32* %4
br label %16
16: ; preds = %14, %10
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %6
19: ; preds = %6
%20 = load i32, i32* %2
%21 = icmp sgt i32 %20, 0
br i1 %21, label %22, label %33
22: ; preds = %19
%23 = load i32, i32* %4
%24 = icmp sle i32 0, %23
br i1 %24, label %25, label %29
25: ; preds = %22
%26 = load i32, i32* %4
%27 = load i32, i32* %2
%28 = icmp slt i32 %26, %27
br label %29
29: ; preds = %25, %22
%30 = phi i1 [ false, %22 ], [ %28, %25 ]
%31 = zext i1 %30 to i32
%32 = call i32 @__VERIFIER_assert(i32 %31)
br label %33
33: ; preds = %29, %19
%34 = load i32, i32* %1
ret i32 %34
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int strcmp(char *, char *);
int reverse(char *p1, char *p2) { return (strcmp(p1, p2)); }


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

x86 assembly (clang, -O2):
<reverse>:
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @reverse(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 = call i32 @strcmp(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @reverse(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
unsigned int slapi_setbit_int(unsigned int f, unsigned int bitnum) {
  return (f | ((unsigned int)1 << bitnum));
}


x86 assembly (clang, -O0):
<slapi_setbit_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @slapi_setbit_int(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = or i32 %3, %0
ret i32 %4
}
void UpdateArg(int i, int *p) { *p += i; }


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

x86 assembly (clang, -O2):
<UpdateArg>:
add    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @UpdateArg(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 = load i32, i32* %6
%8 = add nsw i32 %7, %5
store i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @UpdateArg(i32 %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = add nsw i32 %3, %0
store i32 %4, i32* %1
ret void
}
unsigned long PWMARRGet(unsigned long ulBase) {
  ;
  return ((*((volatile unsigned long *)(ulBase + 0x0000002C))) & 0x0000FFFF);
}


x86 assembly (clang, -O0):
<PWMARRGet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2c(%rax),%rax
and    $0xffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMARRGet>:
mov    0x2c(%rdi),%rax
movzwl %ax,%eax
ret

LLVM IR (-O0):
define i64 @PWMARRGet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 44
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, 65535
ret i64 %7
}

LLVM IR (-O2):
define i64 @PWMARRGet(i64 %0) {
%2 = add i64 %0, 44
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = and i64 %4, 65535
ret i64 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ le16toh(int /*<<< orphan*/);
void unaligned_write_le16(void *_u, uint16_t a) {
  struct __attribute__((packed, may_alias)) {
    uint16_t x;
  } *u = _u;
  u->x = le16toh(a);
}


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

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

LLVM IR (-O0):
%struct.anon = type { i32 }
define void @unaligned_write_le16(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca %struct.anon*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.anon*
store %struct.anon* %7, %struct.anon** %5
%8 = load i32, i32* %4
%9 = call i32 @le16toh(i32 %8)
%10 = load %struct.anon*, %struct.anon** %5
%11 = getelementptr inbounds %struct.anon, %struct.anon* %10, i32 0, i32 0
store i32 %9, i32* %11
ret void
}

LLVM IR (-O2):
define void @unaligned_write_le16(i8* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @le16toh(i32 %1)
%4 = bitcast i8* %0 to i32*
store i32 %3, i32* %4
ret void
}
/* Variables and functions */
int close(int);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ printf(char *, char *);
char *strerror(int /*<<< orphan*/);
void cli_file_close(int fd) {
  if (close(fd) == -1)
    printf("warning: close() %s\n", strerror(errno));
}


x86 assembly (clang, -O0):
<cli_file_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
cmp    $0xffffffff,%eax
jne    1169 <cli_file_close+0x39>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %rax,%rsi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cli_file_close>:
push   %rax
call   1040 <close@plt>
cmp    $0xffffffff,%eax
je     113d <cli_file_close+0xd>
pop    %rax
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeae(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"warning: close() %s\0A\00"
@errno = global i32 0
define void @cli_file_close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @close(i32 %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* @errno
%8 = call i8* @strerror(i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %10
10: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"warning: close() %s\0A\00"
@errno = global i32 0
define void @cli_file_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @errno
%6 = tail call i8* @strerror(i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %8
8: ; preds = %4, %1
ret void
}
float oscEndian_f(const float x) {
  float ret;
  int size = sizeof(float);
  char *src = (char *)&x + sizeof(float) - 1;
  char *dst = (char *)&ret;
  while (size-- > 0) {
    *dst++ = *src--;
  }
  return ret;
}


x86 assembly (clang, -O0):
<oscEndian_f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movl   $0x4,-0xc(%rbp)
lea    -0x4(%rbp),%rax
add    $0x4,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
jle    1163 <oscEndian_f+0x63>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
jmp    1128 <oscEndian_f+0x28>
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<oscEndian_f>:
movd   %xmm0,%eax
bswap  %eax
movd   %eax,%xmm0
ret

LLVM IR (-O0):
define float @oscEndian_f(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store float %0, float* %2
store i32 4, i32* %4
%7 = bitcast float* %2 to i8*
%8 = getelementptr inbounds i8, i8* %7, i64 4
%9 = getelementptr inbounds i8, i8* %8, i64 -1
store i8* %9, i8** %5
%10 = bitcast float* %3 to i8*
store i8* %10, i8** %6
br label %11
11: ; preds = %15, %1
%12 = load i32, i32* %4
%13 = add nsw i32 %12, -1
store i32 %13, i32* %4
%14 = icmp sgt i32 %12, 0
br i1 %14, label %15, label %21
15: ; preds = %11
%16 = load i8*, i8** %5
%17 = getelementptr inbounds i8, i8* %16, i32 -1
store i8* %17, i8** %5
%18 = load i8, i8* %16
%19 = load i8*, i8** %6
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %6
store i8 %18, i8* %19
br label %11
21: ; preds = %11
%22 = load float, float* %3
ret float %22
}

LLVM IR (-O2):
define float @oscEndian_f(float %0) {
%2 = bitcast float %0 to i32
%3 = call i32 @llvm.bswap.i32(i32 %2)
%4 = bitcast i32 %3 to float
ret float %4
}
/* Variables and functions */
char *strcpy(char *, char const *);
size_t strlen(char const *);
scalar_t__ xmalloc(size_t);
char *xstrdup(const char *s) {
  size_t len = strlen(s);
  char *p = (char *)xmalloc(len + 1);
  return strcpy(p, s);
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1050 <xmalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <xmalloc@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = add i64 %7, 1
%9 = call i64 @xmalloc(i64 %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = load i8*, i8** %2
%13 = call i8* @strcpy(i8* %11, i8* %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i64 @xmalloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i8* @strcpy(i8* dereferenceable(1) %5, i8* dereferenceable(1) %0)
ret i8* %5
}
unsigned long choose_bm_space(unsigned long devsize) {
  if (devsize < 64 * 2)
    return 0;
  if (devsize - 64 * 2 >= 200 * 1024 * 1024 * 2)
    return 128 * 2;
  if (devsize - 4 * 2 > 8 * 1024 * 1024 * 2)
    return 64 * 2;
  return 4 * 2;
}


x86 assembly (clang, -O0):
<choose_bm_space>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x80,-0x10(%rbp)
jae    1123 <choose_bm_space+0x23>
movq   $0x0,-0x8(%rbp)
jmp    116f <choose_bm_space+0x6f>
mov    -0x10(%rbp),%rax
sub    $0x80,%rax
cmp    $0x19000000,%rax
jb     1146 <choose_bm_space+0x46>
movq   $0x100,-0x8(%rbp)
jmp    116f <choose_bm_space+0x6f>
mov    -0x10(%rbp),%rax
sub    $0x8,%rax
cmp    $0x1000000,%rax
jbe    1167 <choose_bm_space+0x67>
movq   $0x80,-0x8(%rbp)
jmp    116f <choose_bm_space+0x6f>
movq   $0x8,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<choose_bm_space>:
cmp    $0x80,%rdi
jae    110c <choose_bm_space+0xc>
xor    %eax,%eax
ret
lea    -0x19000080(%rdi),%rcx
mov    $0x100,%eax
cmp    $0xffffffffe7000000,%rcx
jb     113d <choose_bm_space+0x3d>
add    $0xfffffffffefffff7,%rdi
cmp    $0xfffffffffeffffff,%rdi
mov    $0x80,%ecx
mov    $0x8,%eax
cmovb  %rcx,%rax
ret

LLVM IR (-O0):
define i64 @choose_bm_space(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp ult i64 %4, 128
br i1 %5, label %6, label %7
6: ; preds = %1
store i64 0, i64* %2
br label %18
7: ; preds = %1
%8 = load i64, i64* %3
%9 = sub i64 %8, 128
%10 = icmp uge i64 %9, 419430400
br i1 %10, label %11, label %12
11: ; preds = %7
store i64 256, i64* %2
br label %18
12: ; preds = %7
%13 = load i64, i64* %3
%14 = sub i64 %13, 8
%15 = icmp ugt i64 %14, 16777216
br i1 %15, label %16, label %17
16: ; preds = %12
store i64 128, i64* %2
br label %18
17: ; preds = %12
store i64 8, i64* %2
br label %18
18: ; preds = %17, %16, %11, %6
%19 = load i64, i64* %2
ret i64 %19
}

LLVM IR (-O2):
define i64 @choose_bm_space(i64 %0) {
%2 = icmp ult i64 %0, 128
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = add i64 %0, -419430528
%5 = icmp ult i64 %4, -419430400
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = add nsw i64 %0, -16777225
%8 = icmp ult i64 %7, -16777217
%9 = select i1 %8, i64 128, i64 8
br label %10
10: ; preds = %6, %3, %1
%11 = phi i64 [ 0, %1 ], [ 256, %3 ], [ %9, %6 ]
ret i64 %11
}
/* Variables and functions */
size_t sav_compressed_row_bound(size_t uncompressed_length) {
  return uncompressed_length + (uncompressed_length / 8 + 8) / 8 * 8;
}


x86 assembly (clang, -O0):
<sav_compressed_row_bound>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
shr    $0x3,%rcx
add    $0x8,%rcx
shr    $0x3,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sav_compressed_row_bound>:
mov    %rdi,%rax
shr    $0x3,%rax
add    $0x8,%rax
and    $0xfffffffffffffff8,%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @sav_compressed_row_bound(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* %2
%5 = udiv i64 %4, 8
%6 = add i64 %5, 8
%7 = udiv i64 %6, 8
%8 = mul i64 %7, 8
%9 = add i64 %3, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @sav_compressed_row_bound(i64 %0) {
%2 = lshr i64 %0, 3
%3 = add nuw nsw i64 %2, 8
%4 = and i64 %3, 4611686018427387896
%5 = add i64 %4, %0
ret i64 %5
}