xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Calc();
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  printf("Executing \"%s\" (argc=%d)\n", argv[0], argc);
  Calc();
  printf("done...");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x4(%rbp),%edx
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <Calc@plt>
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %edi,%edx
mov    (%rsi),%rsi
lea    0xed3(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <Calc@plt>
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Executing \22%s\22 (argc=%d)\0A\00"
@.str.1 = [8 x i8] c"done...\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 0
%7 = load i8*, i8** %6
%8 = load i32, i32* %3
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8)
%10 = call i32 (...) @Calc()
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"Executing \22%s\22 (argc=%d)\0A\00"
@.str.1 = [8 x i8] c"done...\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %3, i32 %0)
%5 = tail call i32 (...) @Calc()
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
int is_letter(const char c) {
  if (c >= 'a' && c <= 'z') {
    return 1;
  }
  if (c >= 'A' && c <= 'Z') {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_letter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1130 <is_letter+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     1130 <is_letter+0x30>
movl   $0x1,-0x4(%rbp)
jmp    115d <is_letter+0x5d>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1156 <is_letter+0x56>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     1156 <is_letter+0x56>
movl   $0x1,-0x4(%rbp)
jmp    115d <is_letter+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_letter>:
and    $0xdf,%dil
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_letter(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 122
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %22
12: ; preds = %7, %1
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp sge i32 %14, 65
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp sle i32 %18, 90
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 1, i32* %2
br label %22
21: ; preds = %16, %12
store i32 0, i32* %2
br label %22
22: ; preds = %21, %20, %11
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @is_letter(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
ugt() {
  ol("CMP  BX,AX");
  ol("MOV  AX,1");
  ol("JA   $+5");
  ol("MOV  AX,0");
}


x86 assembly (clang, -O0):
<ugt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <ol@plt>
lea    0xee0(%rip),%rdi
call   1030 <ol@plt>
lea    0xede(%rip),%rdi
call   1030 <ol@plt>
lea    0xedb(%rip),%rdi
call   1030 <ol@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ugt>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <ol@plt>
lea    0xee7(%rip),%rdi
call   1030 <ol@plt>
lea    0xee5(%rip),%rdi
call   1030 <ol@plt>
lea    0xee2(%rip),%rdi
pop    %rax
jmp    1030 <ol@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"CMP BX,AX\00"
@.str.1 = [10 x i8] c"MOV AX,1\00"
@.str.2 = [9 x i8] c"JA $+5\00"
@.str.3 = [10 x i8] c"MOV AX,0\00"
define i32 @ugt() {
%1 = alloca i32
%2 = call i32 @ol(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @ol(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @ol(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @ol(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
@.str = [11 x i8] c"CMP BX,AX\00"
@.str.1 = [10 x i8] c"MOV AX,1\00"
@.str.2 = [9 x i8] c"JA $+5\00"
@.str.3 = [10 x i8] c"MOV AX,0\00"
define i32 @ugt() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @ol(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @ol(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @ol(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
double RAND_MAX;
double rand();
long get_randnum(long min, long max) {
  return min + (long)((float)max * (rand() / (RAND_MAX + 1.0)));
}


x86 assembly (clang, -O0):
<get_randnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
cvtsi2ssq -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x20(%rbp),%rax
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  0xeae(%rip),%xmm2
mov    0x2e8f(%rip),%rcx
addsd  (%rcx),%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_randnum>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
cvtsi2ss %rsi,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2eb3(%rip),%rax
movsd  (%rax),%xmm1
addsd  0xebf(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  0x8(%rsp),%xmm0
cvttsd2si %xmm0,%rax
add    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define i64 @get_randnum(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = sitofp i64 %6 to float
%8 = fpext float %7 to double
%9 = call double (...) @rand()
%10 = load double, double* @RAND_MAX
%11 = fadd double %10, 1.000000e+00
%12 = fdiv double %9, %11
%13 = fmul double %8, %12
%14 = fptosi double %13 to i64
%15 = add nsw i64 %5, %14
ret i64 %15
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define i64 @get_randnum(i64 %0, i64 %1) {
%3 = sitofp i64 %1 to float
%4 = fpext float %3 to double
%5 = tail call double (...) @rand()
%6 = load double, double* @RAND_MAX
%7 = fadd double %6, 1.000000e+00
%8 = fdiv double %5, %7
%9 = fmul double %8, %4
%10 = fptosi double %9 to i64
%11 = add nsw i64 %10, %0
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
char *tmpnam(char *);
int main() {
  char s[20];
  printf("%s, s %s\n", tmpnam(s), s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
call   1040 <tmpnam@plt>
mov    %rax,%rsi
lea    -0x20(%rbp),%rdx
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <tmpnam@plt>
lea    0xec9(%rip),%rdi
mov    %rax,%rsi
mov    %rbx,%rdx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%s, s %s\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i8* @tmpnam(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %2)
ret i32 0
}
int do_442() { return 442; }


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

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

LLVM IR (-O0):
define i32 @do_442() {
ret i32 442
}

LLVM IR (-O2):
define i32 @do_442() {
ret i32 442
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
char *rewrite_null(int code) {
  error("missing #cpu declaration");
  return 0;
}


x86 assembly (clang, -O0):
<rewrite_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <error@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [25 x i8] c"missing #cpu declaration\00"
define i8* @rewrite_null(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @error(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@.str = [25 x i8] c"missing #cpu declaration\00"
define noalias i8* @rewrite_null(i32 %0) {
%2 = tail call i32 @error(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i8* null
}
int *B() { return 0; }


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

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

LLVM IR (-O0):
define i32* @B() {
ret i32* null
}

LLVM IR (-O2):
define noalias i32* @B() {
ret i32* null
}
unsigned int calc_gcd(unsigned int *a, unsigned int *b) {
  if (*b == 0)
    return *a;
  *a = *a - (*b) * ((*a) / (*b));
  return calc_gcd(b, a);
}


x86 assembly (clang, -O0):
<calc_gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpl   $0x0,(%rax)
jne    113b <calc_gcd+0x2b>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1178 <calc_gcd+0x68>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rsi
xor    %edx,%edx
divl   (%rsi)
mov    %eax,%edx
mov    -0x1c(%rbp),%eax
imul   %edx,%eax
sub    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calc_gcd@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_gcd>:
mov    (%rsi),%ecx
test   %ecx,%ecx
je     112b <calc_gcd+0x2b>
cs nopw 0x0(%rax,%rax,1)
mov    %rsi,%r8
mov    (%rdi),%eax
xor    %edx,%edx
div    %ecx
mov    %edx,%ecx
mov    %edx,(%rdi)
mov    %rdi,%rsi
mov    %r8,%rdi
test   %edx,%edx
jne    1110 <calc_gcd+0x10>
mov    (%r8),%eax
ret
mov    %rdi,%r8
mov    (%r8),%eax
ret

LLVM IR (-O0):
define i32 @calc_gcd(i32* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
%6 = load i32*, i32** %5
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i32*, i32** %4
%11 = load i32, i32* %10
store i32 %11, i32* %3
br label %28
12: ; preds = %2
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = load i32*, i32** %5
%16 = load i32, i32* %15
%17 = load i32*, i32** %4
%18 = load i32, i32* %17
%19 = load i32*, i32** %5
%20 = load i32, i32* %19
%21 = udiv i32 %18, %20
%22 = mul i32 %16, %21
%23 = sub i32 %14, %22
%24 = load i32*, i32** %4
store i32 %23, i32* %24
%25 = load i32*, i32** %5
%26 = load i32*, i32** %4
%27 = call i32 @calc_gcd(i32* %25, i32* %26)
store i32 %27, i32* %3
br label %28
28: ; preds = %12, %9
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @calc_gcd(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %8, %2
%6 = phi i32* [ %0, %2 ], [ %10, %8 ]
%7 = load i32, i32* %6
ret i32 %7
8: ; preds = %2, %8
%9 = phi i32 [ %13, %8 ], [ %3, %2 ]
%10 = phi i32* [ %11, %8 ], [ %1, %2 ]
%11 = phi i32* [ %10, %8 ], [ %0, %2 ]
%12 = load i32, i32* %11
%13 = urem i32 %12, %9
store i32 %13, i32* %11
%14 = icmp eq i32 %13, 0
br i1 %14, label %5, label %8
}
int read_initial_state_information(void) {}


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

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

LLVM IR (-O0):
define i32 @read_initial_state_information() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @read_initial_state_information() {
ret i32 undef
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void *memdup(const void *mem, size_t bytes) {
  void *p = malloc(bytes);
  if (!p) {
    return 0;
  }
  memcpy(p, mem, bytes);
  return p;
}


x86 assembly (clang, -O0):
<memdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1155 <memdup+0x35>
movq   $0x0,-0x8(%rbp)
jmp    116e <memdup+0x4e>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memdup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1149 <memdup+0x29>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @memdup(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
%7 = load i64, i64* %5
%8 = call i8* @malloc(i64 %7)
store i8* %8, i8** %6
%9 = load i8*, i8** %6
%10 = icmp ne i8* %9, null
br i1 %10, label %12, label %11
11: ; preds = %2
store i8* null, i8** %3
br label %18
12: ; preds = %2
%13 = load i8*, i8** %6
%14 = load i8*, i8** %4
%15 = load i64, i64* %5
%16 = call i32 @memcpy(i8* %13, i8* %14, i64 %15)
%17 = load i8*, i8** %6
store i8* %17, i8** %3
br label %18
18: ; preds = %12, %11
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
define i8* @memdup(i8* %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @memcpy(i8* %3, i8* %0, i64 %1)
br label %7
7: ; preds = %2, %5
ret i8* %3
}
int foo(__int128 x) { return x; }


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

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

LLVM IR (-O0):
define i32 @foo(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = bitcast i128* %3 to { i64, i64 }*
%6 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %5, i32 0, i32 0
store i64 %0, i64* %6
%7 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %5, i32 0, i32 1
store i64 %1, i64* %7
%8 = load i128, i128* %3
store i128 %8, i128* %4
%9 = load i128, i128* %4
%10 = trunc i128 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @foo(i64 %0, i64 %1) {
%3 = trunc i64 %0 to i32
ret i32 %3
}
/* Variables and functions */
int getValueFromFile(char *);
int getCpuFreq(void) {
  int result;
  result = (int)(getValueFromFile(
                     "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq") /
                 1000);
  return result;
}


x86 assembly (clang, -O0):
<getCpuFreq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <getValueFromFile@plt>
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCpuFreq>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <getValueFromFile@plt>
cltq
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [54 x i8] c"/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq\00"
define i32 @getCpuFreq() {
%1 = alloca i32
%2 = call i32 @getValueFromFile(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%3 = sdiv i32 %2, 1000
store i32 %3, i32* %1
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [54 x i8] c"/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq\00"
define i32 @getCpuFreq() {
%1 = tail call i32 @getValueFromFile(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%2 = sdiv i32 %1, 1000
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ log_err(char *);
char *malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
char *displayACLRuleHeader() {
  char *buffer = malloc(200);
  if (buffer == NULL) {
    log_err("displayACLRuleHeader: Unable to allocate memory.");
    return NULL;
  }
  strcpy(buffer, "index address               mask                  type \n");
  return buffer;
}


x86 assembly (clang, -O0):
<displayACLRuleHeader>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xc8,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116a <displayACLRuleHeader+0x3a>
lea    0xea8(%rip),%rdi
call   1050 <log_err@plt>
movq   $0x0,-0x8(%rbp)
jmp    1182 <displayACLRuleHeader+0x52>
mov    -0x10(%rbp),%rdi
lea    0xebc(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<displayACLRuleHeader>:
push   %rbx
mov    $0xc8,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1154 <displayACLRuleHeader+0x24>
lea    0xee7(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
jmp    1160 <displayACLRuleHeader+0x30>
lea    0xea5(%rip),%rdi
call   1050 <log_err@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [49 x i8] c"displayACLRuleHeader: Unable to allocate memory.\00"
@.str.1 = [57 x i8] c"index address mask type \0A\00"
define i8* @displayACLRuleHeader() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* @malloc(i32 200)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @log_err(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
store i8* null, i8** %1
br label %12
8: ; preds = %0
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %9, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0))
%11 = load i8*, i8** %2
store i8* %11, i8** %1
br label %12
12: ; preds = %8, %6
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str = [49 x i8] c"displayACLRuleHeader: Unable to allocate memory.\00"
@.str.1 = [57 x i8] c"index address mask type \0A\00"
define i8* @displayACLRuleHeader() {
%1 = tail call dereferenceable_or_null(200) i8* @malloc(i32 200)
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @log_err(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %0
%6 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret i8* %1
}
void voidfn() { return; }


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

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

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

LLVM IR (-O2):
define void @voidfn() {
ret void
}
/* Variables and functions */
char *strcasestr(char const *, char const *);
char *my_strcasestr(const char *s1, const char *s2) {
  return strcasestr(s1, s2);
}


x86 assembly (clang, -O0):
<my_strcasestr>:
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 <strcasestr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strcasestr>:
jmp    1030 <strcasestr@plt>

LLVM IR (-O0):
define i8* @my_strcasestr(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 i8* @strcasestr(i8* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @my_strcasestr(i8* %0, i8* %1) {
%3 = tail call i8* @strcasestr(i8* %0, i8* %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *progname) {
  fprintf(stderr, "Usage: %s [-dv] [export_file [...]]\n", progname);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"Usage: %s [-dv] [export_file [...]]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"Usage: %s [-dv] [export_file [...]]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ pauseparsing_();
void PauseParsing() { pauseparsing_(); }


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

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

LLVM IR (-O0):
define void @PauseParsing() {
%1 = call i32 (...) @pauseparsing_()
ret void
}

LLVM IR (-O2):
define void @PauseParsing() {
%1 = tail call i32 (...) @pauseparsing_()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ XButtonEvent;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void free_XButtonEvent(void *_p) {
  if (_p == NULL)
    abort();
  free((XButtonEvent *)_p);
}


x86 assembly (clang, -O0):
<free_XButtonEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113e <free_XButtonEvent+0x1e>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_XButtonEvent>:
test   %rdi,%rdi
je     112a <free_XButtonEvent+0xa>
jmp    1030 <free@plt>
push   %rax
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define void @free_XButtonEvent(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = call i32 @free(i32* %9)
ret void
}

LLVM IR (-O2):
define void @free_XButtonEvent(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
%6 = bitcast i8* %0 to i32*
%7 = tail call i32 @free(i32* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *cmd) { printf("%s [-c <config>]\n", cmd); }


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [18 x i8] c"%s [-c <config>]\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void f(int b) { int \U000000e9[b]; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %3
%8 = alloca i32, i64 %6
store i64 %6, i64* %4
%9 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
define void @f(i32 %0) {
ret void
}
/* Type definitions */
struct shmem {
  int dummy;
};

/* Variables and functions */
int shmdt(struct shmem *);
int deAllocSharedMem(struct shmem *shmem) { return shmdt(shmem); }


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

x86 assembly (clang, -O2):
<deAllocSharedMem>:
jmp    1030 <shmdt@plt>

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

LLVM IR (-O2):
%struct.shmem = type { i32 }
define i32 @deAllocSharedMem(%struct.shmem* %0) {
%2 = tail call i32 @shmdt(%struct.shmem* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x8a() {
  Assert_real((isdigit(138) == 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_isdigit.c",
              695, ("isdigit should be 0 for 0x8a"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0x8a>:
push   %rax
mov    $0x8a,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2b7,%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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x8a\00"
define void @t_isdigit_0x8a() {
%1 = call i64 @isdigit(i32 138)
%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 695, i8* getelementptr inbounds ([29 x i8], [29 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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x8a\00"
define void @t_isdigit_0x8a() {
%1 = tail call i64 @isdigit(i32 138)
%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 695, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ srand(unsigned int);
void GaussNoiseSeed(unsigned int seed) { srand(seed); }


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

x86 assembly (clang, -O2):
<GaussNoiseSeed>:
jmp    1030 <srand@plt>

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

LLVM IR (-O2):
define void @GaussNoiseSeed(i32 %0) {
%2 = tail call i32 @srand(i32 %0)
ret void
}
void fsl_udc_clk_enable(void) {}


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

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

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

LLVM IR (-O2):
define void @fsl_udc_clk_enable() {
ret void
}
/* Variables and functions */
int is_setting_active(char *);
int is_mptcp_active() {
  return is_setting_active("/proc/sys/net/mptcp/mptcp_enabled");
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"/proc/sys/net/mptcp/mptcp_enabled\00"
define i32 @is_mptcp_active() {
%1 = call i32 @is_setting_active(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [34 x i8] c"/proc/sys/net/mptcp/mptcp_enabled\00"
define i32 @is_mptcp_active() {
%1 = tail call i32 @is_setting_active(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
void exactinit(void) {}


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

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

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

LLVM IR (-O2):
define void @exactinit() {
ret void
}
int open_registry_file(void) {}


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

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

LLVM IR (-O0):
define i32 @open_registry_file() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @open_registry_file() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ sample1();
int /*<<< orphan*/ sample2();
int main() {
  sample1();
  sample2();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <sample1@plt>
xor    %eax,%eax
call   1040 <sample2@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @sample1()
%3 = call i32 (...) @sample2()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @sample1()
%2 = tail call i32 (...) @sample2()
ret i32 0
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_event_get_fd(void *e) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_event_get_fd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ecf(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_event_get_fd>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_event_get_fd(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_event_get_fd(i8* nocapture readnone %0) {
%2 = load i32, i32* @EINVAL
%3 = sub nsw i32 0, %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ __ESBMC_assume(int);
int /*<<< orphan*/ assert(int);
int nondet_int();
int main() {
  int i = 0, x = 0, y = 0;
  int n = nondet_int();
  __ESBMC_assume(n > 0);
  for (i = 0; 1; i++) {
    assert(x == 0);
  }
  assert(x == 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <nondet_int@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__ESBMC_assume@plt>
movl   $0x0,-0x8(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    1185 <main+0x55>
jmp    11a4 <main+0x74>
cmpl   $0x0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1176 <main+0x46>
cmpl   $0x0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <nondet_int@plt>
xor    %edi,%edi
test   %eax,%eax
setg   %dil
call   1040 <__ESBMC_assume@plt>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x1,%edi
call   1050 <assert@plt>
jmp    1150 <main+0x20>

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* %2
store i32 0, i32* %3
store i32 0, i32* %4
%6 = call i32 (...) @nondet_int()
store i32 %6, i32* %5
%7 = load i32, i32* %5
%8 = icmp sgt i32 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @__ESBMC_assume(i32 %9)
store i32 0, i32* %2
br label %11
11: ; preds = %17, %0
br i1 true, label %12, label %20
12: ; preds = %11
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 0
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
br label %17
17: ; preds = %12
%18 = load i32, i32* %2
%19 = add nsw i32 %18, 1
store i32 %19, i32* %2
br label %11
20: ; preds = %11
%21 = load i32, i32* %3
%22 = icmp eq i32 %21, 0
%23 = zext i1 %22 to i32
%24 = call i32 @assert(i32 %23)
%25 = load i32, i32* %1
ret i32 %25
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @nondet_int()
%2 = icmp sgt i32 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @__ESBMC_assume(i32 %3)
br label %5
5: ; preds = %5, %0
%6 = tail call i32 @assert(i32 1)
br label %5
}
mod2(signed short x) { return x % -1; }


x86 assembly (clang, -O0):
<mod2>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
mov    $0xffffffff,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @mod2(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = srem i32 %4, -1
ret i32 %5
}

LLVM IR (-O2):
define i32 @mod2(i16 signext %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ scanf(char *, float *);
main() {
  float metroCubico;
  scanf("%f", &metroCubico);
  printf("%f", metroCubico * 1000);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xece(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  0xeb9(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed8(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
mulss  0xeb9(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%4 = load float, float* %2
%5 = fmul float %4, 1.000000e+03
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%4 = load float, float* %1
%5 = fmul float %4, 1.000000e+03
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *realloc(void *, size_t);
void *srx_DefaultMemFunc(void *userdata, void *ptr, size_t size) {
  (void)userdata;
  if (size)
    return realloc(ptr, size);
  free(ptr);
  return NULL;
}


x86 assembly (clang, -O0):
<srx_DefaultMemFunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1155 <srx_DefaultMemFunc+0x35>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
jmp    1166 <srx_DefaultMemFunc+0x46>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<srx_DefaultMemFunc>:
mov    %rsi,%rdi
test   %rdx,%rdx
je     1130 <srx_DefaultMemFunc+0x10>
mov    %rdx,%rsi
jmp    1040 <realloc@plt>
push   %rax
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @srx_DefaultMemFunc(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
%8 = load i8*, i8** %5
%9 = load i64, i64* %7
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %3
%12 = load i8*, i8** %6
%13 = load i64, i64* %7
%14 = call i8* @realloc(i8* %12, i64 %13)
store i8* %14, i8** %4
br label %18
15: ; preds = %3
%16 = load i8*, i8** %6
%17 = call i32 @free(i8* %16)
store i8* null, i8** %4
br label %18
18: ; preds = %15, %11
%19 = load i8*, i8** %4
ret i8* %19
}

LLVM IR (-O2):
define noalias i8* @srx_DefaultMemFunc(i8* nocapture readnone %0, i8* nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i8* @realloc(i8* %1, i64 %2)
br label %9
7: ; preds = %3
%8 = tail call i32 @free(i8* %1)
br label %9
9: ; preds = %7, %5
%10 = phi i8* [ %6, %5 ], [ null, %7 ]
ret i8* %10
}
void print_string(string) const char *string;
{
  while (*string != '\0')
    print_char(*string++);
}


x86 assembly (clang, -O0):
<print_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114a <print_string+0x3a>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
mov    $0x0,%al
call   1030 <print_char@plt>
jmp    111c <print_string+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_string>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1135 <print_string+0x25>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
xor    %eax,%eax
call   1030 <print_char@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <print_string+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @print_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @print_char to i32 (i32, ...)*)(i32 %7)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
int f(int s, int c) {
  int a1, a2, a3, a4, x1, x2, x3, x4, x;
  a1 = 2 * s;
  x1 = c + a1;
  a2 = 4 * s;
  x2 = c + a2;
  a3 = 7 * s;
  x3 = c + a3;
  a4 = 5 * s;
  x4 = c + a4;
  x = x1 + x2 + x3 + x4;
  return x;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x20(%rbp)
imul   $0x7,-0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
imul   $0x5,-0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x1c(%rbp),%eax
add    -0x20(%rbp),%eax
add    -0x24(%rbp),%eax
add    -0x28(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
lea    (%rdi,%rdi,8),%eax
add    %eax,%eax
lea    (%rax,%rsi,4),%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = shl i32 %1, 2
%4 = mul i32 %0, 18
%5 = add i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void sigabort() { exit(-1); }


x86 assembly (clang, -O0):
<sigabort>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<sigabort>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @sigabort() {
%1 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define void @sigabort() {
%1 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
char *U_EMR_CORE5_set(int);
char *U_EMRWIDENPATH_set(void) { return (U_EMR_CORE5_set(66)); }


x86 assembly (clang, -O0):
<U_EMRWIDENPATH_set>:
push   %rbp
mov    %rsp,%rbp
mov    $0x42,%edi
call   1030 <U_EMR_CORE5_set@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<U_EMRWIDENPATH_set>:
mov    $0x42,%edi
jmp    1030 <U_EMR_CORE5_set@plt>

LLVM IR (-O0):
define i8* @U_EMRWIDENPATH_set() {
%1 = call i8* @U_EMR_CORE5_set(i32 66)
ret i8* %1
}

LLVM IR (-O2):
define i8* @U_EMRWIDENPATH_set() {
%1 = tail call i8* @U_EMR_CORE5_set(i32 66)
ret i8* %1
}
extern int func5(void) { return 5; }


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

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

LLVM IR (-O0):
define i32 @func5() {
ret i32 5
}

LLVM IR (-O2):
define i32 @func5() {
ret i32 5
}
int main() {
  unsigned int a = 1, b = 1, i = 0, temp = 0;
  for (i = 0; i < 20; i++) {
    temp = a;
    a = b;
    b += temp;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x14,-0x10(%rbp)
jae    115b <main+0x5b>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112e <main+0x2e>
xor    %eax,%eax
pop    %rbp
ret

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

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

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