xunge/DecIR huggingface dataset:
int imax(n, m)
int n, m;
{ return (n > m ? n : m); }


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

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

LLVM IR (-O0):
define i32 @imax(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @imax(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int oad(int, int);
int gjmp(int t) { return oad(0xe9, t); }


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

x86 assembly (clang, -O2):
<gjmp>:
mov    %edi,%esi
mov    $0xe9,%edi
jmp    1030 <oad@plt>

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

LLVM IR (-O2):
define i32 @gjmp(i32 %0) {
%2 = tail call i32 @oad(i32 233, i32 %0)
ret i32 %2
}
unsigned int rotateLeft(unsigned int x) {
  unsigned int lastBit = 0x80000000 & x;
  lastBit = lastBit >> 31;
  x = x << 1;
  return (x | lastBit);
}


x86 assembly (clang, -O0):
<rotateLeft>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x80000000,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x1f,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotateLeft>:
mov    %edi,%eax
rol    %eax
ret

LLVM IR (-O0):
define i32 @rotateLeft(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 -2147483648, %4
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = lshr i32 %6, 31
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = shl i32 %8, 1
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = or i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rotateLeft(i32 %0) {
%2 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 1)
ret i32 %2
}
/* Variables and functions */
double __nv_ddiv_rz(double, double);
double __ddiv_rz(double __a, double __b) { return __nv_ddiv_rz(__a, __b); }


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

x86 assembly (clang, -O2):
<__ddiv_rz>:
jmp    1030 <__nv_ddiv_rz@plt>

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

LLVM IR (-O2):
define double @__ddiv_rz(double %0, double %1) {
%3 = tail call double @__nv_ddiv_rz(double %0, double %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int usage(const char *path) {
  printf("Usage: %s [CONF_FILE]\n", path);
  return 0;
}


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>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [23 x i8] c"Usage: %s [CONF_FILE]\0A\00"
define i32 @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
/* Variables and functions */
scalar_t__ libsais_unbwt_create_ctx_main(int);
void *libsais_unbwt_create_ctx(void) {
  return (void *)libsais_unbwt_create_ctx_main(1);
}


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

x86 assembly (clang, -O2):
<libsais_unbwt_create_ctx>:
mov    $0x1,%edi
jmp    1030 <libsais_unbwt_create_ctx_main@plt>

LLVM IR (-O0):
define i8* @libsais_unbwt_create_ctx() {
%1 = call i64 @libsais_unbwt_create_ctx_main(i32 1)
%2 = inttoptr i64 %1 to i8*
ret i8* %2
}

LLVM IR (-O2):
define i8* @libsais_unbwt_create_ctx() {
%1 = tail call i64 @libsais_unbwt_create_ctx_main(i32 1)
%2 = inttoptr i64 %1 to i8*
ret i8* %2
}
void free_2d(int **A, int x) {
  for (int i = 0; i < x; ++i)
    free(A[i]);
  free(A);
}


x86 assembly (clang, -O0):
<free_2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <free_2d+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free_2d+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_2d>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <free_2d+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_2d+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_2d(i32** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = bitcast i32** %0 to i8*
tail call void @free(i8* %7)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i32*, i32** %0, i64 %9
%11 = bitcast i32** %10 to i8**
%12 = load i8*, i8** %11
tail call void @free(i8* %12)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
long test_long_3(long a, long b, long c) { return a * b * c; }


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

x86 assembly (clang, -O2):
<test_long_3>:
mov    %rdi,%rax
imul   %rsi,%rax
imul   %rdx,%rax
ret

LLVM IR (-O0):
define i64 @test_long_3(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = mul nsw i64 %7, %8
%10 = load i64, i64* %6
%11 = mul nsw i64 %9, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @test_long_3(i64 %0, i64 %1, i64 %2) {
%4 = mul nsw i64 %1, %0
%5 = mul nsw i64 %4, %2
ret i64 %5
}
void sgi_set_rspeed(void) {}


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

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

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

LLVM IR (-O2):
define void @sgi_set_rspeed() {
ret void
}
void outsb(unsigned short port, const void *addr, unsigned long count) {
  __asm__ __volatile__("cld ; rep ; outs"
                       "b"
                       : "=S"(addr), "=c"(count)
                       : "d"(port), "0"(addr), "1"(count));
}


x86 assembly (clang, -O0):
<outsb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
cld
rep outsb %ds:(%rsi),(%dx)
mov    %rsi,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outsb>:
mov    %rdx,%rcx
mov    %edi,%edx
cld
rep outsb %ds:(%rsi),(%dx)
ret

LLVM IR (-O0):
define void @outsb(i16 zeroext %0, i8* %1, i64 %2) {
%4 = alloca i16
%5 = alloca i8*
%6 = alloca i64
store i16 %0, i16* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i16, i16* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call { i8*, i64 } asm sideeffect "cld ; rep ; outsb", "={si},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %7, i8* %8, i64 %9)
%11 = extractvalue { i8*, i64 } %10, 0
%12 = extractvalue { i8*, i64 } %10, 1
store i8* %11, i8** %5
store i64 %12, i64* %6
ret void
}

LLVM IR (-O2):
define void @outsb(i16 zeroext %0, i8* %1, i64 %2) {
%4 = tail call { i8*, i64 } asm sideeffect "cld ; rep ; outsb", "={si},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ e_lda();
int /*<<< orphan*/ e_zpx();
void e_lda_zpx() {
  e_zpx();
  e_lda();
}


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

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

LLVM IR (-O0):
define void @e_lda_zpx() {
%1 = call i32 (...) @e_zpx()
%2 = call i32 (...) @e_lda()
ret void
}

LLVM IR (-O2):
define void @e_lda_zpx() {
%1 = tail call i32 (...) @e_zpx()
%2 = tail call i32 (...) @e_lda()
ret void
}
void simple_destroy(void) {}


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

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

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

LLVM IR (-O2):
define void @simple_destroy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fz_free(void *, void *);
void zfree(void *opaque, void *address) { fz_free(opaque, address); }


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

x86 assembly (clang, -O2):
<zfree>:
jmp    1030 <fz_free@plt>

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

LLVM IR (-O2):
define void @zfree(i8* %0, i8* %1) {
%3 = tail call i32 @fz_free(i8* %0, i8* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ by_ptr_mm(int /*<<< orphan*/);
void or_by_ptr_mm(uint32_t x) {
  by_ptr_mm(x);
  or ();
}


x86 assembly (clang, -O0):
<or_by_ptr_mm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <by_ptr_mm@plt>
mov    $0x0,%al
call   1030 <or@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @or_by_ptr_mm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @by_ptr_mm(i32 %3)
%5 = call i32 (...) @or()
ret void
}

LLVM IR (-O2):
define void @or_by_ptr_mm(i32 %0) {
%2 = tail call i32 @by_ptr_mm(i32 %0)
%3 = tail call i32 (...) @or()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ permute(char *, int /*<<< orphan*/, scalar_t__);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
scalar_t__ strlen(char *);
int main() {
  char str[100];
  printf("Enter a string.\n");
  scanf("%s", str);
  permute(str, 0, strlen(str) - 1);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xea7(%rip),%rdi
call   1050 <printf@plt>
lea    -0x70(%rbp),%rsi
lea    0xea8(%rip),%rdi
call   1060 <scanf@plt>
lea    -0x70(%rbp),%rax
mov    %rax,-0x78(%rbp)
lea    -0x70(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x78(%rbp),%rdi
mov    %rax,%rdx
sub    $0x1,%rdx
xor    %esi,%esi
call   1030 <permute@plt>
mov    $0x1,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xeb7(%rip),%rdi
call   1030 <puts@plt>
lea    0xea8(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
lea    -0x1(%rax),%rdx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <permute@plt>
mov    $0x1,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a string.\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%8 = call i64 @strlen(i8* %7)
%9 = sub nsw i64 %8, 1
%10 = call i32 @permute(i8* %6, i32 0, i64 %9)
ret i32 1
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@str = [16 x i8] c"Enter a string.\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i64 @strlen(i8* %2)
%6 = add nsw i64 %5, -1
%7 = call i32 @permute(i8* %2, i32 0, i64 %6)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long long);
int /*<<< orphan*/ solver();
unsigned long long walltime_us();
int main(void) {
  unsigned long long t0 = walltime_us();
  solver();
  unsigned long long t1 = walltime_us();
  printf("usec: %llu\n", t1 - t0);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <walltime_us@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <solver@plt>
xor    %eax,%eax
call   1040 <walltime_us@plt>
sub    %rbx,%rax
lea    0xead(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"usec: %llu\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @walltime_us()
%2 = tail call i32 (...) @solver()
%3 = tail call i64 (...) @walltime_us()
%4 = sub i64 %3, %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i64 %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ xs;

/* Variables and functions */
int /*<<< orphan*/ threeSum(int *, int, int *);
int main() {
  int xs[] = {4, -1, 0, 1, 2, -1};
  int x;
  threeSum(xs, sizeof(xs) / sizeof(xs[0]), &x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x6,%esi
lea    -0x24(%rbp),%rdx
call   1030 <threeSum@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rdx
mov    $0x6,%esi
call   1030 <threeSum@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.xs = [6 x i32] [i32 4, i32 -1, i32 0, i32 1, i32 2, i32 -1]
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [6 x i32]* %2 to i8*
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%6 = call i32 @threeSum(i32* %5, i32 6, i32* %3)
ret i32 0
}

LLVM IR (-O2):
@__const.main.xs = [6 x i32] [i32 4, i32 -1, i32 0, i32 1, i32 2, i32 -1]
define i32 @main() {
%1 = alloca [6 x i32]
%2 = alloca i32
%3 = bitcast [6 x i32]* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%6 = call i32 @threeSum(i32* %5, i32 6, i32* %2)
ret i32 0
}
int picked2() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @picked2() {
ret i32 0
}
int ft_isascii(int c) {
  if (c <= 127 && c >= 0)
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<ft_isascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x7f,-0x8(%rbp)
jg     1127 <ft_isascii+0x27>
cmpl   $0x0,-0x8(%rbp)
jl     1127 <ft_isascii+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <ft_isascii+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isascii>:
xor    %eax,%eax
cmp    $0x80,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @ft_isascii(i32 %0) {
%2 = icmp ult i32 %0, 128
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
size_t strlen(char *);
int check_name(char *string, size_t m) { return strlen(string) <= m; }


x86 assembly (clang, -O0):
<check_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    -0x10(%rbp),%rax
setbe  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_name>:
push   %rbx
mov    %rsi,%rbx
call   1030 <strlen@plt>
xor    %ecx,%ecx
cmp    %rbx,%rax
setbe  %cl
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @check_name(i8* nocapture %0, i64 %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = icmp ule i64 %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
void YabThreadYield(void) {}


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

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

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

LLVM IR (-O2):
define void @YabThreadYield() {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ height;
};
typedef TYPE_1__ XSizeHints;

/* Variables and functions */
int get_XSizeHints_height(void *_p) { return (int)((XSizeHints *)_p)->height; }


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XSizeHints_height(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 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XSizeHints_height(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
void strpush(char *base, char *s) {
  while (*base)
    base++;
  while (*s) {
    *base++ = *s++;
  }
  *base = '\0';
}


x86 assembly (clang, -O0):
<strpush>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     112a <strpush+0x2a>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <strpush+0xc>
jmp    112f <strpush+0x2f>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1163 <strpush+0x63>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    112f <strpush+0x2f>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<strpush>:
mov    %rdi,%rcx
add    $0x1,%rdi
cmpb   $0x0,(%rcx)
jne    1100 <strpush>
mov    (%rsi),%al
test   %al,%al
je     1136 <strpush+0x36>
mov    $0xffffffffffffffff,%rcx
nopl   0x0(%rax)
mov    %al,(%rdi,%rcx,1)
movzbl 0x2(%rsi,%rcx,1),%eax
add    $0x1,%rcx
test   %al,%al
jne    1120 <strpush+0x20>
add    %rcx,%rdi
mov    %rdi,%rcx
movb   $0x0,(%rcx)
ret

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

LLVM IR (-O2):
define void @strpush(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = load i8, i8* %1
%10 = icmp eq i8 %9, 0
br i1 %10, label %19, label %11
11: ; preds = %8, %11
%12 = phi i8 [ %17, %11 ], [ %9, %8 ]
%13 = phi i8* [ %15, %11 ], [ %1, %8 ]
%14 = phi i8* [ %16, %11 ], [ %4, %8 ]
%15 = getelementptr inbounds i8, i8* %13, i64 1
%16 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %12, i8* %14
%17 = load i8, i8* %15
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %11
19: ; preds = %11, %8
%20 = phi i8* [ %4, %8 ], [ %16, %11 ]
store i8 0, i8* %20
ret void
}
/* Variables and functions */
int /*<<< orphan*/ db_free();
void ssa_db_close() { db_free(); }


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

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

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

LLVM IR (-O2):
define void @ssa_db_close() {
%1 = tail call i32 (...) @db_free()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ console_putchar(char);
int /*<<< orphan*/ console_putstring(char const *);
int puts(const char *s) {
  console_putstring(s);
  console_putchar('\n');
  return -1;
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <console_putstring@plt>
mov    $0xa,%edi
call   1040 <console_putchar@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rax
call   1030 <console_putstring@plt>
mov    $0xa,%edi
call   1040 <console_putchar@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @puts(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @console_putstring(i8* %3)
%5 = call i32 @console_putchar(i8 signext 10)
ret i32 -1
}

LLVM IR (-O2):
define i32 @puts(i8* %0) {
%2 = tail call i32 @console_putstring(i8* %0)
%3 = tail call i32 @console_putchar(i8 signext 10)
ret i32 -1
}
void _exit(int status) {
  int (*nacl_exit)(int status) = (0x10000 + ((30) * 32));
  nacl_exit(status);
  __asm__("hlt");
}


x86 assembly (clang, -O0):
<_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x103c0,%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%edi
call   *%rax
hlt

x86 assembly (clang, -O2):
<_exit>:
push   %rax
mov    $0x103c0,%eax
call   *%rax
hlt

LLVM IR (-O0):
define void @_exit(i32 %0) {
%2 = alloca i32
%3 = alloca i32 (i32)*
store i32 %0, i32* %2
store i32 (i32)* inttoptr (i64 66496 to i32 (i32)*), i32 (i32)** %3
%4 = load i32 (i32)*, i32 (i32)** %3
%5 = load i32, i32* %2
%6 = call i32 %4(i32 %5)
unreachable
}

LLVM IR (-O2):
define void @_exit(i32 %0) {
%2 = tail call i32 inttoptr (i64 66496 to i32 (i32)*)(i32 %0)
tail call void asm sideeffect "hlt", "~{dirflag},~{fpsr},~{flags}"()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *prg) {
  fprintf(stderr,
          "Usage: %s TFILE IFILE EPS EPS_RATIO_1 C0 RLEN NI BF [SEED]\n", prg);
  exit(EXIT_FAILURE);
}


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    0x2e8c(%rip),%rax
mov    (%rax),%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    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [60 x i8] c"Usage: %s TFILE IFILE EPS EPS_RATIO_1 C0 RLEN NI BF [SEED]\0A\00"
@EXIT_FAILURE = global i32 0
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 ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [60 x i8] c"Usage: %s TFILE IFILE EPS EPS_RATIO_1 C0 RLEN NI BF [SEED]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
unsigned int ENOSYS;
unsigned int sysfs_cpu_exists(unsigned int cpu) { return -ENOSYS; }


x86 assembly (clang, -O0):
<sysfs_cpu_exists>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    0x2ed8(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @sysfs_cpu_exists(i32 %0) {
%2 = load i32, i32* @ENOSYS
%3 = sub i32 0, %2
ret i32 %3
}
int retZero() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @retZero() {
ret i32 0
}
unsigned int cpuid_eax(unsigned int op) {
  unsigned int eax;
  __asm__("mov %%ebx, %%edi;"
          "cpuid;"
          "mov %%edi, %%ebx;"
          : "=a"(eax)
          : "0"(op)
          : "ecx", "edx", "edi");
  return eax;
}


x86 assembly (clang, -O0):
<cpuid_eax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %ebx,%edi
cpuid
mov    %edi,%ebx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_eax>:
mov    %edi,%eax
mov    %ebx,%edi
cpuid
mov    %edi,%ebx
ret

LLVM IR (-O0):
define i32 @cpuid_eax(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 asm "mov %ebx, %edi;cpuid;mov %edi, %ebx;", "={ax},0,~{ecx},~{edx},~{edi},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @cpuid_eax(i32 %0) {
%2 = tail call i32 asm "mov %ebx, %edi;cpuid;mov %edi, %ebx;", "={ax},0,~{ecx},~{edx},~{edi},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i32 %2
}
char *mop_longopts_arg(char *option) {
  for (; *option && *option != '='; option++)
    ;
  if (*option == '=')
    return option + 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<mop_longopts_arg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     112d <mop_longopts_arg+0x2d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3d,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    113d <mop_longopts_arg+0x3d>
jmp    1153 <mop_longopts_arg+0x53>
jmp    1142 <mop_longopts_arg+0x42>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <mop_longopts_arg+0x8>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3d,%eax
jne    1174 <mop_longopts_arg+0x74>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    117c <mop_longopts_arg+0x7c>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mop_longopts_arg>:
add    $0x1,%rdi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl -0x1(%rdi),%ecx
test   %cl,%cl
je     1123 <mop_longopts_arg+0x23>
cmp    $0x3d,%cl
je     1123 <mop_longopts_arg+0x23>
add    $0x1,%rdi
jmp    1110 <mop_longopts_arg+0x10>
xor    %eax,%eax
cmp    $0x3d,%cl
cmove  %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @mop_longopts_arg(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %7
i8 61, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2
%8 = icmp eq i8 %4, 61
%9 = getelementptr inbounds i8, i8* %3, i64 1
%10 = select i1 %8, i8* %9, i8* null
ret i8* %10
}
float potencia(int n) { return n / (n + 1.0); }


x86 assembly (clang, -O0):
<potencia>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xee7(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<potencia>:
cvtsi2sd %edi,%xmm0
movsd  0xef4(%rip),%xmm1
addsd  %xmm0,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @potencia(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = load i32, i32* %2
%6 = sitofp i32 %5 to double
%7 = fadd double %6, 1.000000e+00
%8 = fdiv double %4, %7
%9 = fptrunc double %8 to float
ret float %9
}

LLVM IR (-O2):
define float @potencia(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fadd double %2, 1.000000e+00
%4 = fdiv double %2, %3
%5 = fptrunc double %4 to float
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void setcolor(int arg) {
  printf("\x1b["
         "48;5;%dm",
         arg);
}


x86 assembly (clang, -O0):
<setcolor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setcolor>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"\1B[48;5;%dm\00"
define void @setcolor(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"\1B[48;5;%dm\00"
define void @setcolor(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
scalar_t__ gen_tempname(char *);
char *mkdtemp(char *Template) {
  if (gen_tempname(Template))
    return NULL;
  else
    return Template;
}


x86 assembly (clang, -O0):
<mkdtemp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <gen_tempname@plt>
cmp    $0x0,%rax
je     113c <mkdtemp+0x2c>
movq   $0x0,-0x8(%rbp)
jmp    1144 <mkdtemp+0x34>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkdtemp>:
push   %rbx
mov    %rdi,%rbx
call   1030 <gen_tempname@plt>
xor    %ecx,%ecx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @mkdtemp(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @gen_tempname(i8* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* null, i8** %2
br label %10
8: ; preds = %1
%9 = load i8*, i8** %3
store i8* %9, i8** %2
br label %10
10: ; preds = %8, %7
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
define i8* @mkdtemp(i8* %0) {
%2 = tail call i64 @gen_tempname(i8* %0)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i8* %0, i8* null
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
void division(int x, int y, int z) {
  float III = (x / y);
  III /= z;
  printf("[!] divided (a/b)/c = %f\n", III);
}


x86 assembly (clang, -O0):
<division>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
cvtsi2ssl -0xc(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<division>:
mov    %edx,%ecx
mov    %edi,%eax
cltd
idiv   %esi
cvtsi2ss %eax,%xmm0
cvtsi2ss %ecx,%xmm1
divss  %xmm1,%xmm0
lea    0xed6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"[!] divided (a/b)/c = %f\0A\00"
define void @division(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = sdiv i32 %8, %9
%11 = sitofp i32 %10 to float
store float %11, float* %7
%12 = load i32, i32* %6
%13 = sitofp i32 %12 to float
%14 = load float, float* %7
%15 = fdiv float %14, %13
store float %15, float* %7
%16 = load float, float* %7
%17 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), float %16)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"[!] divided (a/b)/c = %f\0A\00"
define void @division(i32 %0, i32 %1, i32 %2) {
%4 = sdiv i32 %0, %1
%5 = sitofp i32 %4 to float
%6 = sitofp i32 %2 to float
%7 = fdiv float %5, %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), float %7)
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int read_standard_start_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(13, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<read_standard_start_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xd,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_standard_start_system>:
mov    $0xd,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @read_standard_start_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 13, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @read_standard_start_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 13, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xc8() {
  Assert_real((isdigit(200) == 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",
              1005, ("isdigit should be 0 for 0xc8"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0xc8>:
push   %rax
mov    $0xc8,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3ed,%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 0xc8\00"
define void @t_isdigit_0xc8() {
%1 = call i64 @isdigit(i32 200)
%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 1005, 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 0xc8\00"
define void @t_isdigit_0xc8() {
%1 = tail call i64 @isdigit(i32 200)
%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 1005, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int foo(int bar) {
  bar -= 3;
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
ret i32 0
}
void XtDisplayStringConversionWarning() {}


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

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

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

LLVM IR (-O2):
define void @XtDisplayStringConversionWarning() {
ret void
}
/* Variables and functions */
float pow(float, double);
float sRGB_decode_f(float f) {
  float lin;
  if (f <= 0.03928)
    lin = f / 12.92;
  else
    lin = pow((f + 0.055) / 1.055, 2.4);
  return lin;
}


x86 assembly (clang, -O0):
<sRGB_decode_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xed2(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     115b <sRGB_decode_f+0x4b>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed7(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1192 <sRGB_decode_f+0x82>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeac(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xe98(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movsd  0xe80(%rip),%xmm1
call   1030 <pow@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sRGB_decode_f>:
cvtss2sd %xmm0,%xmm0
movsd  0xee4(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    1143 <sRGB_decode_f+0x33>
addsd  0xee6(%rip),%xmm0
divsd  0xee6(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movsd  0xee2(%rip),%xmm1
jmp    1030 <pow@plt>
divsd  0xebd(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @sRGB_decode_f(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fpext float %4 to double
%6 = fcmp ole double %5, 3.928000e-02
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load float, float* %2
%9 = fpext float %8 to double
%10 = fdiv double %9, 1.292000e+01
%11 = fptrunc double %10 to float
store float %11, float* %3
br label %19
12: ; preds = %1
%13 = load float, float* %2
%14 = fpext float %13 to double
%15 = fadd double %14, 5.500000e-02
%16 = fdiv double %15, 1.055000e+00
%17 = fptrunc double %16 to float
%18 = call float @pow(float %17, double 2.400000e+00)
store float %18, float* %3
br label %19
19: ; preds = %12, %7
%20 = load float, float* %3
ret float %20
}

LLVM IR (-O2):
define float @sRGB_decode_f(float %0) {
%2 = fpext float %0 to double
%3 = fcmp ugt double %2, 3.928000e-02
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = fdiv double %2, 1.292000e+01
%6 = fptrunc double %5 to float
br label %12
7: ; preds = %1
%8 = fadd double %2, 5.500000e-02
%9 = fdiv double %8, 1.055000e+00
%10 = fptrunc double %9 to float
%11 = tail call float @pow(float %10, double 2.400000e+00)
br label %12
12: ; preds = %7, %4
%13 = phi float [ %6, %4 ], [ %11, %7 ]
ret float %13
}
/* Type definitions */
typedef int /*<<< orphan*/ seed;
typedef int /*<<< orphan*/ gmp_randstate_t;

/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ gmp_randinit_default(int /*<<< orphan*/);
int /*<<< orphan*/ gmp_randseed_ui(int /*<<< orphan*/, unsigned long);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ read(int, unsigned long *, int);
void get_rand_seed(gmp_randstate_t r_state) {
  int randomData = open("/dev/urandom", O_RDONLY);
  unsigned long int seed;
  read(randomData, &seed, sizeof(seed));
  gmp_randinit_default(r_state);
  gmp_randseed_ui(r_state, seed);
  close(randomData);
}


x86 assembly (clang, -O0):
<get_rand_seed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e86(%rip),%rax
mov    (%rax),%esi
lea    0xe95(%rip),%rdi
call   1050 <open@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1040 <read@plt>
mov    -0x4(%rbp),%edi
call   1070 <gmp_randinit_default@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1060 <gmp_randseed_ui@plt>
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_rand_seed>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2e8c(%rip),%rax
mov    (%rax),%esi
lea    0xe9b(%rip),%rdi
call   1050 <open@plt>
mov    %eax,%ebp
mov    %rsp,%rsi
mov    %eax,%edi
mov    $0x8,%edx
call   1040 <read@plt>
mov    %ebx,%edi
call   1070 <gmp_randinit_default@plt>
mov    (%rsp),%rsi
mov    %ebx,%edi
call   1060 <gmp_randseed_ui@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <close@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"/dev/urandom\00"
@O_RDONLY = global i32 0
define void @get_rand_seed(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* @O_RDONLY
%6 = call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @read(i32 %7, i64* %4, i32 8)
%9 = load i32, i32* %2
%10 = call i32 @gmp_randinit_default(i32 %9)
%11 = load i32, i32* %2
%12 = load i64, i64* %4
%13 = call i32 @gmp_randseed_ui(i32 %11, i64 %12)
%14 = load i32, i32* %3
%15 = call i32 @close(i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"/dev/urandom\00"
@O_RDONLY = global i32 0
define void @get_rand_seed(i32 %0) {
%2 = alloca i64
%3 = load i32, i32* @O_RDONLY
%4 = tail call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = bitcast i64* %2 to i8*
%6 = call i32 @read(i32 %4, i64* %2, i32 8)
%7 = tail call i32 @gmp_randinit_default(i32 %0)
%8 = load i64, i64* %2
%9 = tail call i32 @gmp_randseed_ui(i32 %0, i64 %8)
%10 = tail call i32 @close(i32 %4)
ret void
}