xunge/DecIR huggingface dataset:
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double datetime_stamp_now(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return (1000000 * tv.tv_sec + tv.tv_usec) / 1000.0;
}


x86 assembly (clang, -O0):
<datetime_stamp_now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x8(%rbp),%eax
add    -0x4(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xec5(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<datetime_stamp_now>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,(%rsp),%eax
add    0x4(%rsp),%eax
cvtsi2sd %eax,%xmm0
divsd  0xece(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define double @datetime_stamp_now() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 1000000, %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = add nsw i32 %5, %7
%9 = sitofp i32 %8 to double
%10 = fdiv double %9, 1.000000e+03
ret double %10
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define double @datetime_stamp_now() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
%10 = sitofp i32 %9 to double
%11 = fdiv double %10, 1.000000e+03
ret double %11
}
/* Variables and functions */
char *malloc(int);
int rand();
char *realloc(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
char *fn39() {
  char *result;
  result = malloc(20 + rand() % 20);
  result = realloc(result, 30 + rand() % 20);
  strcpy((char *)result, "fn39");
  return result;
}


x86 assembly (clang, -O0):
<fn39>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    -0x10(%rbp),%rdi
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x1e,%esi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe67(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn39>:
push   %rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1e,%esi
mov    %rbx,%rdi
call   1050 <realloc@plt>
mov    %rax,%rbx
lea    0xe4f(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"fn39\00"
define i8* @fn39() {
%1 = alloca i8*
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 20
%4 = add nsw i32 20, %3
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 20
%9 = add nsw i32 30, %8
%10 = call i8* @realloc(i8* %6, i32 %9)
store i8* %10, i8** %1
%11 = load i8*, i8** %1
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"fn39\00"
define i8* @fn39() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 20
%3 = add nsw i32 %2, 20
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 20
%7 = add nsw i32 %6, 30
%8 = tail call i8* @realloc(i8* %4, i32 %7)
%9 = tail call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int Handle_Output(char *x) {
  printf("%s", x);
  return (0);
}


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

x86 assembly (clang, -O2):
<Handle_Output>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @Handle_Output(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
int executeQuit(void) { return -1; }


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

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

LLVM IR (-O0):
define i32 @executeQuit() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @executeQuit() {
ret i32 -1
}
void glutAddMenuEntry(const char *label, int value) {}


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

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

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

LLVM IR (-O2):
define void @glutAddMenuEntry(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int max(int *, int);
int /*<<< orphan*/ radix_counting_sort(int *, int, int, int);
void radix_sort(int nums[], int n) {
  int radix = 10;
  int mx = max(nums, n);
  int exp;
  for (exp = 1; mx / exp > 0; exp *= radix)
    radix_counting_sort(nums, n, exp, radix);
}


x86 assembly (clang, -O0):
<radix_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0xa,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <max@plt>
mov    %eax,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cltd
idivl  -0x18(%rbp)
cmp    $0x0,%eax
jle    117d <radix_sort+0x5d>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <radix_counting_sort@plt>
mov    -0x10(%rbp),%eax
imul   -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    114c <radix_sort+0x2c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<radix_sort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %rdi,%r15
call   1040 <max@plt>
test   %eax,%eax
jle    1160 <radix_sort+0x40>
mov    %eax,%ebp
mov    $0x1,%ebx
nopl   (%rax)
mov    %r15,%rdi
mov    %r14d,%esi
mov    %ebx,%edx
mov    $0xa,%ecx
call   1030 <radix_counting_sort@plt>
add    %ebx,%ebx
lea    (%rbx,%rbx,4),%ebx
mov    %ebp,%eax
cltd
idiv   %ebx
test   %eax,%eax
jg     1140 <radix_sort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @radix_sort(i32* %0, i32 %1) {
%3 = tail call i32 @max(i32* %0, i32 %1)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ 1, %2 ]
%7 = tail call i32 @radix_counting_sort(i32* %0, i32 %1, i32 %6, i32 10)
%8 = mul nsw i32 %6, 10
%9 = sdiv i32 %3, %8
%10 = icmp sgt i32 %9, 0
br i1 %10, label %5, label %11
11: ; preds = %5, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ append(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ display_name(char const *, char const *);
void on_int64(void *ctx, const char *code, const char *name, int64_t value) {
  append("%s: %lld", display_name(code, name), value);
}


x86 assembly (clang, -O0):
<on_int64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <display_name@plt>
mov    %eax,%esi
mov    -0x1c(%rbp),%edx
lea    0xeb0(%rip),%rdi
call   1030 <append@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<on_int64>:
push   %rbx
mov    %ecx,%ebx
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1040 <display_name@plt>
lea    0xecb(%rip),%rdi
mov    %eax,%esi
mov    %ebx,%edx
pop    %rbx
jmp    1030 <append@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"%s: %lld\00"
define void @on_int64(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %6
%10 = load i8*, i8** %7
%11 = call i32 @display_name(i8* %9, i8* %10)
%12 = load i32, i32* %8
%13 = call i32 @append(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"%s: %lld\00"
define void @on_int64(i8* nocapture readnone %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i32 @display_name(i8* %1, i8* %2)
%6 = tail call i32 @append(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %3)
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
void clean_buffer(char *str) {
  if (strcmp(str, "\\exit\r\n") == 0 || strcmp(str, "\\exit\n") == 0) {
    char *p = str + 1;
    strncpy(str, p, 256 - 1);
  }
}


x86 assembly (clang, -O0):
<clean_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     1160 <clean_buffer+0x40>
mov    -0x8(%rbp),%rdi
lea    0xeb7(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    117e <clean_buffer+0x5e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0xff,%edx
call   1030 <strncpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean_buffer>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     114b <clean_buffer+0x2b>
lea    0xecc(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     114b <clean_buffer+0x2b>
pop    %rbx
ret
lea    0x1(%rbx),%rsi
mov    %rbx,%rdi
mov    $0xff,%edx
pop    %rbx
jmp    1030 <strncpy@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"\\exit\0D\0A\00"
@.str.1 = [7 x i8] c"\\exit\0A\00"
define void @clean_buffer(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4, %1
%8 = getelementptr inbounds i8, i8* %0, i64 1
%9 = tail call i32 @strncpy(i8* %0, i8* %8, i32 255)
br label %10
10: ; preds = %7, %4
ret void
}
void mmc_stor_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @mmc_stor_exit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *, char *);
void f_error(char *filename, char *message) {
  char error[50];
  snprintf(error, 50, "%s: %s%s", "sleep", (message == NULL) ? "" : message,
           filename);
  perror(error);
}


x86 assembly (clang, -O0):
<f_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x50(%rbp),%rax
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1153 <f_error+0x33>
lea    0xec4(%rip),%rax
mov    %rax,-0x60(%rbp)
jmp    115b <f_error+0x3b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x58(%rbp),%rdi
mov    -0x60(%rbp),%r8
mov    -0x8(%rbp),%r9
mov    $0x32,%esi
lea    0xe8d(%rip),%rdx
lea    0xe8f(%rip),%rcx
call   1030 <snprintf@plt>
lea    -0x50(%rbp),%rdi
call   1040 <perror@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_error>:
push   %rbx
sub    $0x40,%rsp
mov    %rdi,%r9
test   %rsi,%rsi
lea    0xedc(%rip),%r8
cmovne %rsi,%r8
lea    0xec3(%rip),%rdx
lea    0xec5(%rip),%rcx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x32,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%s: %s%s\00"
@.str.1 = [6 x i8] c"sleep\00"
@.str.2 = [1 x i8] zeroinitializer
define void @f_error(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [50 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %4
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %10
9: ; preds = %2
br label %12
10: ; preds = %2
%11 = load i8*, i8** %4
br label %12
12: ; preds = %10, %9
%13 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), %9 ], [ %11, %10 ]
%14 = load i8*, i8** %3
%15 = call i32 @snprintf(i8* %6, i32 50, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %13, i8* %14)
%16 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
%17 = call i32 @perror(i8* %16)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"%s: %s%s\00"
@.str.1 = [6 x i8] c"sleep\00"
@.str.2 = [1 x i8] zeroinitializer
define void @f_error(i8* %0, i8* %1) {
%3 = alloca [50 x i8]
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%5 = icmp eq i8* %1, null
%6 = select i1 %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* %1
%7 = call i32 @snprintf(i8* %4, i32 50, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %6, i8* %0)
%8 = call i32 @perror(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ remove_mem_info(void *);
void xfree(void *mem_ref) {
  remove_mem_info(mem_ref);
  free(mem_ref);
}


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

x86 assembly (clang, -O2):
<xfree>:
push   %rbx
mov    %rdi,%rbx
call   1040 <remove_mem_info@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @xfree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @remove_mem_info(i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @free(i8* %5)
ret void
}

LLVM IR (-O2):
define void @xfree(i8* %0) {
%2 = tail call i32 @remove_mem_info(i8* %0)
%3 = tail call i32 @free(i8* %0)
ret void
}
int main() { int a = {4, {"Hello", "World"}, 3.14}; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int rightrot(int x, int n) {
  int wordlength(void);
  while (n-- > 0) {
    x = x >> 1;
    x = x | (unsigned)((x & 1) << (wordlength() - 1));
  }
  return x;
}


x86 assembly (clang, -O0):
<rightrot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
jle    1168 <rightrot+0x58>
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0x10(%rbp)
call   1030 <wordlength@plt>
mov    -0x10(%rbp),%edx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    $0x1,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    111e <rightrot+0xe>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rightrot>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
test   %esi,%esi
jle    114d <rightrot+0x3d>
mov    %esi,%r14d
add    $0x1,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
sar    %ebx
mov    %ebx,%ebp
and    $0x1,%ebp
call   1030 <wordlength@plt>
lea    -0x1(%rax),%ecx
shl    %cl,%ebp
or     %ebp,%ebx
add    $0xffffffff,%r14d
cmp    $0x1,%r14d
ja     1130 <rightrot+0x20>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rightrot(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %5
5: ; preds = %9, %2
%6 = load i32, i32* %4
%7 = add nsw i32 %6, -1
store i32 %7, i32* %4
%8 = icmp sgt i32 %6, 0
br i1 %8, label %9, label %19
9: ; preds = %5
%10 = load i32, i32* %3
%11 = ashr i32 %10, 1
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = load i32, i32* %3
%14 = and i32 %13, 1
%15 = call i32 @wordlength()
%16 = sub nsw i32 %15, 1
%17 = shl i32 %14, %16
%18 = or i32 %12, %17
store i32 %18, i32* %3
br label %5
19: ; preds = %5
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @rightrot(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %15
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %13, %4 ], [ %0, %2 ]
%7 = add nsw i32 %5, -1
%8 = ashr i32 %6, 1
%9 = and i32 %8, 1
%10 = tail call i32 @wordlength()
%11 = add nsw i32 %10, -1
%12 = shl nuw i32 %9, %11
%13 = or i32 %12, %8
%14 = icmp ugt i32 %5, 1
br i1 %14, label %4, label %15
15: ; preds = %4, %2
%16 = phi i32 [ %0, %2 ], [ %13, %4 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ cBreak();
int /*<<< orphan*/ dash();
int /*<<< orphan*/ dot();
void sN() {
  dash();
  dot();
  cBreak();
}


x86 assembly (clang, -O0):
<sN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <dash@plt>
mov    $0x0,%al
call   1030 <dot@plt>
mov    $0x0,%al
call   1050 <cBreak@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sN>:
push   %rax
xor    %eax,%eax
call   1040 <dash@plt>
xor    %eax,%eax
call   1030 <dot@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <cBreak@plt>

LLVM IR (-O0):
define void @sN() {
%1 = call i32 (...) @dash()
%2 = call i32 (...) @dot()
%3 = call i32 (...) @cBreak()
ret void
}

LLVM IR (-O2):
define void @sN() {
%1 = tail call i32 (...) @dash()
%2 = tail call i32 (...) @dot()
%3 = tail call i32 (...) @cBreak()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void fibo_3(int n) {
  int i, a = 0, b = 1, t = 1;
  for (i = 0; i < n; i++) {
    t = a + b;
    a = b;
    b = t;
    printf("%d\n", a);
  }
}


x86 assembly (clang, -O0):
<fibo_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1175 <fibo_3+0x65>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1137 <fibo_3+0x27>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibo_3>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    1149 <fibo_3+0x39>
mov    %edi,%ebx
xor    %ebp,%ebp
mov    $0x1,%eax
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %eax,%r15d
add    %eax,%ebp
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %ebp,%eax
mov    %r15d,%ebp
add    $0xffffffff,%ebx
jne    1130 <fibo_3+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @fibo_3(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 1, %1 ]
%5 = phi i32 [ %4, %3 ], [ 0, %1 ]
%6 = phi i32 [ %9, %3 ], [ 0, %1 ]
%7 = add nsw i32 %4, %5
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%9 = add nuw nsw i32 %6, 1
%10 = icmp eq i32 %9, %0
br i1 %10, label %11, label %3
11: ; preds = %3, %1
ret void
}
/* Type definitions */
struct ibv_rwq_ind_table {
  int dummy;
};

/* Variables and functions */
int ibv_destroy_rwq_ind_table(struct ibv_rwq_ind_table *);
int mlx4_glue_destroy_rwq_ind_table(struct ibv_rwq_ind_table *rwq_ind_table) {
  return ibv_destroy_rwq_ind_table(rwq_ind_table);
}


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

x86 assembly (clang, -O2):
<mlx4_glue_destroy_rwq_ind_table>:
jmp    1030 <ibv_destroy_rwq_ind_table@plt>

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

LLVM IR (-O2):
%struct.ibv_rwq_ind_table = type { i32 }
define i32 @mlx4_glue_destroy_rwq_ind_table(%struct.ibv_rwq_ind_table* %0) {
%2 = tail call i32 @ibv_destroy_rwq_ind_table(%struct.ibv_rwq_ind_table* %0)
ret i32 %2
}
void ct_assert_do_nothing(struct ct_model *model) {}


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

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

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

LLVM IR (-O2):
%struct.ct_model = type opaque
define void @ct_assert_do_nothing(%struct.ct_model* nocapture %0) {
ret void
}
extern int func4(void) { return 4; }


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

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

LLVM IR (-O0):
define i32 @func4() {
ret i32 4
}

LLVM IR (-O2):
define i32 @func4() {
ret i32 4
}
/* Type definitions */
struct json_object {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ *json_get(struct json_object *, char const *);
int json_contains(struct json_object *object, const char *key) {
  return json_get(object, key) != NULL;
}


x86 assembly (clang, -O0):
<json_contains>:
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 <json_get@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<json_contains>:
push   %rax
call   1030 <json_get@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.json_object = type { i32 }
define i32 @json_contains(%struct.json_object* %0, i8* %1) {
%3 = alloca %struct.json_object*
%4 = alloca i8*
store %struct.json_object* %0, %struct.json_object** %3
store i8* %1, i8** %4
%5 = load %struct.json_object*, %struct.json_object** %3
%6 = load i8*, i8** %4
%7 = call i32* @json_get(%struct.json_object* %5, i8* %6)
%8 = icmp ne i32* %7, null
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
%struct.json_object = type { i32 }
define i32 @json_contains(%struct.json_object* %0, i8* %1) {
%3 = tail call i32* @json_get(%struct.json_object* %0, i8* %1)
%4 = icmp ne i32* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ depths;
};
typedef TYPE_1__ Screen;

/* Variables and functions */
void *get_Screen_depths(void *_p) { return (void *)((Screen *)_p)->depths; }


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

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

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

LLVM IR (-O2):
define i8* @get_Screen_depths(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
unsigned xrop3_106_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T & S;
  stk1 = D ^ stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_106_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_106_1_1>:
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
or     %edi,%esi
mov    %edi,%ecx
not    %cl
movzbl %cl,%ecx
not    %eax
and    %ecx,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_106_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = load i32, i32* %6
%24 = and i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %5
%26 = load i32, i32* %9
%27 = xor i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = load i32, i32* %6
%30 = xor i32 %29, -1
%31 = and i32 %28, %30
%32 = load i32, i32* %7
%33 = xor i32 %32, -1
%34 = and i32 %31, %33
%35 = load i32, i32* %5
%36 = load i32, i32* %6
%37 = and i32 %35, %36
%38 = or i32 %34, %37
%39 = load i32, i32* %5
%40 = load i32, i32* %7
%41 = and i32 %39, %40
%42 = or i32 %38, %41
ret i32 %42
}

LLVM IR (-O2):
define i32 @xrop3_106_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %1 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = xor i8 %0, -1
%6 = zext i8 %5 to i32
%7 = xor i32 %4, -1
%8 = and i32 %6, %7
%9 = or i8 %1, %0
%10 = zext i8 %9 to i32
%11 = or i32 %8, %10
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void close_files(FILE *in, FILE *out) {
  fclose(in);
  fclose(out);
}


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

x86 assembly (clang, -O2):
<close_files>:
push   %rbx
mov    %rsi,%rbx
call   1030 <fclose@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>

LLVM IR (-O0):
define void @close_files(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 = call i32 @fclose(i32* %5)
%7 = load i32*, i32** %4
%8 = call i32 @fclose(i32* %7)
ret void
}

LLVM IR (-O2):
define void @close_files(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @fclose(i32* %0)
%4 = tail call i32 @fclose(i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ quickSortHelp(int *, int /*<<< orphan*/, int);
void quickSort(int *arr, int len) { quickSortHelp(arr, 0, len - 1); }


x86 assembly (clang, -O0):
<quickSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <quickSortHelp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quickSort>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <quickSortHelp@plt>

LLVM IR (-O0):
define void @quickSort(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 = sub nsw i32 %6, 1
%8 = call i32 @quickSortHelp(i32* %5, i32 0, i32 %7)
ret void
}

LLVM IR (-O2):
define void @quickSort(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @quickSortHelp(i32* %0, i32 0, i32 %3)
ret void
}
int main() {
  struct business {
    char CustomName[21];
    char CustomAddress[41];
    char model[21];
    struct cash *CashStyle;
    struct loan *LoanStyle;
    struct rent *rentStyle;
  };
  struct cash {
    float ManufactuerSuggestedRealtailPriece;
    float ActualSellingPrice;
    float SalesTax;
    float LicensingFee;
  };
  struct rent {
    float ActualSellingPrice;
    float DownPayment;
    float SecurityDeposit;
    float MonthlyPayment;
    int LeaseTerm;
  };
  struct loan {
    float ManufactuerSuggestedRealtailPriece;
    float ActualSellingPrice;
    float DownPagment;
    float SecurityDeposit;
    float MonthlyPayment;
    float LeaseTerm;
  };
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void foo(unsigned int *p) {
  if ((signed char)(*p & 0xFF) == 17 || (signed char)(*p & 0xFF) == 18)
    return;
  else
    abort();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xff,%eax
movsbl %al,%eax
cmp    $0x11,%eax
je     114a <foo+0x3a>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xff,%eax
movsbl %al,%eax
cmp    $0x12,%eax
jne    1150 <foo+0x40>
add    $0x10,%rsp
pop    %rbp
ret
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<foo>:
push   %rax
mov    (%rdi),%eax
shl    $0x18,%eax
cmp    $0x12000000,%eax
je     1124 <foo+0x14>
cmp    $0x11000000,%eax
jne    1126 <foo+0x16>
pop    %rax
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @foo(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 255
%6 = trunc i32 %5 to i8
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 17
br i1 %8, label %16, label %9
9: ; preds = %1
%10 = load i32*, i32** %2
%11 = load i32, i32* %10
%12 = and i32 %11, 255
%13 = trunc i32 %12 to i8
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 18
br i1 %15, label %16, label %17
16: ; preds = %9, %1
ret void
17: ; preds = %9
%18 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @foo(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 24
switch i32 %3, label %5 [
i32 285212672, label %4
i32 301989888, label %4
]
4: ; preds = %1, %1
ret void
5: ; preds = %1
%6 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int i = 0;
  int acc = 0;
  for (i; i < 1000; i++) {
    acc += i;
  }
  printf("no, yo soy tu padre... %d!\n", acc);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x3e8,-0x14(%rbp)
jge    1158 <main+0x48>
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1134 <main+0x24>
mov    -0x18(%rbp),%esi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [28 x i8] c"no, yo soy tu padre... %d!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
%8 = load i32, i32* %6
br label %9
9: ; preds = %16, %2
%10 = load i32, i32* %6
%11 = icmp slt i32 %10, 1000
br i1 %11, label %12, label %19
12: ; preds = %9
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = add nsw i32 %14, %13
store i32 %15, i32* %7
br label %16
16: ; preds = %12
%17 = load i32, i32* %6
%18 = add nsw i32 %17, 1
store i32 %18, i32* %6
br label %9
19: ; preds = %9
%20 = load i32, i32* %7
%21 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"no, yo soy tu padre... %d!\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 499500)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ crypt(int *, int *, int);
void decrypt(int plaintext[], int key[]) { crypt(plaintext, key, 1); }


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

x86 assembly (clang, -O2):
<decrypt>:
mov    $0x1,%edx
jmp    1030 <crypt@plt>

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

LLVM IR (-O2):
define void @decrypt(i32* %0, i32* %1) {
%3 = tail call i32 @crypt(i32* %0, i32* %1, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
scalar_t__ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int puts(const char *s) {
  if (fputs(s, stdout)) {
    return -1;
  } else {
    fputc('\n', stdout);
    return 0;
  }
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
cmp    $0x0,%rax
je     1154 <puts+0x34>
movl   $0xffffffff,-0x4(%rbp)
jmp    116e <puts+0x4e>
mov    0x2e85(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1040 <fputc@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%esi
call   1030 <fputs@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
je     113e <puts+0x1e>
pop    %rbx
ret
mov    (%rbx),%esi
mov    $0xa,%edi
call   1040 <fputc@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
define i32 @puts(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i32, i32* @stdout
%6 = call i64 @fputs(i8* %4, i32 %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %12
9: ; preds = %1
%10 = load i32, i32* @stdout
%11 = call i32 @fputc(i8 signext 10, i32 %10)
store i32 0, i32* %2
br label %12
12: ; preds = %9, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @puts(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i64 @fputs(i8* %0, i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* @stdout
%7 = tail call i32 @fputc(i8 signext 10, i32 %6)
br label %8
8: ; preds = %1, %5
%9 = phi i32 [ 0, %5 ], [ -1, %1 ]
ret i32 %9
}
int(cstrlen)(const char *s) {
  const char *p = s;
  while (*p != '\0')
    p = p + 2;
  return (int)(p - s);
}


x86 assembly (clang, -O0):
<cstrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1131 <cstrlen+0x31>
mov    -0x10(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <cstrlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cstrlen>:
mov    $0xfffffffe,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x2,%eax
cmpb   $0x0,(%rdi)
lea    0x2(%rdi),%rdi
jne    1110 <cstrlen+0x10>
ret

LLVM IR (-O0):
define i32 @cstrlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %10, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 2
store i8* %12, i8** %3
br label %5
13: ; preds = %5
%14 = load i8*, i8** %3
%15 = load i8*, i8** %2
%16 = ptrtoint i8* %14 to i64
%17 = ptrtoint i8* %15 to i64
%18 = sub i64 %16, %17
%19 = trunc i64 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @cstrlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 2
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
/* Variables and functions */
scalar_t__ convertBCD(int /*<<< orphan*/, unsigned int);
unsigned long int2BCD5(unsigned int input) {
  return (unsigned long)convertBCD(0, input);
}


x86 assembly (clang, -O0):
<int2BCD5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
xor    %edi,%edi
call   1030 <convertBCD@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int2BCD5>:
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <convertBCD@plt>

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

LLVM IR (-O2):
define i64 @int2BCD5(i32 %0) {
%2 = tail call i64 @convertBCD(i32 0, i32 %0)
ret i64 %2
}
/* Variables and functions */
unsigned char *haval224_buffer(unsigned char *, unsigned char const *, size_t);
unsigned char *hash_buffer_haval224(unsigned char *out, const unsigned char *in,
                                    size_t in_len) {
  return haval224_buffer(out, in, in_len);
}


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

x86 assembly (clang, -O2):
<hash_buffer_haval224>:
jmp    1030 <haval224_buffer@plt>

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

LLVM IR (-O2):
define i8* @hash_buffer_haval224(i8* %0, i8* %1, i64 %2) {
%4 = tail call i8* @haval224_buffer(i8* %0, i8* %1, i64 %2)
ret i8* %4
}
int FnCompare_double(const void *v1, const void *v2) {
  const double *i1 = v1;
  const double *i2 = v2;
  if (*i1 < *i2)
    return (-1);
  else if (*i1 > *i2)
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<FnCompare_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1142 <FnCompare_double+0x42>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <FnCompare_double+0x6b>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    1164 <FnCompare_double+0x64>
movl   $0x1,-0x4(%rbp)
jmp    116b <FnCompare_double+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FnCompare_double>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @FnCompare_double(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double*
%7 = alloca double*
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
store double* %9, double** %6
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to double*
store double* %11, double** %7
%12 = load double*, double** %6
%13 = load double, double* %12
%14 = load double*, double** %7
%15 = load double, double* %14
%16 = fcmp olt double %13, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 -1, i32* %3
br label %26
18: ; preds = %2
%19 = load double*, double** %6
%20 = load double, double* %19
%21 = load double*, double** %7
%22 = load double, double* %21
%23 = fcmp ogt double %20, %22
br i1 %23, label %24, label %25
24: ; preds = %18
store i32 1, i32* %3
br label %26
25: ; preds = %18
store i32 0, i32* %3
br label %26
26: ; preds = %25, %24, %17
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @FnCompare_double(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = bitcast i8* %1 to double*
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
%8 = fcmp ogt double %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
unsigned long get_tpuser(void) {
  unsigned long reg = 0;
  if (0 && !0)
    __asm__("mrc p15, 0, %0, c13, c0, 2" : "=r"(reg));
  return reg;
}


x86 assembly (clang, -O0):
<get_tpuser>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @get_tpuser() {
%1 = alloca i64
store i64 0, i64* %1
%2 = load i64, i64* %1
ret i64 %2
}

LLVM IR (-O2):
define i64 @get_tpuser() {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ __ESBMC_assume(int);
int /*<<< orphan*/ assert(int);
int main() {
  typedef int *intptr;
  intptr a[10];
  int x, y;
  unsigned i;
  __ESBMC_assume(i < 10);
  a[i] = &x;
  a[5] = &y;
  assert(*(a[i]) == x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
cmpl   $0xa,-0x5c(%rbp)
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__ESBMC_assume@plt>
mov    -0x5c(%rbp),%eax
lea    -0x54(%rbp),%rcx
mov    %rcx,-0x50(%rbp,%rax,8)
lea    -0x58(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x5c(%rbp),%eax
mov    -0x50(%rbp,%rax,8),%rax
mov    (%rax),%eax
cmp    -0x54(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <__ESBMC_assume@plt>
mov    $0x1,%edi
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [10 x i32*]
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = load i32, i32* %4
%6 = icmp ult i32 %5, 10
%7 = zext i1 %6 to i32
%8 = call i32 @__ESBMC_assume(i32 %7)
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds [10 x i32*], [10 x i32*]* %1, i64 0, i64 %10
store i32* %2, i32** %11
%12 = getelementptr inbounds [10 x i32*], [10 x i32*]* %1, i64 0, i64 5
store i32* %3, i32** %12
%13 = load i32, i32* %4
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds [10 x i32*], [10 x i32*]* %1, i64 0, i64 %14
%16 = load i32*, i32** %15
%17 = load i32, i32* %16
%18 = load i32, i32* %2
%19 = icmp eq i32 %17, %18
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__ESBMC_assume(i32 0)
%2 = tail call i32 @assert(i32 1)
ret i32 0
}