xunge/DecIR huggingface dataset:
/* Variables and functions */
float cubic_out(float, float, float);
float cubic_f_out(float step, float max_steps, float max_val) {
  return cubic_out(step, max_steps, max_val);
}


x86 assembly (clang, -O0):
<cubic_f_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1030 <cubic_out@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cubic_f_out>:
jmp    1030 <cubic_out@plt>

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

LLVM IR (-O2):
define float @cubic_f_out(float %0, float %1, float %2) {
%4 = tail call float @cubic_out(float %0, float %1, float %2)
ret float %4
}
/* Variables and functions */
int fsync(int);
int ness_os_fsync(int fd) {
  int r = -1;
  r = fsync(fd);
  return r;
}


x86 assembly (clang, -O0):
<ness_os_fsync>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <fsync@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ness_os_fsync>:
jmp    1030 <fsync@plt>

LLVM IR (-O0):
define i32 @ness_os_fsync(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 -1, i32* %3
%4 = load i32, i32* %2
%5 = call i32 @fsync(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @ness_os_fsync(i32 %0) {
%2 = tail call i32 @fsync(i32 %0)
ret i32 %2
}
void swr_set_channel_mapping() {}


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

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

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

LLVM IR (-O2):
define void @swr_set_channel_mapping() {
ret void
}
int test_imm_2Eint32_mem(int *val) {
  return ((*val) & (0x2E << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_2Eint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 46
%6 = icmp ne i32 %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_2Eint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 46
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ check_case(int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int N;
  scanf("%d", &N);
  check_case(N);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @check_case(i32 %4)
ret i32 0
}
unsigned short makeColour(unsigned short int r, unsigned short int g,
                          unsigned short int b) {
  return ((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3);
}


x86 assembly (clang, -O0):
<makeColour>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %si,%cx
mov    %di,%dx
mov    %dx,-0x2(%rbp)
mov    %cx,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x3,%eax
shl    $0xb,%eax
movzwl -0x4(%rbp),%ecx
sar    $0x2,%ecx
shl    $0x5,%ecx
or     %ecx,%eax
movzwl -0x6(%rbp),%ecx
sar    $0x3,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeColour>:
shl    $0x8,%edi
and    $0xfff800,%edi
lea    0x0(,%rsi,8),%eax
and    $0xffffffe0,%eax
or     %edi,%eax
shr    $0x3,%edx
or     %edx,%eax
ret

LLVM IR (-O0):
define zeroext i16 @makeColour(i16 zeroext %0, i16 zeroext %1, i16 zeroext %2) {
%4 = alloca i16
%5 = alloca i16
%6 = alloca i16
store i16 %0, i16* %4
store i16 %1, i16* %5
store i16 %2, i16* %6
%7 = load i16, i16* %4
%8 = zext i16 %7 to i32
%9 = ashr i32 %8, 3
%10 = shl i32 %9, 11
%11 = load i16, i16* %5
%12 = zext i16 %11 to i32
%13 = ashr i32 %12, 2
%14 = shl i32 %13, 5
%15 = or i32 %10, %14
%16 = load i16, i16* %6
%17 = zext i16 %16 to i32
%18 = ashr i32 %17, 3
%19 = or i32 %15, %18
%20 = trunc i32 %19 to i16
ret i16 %20
}

LLVM IR (-O2):
define zeroext i16 @makeColour(i16 zeroext %0, i16 zeroext %1, i16 zeroext %2) {
%4 = shl i16 %0, 8
%5 = and i16 %4, -2048
%6 = shl i16 %1, 3
%7 = and i16 %6, -32
%8 = or i16 %7, %5
%9 = lshr i16 %2, 3
%10 = or i16 %8, %9
ret i16 %10
}
/* Variables and functions */
int /*<<< orphan*/ Section1(int);
int /*<<< orphan*/ Section2(int);
int /*<<< orphan*/ Section3(int);
int /*<<< orphan*/ Section4(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int seconds;
  printf("Insert seconds: ");
  scanf("%d", &seconds);
  Section1(seconds);
  Section2(seconds);
  Section3(seconds);
  Section4(seconds);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe8a(%rip),%rdi
call   1050 <printf@plt>
lea    0xe8f(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1080 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1060 <Section1@plt>
mov    -0x8(%rbp),%edi
call   1030 <Section2@plt>
mov    -0x8(%rbp),%edi
call   1070 <Section3@plt>
mov    -0x8(%rbp),%edi
call   1040 <Section4@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xe98(%rip),%rdi
call   1050 <printf@plt>
lea    0xe9d(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1080 <scanf@plt>
mov    0x4(%rsp),%edi
call   1060 <Section1@plt>
mov    0x4(%rsp),%edi
call   1030 <Section2@plt>
mov    0x4(%rsp),%edi
call   1070 <Section3@plt>
mov    0x4(%rsp),%edi
call   1040 <Section4@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Insert seconds: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @Section1(i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @Section2(i32 %7)
%9 = load i32, i32* %2
%10 = call i32 @Section3(i32 %9)
%11 = load i32, i32* %2
%12 = call i32 @Section4(i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Insert seconds: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @Section1(i32 %5)
%7 = load i32, i32* %1
%8 = call i32 @Section2(i32 %7)
%9 = load i32, i32* %1
%10 = call i32 @Section3(i32 %9)
%11 = load i32, i32* %1
%12 = call i32 @Section4(i32 %11)
ret i32 0
}
void g_signal_has_handler_pending() {}


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

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

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

LLVM IR (-O2):
define void @g_signal_has_handler_pending() {
ret void
}
int resume_kex(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @resume_kex() {
ret i32 1
}
/* Type definitions */
typedef scalar_t__ loff_t;

/* Variables and functions */
scalar_t__ llseek(int, scalar_t__, int /*<<< orphan*/);
int write(int, void *, int);
int fs_write(int fd, loff_t pos, int size, void *data) {
  if (llseek(fd, pos, 0) == pos) {
    if (write(fd, data, size) == size)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<fs_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1040 <llseek@plt>
cmp    -0x10(%rbp),%rax
jne    1177 <fs_write+0x57>
mov    -0x8(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
cmp    -0x14(%rbp),%eax
jne    1172 <fs_write+0x52>
movl   $0x1,-0x4(%rbp)
jmp    117e <fs_write+0x5e>
jmp    1177 <fs_write+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_write>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %edx,%r15d
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %edx,%edx
call   1040 <llseek@plt>
cmp    %rbx,%rax
jne    1157 <fs_write+0x37>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %r15d,%edx
call   1030 <write@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %r15d,%ecx
je     1159 <fs_write+0x39>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fs_write(i32 %0, i64 %1, i32 %2, i8* nocapture %3) {
%5 = tail call i64 @llseek(i32 %0, i64 %1, i32 0)
%6 = icmp eq i64 %5, %1
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = tail call i32 @write(i32 %0, i8* %3, i32 %2)
%9 = icmp eq i32 %8, %2
br i1 %9, label %11, label %10
10: ; preds = %7, %4
br label %11
11: ; preds = %7, %10
%12 = phi i32 [ 0, %10 ], [ 1, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
float mus_char_to_lfloat(const unsigned char *inp) {
  float o;
  unsigned char *outp = (unsigned char *)&o;
  memcpy((void *)outp, (void *)inp, 4);
  return (o);
}


x86 assembly (clang, -O0):
<mus_char_to_lfloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
movss  -0xc(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mus_char_to_lfloat>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @mus_char_to_lfloat(i8* %0) {
%2 = alloca i8*
%3 = alloca float
%4 = alloca i8*
store i8* %0, i8** %2
%5 = bitcast float* %3 to i8*
store i8* %5, i8** %4
%6 = load i8*, i8** %4
%7 = load i8*, i8** %2
%8 = call i32 @memcpy(i8* %6, i8* %7, i32 4)
%9 = load float, float* %3
ret float %9
}

LLVM IR (-O2):
define float @mus_char_to_lfloat(i8* %0) {
%2 = alloca float
%3 = bitcast float* %2 to i8*
%4 = call i32 @memcpy(i8* %3, i8* %0, i32 4)
%5 = load float, float* %2
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int scanf(char *, int *, int *);
int main(void) {
  int no1, no2;
  if (scanf("%d%d", &no1, &no2) == 2)
    printf("%d\n", no1 + no2);
  else
    printf("Illegal input!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    1165 <main+0x45>
mov    -0x8(%rbp),%esi
add    -0xc(%rbp),%esi
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1173 <main+0x53>
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
cmp    $0x2,%eax
jne    1161 <main+0x31>
mov    (%rsp),%esi
add    0x4(%rsp),%esi
lea    0xead(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    116d <main+0x3d>
lea    0xea1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [16 x i8] c"Illegal input!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%5 = icmp eq i32 %4, 2
br i1 %5, label %6, label %11
6: ; preds = %0
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = add nsw i32 %7, %8
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
br label %13
11: ; preds = %0
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
br label %13
13: ; preds = %11, %6
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@str = [15 x i8] c"Illegal input!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = icmp eq i32 %5, 2
br i1 %6, label %7, label %12
7: ; preds = %0
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = add nsw i32 %9, %8
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %10)
br label %14
12: ; preds = %0
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
br label %14
14: ; preds = %12, %7
ret i32 0
}
char *my_strchr(const char *s, int c) {
  do {
    if (*s == c) {
      return (char *)s;
    }
  } while (*s++);
  return 0;
}


x86 assembly (clang, -O0):
<my_strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1128 <my_strchr+0x28>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114d <my_strchr+0x4d>
jmp    112d <my_strchr+0x2d>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,(%rax)
jne    110b <my_strchr+0xb>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strchr>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl (%rax),%ecx
cmp    %esi,%ecx
je     1121 <my_strchr+0x21>
add    $0x1,%rax
test   %cl,%cl
jne    1110 <my_strchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @my_strchr(i8* %0, i32 %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i8* [ %0, %2 ], [ %9, %8 ]
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, %1
br i1 %7, label %11, label %8
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = icmp eq i8 %5, 0
br i1 %10, label %11, label %3
11: ; preds = %8, %3
%12 = phi i8* [ %4, %3 ], [ null, %8 ]
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ arg_test(char const *, int const, double const);
int main() {
  const char *s = "Hello, World!";
  const int i = 123123123;
  const double d = 3.14159265359;
  arg_test(s, i, d);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee2(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x756b5b3,-0x14(%rbp)
movsd  0xec7(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x756b5b3,%esi
movsd  0xeb1(%rip),%xmm0
call   1030 <arg_test@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movsd  0xee0(%rip),%xmm0
mov    $0x756b5b3,%esi
call   1030 <arg_test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, World!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
%4 = alloca double
store i32 0, i32* %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %2
store i32 123123123, i32* %3
store double 0x400921FB54442EEA, double* %4
%5 = load i8*, i8** %2
%6 = call i32 @arg_test(i8* %5, i32 123123123, double 0x400921FB54442EEA)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, World!\00"
define i32 @main() {
%1 = tail call i32 @arg_test(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 123123123, double 0x400921FB54442EEA)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xe2() {
  Assert_real((islower(226) == 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_islower.c",
              1135, ("islower should be 0 for 0xe2"));
}


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

x86 assembly (clang, -O2):
<t_islower_0xe2>:
push   %rax
mov    $0xe2,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x46f,%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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xe2\00"
define void @t_islower_0xe2() {
%1 = call i64 @islower(i32 226)
%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 1135, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xe2\00"
define void @t_islower_0xe2() {
%1 = tail call i64 @islower(i32 226)
%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 1135, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int bitcount(unsigned int x) {
  int b;
  for (b = 0; x != 0; x >>= 1) {
    if (x & 0x01) {
      b++;
    }
  }
  return b;
}


x86 assembly (clang, -O0):
<bitcount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1143 <bitcount+0x43>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1130 <bitcount+0x30>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1135 <bitcount+0x35>
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <bitcount+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitcount>:
xor    %eax,%eax
test   %edi,%edi
je     1120 <bitcount+0x20>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x1,%edx
add    %edx,%eax
shr    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <bitcount+0x10>
ret

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

LLVM IR (-O2):
define i32 @bitcount(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = and i32 %5, 1
%7 = add nuw nsw i32 %4, %6
%8 = lshr i32 %5, 1
%9 = icmp ult i32 %5, 2
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void dummy_oracle_sid() { printf("\n"); }


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

x86 assembly (clang, -O2):
<dummy_oracle_sid>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @dummy_oracle_sid() {
%1 = tail call i32 @putchar(i32 10)
ret void
}
unsigned div3(unsigned n) { return n / 3; }


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

x86 assembly (clang, -O2):
<div3>:
mov    %edi,%ecx
mov    $0xaaaaaaab,%eax
imul   %rcx,%rax
shr    $0x21,%rax
ret

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

LLVM IR (-O2):
define i32 @div3(i32 %0) {
%2 = udiv i32 %0, 3
ret i32 %2
}
int Mini_AigLitIsCompl(int Lit) { return Lit & 1; }


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

x86 assembly (clang, -O2):
<Mini_AigLitIsCompl>:
mov    %edi,%eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @Mini_AigLitIsCompl(i32 %0) {
%2 = and i32 %0, 1
ret i32 %2
}
int lsm_process_label_set(const char *label, struct lxc_conf *conf,
                          int use_default, int on_exec) {
  return 0;
}


x86 assembly (clang, -O0):
<lsm_process_label_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.lxc_conf = type opaque
define i32 @lsm_process_label_set(i8* %0, %struct.lxc_conf* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca %struct.lxc_conf*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store %struct.lxc_conf* %1, %struct.lxc_conf** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret i32 0
}

LLVM IR (-O2):
%struct.lxc_conf = type opaque
define i32 @lsm_process_label_set(i8* nocapture readnone %0, %struct.lxc_conf* nocapture readnone %1, i32 %2, i32 %3) {
ret i32 0
}
int stuff_send_buffer_header(unsigned short index, unsigned char serial_number,
                             unsigned char packet_type, unsigned char *buffer) {
  buffer[0] = (index >> 0) & 0xff;
  buffer[1] = (index >> 8) & 0xff;
  buffer[2] = serial_number;
  buffer[3] = packet_type;
  return (index);
}


x86 assembly (clang, -O0):
<stuff_send_buffer_header>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%dl
mov    %di,%si
mov    %si,-0x2(%rbp)
mov    %dl,-0x3(%rbp)
mov    %al,-0x4(%rbp)
mov    %rcx,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x0,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x3(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x4(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stuff_send_buffer_header>:
mov    %edi,%eax
mov    %al,(%rcx)
mov    %ah,0x1(%rcx)
mov    %sil,0x2(%rcx)
mov    %dl,0x3(%rcx)
ret

LLVM IR (-O0):
define i32 @stuff_send_buffer_header(i16 zeroext %0, i8 zeroext %1, i8 zeroext %2, i8* %3) {
%5 = alloca i16
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8*
store i16 %0, i16* %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i8* %3, i8** %8
%9 = load i16, i16* %5
%10 = zext i16 %9 to i32
%11 = ashr i32 %10, 0
%12 = and i32 %11, 255
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %8
%15 = getelementptr inbounds i8, i8* %14, i64 0
store i8 %13, i8* %15
%16 = load i16, i16* %5
%17 = zext i16 %16 to i32
%18 = ashr i32 %17, 8
%19 = and i32 %18, 255
%20 = trunc i32 %19 to i8
%21 = load i8*, i8** %8
%22 = getelementptr inbounds i8, i8* %21, i64 1
store i8 %20, i8* %22
%23 = load i8, i8* %6
%24 = load i8*, i8** %8
%25 = getelementptr inbounds i8, i8* %24, i64 2
store i8 %23, i8* %25
%26 = load i8, i8* %7
%27 = load i8*, i8** %8
%28 = getelementptr inbounds i8, i8* %27, i64 3
store i8 %26, i8* %28
%29 = load i16, i16* %5
%30 = zext i16 %29 to i32
ret i32 %30
}

LLVM IR (-O2):
define i32 @stuff_send_buffer_header(i16 zeroext %0, i8 zeroext %1, i8 zeroext %2, i8* nocapture writeonly %3) {
%5 = zext i16 %0 to i32
%6 = trunc i16 %0 to i8
store i8 %6, i8* %3
%7 = lshr i16 %0, 8
%8 = trunc i16 %7 to i8
%9 = getelementptr inbounds i8, i8* %3, i64 1
store i8 %8, i8* %9
%10 = getelementptr inbounds i8, i8* %3, i64 2
store i8 %1, i8* %10
%11 = getelementptr inbounds i8, i8* %3, i64 3
store i8 %2, i8* %11
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdin;
scalar_t__ timlib_get_line(char *, int /*<<< orphan*/, int);
void test_get_line(void) {
  char buffer[1024];
  while (timlib_get_line(buffer, stdin, 1024)) {
    printf("%s\n", buffer);
  }
}


x86 assembly (clang, -O0):
<test_get_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
lea    -0x400(%rbp),%rdi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
mov    $0x400,%edx
call   1040 <timlib_get_line@plt>
cmp    $0x0,%rax
je     1167 <test_get_line+0x47>
lea    -0x400(%rbp),%rsi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
jmp    112b <test_get_line+0xb>
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_get_line>:
push   %r15
push   %r14
push   %rbx
sub    $0x400,%rsp
mov    0x2eb5(%rip),%r15
mov    (%r15),%esi
mov    %rsp,%rdi
mov    $0x400,%edx
call   1040 <timlib_get_line@plt>
test   %rax,%rax
je     1180 <test_get_line+0x60>
lea    0xeb1(%rip),%r14
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    (%r15),%esi
mov    %rbx,%rdi
mov    $0x400,%edx
call   1040 <timlib_get_line@plt>
test   %rax,%rax
jne    1160 <test_get_line+0x40>
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @test_get_line() {
%1 = alloca [1024 x i8]
br label %2
2: ; preds = %7, %0
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%4 = load i32, i32* @stdin
%5 = call i64 @timlib_get_line(i8* %3, i32 %4, i32 1024)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %2
10: ; preds = %2
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @test_get_line() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i64 @timlib_get_line(i8* %2, i32 %3, i32 1024)
%5 = icmp eq i64 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %0, %6
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%8 = load i32, i32* @stdin
%9 = call i64 @timlib_get_line(i8* %2, i32 %8, i32 1024)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %6
11: ; preds = %6, %0
ret void
}
int countOnes(int num) {
  int numOnes = 0;
  while (num) {
    if (num % 2 == 1) {
      numOnes += 1;
    }
    num = num >> 1;
  }
  return numOnes;
}


x86 assembly (clang, -O0):
<countOnes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1143 <countOnes+0x43>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    1135 <countOnes+0x35>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <countOnes+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countOnes>:
xor    %eax,%eax
test   %edi,%edi
je     1131 <countOnes+0x31>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
shr    $0x1f,%edx
add    %edi,%edx
and    $0xfffffffe,%edx
mov    %edi,%esi
sub    %edx,%esi
xor    %edx,%edx
cmp    $0x1,%esi
sete   %dl
add    %edx,%eax
sar    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <countOnes+0x10>
ret

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

LLVM IR (-O2):
define i32 @countOnes(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ 0, %1 ]
%5 = phi i32 [ %10, %3 ], [ %0, %1 ]
%6 = srem i32 %5, 2
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i32
%9 = add nuw nsw i32 %4, %8
%10 = ashr i32 %5, 1
%11 = icmp ult i32 %5, 2
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %9, %3 ]
ret i32 %13
}
/* Variables and functions */
unsigned int fwrite(void const *, int, int, void *);
int send_fp_chars(void *arg, const void *buf, int len) {
  if (!arg)
    return 1;
  if (fwrite(buf, 1, len, arg) != (unsigned int)len)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<send_fp_chars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    113a <send_fp_chars+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    116b <send_fp_chars+0x5b>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fwrite@plt>
cmp    -0x1c(%rbp),%eax
je     1164 <send_fp_chars+0x54>
movl   $0x0,-0x4(%rbp)
jmp    116b <send_fp_chars+0x5b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_fp_chars>:
test   %rdi,%rdi
je     1133 <send_fp_chars+0x23>
push   %rbx
mov    %edx,%ebx
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    $0x1,%esi
call   1030 <fwrite@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ebx,%ecx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @send_fp_chars(i8* %0, i8* nocapture %1, i32 %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = tail call i32 @fwrite(i8* %1, i32 1, i32 %2, i8* %0)
%7 = icmp eq i32 %6, %2
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %3
%10 = phi i32 [ 1, %3 ], [ %8, %5 ]
ret i32 %10
}
void mulvv(double *result, const double *s1) {
  result[0] *= s1[0];
  result[1] *= s1[1];
  result[2] *= s1[2];
}


x86 assembly (clang, -O0):
<mulvv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x10(%rax),%xmm0
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mulvv>:
movsd  (%rsi),%xmm0
mulsd  (%rdi),%xmm0
movsd  %xmm0,(%rdi)
movsd  0x8(%rsi),%xmm0
mulsd  0x8(%rdi),%xmm0
movsd  %xmm0,0x8(%rdi)
movsd  0x10(%rsi),%xmm0
mulsd  0x10(%rdi),%xmm0
movsd  %xmm0,0x10(%rdi)
ret

LLVM IR (-O0):
define void @mulvv(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %3
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = fmul double %10, %7
store double %11, double* %9
%12 = load double*, double** %4
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = load double*, double** %3
%16 = getelementptr inbounds double, double* %15, i64 1
%17 = load double, double* %16
%18 = fmul double %17, %14
store double %18, double* %16
%19 = load double*, double** %4
%20 = getelementptr inbounds double, double* %19, i64 2
%21 = load double, double* %20
%22 = load double*, double** %3
%23 = getelementptr inbounds double, double* %22, i64 2
%24 = load double, double* %23
%25 = fmul double %24, %21
store double %25, double* %23
ret void
}

LLVM IR (-O2):
define void @mulvv(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = load double, double* %0
%5 = fmul double %3, %4
store double %5, double* %0
%6 = getelementptr inbounds double, double* %1, i64 1
%7 = load double, double* %6
%8 = getelementptr inbounds double, double* %0, i64 1
%9 = load double, double* %8
%10 = fmul double %7, %9
store double %10, double* %8
%11 = getelementptr inbounds double, double* %1, i64 2
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %0, i64 2
%14 = load double, double* %13
%15 = fmul double %12, %14
store double %15, double* %13
ret void
}
void fc228(int n) {
  {
    typedef int(*b)[n];
    {
      typedef int(*c)[n];
      0;
    }
    {
      typedef int(*d)[n];
      0;
    };
    typedef int(*e)[n];
    0;
  };
a : {
  typedef int(*f)[n];
  {
    typedef int(*g)[n];
    0;
  };
  {
    typedef int(*h)[n];
    0;
  };
  ;
  typedef int(*i)[n];
  goto a;
  0;
};
  ;
  typedef int(*j)[n];
  0;
}


x86 assembly (clang, -O0):
<fc228>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fc228+0x7>

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

LLVM IR (-O0):
define void @fc228(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = load i32, i32* %2
%8 = zext i32 %7 to i64
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %11, %1
%12 = load i32, i32* %2
%13 = zext i32 %12 to i64
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
%16 = load i32, i32* %2
%17 = zext i32 %16 to i64
%18 = load i32, i32* %2
%19 = zext i32 %18 to i64
br label %11
20: ; No predecessors!
%21 = load i32, i32* %2
%22 = zext i32 %21 to i64
ret void
}

LLVM IR (-O2):
define void @fc228(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fwrite(void const *, size_t, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char const *);
void dumpBinaryFile(const char *filename, const void *buf, size_t bufSize) {
  FILE *f = fopen(filename, "wb");
  fwrite(buf, bufSize, 1, f);
  fclose(f);
  printf("dumped file %s\n", filename);
}


x86 assembly (clang, -O0):
<dumpBinaryFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea1(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rcx
mov    $0x1,%edx
call   1060 <fwrite@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x8(%rbp),%rsi
lea    0xe71(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dumpBinaryFile>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
lea    0xea8(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
mov    %rax,%rcx
call   1060 <fwrite@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
lea    0xe81(%rip),%rdi
mov    %r12,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"wb\00"
@.str.1 = [16 x i8] c"dumped file %s\0A\00"
define void @dumpBinaryFile(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = call i32* @fopen(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %9, i32** %7
%10 = load i8*, i8** %5
%11 = load i64, i64* %6
%12 = load i32*, i32** %7
%13 = call i32 @fwrite(i8* %10, i64 %11, i32 1, i32* %12)
%14 = load i32*, i32** %7
%15 = call i32 @fclose(i32* %14)
%16 = load i8*, i8** %4
%17 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %16)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"wb\00"
@.str.1 = [16 x i8] c"dumped file %s\0A\00"
define void @dumpBinaryFile(i8* %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @fwrite(i8* %1, i64 %2, i32 1, i32* %4)
%6 = tail call i32 @fclose(i32* %4)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ L(int /*<<< orphan*/ *);
int /*<<< orphan*/ P(int /*<<< orphan*/ *);
int /*<<< orphan*/ S(int /*<<< orphan*/ *);
int /*<<< orphan*/ XOR(int /*<<< orphan*/ *, int /*<<< orphan*/ const *);
void LPSX(uint32_t *dst, const uint32_t *chunk) {
  XOR(dst, chunk);
  S(dst);
  P(dst);
  L(dst);
}


x86 assembly (clang, -O0):
<LPSX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <XOR@plt>
mov    -0x8(%rbp),%rdi
call   1060 <S@plt>
mov    -0x8(%rbp),%rdi
call   1030 <P@plt>
mov    -0x8(%rbp),%rdi
call   1040 <L@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LPSX>:
push   %rbx
mov    %rdi,%rbx
call   1050 <XOR@plt>
mov    %rbx,%rdi
call   1060 <S@plt>
mov    %rbx,%rdi
call   1030 <P@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <L@plt>

LLVM IR (-O0):
define void @LPSX(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i32*, i32** %4
%7 = call i32 @XOR(i32* %5, i32* %6)
%8 = load i32*, i32** %3
%9 = call i32 @S(i32* %8)
%10 = load i32*, i32** %3
%11 = call i32 @P(i32* %10)
%12 = load i32*, i32** %3
%13 = call i32 @L(i32* %12)
ret void
}

LLVM IR (-O2):
define void @LPSX(i32* %0, i32* %1) {
%3 = tail call i32 @XOR(i32* %0, i32* %1)
%4 = tail call i32 @S(i32* %0)
%5 = tail call i32 @P(i32* %0)
%6 = tail call i32 @L(i32* %0)
ret void
}
/* Variables and functions */
scalar_t__ malloc(size_t);
void *xi_alloc(size_t b) { return (void *)malloc(b); }


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

x86 assembly (clang, -O2):
<xi_alloc>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @xi_alloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @xi_alloc(i64 %0) {
%2 = tail call i64 @malloc(i64 %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ ft_putendl(char *);
int /*<<< orphan*/ ft_putnbr(int);
int /*<<< orphan*/ ft_putstr(char *);
void ft_putnbrendl_info(int nb) {
  ft_putstr("\x1B[36m");
  ft_putnbr(nb);
  ft_putendl("\x1B[0m");
}


x86 assembly (clang, -O0):
<ft_putnbrendl_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1050 <ft_putstr@plt>
mov    -0x4(%rbp),%edi
call   1040 <ft_putnbr@plt>
lea    0xeb0(%rip),%rdi
call   1030 <ft_putendl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putnbrendl_info>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
call   1050 <ft_putstr@plt>
mov    %ebx,%edi
call   1040 <ft_putnbr@plt>
lea    0xeb9(%rip),%rdi
pop    %rbx
jmp    1030 <ft_putendl@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[36m\00"
@.str.1 = [5 x i8] c"\1B[0m\00"
define void @ft_putnbrendl_info(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @ft_putstr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @ft_putnbr(i32 %4)
%6 = call i32 @ft_putendl(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[36m\00"
@.str.1 = [5 x i8] c"\1B[0m\00"
define void @ft_putnbrendl_info(i32 %0) {
%2 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @ft_putnbr(i32 %0)
%4 = tail call i32 @ft_putendl(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}
__attribute__((always_)) void
flush_icache_user_range(struct vm_area_struct *vma, struct page *page,
                        unsigned long addr, unsigned long len) {}


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

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

LLVM IR (-O0):
%struct.vm_area_struct = type opaque
%struct.page = type opaque
define void @flush_icache_user_range(%struct.vm_area_struct* %0, %struct.page* %1, i64 %2, i64 %3) {
%5 = alloca %struct.vm_area_struct*
%6 = alloca %struct.page*
%7 = alloca i64
%8 = alloca i64
store %struct.vm_area_struct* %0, %struct.vm_area_struct** %5
store %struct.page* %1, %struct.page** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
ret void
}

LLVM IR (-O2):
%struct.vm_area_struct = type opaque
%struct.page = type opaque
define void @flush_icache_user_range(%struct.vm_area_struct* nocapture %0, %struct.page* nocapture %1, i64 %2, i64 %3) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint8_t get_spc(uint32_t ClusterSizeKB, uint32_t BytesPerSect) {
  uint32_t spc = (ClusterSizeKB * 1024) / BytesPerSect;
  return ((uint8_t)spc);
}


x86 assembly (clang, -O0):
<get_spc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xa,%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_spc>:
mov    %edi,%eax
shl    $0xa,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @get_spc(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = mul nsw i32 %6, 1024
%8 = load i32, i32* %4
%9 = sdiv i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @get_spc(i32 %0, i32 %1) {
%3 = shl nsw i32 %0, 10
%4 = sdiv i32 %3, %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void prog(double percent) { printf("\r%3.0f%% completed", percent * 100); }


x86 assembly (clang, -O0):
<prog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prog>:
mulsd  0xee8(%rip),%xmm0
lea    0xee9(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"\0D%3.0f%% completed\00"
define void @prog(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 1.000000e+02
%5 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double %4)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"\0D%3.0f%% completed\00"
define void @prog(double %0) {
%2 = fmul double %0, 1.000000e+02
%3 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double %2)
ret void
}