xunge/DecIR huggingface dataset:
double GetVelocity(double *sln, int yardage) {
  double size = sln[50001 * 10 + 1];
  if (yardage < size) {
    return sln[10 * yardage + 6];
  } else
    return 0;
}


x86 assembly (clang, -O0):
<GetVelocity>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x3d0958(%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
cvtsi2sdl -0x14(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    114d <GetVelocity+0x4d>
mov    -0x10(%rbp),%rax
imul   $0xa,-0x14(%rbp),%ecx
add    $0x6,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1155 <GetVelocity+0x55>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetVelocity>:
cvtsi2sd %esi,%xmm1
movsd  0x3d0958(%rdi),%xmm2
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm2
jbe    1122 <GetVelocity+0x22>
add    %esi,%esi
lea    (%rsi,%rsi,4),%eax
cltq
movsd  0x30(%rdi,%rax,8),%xmm0
ret

LLVM IR (-O0):
define double @GetVelocity(double* %0, i32 %1) {
%3 = alloca double
%4 = alloca double*
%5 = alloca i32
%6 = alloca double
store double* %0, double** %4
store i32 %1, i32* %5
%7 = load double*, double** %4
%8 = getelementptr inbounds double, double* %7, i64 500011
%9 = load double, double* %8
store double %9, double* %6
%10 = load i32, i32* %5
%11 = sitofp i32 %10 to double
%12 = load double, double* %6
%13 = fcmp olt double %11, %12
br i1 %13, label %14, label %22
14: ; preds = %2
%15 = load double*, double** %4
%16 = load i32, i32* %5
%17 = mul nsw i32 10, %16
%18 = add nsw i32 %17, 6
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds double, double* %15, i64 %19
%21 = load double, double* %20
store double %21, double* %3
br label %23
22: ; preds = %2
store double 0.000000e+00, double* %3
br label %23
23: ; preds = %22, %14
%24 = load double, double* %3
ret double %24
}

LLVM IR (-O2):
define double @GetVelocity(double* nocapture %0, i32 %1) {
%3 = getelementptr inbounds double, double* %0, i64 500011
%4 = load double, double* %3
%5 = sitofp i32 %1 to double
%6 = fcmp ogt double %4, %5
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = mul nsw i32 %1, 10
%9 = add nsw i32 %8, 6
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds double, double* %0, i64 %10
%12 = load double, double* %11
br label %13
13: ; preds = %2, %7
%14 = phi double [ %12, %7 ], [ 0.000000e+00, %2 ]
ret double %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_format_info_from_sample_spec() {
  printf("NOT IMPLEMENTED:"
         "pa_format_info_from_sample_spec"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [49 x i8] c"NOT IMPLEMENTED:pa_format_info_from_sample_spec\0A\00"
define i32 @pa_format_info_from_sample_spec() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [48 x i8] c"NOT IMPLEMENTED:pa_format_info_from_sample_spec\00"
define i32 @pa_format_info_from_sample_spec() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ w;

/* Variables and functions */
unsigned long hweight32(unsigned long);
unsigned long hweight64(unsigned long);
unsigned long hweight_long(unsigned long w) {
  return sizeof(w) == 4 ? hweight32(w) : hweight64(w);
}


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

x86 assembly (clang, -O2):
<hweight_long>:
jmp    1030 <hweight64@plt>

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

LLVM IR (-O2):
define i64 @hweight_long(i64 %0) {
%2 = tail call i64 @hweight64(i64 %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void sc_cleanup_close(int *ptr) {
  if (ptr != NULL && *ptr != -1) {
    close(*ptr);
  }
}


x86 assembly (clang, -O0):
<sc_cleanup_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113f <sc_cleanup_close+0x2f>
mov    -0x8(%rbp),%rax
cmpl   $0xffffffff,(%rax)
je     113f <sc_cleanup_close+0x2f>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sc_cleanup_close>:
test   %rdi,%rdi
je     1121 <sc_cleanup_close+0x11>
mov    (%rdi),%edi
cmp    $0xffffffff,%edi
je     1121 <sc_cleanup_close+0x11>
jmp    1030 <close@plt>
ret

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

LLVM IR (-O2):
define void @sc_cleanup_close(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load i32, i32* %0
%5 = icmp eq i32 %4, -1
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @close(i32 %4)
br label %8
8: ; preds = %6, %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int u2dump(char *);
int main(int argc, char **argv) {
  if (argc != 2) {
    puts("usage: u2eventdump <file>");
    return 1;
  }
  return u2dump(argv[1]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1158 <main+0x38>
lea    0xeb9(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    1168 <main+0x48>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <u2dump@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1130 <main+0x10>
mov    0x8(%rsi),%rdi
pop    %rax
jmp    1040 <u2dump@plt>
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"usage: u2eventdump <file>\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @puts(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @u2dump(i8* %13)
store i32 %14, i32* %3
br label %15
15: ; preds = %10, %8
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@.str = [26 x i8] c"usage: u2eventdump <file>\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %10
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @u2dump(i8* %8)
br label %10
10: ; preds = %6, %4
%11 = phi i32 [ 1, %4 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ initApi();
int /*<<< orphan*/ initSpider();
int /*<<< orphan*/ startSpider();
int main(int argc, char **argv) {
  initApi();
  initSpider();
  startSpider();
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <initApi@plt>
mov    $0x0,%al
call   1050 <initSpider@plt>
mov    $0x0,%al
call   1040 <startSpider@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <initApi@plt>
xor    %eax,%eax
call   1050 <initSpider@plt>
xor    %eax,%eax
call   1040 <startSpider@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @initApi()
%7 = call i32 (...) @initSpider()
%8 = call i32 (...) @startSpider()
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @initApi()
%4 = tail call i32 (...) @initSpider()
%5 = tail call i32 (...) @startSpider()
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}
XSelectInput() {}


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

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

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

LLVM IR (-O2):
define i32 @XSelectInput() {
ret i32 undef
}
void UYVYToUVRow_Any_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @UYVYToUVRow_Any_AVX2() {
ret void
}
int test_imm_FDuint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xFD << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_FDuint64_highword_reg>:
movabs $0xfd00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_FDuint64_highword_reg(i64 %0) {
%2 = and i64 %0, 1086626725888
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void MMX_PUNPCKLBW(int dst_reg, int src_reg) {
  addbyte(0x66);
  addbyte(0x0f);
  addbyte(0x60);
  addbyte(0xc0 | (dst_reg << 3) | src_reg);
}


x86 assembly (clang, -O0):
<MMX_PUNPCKLBW>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0x60,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     $0xc0,%edi
or     -0x8(%rbp),%edi
call   1030 <addbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MMX_PUNPCKLBW>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0x60,%edi
call   1030 <addbyte@plt>
shl    $0x3,%ebp
or     %ebx,%ebp
or     $0xc0,%ebp
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @MMX_PUNPCKLBW(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @addbyte(i32 102)
%6 = call i32 @addbyte(i32 15)
%7 = call i32 @addbyte(i32 96)
%8 = load i32, i32* %3
%9 = shl i32 %8, 3
%10 = or i32 192, %9
%11 = load i32, i32* %4
%12 = or i32 %10, %11
%13 = call i32 @addbyte(i32 %12)
ret void
}

LLVM IR (-O2):
define void @MMX_PUNPCKLBW(i32 %0, i32 %1) {
%3 = tail call i32 @addbyte(i32 102)
%4 = tail call i32 @addbyte(i32 15)
%5 = tail call i32 @addbyte(i32 96)
%6 = shl i32 %0, 3
%7 = or i32 %6, %1
%8 = or i32 %7, 192
%9 = tail call i32 @addbyte(i32 %8)
ret void
}
/* Type definitions */
struct ebt_mac_wormhash_tuple {
  scalar_t__ cmp;
};

/* Variables and functions */
int fcmp(const void *va, const void *vb) {
  const struct ebt_mac_wormhash_tuple *a = va;
  const struct ebt_mac_wormhash_tuple *b = vb;
  int ca = ((const unsigned char *)a->cmp)[7];
  int cb = ((const unsigned char *)b->cmp)[7];
  return ca - cb;
}


x86 assembly (clang, -O0):
<fcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movzbl 0x7(%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
movzbl 0x7(%rax),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%eax
sub    -0x28(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcmp>:
mov    (%rdi),%rax
movzbl 0x7(%rax),%eax
mov    (%rsi),%rcx
movzbl 0x7(%rcx),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
%struct.ebt_mac_wormhash_tuple = type { i64 }
define i32 @fcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca %struct.ebt_mac_wormhash_tuple*
%6 = alloca %struct.ebt_mac_wormhash_tuple*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%9 = load i8*, i8** %3
%10 = bitcast i8* %9 to %struct.ebt_mac_wormhash_tuple*
store %struct.ebt_mac_wormhash_tuple* %10, %struct.ebt_mac_wormhash_tuple** %5
%11 = load i8*, i8** %4
%12 = bitcast i8* %11 to %struct.ebt_mac_wormhash_tuple*
store %struct.ebt_mac_wormhash_tuple* %12, %struct.ebt_mac_wormhash_tuple** %6
%13 = load %struct.ebt_mac_wormhash_tuple*, %struct.ebt_mac_wormhash_tuple** %5
%14 = getelementptr inbounds %struct.ebt_mac_wormhash_tuple, %struct.ebt_mac_wormhash_tuple* %13, i32 0, i32 0
%15 = load i64, i64* %14
%16 = inttoptr i64 %15 to i8*
%17 = getelementptr inbounds i8, i8* %16, i64 7
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
store i32 %19, i32* %7
%20 = load %struct.ebt_mac_wormhash_tuple*, %struct.ebt_mac_wormhash_tuple** %6
%21 = getelementptr inbounds %struct.ebt_mac_wormhash_tuple, %struct.ebt_mac_wormhash_tuple* %20, i32 0, i32 0
%22 = load i64, i64* %21
%23 = inttoptr i64 %22 to i8*
%24 = getelementptr inbounds i8, i8* %23, i64 7
%25 = load i8, i8* %24
%26 = zext i8 %25 to i32
store i32 %26, i32* %8
%27 = load i32, i32* %7
%28 = load i32, i32* %8
%29 = sub nsw i32 %27, %28
ret i32 %29
}

LLVM IR (-O2):
define i32 @fcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = inttoptr i64 %4 to i8*
%6 = getelementptr inbounds i8, i8* %5, i64 7
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = bitcast i8* %1 to i64*
%10 = load i64, i64* %9
%11 = inttoptr i64 %10 to i8*
%12 = getelementptr inbounds i8, i8* %11, i64 7
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = sub nsw i32 %8, %14
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int cp850_string_to_wchar_string(int /*<<< orphan*/ *, char *, unsigned int);
int dos_string_to_wchar_string(wchar_t *out, char *in, unsigned int out_size) {
  return cp850_string_to_wchar_string(out, in, out_size);
}


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

x86 assembly (clang, -O2):
<dos_string_to_wchar_string>:
jmp    1030 <cp850_string_to_wchar_string@plt>

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

LLVM IR (-O2):
define i32 @dos_string_to_wchar_string(i32* %0, i8* %1, i32 %2) {
%4 = tail call i32 @cp850_string_to_wchar_string(i32* %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
size_t strlen(const char *str) {
  size_t len = 0;
  while (str[len] != '\0') {
    ++len;
  }
  return len;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1136 <strlen+0x36>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ flipVert();
int /*<<< orphan*/ rotate90cw();
void rotate90ccw() {
  flipVert();
  rotate90cw();
}


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

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

LLVM IR (-O0):
define void @rotate90ccw() {
%1 = call i32 (...) @flipVert()
%2 = call i32 (...) @rotate90cw()
ret void
}

LLVM IR (-O2):
define void @rotate90ccw() {
%1 = tail call i32 (...) @flipVert()
%2 = tail call i32 (...) @rotate90cw()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ end_ui();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void finish(int sig) {
  end_ui();
  exit(0);
}


x86 assembly (clang, -O0):
<finish>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <end_ui@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<finish>:
push   %rax
xor    %eax,%eax
call   1030 <end_ui@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @finish(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @end_ui()
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @finish(i32 %0) {
%2 = tail call i32 (...) @end_ui()
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int deref(int /*<<< orphan*/);
int test() { return deref(0); }


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <deref@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
xor    %edi,%edi
jmp    1030 <deref@plt>

LLVM IR (-O0):
define i32 @test() {
%1 = call i32 @deref(i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @test() {
%1 = tail call i32 @deref(i32 0)
ret i32 %1
}
/* Variables and functions */
void Reserved_Handler29(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<Reserved_Handler29>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <Reserved_Handler29+0x9>
jmp    1109 <Reserved_Handler29+0x9>

x86 assembly (clang, -O2):
<Reserved_Handler29>:
jmp    1100 <Reserved_Handler29>

LLVM IR (-O0):
define void @Reserved_Handler29() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @Reserved_Handler29() {
br label %1
1: ; preds = %0, %1
br label %1
}
void srgb_trans(double *c) {
  double a = 0.055;
  if (*c <= 0.0031308)
    *c = 12.92 * (*c);
  if (*c > 255)
    *c = 255;
  else if (*c < 0)
    *c = 0;
  return;
}


x86 assembly (clang, -O0):
<srgb_trans>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  0xef8(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xedf(%rip),%xmm0
ucomisd (%rax),%xmm0
jb     1143 <srgb_trans+0x43>
mov    -0x8(%rbp),%rax
movsd  0xed9(%rip),%xmm0
mulsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xec5(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1172 <srgb_trans+0x72>
mov    -0x8(%rbp),%rax
movsd  0xeaf(%rip),%xmm0
movsd  %xmm0,(%rax)
jmp    1193 <srgb_trans+0x93>
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd (%rax),%xmm0
jbe    118e <srgb_trans+0x8e>
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
jmp    1193 <srgb_trans+0x93>
pop    %rbp
ret

x86 assembly (clang, -O2):
<srgb_trans>:
movsd  (%rdi),%xmm0
movsd  0xef4(%rip),%xmm1
ucomisd %xmm0,%xmm1
jb     111e <srgb_trans+0x1e>
mulsd  0xeee(%rip),%xmm0
movsd  %xmm0,(%rdi)
movsd  0xeea(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     1136 <srgb_trans+0x36>
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    113a <srgb_trans+0x3a>
movsd  %xmm1,(%rdi)
ret

LLVM IR (-O0):
define void @srgb_trans(double* %0) {
%2 = alloca double*
%3 = alloca double
store double* %0, double** %2
store double 5.500000e-02, double* %3
%4 = load double*, double** %2
%5 = load double, double* %4
%6 = fcmp ole double %5, 3.130800e-03
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load double*, double** %2
%9 = load double, double* %8
%10 = fmul double 1.292000e+01, %9
%11 = load double*, double** %2
store double %10, double* %11
br label %12
12: ; preds = %7, %1
%13 = load double*, double** %2
%14 = load double, double* %13
%15 = fcmp ogt double %14, 2.550000e+02
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load double*, double** %2
store double 2.550000e+02, double* %17
br label %25
18: ; preds = %12
%19 = load double*, double** %2
%20 = load double, double* %19
%21 = fcmp olt double %20, 0.000000e+00
br i1 %21, label %22, label %24
22: ; preds = %18
%23 = load double*, double** %2
store double 0.000000e+00, double* %23
br label %24
24: ; preds = %22, %18
br label %25
25: ; preds = %24, %16
ret void
}

LLVM IR (-O2):
define void @srgb_trans(double* nocapture %0) {
%2 = load double, double* %0
%3 = fcmp ugt double %2, 3.130800e-03
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = fmul double %2, 1.292000e+01
store double %5, double* %0
br label %6
6: ; preds = %4, %1
%7 = phi double [ %5, %4 ], [ %2, %1 ]
%8 = fcmp ogt double %7, 2.550000e+02
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = fcmp olt double %7, 0.000000e+00
br i1 %10, label %11, label %13
11: ; preds = %9, %6
%12 = phi double [ 2.550000e+02, %6 ], [ 0.000000e+00, %9 ]
store double %12, double* %0
br label %13
13: ; preds = %11, %9
ret void
}
void fnvArith128add(struct Arith128 *kOut, const struct Arith128 *kIn) {
  *((__uint128_t *)kOut) += *((__uint128_t *)kIn);
}


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

x86 assembly (clang, -O2):
<fnvArith128add>:
mov    (%rsi),%rax
mov    0x8(%rsi),%rcx
add    %rax,(%rdi)
adc    %rcx,0x8(%rdi)
ret

LLVM IR (-O0):
%struct.Arith128 = type opaque
define void @fnvArith128add(%struct.Arith128* %0, %struct.Arith128* %1) {
%3 = alloca %struct.Arith128*
%4 = alloca %struct.Arith128*
store %struct.Arith128* %0, %struct.Arith128** %3
store %struct.Arith128* %1, %struct.Arith128** %4
%5 = load %struct.Arith128*, %struct.Arith128** %4
%6 = bitcast %struct.Arith128* %5 to i128*
%7 = load i128, i128* %6
%8 = load %struct.Arith128*, %struct.Arith128** %3
%9 = bitcast %struct.Arith128* %8 to i128*
%10 = load i128, i128* %9
%11 = add i128 %10, %7
store i128 %11, i128* %9
ret void
}

LLVM IR (-O2):
%struct.Arith128 = type opaque
define void @fnvArith128add(%struct.Arith128* nocapture %0, %struct.Arith128* nocapture %1) {
%3 = bitcast %struct.Arith128* %1 to i128*
%4 = load i128, i128* %3
%5 = bitcast %struct.Arith128* %0 to i128*
%6 = load i128, i128* %5
%7 = add i128 %6, %4
store i128 %7, i128* %5
ret void
}
/* Variables and functions */
int euler_problem_4();
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", euler_problem_4());
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @euler_problem_4()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ output_line(char *);
void gen_twos_complement(void) { output_line("neg r1"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"neg r1\00"
define void @gen_twos_complement() {
%1 = call i32 @output_line(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"neg r1\00"
define void @gen_twos_complement() {
%1 = tail call i32 @output_line(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ ai_knighton(int);
int data_getcards(int, int /*<<< orphan*/);
int /*<<< orphan*/ devcards_knight(int);
int ai_playknight(int player) {
  if (data_getcards(player, 0) >= 1 && ai_knighton(player)) {
    devcards_knight(player);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<ai_playknight>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
xor    %esi,%esi
call   1040 <data_getcards@plt>
cmp    $0x1,%eax
jl     1174 <ai_playknight+0x44>
mov    -0x8(%rbp),%edi
call   1030 <ai_knighton@plt>
cmp    $0x0,%rax
je     1174 <ai_playknight+0x44>
mov    -0x8(%rbp),%edi
call   1050 <devcards_knight@plt>
movl   $0x1,-0x4(%rbp)
jmp    117b <ai_playknight+0x4b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ai_playknight>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
xor    %ebx,%ebx
xor    %esi,%esi
call   1040 <data_getcards@plt>
test   %eax,%eax
jle    115a <ai_playknight+0x2a>
mov    %ebp,%edi
call   1030 <ai_knighton@plt>
test   %rax,%rax
je     115a <ai_playknight+0x2a>
mov    %ebp,%edi
call   1050 <devcards_knight@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ai_playknight(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @data_getcards(i32 %4, i32 0)
%6 = icmp sge i32 %5, 1
br i1 %6, label %7, label %14
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i64 @ai_knighton(i32 %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i32, i32* %3
%13 = call i32 @devcards_knight(i32 %12)
store i32 1, i32* %2
br label %15
14: ; preds = %7, %1
store i32 0, i32* %2
br label %15
15: ; preds = %14, %11
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @ai_playknight(i32 %0) {
%2 = tail call i32 @data_getcards(i32 %0, i32 0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = tail call i64 @ai_knighton(i32 %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @devcards_knight(i32 %0)
br label %9
9: ; preds = %1, %4, %7
%10 = phi i32 [ 1, %7 ], [ 0, %4 ], [ 0, %1 ]
ret i32 %10
}
void clear() {
  printf("\033[2J");
  printf("\033[%d;%dH", 0, 0);
}


x86 assembly (clang, -O0):
<clear>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
xor    %edx,%edx
mov    %edx,%esi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %eax,%eax
pop    %rcx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[2J\00"
@.str.1 = [9 x i8] c"\1B[%d;%dH\00"
define void @clear() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[2J\00"
@.str.1 = [9 x i8] c"\1B[%d;%dH\00"
define void @clear() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long const);
int main(void) {
  const long num = 0xabcd1234;
  printf("%lx\n", num);
  ((unsigned char *)&num)[0] = 0xaa;
  printf("%lx\n", num);
  return (0);
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lx\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 2882343476)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 2882343476)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ smrand_do();
uint32_t smrandv() { return smrand_do(); }


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

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

LLVM IR (-O0):
define i32 @smrandv() {
%1 = call i32 (...) @smrand_do()
ret i32 %1
}

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

/* Variables and functions */
int /*<<< orphan*/ UP3D_GetParameter(int);
int32_t UP3D_GetWriteToSD() { return UP3D_GetParameter(0x37); }


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

x86 assembly (clang, -O2):
<UP3D_GetWriteToSD>:
mov    $0x37,%edi
jmp    1030 <UP3D_GetParameter@plt>

LLVM IR (-O0):
define i32 @UP3D_GetWriteToSD() {
%1 = call i32 @UP3D_GetParameter(i32 55)
ret i32 %1
}

LLVM IR (-O2):
define i32 @UP3D_GetWriteToSD() {
%1 = tail call i32 @UP3D_GetParameter(i32 55)
ret i32 %1
}
void setClip(struct graphics *gc, int x, int y, int w, int h) {}


x86 assembly (clang, -O0):
<setClip>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.graphics = type opaque
define void @setClip(%struct.graphics* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.graphics*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store %struct.graphics* %0, %struct.graphics** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
ret void
}

LLVM IR (-O2):
%struct.graphics = type opaque
define void @setClip(%struct.graphics* nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main() {
  int a = 12;
  float b = 34.455;
  b = (int)b;
  printf("%f", b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xc,-0x8(%rbp)
movss  0xed2(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
cvttss2si -0xc(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
store i32 0, i32* %1
store i32 12, i32* %2
store float 0x40413A3D80000000, float* %3
%4 = load float, float* %3
%5 = fptosi float %4 to i32
%6 = sitofp i32 %5 to float
store float %6, float* %3
%7 = load float, float* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float 3.400000e+01)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct ibv_port_attr {
  int dummy;
};
struct ibv_context {
  int dummy;
};

/* Variables and functions */
int ibv_query_port(struct ibv_context *, int /*<<< orphan*/,
                   struct ibv_port_attr *);
int mlx4_glue_query_port(struct ibv_context *context, uint8_t port_num,
                         struct ibv_port_attr *port_attr) {
  return ibv_query_port(context, port_num, port_attr);
}


x86 assembly (clang, -O0):
<mlx4_glue_query_port>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <ibv_query_port@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mlx4_glue_query_port>:
jmp    1030 <ibv_query_port@plt>

LLVM IR (-O0):
%struct.ibv_context = type { i32 }
%struct.ibv_port_attr = type { i32 }
define i32 @mlx4_glue_query_port(%struct.ibv_context* %0, i32 %1, %struct.ibv_port_attr* %2) {
%4 = alloca %struct.ibv_context*
%5 = alloca i32
%6 = alloca %struct.ibv_port_attr*
store %struct.ibv_context* %0, %struct.ibv_context** %4
store i32 %1, i32* %5
store %struct.ibv_port_attr* %2, %struct.ibv_port_attr** %6
%7 = load %struct.ibv_context*, %struct.ibv_context** %4
%8 = load i32, i32* %5
%9 = load %struct.ibv_port_attr*, %struct.ibv_port_attr** %6
%10 = call i32 @ibv_query_port(%struct.ibv_context* %7, i32 %8, %struct.ibv_port_attr* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.ibv_context = type { i32 }
%struct.ibv_port_attr = type { i32 }
define i32 @mlx4_glue_query_port(%struct.ibv_context* %0, i32 %1, %struct.ibv_port_attr* %2) {
%4 = tail call i32 @ibv_query_port(%struct.ibv_context* %0, i32 %1, %struct.ibv_port_attr* %2)
ret i32 %4
}
/* Variables and functions */
char get_printable_rand_char();
void get_rand_str(char *str, int len) {
  int i;
  for (i = 0; i < len; ++i) {
    str[i] = get_printable_rand_char();
  }
  str[i] = '\0';
}


x86 assembly (clang, -O0):
<get_rand_str>:
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    1154 <get_rand_str+0x44>
mov    $0x0,%al
call   1030 <get_printable_rand_char@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <get_rand_str+0x16>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_rand_str>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1146 <get_rand_str+0x36>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <get_printable_rand_char@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <get_rand_str+0x20>
jmp    1149 <get_rand_str+0x39>
xor    %r15d,%r15d
movb   $0x0,(%r14,%r15,1)
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @get_rand_str(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = tail call signext i8 (...) @get_printable_rand_char()
%9 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %8, i8* %9
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6
%13 = zext i32 %1 to i64
br label %14
14: ; preds = %2, %12
%15 = phi i64 [ %13, %12 ], [ 0, %2 ]
%16 = getelementptr inbounds i8, i8* %0, i64 %15
store i8 0, i8* %16
ret void
}
/* Variables and functions */
int w5100_readSn_byte(unsigned int, int);
unsigned w5100_readSnTTL(unsigned sock) {
  return w5100_readSn_byte(sock, 0x0016);
}


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

x86 assembly (clang, -O2):
mov    $0x16,%esi
jmp    1030 <w5100_readSn_byte@plt>

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

LLVM IR (-O2):
define i32 @w5100_readSnTTL(i32 %0) {
%2 = tail call i32 @w5100_readSn_byte(i32 %0, i32 22)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x5d() {
  Assert_real((iscntrl(93) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              470, ("iscntrl should be 0 for ]"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for ]\00"
define void @t_iscntrl_0x5d() {
%1 = call i64 @iscntrl(i32 93)
%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 470, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for ]\00"
define void @t_iscntrl_0x5d() {
%1 = tail call i64 @iscntrl(i32 93)
%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 470, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
double atan2(double, double);
double intr_wrap_021(double p1, double p2) { return atan2(p1, p2); }


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

x86 assembly (clang, -O2):
<intr_wrap_021>:
jmp    1030 <atan2@plt>

LLVM IR (-O0):
define double @intr_wrap_021(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 @atan2(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @intr_wrap_021(double %0, double %1) {
%3 = tail call double @atan2(double %0, double %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ with_message_repeat(void (*)(), char *);
void repeat_till_user(void (*f)(void)) { with_message_repeat(f, "Repetir?"); }


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

x86 assembly (clang, -O2):
<repeat_till_user>:
lea    0xee9(%rip),%rsi
jmp    1030 <with_message_repeat@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"Repetir?\00"
define void @repeat_till_user(void ()* %0) {
%2 = alloca void ()*
store void ()* %0, void ()** %2
%3 = load void ()*, void ()** %2
%4 = bitcast void ()* %3 to void (...)*
%5 = call i32 @with_message_repeat(void (...)* %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"Repetir?\00"
define void @repeat_till_user(void ()* %0) {
%2 = bitcast void ()* %0 to void (...)*
%3 = tail call i32 @with_message_repeat(void (...)* %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
yyPrintIndex(i) long i;
{ printf("#%ld", i); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"#%ld\00"
define i32 @yyPrintIndex(i64 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %0)
ret i32 undef
}
void delay(unsigned int count) {
  while (count--) {
  }
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1120 <delay+0x20>
jmp    1107 <delay+0x7>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @delay(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* %2
%5 = add i32 %4, -1
store i32 %5, i32* %2
%6 = icmp ne i32 %4, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @delay(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void nativeWriteln(char *msg) { printf("%s\n", msg); }


x86 assembly (clang, -O0):
<nativeWriteln>:
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):
<nativeWriteln>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

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


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

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

LLVM IR (-O0):
define i32 @fun947() {
ret i32 947
}

LLVM IR (-O2):
define i32 @fun947() {
ret i32 947
}