xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ file_get_name(char const *);
char *strrchr(int /*<<< orphan*/, char);
char *file_get_ext(const char *filename) {
  char *file_ext = strrchr(file_get_name(filename), '.');
  if (!file_ext) {
    return "";
  }
  return file_ext;
}


x86 assembly (clang, -O0):
<file_get_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <file_get_name@plt>
mov    %eax,%edi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1160 <file_get_ext+0x40>
lea    0xea9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1168 <file_get_ext+0x48>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_get_ext>:
push   %rax
call   1040 <file_get_name@plt>
mov    %eax,%edi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
lea    0xec4(%rip),%rcx
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @file_get_ext(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @file_get_name(i8* %5)
%7 = call i8* @strrchr(i32 %6, i8 signext 46)
store i8* %7, i8** %4
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br i1 %9, label %11, label %10
10: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %13
11: ; preds = %1
%12 = load i8*, i8** %4
store i8* %12, i8** %2
br label %13
13: ; preds = %11, %10
%14 = load i8*, i8** %2
ret i8* %14
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @file_get_ext(i8* %0) {
%2 = tail call i32 @file_get_name(i8* %0)
%3 = tail call i8* @strrchr(i32 %2, i8 signext 46)
%4 = icmp eq i8* %3, null
%5 = select i1 %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
void mapPage(int *table, int page, int frame) { *(table + page) = frame; }


x86 assembly (clang, -O0):
<mapPage>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mapPage>:
movslq %esi,%rax
mov    %edx,(%rdi,%rax,4)
ret

LLVM IR (-O0):
define void @mapPage(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
store i32 %7, i32* %11
ret void
}

LLVM IR (-O2):
define void @mapPage(i32* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
store i32 %2, i32* %5
ret void
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMR4A_get(void) { return U_WMRCORENONE_get("U_WMR4A"); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR4A\00"
define i32 @U_WMR4A_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
float obdConvert_21(unsigned int A, unsigned int B, unsigned int C,
                    unsigned int D) {
  return (float)A * 256.0f + (float)B;
}


x86 assembly (clang, -O0):
<obdConvert_21>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2ss %rax,%xmm0
mov    -0x8(%rbp),%eax
cvtsi2ss %rax,%xmm1
movss  0xed8(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<obdConvert_21>:
mov    %edi,%eax
cvtsi2ss %rax,%xmm0
mov    %esi,%eax
cvtsi2ss %rax,%xmm1
mulss  0xeea(%rip),%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @obdConvert_21(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = uitofp i32 %9 to float
%11 = load i32, i32* %6
%12 = uitofp i32 %11 to float
%13 = call float @llvm.fmuladd.f32(float %10, float 2.560000e+02, float %12)
ret float %13
}

LLVM IR (-O2):
define float @obdConvert_21(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = uitofp i32 %0 to float
%6 = uitofp i32 %1 to float
%7 = tail call float @llvm.fmuladd.f32(float %5, float 2.560000e+02, float %6)
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, double);
double time_measure_stop(char const *);
void time_measure_stop_and_print(const char *key) {
  double elapsed_time = time_measure_stop(key);
  printf("Elapsed time for %s is %lf s\n", key, elapsed_time);
}


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

x86 assembly (clang, -O2):
<time_measure_stop_and_print>:
push   %rbx
mov    %rdi,%rbx
call   1040 <time_measure_stop@plt>
lea    0xed0(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Elapsed time for %s is %lf s\0A\00"
define void @time_measure_stop_and_print(i8* %0) {
%2 = alloca i8*
%3 = alloca double
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call double @time_measure_stop(i8* %4)
store double %5, double* %3
%6 = load i8*, i8** %2
%7 = load double, double* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %6, double %7)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"Elapsed time for %s is %lf s\0A\00"
define void @time_measure_stop_and_print(i8* %0) {
%2 = tail call double @time_measure_stop(i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0, double %2)
ret void
}
unsigned char __VERIFIER_nondet_uchar(void) {
  unsigned char uc;
  { return (uc); }
}


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

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

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

LLVM IR (-O2):
define zeroext i8 @__VERIFIER_nondet_uchar() {
ret i8 undef
}
void (*f3(int i))(int, char) {
  static int s1;
  if (i) {
    char c;
  }
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1116 <f3+0x16>
jmp    1116 <f3+0x16>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias void (i32, i8)* @f3(i32 %0) {
ret void (i32, i8)* undef
}
int test_imm_DEint16_mem(short *val) {
  return ((*val) & (0xDE << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_DEint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xde,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_DEint16_mem>:
testb  $0xde,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_DEint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 222
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int Operand_simm7_decode(unsigned int *valp) {
  unsigned simm7_0, imm7_0;
  imm7_0 = *valp & 0x7f;
  simm7_0 = ((((-((((imm7_0 >> 6) & 1)) & (((imm7_0 >> 5) & 1)))) & 0x1ffffff))
             << 7) |
            imm7_0;
  *valp = simm7_0;
  return 0;
}


x86 assembly (clang, -O0):
<Operand_simm7_decode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0x7f,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
shr    $0x6,%ecx
and    $0x1,%ecx
mov    -0x10(%rbp),%eax
shr    $0x5,%eax
and    $0x1,%eax
and    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
and    $0x1ffffff,%eax
shl    $0x7,%eax
or     -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_simm7_decode>:
mov    (%rdi),%eax
mov    %eax,%ecx
and    $0x7f,%ecx
mov    %eax,%edx
shr    $0x6,%edx
shr    $0x5,%eax
and    %edx,%eax
and    $0x1,%eax
shl    $0x7,%eax
sub    %eax,%ecx
mov    %ecx,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @Operand_simm7_decode(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = and i32 %6, 127
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = lshr i32 %8, 6
%10 = and i32 %9, 1
%11 = load i32, i32* %4
%12 = lshr i32 %11, 5
%13 = and i32 %12, 1
%14 = and i32 %10, %13
%15 = sub i32 0, %14
%16 = and i32 %15, 33554431
%17 = shl i32 %16, 7
%18 = load i32, i32* %4
%19 = or i32 %17, %18
store i32 %19, i32* %3
%20 = load i32, i32* %3
%21 = load i32*, i32** %2
store i32 %20, i32* %21
ret i32 0
}

LLVM IR (-O2):
define i32 @Operand_simm7_decode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 127
%4 = lshr i32 %2, 6
%5 = lshr i32 %2, 5
%6 = and i32 %5, 1
%7 = and i32 %6, %4
%8 = mul nuw nsw i32 %7, -128
%9 = or i32 %8, %3
store i32 %9, i32* %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SetFilePos318(unsigned long);
void setfilepos(unsigned long pos) { SetFilePos318(pos); }


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

x86 assembly (clang, -O2):
<setfilepos>:
jmp    1030 <SetFilePos318@plt>

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

LLVM IR (-O2):
define void @setfilepos(i64 %0) {
%2 = tail call i32 @SetFilePos318(i64 %0)
ret void
}
int nonfluidneighbor(int flag) {
  flag = flag & 4095;
  if ((flag & (~1365)) != 0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<nonfluidneighbor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xfff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xfffffaaa,%eax
cmp    $0x0,%eax
je     112f <nonfluidneighbor+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    1136 <nonfluidneighbor+0x36>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nonfluidneighbor>:
xor    %eax,%eax
test   $0xaaa,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @nonfluidneighbor(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, 4095
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = and i32 %6, -1366
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %11
10: ; preds = %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 @nonfluidneighbor(i32 %0) {
%2 = and i32 %0, 2730
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
bool support_full_demangle(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @support_full_demangle() {
ret i32 0
}
void wbinvd(void) { asm volatile("wbinvd" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @wbinvd() {
tail call void asm sideeffect "wbinvd", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
int get_bitrate(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @get_bitrate() {
ret i32 0
}
void ifun(int x) {}


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

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

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

LLVM IR (-O2):
define void @ifun(i32 %0) {
ret void
}
/* Variables and functions */
size_t SIZE_MAX;
void *malloc(size_t);
void *malloc_array_0(size_t n, size_t size) {
  if (size && n > SIZE_MAX / size)
    return NULL;
  return malloc(n * size);
}


x86 assembly (clang, -O0):
<malloc_array_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1162 <malloc_array_0+0x52>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
jbe    1162 <malloc_array_0+0x52>
movq   $0x0,-0x8(%rbp)
jmp    1174 <malloc_array_0+0x64>
mov    -0x10(%rbp),%rdi
imul   -0x18(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_array_0>:
test   %rsi,%rsi
je     1141 <malloc_array_0+0x31>
mov    0x2ebc(%rip),%rax
mov    (%rax),%rax
mov    %rax,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1138 <malloc_array_0+0x28>
xor    %edx,%edx
div    %rsi
cmp    %rdi,%rax
jae    1141 <malloc_array_0+0x31>
xor    %eax,%eax
ret
xor    %edx,%edx
div    %esi
cmp    %rdi,%rax
jb     1135 <malloc_array_0+0x25>
imul   %rdi,%rsi
mov    %rsi,%rdi
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
@SIZE_MAX = global i64 0
define noalias i8* @malloc_array_0(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = load i64, i64* @SIZE_MAX
%6 = udiv i64 %5, %1
%7 = icmp ult i64 %6, %0
br i1 %7, label %11, label %8
8: ; preds = %4, %2
%9 = mul i64 %1, %0
%10 = tail call i8* @malloc(i64 %9)
br label %11
11: ; preds = %4, %8
%12 = phi i8* [ %10, %8 ], [ null, %4 ]
ret i8* %12
}
double ls_cost_nm2_sq(double x) { return x * x; }


x86 assembly (clang, -O0):
<ls_cost_nm2_sq>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_cost_nm2_sq>:
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @ls_cost_nm2_sq(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @ls_cost_nm2_sq(double %0) {
%2 = fmul double %0, %0
ret double %2
}
int main(int argc, char const *argv[]) {
  typedef struct {
    int *elem;
    int length;
    int listsize;
  } SqList;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int fio_lo_put(char const *, char const *, char *);
int fio_put(const char *filename, const char *text) {
  return fio_lo_put(filename, text, "w");
}


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

x86 assembly (clang, -O2):
<fio_put>:
lea    0xee9(%rip),%rdx
jmp    1030 <fio_lo_put@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
define i32 @fio_put(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 @fio_lo_put(i8* %5, i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 %7
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
define i32 @fio_put(i8* %0, i8* %1) {
%3 = tail call i32 @fio_lo_put(i8* %0, i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 %3
}
/* Variables and functions */
int cap_vm_enough_memory(long);
int security_vm_enough_memory(long pages) {
  return cap_vm_enough_memory(pages);
}


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

x86 assembly (clang, -O2):
<security_vm_enough_memory>:
jmp    1030 <cap_vm_enough_memory@plt>

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

LLVM IR (-O2):
define i32 @security_vm_enough_memory(i64 %0) {
%2 = tail call i32 @cap_vm_enough_memory(i64 %0)
ret i32 %2
}
int g_DUMMY_menu_create_buttonbar2(int win_id) {
  win_id = win_id;
  return -1;
}


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

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

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

LLVM IR (-O2):
define i32 @g_DUMMY_menu_create_buttonbar2(i32 %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
void cgmul(void) { gen("imulq\t%rcx,%rax"); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"imulq\09%rcx,%rax\00"
define void @cgmul() {
%1 = call i32 @gen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"imulq\09%rcx,%rax\00"
define void @cgmul() {
%1 = tail call i32 @gen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
void XParseColor() {}


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

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

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

LLVM IR (-O2):
define void @XParseColor() {
ret void
}
int uses_modrm_flag(unsigned int flag) {
  unsigned int meth;
  if (flag == 0) {
    return 0;
  }
  meth = (flag & 0x00FF0000);
  if ((meth == 0x00040000 || meth == 0x00090000 || meth == 0x000C0000 ||
       meth == 0x00110000 || meth == 0x000D0000)) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<uses_modrm_flag>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <uses_modrm_flag+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    117c <uses_modrm_flag+0x7c>
mov    -0x8(%rbp),%eax
and    $0xff0000,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x40000,-0xc(%rbp)
je     1169 <uses_modrm_flag+0x69>
cmpl   $0x90000,-0xc(%rbp)
je     1169 <uses_modrm_flag+0x69>
cmpl   $0xc0000,-0xc(%rbp)
je     1169 <uses_modrm_flag+0x69>
cmpl   $0x110000,-0xc(%rbp)
je     1169 <uses_modrm_flag+0x69>
cmpl   $0xd0000,-0xc(%rbp)
jne    1175 <uses_modrm_flag+0x75>
movl   $0x1,-0x4(%rbp)
jmp    117c <uses_modrm_flag+0x7c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uses_modrm_flag>:
test   %edi,%edi
je     1128 <uses_modrm_flag+0x28>
movd   %edi,%xmm0
pshufd $0x0,%xmm0,%xmm0
pand   0xeeb(%rip),%xmm0
pcmpeqd 0xef3(%rip),%xmm0
movmskps %xmm0,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @uses_modrm_flag(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = insertelement <2 x i32> poison, i32 %0, i64 0
%5 = shufflevector <2 x i32> %4, <2 x i32> poison, <2 x i32> zeroinitializer
%6 = and <2 x i32> %5, <i32 16711680, i32 16187392>
%7 = shufflevector <2 x i32> %6, <2 x i32> poison, <4 x i32> <i32 0, i32 0, i32 1, i32 0>
%8 = icmp eq <4 x i32> %7, <i32 851968, i32 1114112, i32 262144, i32 589824>
%9 = bitcast <4 x i1> %8 to i4
%10 = icmp ne i4 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %11, %3 ]
ret i32 %13
}
void md_draw(void) {}


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

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

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

LLVM IR (-O2):
define void @md_draw() {
ret void
}
void lineError(fmt, arg1, arg2, arg3) char *fmt;
int arg1;
int arg2;
int arg3;
{
  echoLine(fmt, arg1, arg2, arg3);
  putchar('\7');
}


x86 assembly (clang, -O0):
<lineError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    $0x0,%al
call   1040 <echoLine@plt>
mov    $0x7,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lineError>:
push   %rax
xor    %eax,%eax
call   1040 <echoLine@plt>
mov    $0x7,%edi
xor    %eax,%eax
pop    %rcx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @lineError(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @echoLine to i32 (i8*, i32, i32, i32, ...)*)(i8* %9, i32 %10, i32 %11, i32 %12)
%14 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 7)
ret void
}

LLVM IR (-O2):
define void @lineError(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @echoLine to i32 (i8*, i32, i32, i32, ...)*)(i8* %0, i32 %1, i32 %2, i32 %3)
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void g(int **a) {
  int **b = a;
#pragma omp task inout([10](a[3])) firstprivate(b)
  {
    if (a != b) {
      abort();
    }
  }
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1139 <g+0x29>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @g(i32** nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ next_start_code();
void user_data(void) { next_start_code(); }


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

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

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

LLVM IR (-O2):
define void @user_data() {
%1 = tail call i32 (...) @next_start_code()
ret void
}
/* Variables and functions */
void const *GppcFinfoV1();
const void *pg_finfo_numericfunc3(void) { return GppcFinfoV1(); }


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

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

LLVM IR (-O0):
define i8* @pg_finfo_numericfunc3() {
%1 = call i8* (...) @GppcFinfoV1()
ret i8* %1
}

LLVM IR (-O2):
define i8* @pg_finfo_numericfunc3() {
%1 = tail call i8* (...) @GppcFinfoV1()
ret i8* %1
}
/* Variables and functions */
int core3_swap(char *, int);
int U_EMRSETROP2_swap(char *record, int torev) {
  return (core3_swap(record, torev));
}


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

x86 assembly (clang, -O2):
<U_EMRSETROP2_swap>:
jmp    1030 <core3_swap@plt>

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

LLVM IR (-O2):
define i32 @U_EMRSETROP2_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core3_swap(i8* %0, i32 %1)
ret i32 %3
}
void get_stepping_info(int *chip, int *major, int *minor) {
  *chip = 0x2;
  *major = 0x1;
  *minor = 0x0;
}


x86 assembly (clang, -O0):
<get_stepping_info>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_stepping_info>:
movl   $0x2,(%rdi)
movl   $0x1,(%rsi)
movl   $0x0,(%rdx)
ret

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

LLVM IR (-O2):
define void @get_stepping_info(i32* nocapture writeonly %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
store i32 2, i32* %0
store i32 1, i32* %1
store i32 0, i32* %2
ret void
}
int test_imm_0Buint8_mem(unsigned char *val) {
  return ((*val) & (-0x0B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_0Buint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xfffffff5,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_0Buint8_mem>:
testb  $0xf5,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_0Buint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -11
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
double sinh(double x) {
  return ({
    extern __typeof__(sinh) module_libc_sinh;
    &module_libc_sinh;
  })(x);
}


x86 assembly (clang, -O0):
<sinh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    0x2ecc(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  -0x8(%rbp),%xmm0
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinh>:
jmp    1030 <module_libc_sinh@plt>

LLVM IR (-O0):
define double @sinh(double %0) {
%2 = alloca double
%3 = alloca double (double)*
store double %0, double* %2
store double (double)* @module_libc_sinh, double (double)** %3
%4 = load double (double)*, double (double)** %3
%5 = load double, double* %2
%6 = call double %4(double %5)
ret double %6
}

LLVM IR (-O2):
define double @sinh(double %0) {
%2 = tail call double @module_libc_sinh(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *, char *);
char *strerror(int /*<<< orphan*/);
void fatal(const char *message) {
  printf("[!!] Fatal Error %s: %s\n", message, strerror(errno));
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x10(%rbp),%rsi
mov    %rax,%rdx
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeb7(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1030 <printf@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"[!!] Fatal Error %s: %s\0A\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define void @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @errno
%5 = call i8* @strerror(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %5)
%7 = load i32, i32* @EXIT_FAILURE
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@.str = [25 x i8] c"[!!] Fatal Error %s: %s\0A\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define void @fatal(i8* %0) {
%2 = load i32, i32* @errno
%3 = tail call i8* @strerror(i32 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t ri8(const uint8_t a[1]) {
  uint8_t x;
  x = (uint8_t)a[0] << 0;
  return x;
}


x86 assembly (clang, -O0):
<ri8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x0,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ri8(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 0
%6 = load i32, i32* %5
%7 = shl i32 %6, 0
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @ri8(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
/* Variables and functions */
void *__real_realloc(void *, size_t);
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void *__wrap_realloc(void *ptr, size_t size) {
  void *ret = __real_realloc(ptr, size);
  if (size && !ret) {
    fputs("Out of memory!\n", stderr);
    abort();
  }
  return ret;
}


x86 assembly (clang, -O0):
<__wrap_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <__real_realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1183 <__wrap_realloc+0x53>
cmpq   $0x0,-0x18(%rbp)
jne    1183 <__wrap_realloc+0x53>
mov    0x2e72(%rip),%rax
mov    (%rax),%esi
lea    0xe89(%rip),%rdi
call   1040 <fputs@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wrap_realloc>:
push   %rbx
mov    %rsi,%rbx
call   1050 <__real_realloc@plt>
test   %rbx,%rbx
je     1143 <__wrap_realloc+0x13>
test   %rax,%rax
je     1145 <__wrap_realloc+0x15>
pop    %rbx
ret
mov    0x2e94(%rip),%rax
mov    (%rax),%esi
lea    0xeab(%rip),%rdi
call   1040 <fputs@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Out of memory!\0A\00"
@stderr = global i32 0
define i8* @__wrap_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @__real_realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i64, i64* %4
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %2
%12 = load i8*, i8** %5
%13 = icmp ne i8* %12, null
br i1 %13, label %18, label %14
14: ; preds = %11
%15 = load i32, i32* @stderr
%16 = call i32 @fputs(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = call i32 (...) @abort()
unreachable
18: ; preds = %11, %2
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
@.str = [16 x i8] c"Out of memory!\0A\00"
@stderr = global i32 0
define i8* @__wrap_realloc(i8* %0, i64 %1) {
%3 = tail call i8* @__real_realloc(i8* %0, i64 %1)
%4 = icmp eq i64 %1, 0
%5 = icmp ne i8* %3, null
%6 = select i1 %4, i1 true, i1 %5
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = tail call i32 @fputs(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = tail call i32 (...) @abort()
unreachable
11: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ COLOR_PAIR(int);
int /*<<< orphan*/ attroff(int /*<<< orphan*/);
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ set_ticker(int /*<<< orphan*/);
void cleanup_ncurses() {
  attroff(COLOR_PAIR(1));
  set_ticker(0);
  endwin();
}


x86 assembly (clang, -O0):
<cleanup_ncurses>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1050 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1030 <attroff@plt>
xor    %edi,%edi
call   1040 <set_ticker@plt>
mov    $0x0,%al
call   1060 <endwin@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup_ncurses>:
push   %rax
mov    $0x1,%edi
call   1050 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1030 <attroff@plt>
xor    %edi,%edi
call   1040 <set_ticker@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <endwin@plt>

LLVM IR (-O0):
define void @cleanup_ncurses() {
%1 = call i32 @COLOR_PAIR(i32 1)
%2 = call i32 @attroff(i32 %1)
%3 = call i32 @set_ticker(i32 0)
%4 = call i32 (...) @endwin()
ret void
}

LLVM IR (-O2):
define void @cleanup_ncurses() {
%1 = tail call i32 @COLOR_PAIR(i32 1)
%2 = tail call i32 @attroff(i32 %1)
%3 = tail call i32 @set_ticker(i32 0)
%4 = tail call i32 (...) @endwin()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ bb;

/* Variables and functions */
int /*<<< orphan*/ dump(unsigned char *, int);
int /*<<< orphan*/ strncpy(char *, char *, int);
void test() {
  struct mymsgbuf {
    long mtype;
    char mtext[64];
  } bb;
  bb.mtype = 9;
  strncpy(bb.mtext, "hello world", 64);
  dump((unsigned char *)&bb, sizeof(bb));
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movq   $0x9,-0x48(%rbp)
lea    -0x48(%rbp),%rdi
add    $0x8,%rdi
lea    0xec1(%rip),%rsi
mov    $0x40,%edx
call   1030 <strncpy@plt>
lea    -0x48(%rbp),%rdi
mov    $0x48,%esi
call   1040 <dump@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
sub    $0x48,%rsp
movq   $0x9,(%rsp)
lea    0x8(%rsp),%rdi
lea    0xec8(%rip),%rsi
mov    $0x40,%edx
call   1030 <strncpy@plt>
mov    %rsp,%rdi
mov    $0x48,%esi
call   1040 <dump@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
%struct.mymsgbuf = type { i64, [64 x i8] }
@.str = [12 x i8] c"hello world\00"
define void @test() {
%1 = alloca %struct.mymsgbuf
%2 = getelementptr inbounds %struct.mymsgbuf, %struct.mymsgbuf* %1, i32 0, i32 0
store i64 9, i64* %2
%3 = getelementptr inbounds %struct.mymsgbuf, %struct.mymsgbuf* %1, i32 0, i32 1
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = call i32 @strncpy(i8* %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 64)
%6 = bitcast %struct.mymsgbuf* %1 to i8*
%7 = call i32 @dump(i8* %6, i32 72)
ret void
}

LLVM IR (-O2):
%struct.mymsgbuf = type { i64, [64 x i8] }
@.str = [12 x i8] c"hello world\00"
define void @test() {
%1 = alloca %struct.mymsgbuf
%2 = bitcast %struct.mymsgbuf* %1 to i8*
%3 = getelementptr inbounds %struct.mymsgbuf, %struct.mymsgbuf* %1, i64 0, i32 0
store i64 9, i64* %3
%4 = getelementptr inbounds %struct.mymsgbuf, %struct.mymsgbuf* %1, i64 0, i32 1, i64 0
%5 = call i32 @strncpy(i8* %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 64)
%6 = call i32 @dump(i8* %2, i32 72)
ret void
}
void _line1x1x_callback() {}


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

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

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

LLVM IR (-O2):
define void @_line1x1x_callback() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x33() {
  Assert_real((isprint(51)),
              "/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_isprint.c",
              260, ("isprint should be 1 for 3"));
}


x86 assembly (clang, -O0):
<t_isprint_0x33>:
push   %rbp
mov    %rsp,%rbp
mov    $0x33,%edi
call   1030 <isprint@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x104,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x33>:
push   %rax
mov    $0x33,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x104,%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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for 3\00"
define void @t_isprint_0x33() {
%1 = call i32 @isprint(i32 51)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 260, 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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for 3\00"
define void @t_isprint_0x33() {
%1 = tail call i32 @isprint(i32 51)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 260, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ pfd();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ syscall(int, int);
int close_pipe() {
  char s[16];
  int fd;
  pfd();
  printf("FD? ");
  gets(s);
  fd = atoi(s);
  syscall(33, fd);
}


x86 assembly (clang, -O0):
<close_pipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    $0x0,%al
call   1060 <pfd@plt>
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x20(%rbp),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
mov    $0x21,%edi
call   1040 <syscall@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_pipe>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1060 <pfd@plt>
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %rbx,%rdi
call   1070 <atoi@plt>
mov    $0x21,%edi
mov    %eax,%esi
call   1040 <syscall@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"FD? \00"
define i32 @close_pipe() {
%1 = alloca i32
%2 = alloca [16 x i8]
%3 = alloca i32
%4 = call i32 (...) @pfd()
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%7 = call i32 @gets(i8* %6)
%8 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%9 = call i32 @atoi(i8* %8)
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = call i32 @syscall(i32 33, i32 %10)
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [5 x i8] c"FD? \00"
define i32 @close_pipe() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (...) @pfd()
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @gets(i8* %2)
%6 = call i32 @atoi(i8* %2)
%7 = call i32 @syscall(i32 33, i32 %6)
ret i32 undef
}
void RequestBinaryStdio() {}


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

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

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

LLVM IR (-O2):
define void @RequestBinaryStdio() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ whoiswin();
void result(void) { whoiswin(); }


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

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

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

LLVM IR (-O2):
define void @result() {
%1 = tail call i32 (...) @whoiswin()
ret void
}
int test_imm_A3int32_reg(int val) { return ((val) & (0xA3 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_A3int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xa3,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_A3int32_reg>:
test   $0xa3,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_A3int32_reg(i32 %0) {
%2 = and i32 %0, 163
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
char *print_vfpu_reg(int, int /*<<< orphan*/, char, char, char *);
char *print_vfpumatrix(int reg, char *output) {
  return print_vfpu_reg(reg, 0, 'M', 'E', output);
}


x86 assembly (clang, -O0):
<print_vfpumatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%r8
xor    %esi,%esi
mov    $0x4d,%edx
mov    $0x45,%ecx
call   1030 <print_vfpu_reg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_vfpumatrix>:
mov    %rsi,%r8
xor    %esi,%esi
mov    $0x4d,%edx
mov    $0x45,%ecx
jmp    1030 <print_vfpu_reg@plt>

LLVM IR (-O0):
define i8* @print_vfpumatrix(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i8* @print_vfpu_reg(i32 %5, i32 0, i8 signext 77, i8 signext 69, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @print_vfpumatrix(i32 %0, i8* %1) {
%3 = tail call i8* @print_vfpu_reg(i32 %0, i32 0, i8 signext 77, i8 signext 69, i8* %1)
ret i8* %3
}
int fun() {
  static int num = 7;
  return num--;
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f16(%rip),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,0x2f0b(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
mov    0x2f1a(%rip),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,0x2f11(%rip)
ret

LLVM IR (-O0):
@fun.num = internal global i32 7
define i32 @fun() {
%1 = load i32, i32* @fun.num
%2 = add nsw i32 %1, -1
store i32 %2, i32* @fun.num
ret i32 %1
}

LLVM IR (-O2):
@fun.num = internal unnamed_addr global i32 7
define i32 @fun() {
%1 = load i32, i32* @fun.num
%2 = add nsw i32 %1, -1
store i32 %2, i32* @fun.num
ret i32 %1
}
/* Variables and functions */
void PERQTDeInit(void) {}


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

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

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

LLVM IR (-O2):
define void @PERQTDeInit() {
ret void
}