xunge/DecIR huggingface dataset:
int compare_names(char *entry, char *cmp_name) {
  int i, equal;
  equal = 1;
  for (i = 0; i < 10; i++) {
    if (entry[i] != cmp_name[i]) {
      equal = 0;
    }
  }
  return (equal);
}


x86 assembly (clang, -O0):
<compare_names>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    115e <compare_names+0x5e>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     114b <compare_names+0x4b>
movl   $0x0,-0x18(%rbp)
jmp    1150 <compare_names+0x50>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111a <compare_names+0x1a>
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_names>:
mov    (%rdi),%cl
xor    (%rsi),%cl
mov    0x1(%rdi),%al
xor    0x1(%rsi),%al
movq   0x2(%rdi),%xmm0
movq   0x2(%rsi),%xmm1
pcmpeqb %xmm0,%xmm1
punpcklbw %xmm1,%xmm0
psraw  $0x8,%xmm0
psllw  $0xf,%xmm0
packsswb %xmm0,%xmm0
pmovmskb %xmm0,%edx
not    %dl
or     %al,%dl
xor    %eax,%eax
or     %cl,%dl
sete   %al
ret

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

LLVM IR (-O2):
define i32 @compare_names(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = getelementptr inbounds i8, i8* %1, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %7, %9
%11 = getelementptr inbounds i8, i8* %0, i64 2
%12 = getelementptr inbounds i8, i8* %1, i64 2
%13 = bitcast i8* %11 to <8 x i8>*
%14 = load <8 x i8>, <8 x i8>* %13
%15 = bitcast i8* %12 to <8 x i8>*
%16 = load <8 x i8>, <8 x i8>* %15
%17 = icmp eq <8 x i8> %14, %16
%18 = freeze <8 x i1> %17
%19 = bitcast <8 x i1> %18 to i8
%20 = icmp eq i8 %19, -1
%21 = select i1 %20, i1 %10, i1 false
%22 = select i1 %21, i1 %5, i1 false
%23 = zext i1 %22 to i32
ret i32 %23
}
/* Type definitions */
struct suffix_mult {
  int dummy;
};

/* Variables and functions */
unsigned long xatoull_sfx(char const *, struct suffix_mult const *);
unsigned long xatoul_sfx(const char *str, const struct suffix_mult *sfx) {
  return xatoull_sfx(str, sfx);
}


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

x86 assembly (clang, -O2):
<xatoul_sfx>:
jmp    1030 <xatoull_sfx@plt>

LLVM IR (-O0):
%struct.suffix_mult = type { i32 }
define i64 @xatoul_sfx(i8* %0, %struct.suffix_mult* %1) {
%3 = alloca i8*
%4 = alloca %struct.suffix_mult*
store i8* %0, i8** %3
store %struct.suffix_mult* %1, %struct.suffix_mult** %4
%5 = load i8*, i8** %3
%6 = load %struct.suffix_mult*, %struct.suffix_mult** %4
%7 = call i64 @xatoull_sfx(i8* %5, %struct.suffix_mult* %6)
ret i64 %7
}

LLVM IR (-O2):
%struct.suffix_mult = type { i32 }
define i64 @xatoul_sfx(i8* %0, %struct.suffix_mult* %1) {
%3 = tail call i64 @xatoull_sfx(i8* %0, %struct.suffix_mult* %1)
ret i64 %3
}
void hisfc350_get_best_clock(unsigned int *clock) {
  int ix;
  int clk_reg;
  unsigned int sysclk[] = {
      (((24) + 1) >> 1), (0 << 2), (((112) + 1) >> 1), (1 << 2), 0, 0,
  };
  clk_reg = (0 << 2);
  for (ix = 0; sysclk[ix]; ix += 2) {
    if (*clock < sysclk[ix])
      break;
    clk_reg = sysclk[ix + 1];
  }
  *clock = clk_reg;
}


x86 assembly (clang, -O0):
<hisfc350_get_best_clock>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0xef1(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeee(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xeeb(%rip),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
movslq -0xc(%rbp),%rax
cmpl   $0x0,-0x30(%rbp,%rax,4)
je     117c <hisfc350_get_best_clock+0x7c>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
movslq -0xc(%rbp),%rcx
cmp    -0x30(%rbp,%rcx,4),%eax
jae    115f <hisfc350_get_best_clock+0x5f>
jmp    117c <hisfc350_get_best_clock+0x7c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
mov    -0x30(%rbp,%rax,4),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    1137 <hisfc350_get_best_clock+0x37>
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<hisfc350_get_best_clock>:
xor    %eax,%eax
cmpl   $0x38,(%rdi)
setae  %al
shl    $0x2,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
@__const.hisfc350_get_best_clock.sysclk = [6 x i32] [i32 12, i32 0, i32 56, i32 4, i32 0, i32 0]
define void @hisfc350_get_best_clock(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca [6 x i32]
store i32* %0, i32** %2
%6 = bitcast [6 x i32]* %5 to i8*
store i32 0, i32* %4
store i32 0, i32* %3
br label %7
7: ; preds = %28, %1
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 %9
%11 = load i32, i32* %10
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %31
13: ; preds = %7
%14 = load i32*, i32** %2
%15 = load i32, i32* %14
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 %17
%19 = load i32, i32* %18
%20 = icmp ult i32 %15, %19
br i1 %20, label %21, label %22
21: ; preds = %13
br label %31
22: ; preds = %13
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 %25
%27 = load i32, i32* %26
store i32 %27, i32* %4
br label %28
28: ; preds = %22
%29 = load i32, i32* %3
%30 = add nsw i32 %29, 2
store i32 %30, i32* %3
br label %7
31: ; preds = %21, %7
%32 = load i32, i32* %4
%33 = load i32*, i32** %2
store i32 %32, i32* %33
ret void
}

LLVM IR (-O2):
define void @hisfc350_get_best_clock(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp ult i32 %2, 56
%4 = select i1 %3, i32 0, i32 4
store i32 %4, i32* %0
ret void
}
vf(__builtin_va_list l) { return 2 + __builtin_va_arg(l, int); }


x86 assembly (clang, -O0):
<vf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
cmp    $0x28,%eax
ja     113a <vf+0x3a>
mov    -0x18(%rbp),%rcx
mov    -0xc(%rbp),%edx
movslq %edx,%rax
add    0x10(%rcx),%rax
add    $0x8,%edx
mov    %edx,(%rcx)
mov    %rax,-0x20(%rbp)
jmp    1151 <vf+0x51>
mov    -0x18(%rbp),%rcx
mov    0x8(%rcx),%rdx
mov    %rdx,%rax
add    $0x8,%rdx
mov    %rdx,0x8(%rcx)
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
add    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vf>:
mov    (%rdi),%ecx
cmp    $0x28,%rcx
ja     1116 <vf+0x16>
mov    %rcx,%rax
add    0x10(%rdi),%rax
add    $0x8,%ecx
mov    %ecx,(%rdi)
jmp    1122 <vf+0x22>
mov    0x8(%rdi),%rax
lea    0x8(%rax),%rcx
mov    %rcx,0x8(%rdi)
mov    (%rax),%eax
add    $0x2,%eax
ret

LLVM IR (-O0):
%struct.__va_list_tag = type { i32, i32, i8*, i8* }
define i32 @vf(%struct.__va_list_tag* %0) {
%2 = alloca %struct.__va_list_tag*
store %struct.__va_list_tag* %0, %struct.__va_list_tag** %2
%3 = load %struct.__va_list_tag*, %struct.__va_list_tag** %2
%4 = getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = icmp ule i32 %5, 40
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %3, i32 0, i32 3
%9 = load i8*, i8** %8
%10 = getelementptr i8, i8* %9, i32 %5
%11 = bitcast i8* %10 to i32*
%12 = add i32 %5, 8
store i32 %12, i32* %4
br label %18
13: ; preds = %1
%14 = getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %3, i32 0, i32 2
%15 = load i8*, i8** %14
%16 = bitcast i8* %15 to i32*
%17 = getelementptr i8, i8* %15, i32 8
store i8* %17, i8** %14
br label %18
18: ; preds = %13, %7
%19 = phi i32* [ %11, %7 ], [ %16, %13 ]
%20 = load i32, i32* %19
%21 = add nsw i32 2, %20
ret i32 %21
}

LLVM IR (-O2):
%struct.__va_list_tag = type { i32, i32, i8*, i8* }
define i32 @vf(%struct.__va_list_tag* nocapture %0) {
%2 = getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = icmp ult i32 %3, 41
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %0, i64 0, i32 3
%7 = load i8*, i8** %6
%8 = zext i32 %3 to i64
%9 = getelementptr i8, i8* %7, i64 %8
%10 = add nuw nsw i32 %3, 8
store i32 %10, i32* %2
br label %15
11: ; preds = %1
%12 = getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %0, i64 0, i32 2
%13 = load i8*, i8** %12
%14 = getelementptr i8, i8* %13, i64 8
store i8* %14, i8** %12
br label %15
15: ; preds = %11, %5
%16 = phi i8* [ %9, %5 ], [ %13, %11 ]
%17 = bitcast i8* %16 to i32*
%18 = load i32, i32* %17
%19 = add nsw i32 %18, 2
ret i32 %19
}
void wifi_rsp_i2c_start_read(const struct wifi_msg_i2c_start_read_rsp_t *msg) {}


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

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

LLVM IR (-O0):
%struct.wifi_msg_i2c_start_read_rsp_t = type opaque
define void @wifi_rsp_i2c_start_read(%struct.wifi_msg_i2c_start_read_rsp_t* %0) {
%2 = alloca %struct.wifi_msg_i2c_start_read_rsp_t*
store %struct.wifi_msg_i2c_start_read_rsp_t* %0, %struct.wifi_msg_i2c_start_read_rsp_t** %2
ret void
}

LLVM IR (-O2):
%struct.wifi_msg_i2c_start_read_rsp_t = type opaque
define void @wifi_rsp_i2c_start_read(%struct.wifi_msg_i2c_start_read_rsp_t* nocapture %0) {
ret void
}
/* Variables and functions */
char *ctermid(char *);
char *ctermid_r(char *s) { return s ? ctermid(s) : NULL; }


x86 assembly (clang, -O0):
<ctermid_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1139 <ctermid_r+0x29>
mov    -0x8(%rbp),%rdi
call   1030 <ctermid@plt>
mov    %rax,-0x10(%rbp)
jmp    1144 <ctermid_r+0x34>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    1144 <ctermid_r+0x34>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctermid_r>:
test   %rdi,%rdi
je     111a <ctermid_r+0xa>
jmp    1030 <ctermid@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @ctermid_r(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @ctermid(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i[5] = {10, 2, 3, 4, 50};
  int *ip = i;
  for (int idx = 0; idx < 5; ip++, idx++)
    printf("%d ", *ip);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed5(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x5,-0x2c(%rbp)
jge    1183 <main+0x73>
mov    -0x28(%rbp),%rax
mov    (%rax),%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    114d <main+0x3d>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.i = [5 x i32] [i32 10, i32 2, i32 3, i32 4, i32 50]
@.str = [4 x i8] c"%d \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca i32*
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [5 x i32]* %2 to i8*
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
store i32* %6, i32** %3
store i32 0, i32* %4
br label %7
7: ; preds = %14, %0
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 5
br i1 %9, label %10, label %19
10: ; preds = %7
%11 = load i32*, i32** %3
%12 = load i32, i32* %11
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %10
%15 = load i32*, i32** %3
%16 = getelementptr inbounds i32, i32* %15, i32 1
store i32* %16, i32** %3
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %7
19: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 50)
ret i32 0
}
__attribute__((visibility("hidden"))) int is_composite(const int symbology) {
  return symbology >= 130 && symbology <= 139;
}


x86 assembly (clang, -O0):
<is_composite>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x82,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <is_composite+0x26>
cmpl   $0x8b,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_composite>:
add    $0xffffff7e,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define hidden i32 @is_composite(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 130
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 139
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define hidden i32 @is_composite(i32 %0) {
%2 = add i32 %0, -130
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
double cosApprox(double x) { return 1.0 - x * x / 2.0 + x * x * x * x / 24.0; }


x86 assembly (clang, -O0):
<cosApprox>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  0xef5(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xee1(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  0xeb9(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cosApprox>:
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xef0(%rip),%xmm2
mulsd  %xmm1,%xmm2
addsd  0xeec(%rip),%xmm2
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
divsd  0xee4(%rip),%xmm0
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @cosApprox(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
%6 = fdiv double %5, 2.000000e+00
%7 = fsub double 1.000000e+00, %6
%8 = load double, double* %2
%9 = load double, double* %2
%10 = fmul double %8, %9
%11 = load double, double* %2
%12 = fmul double %10, %11
%13 = load double, double* %2
%14 = fmul double %12, %13
%15 = fdiv double %14, 2.400000e+01
%16 = fadd double %7, %15
ret double %16
}

LLVM IR (-O2):
define double @cosApprox(double %0) {
%2 = fmul double %0, %0
%3 = fmul double %2, 5.000000e-01
%4 = fsub double 1.000000e+00, %3
%5 = fmul double %2, %0
%6 = fmul double %5, %0
%7 = fdiv double %6, 2.400000e+01
%8 = fadd double %4, %7
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ SendByte(int, int /*<<< orphan*/);
void cprintf(int comport_number, const char *text) {
  while (*text != 0)
    SendByte(comport_number, *(text++));
}


x86 assembly (clang, -O0):
<cprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114e <cprintf+0x3e>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%esi
call   1030 <SendByte@plt>
jmp    111f <cprintf+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cprintf>:
push   %rbp
push   %rbx
push   %rax
mov    (%rsi),%al
test   %al,%al
je     1145 <cprintf+0x35>
mov    %rsi,%rbx
mov    %edi,%ebp
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%esi
mov    %ebp,%edi
call   1030 <SendByte@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <cprintf+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @cprintf(i32 %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %1, %2 ]
%8 = sext i8 %6 to i32
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = tail call i32 @SendByte(i32 %0, i32 %8)
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret void
}
/* Variables and functions */
double fmax(double, int);
double relu(double x) { return fmax(x, 0.); }


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

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

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

LLVM IR (-O2):
define double @relu(double %0) {
%2 = tail call double @fmax(double %0, i32 0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int stub3(int, int);
void functionPointer() {
  int maxValue(int, int);
  int a, b;
  scanf("%d %d", &a, &b);
  int (*p)(int, int);
  p = maxValue;
  int c = (*p)(a, b);
  printf("maxValue = %d", c);
}


x86 assembly (clang, -O0):
<functionPointer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1040 <scanf@plt>
mov    0x2e9d(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   *%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<functionPointer>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1030 <maxValue@plt>
lea    0xeae(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [14 x i8] c"maxValue = %d\00"
define void @functionPointer() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32 (i32, i32)*
%4 = alloca i32
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
store i32 (i32, i32)* @maxValue, i32 (i32, i32)** %3
%6 = load i32 (i32, i32)*, i32 (i32, i32)** %3
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 %6(i32 %7, i32 %8)
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [14 x i8] c"maxValue = %d\00"
define void @functionPointer() {
%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 ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @maxValue(i32 %6, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ play_element_sound(int, int, int, int);
void play_sound(int x, int y, int sample) {
  play_element_sound(x, y, sample, -1);
}


x86 assembly (clang, -O0):
<play_sound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    $0xffffffff,%ecx
call   1030 <play_element_sound@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<play_sound>:
mov    $0xffffffff,%ecx
jmp    1030 <play_element_sound@plt>

LLVM IR (-O0):
define void @play_sound(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
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @play_element_sound(i32 %7, i32 %8, i32 %9, i32 -1)
ret void
}

LLVM IR (-O2):
define void @play_sound(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @play_element_sound(i32 %0, i32 %1, i32 %2, i32 -1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ program_getoptint(char, int *);
void program_getoptuint(char c, unsigned int *r) {
  int v = 0;
  program_getoptint(c, &v);
  if (v > 0)
    *r = (unsigned int)v;
}


x86 assembly (clang, -O0):
<program_getoptuint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0x14(%rbp),%rsi
movsbl -0x1(%rbp),%edi
call   1030 <program_getoptint@plt>
cmpl   $0x0,-0x14(%rbp)
jle    1149 <program_getoptuint+0x39>
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<program_getoptuint>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rsi
call   1030 <program_getoptint@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    1134 <program_getoptuint+0x24>
mov    %eax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @program_getoptuint(i8 signext %0, i32* nocapture writeonly %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = call i32 @program_getoptint(i8 signext %0, i32* %3)
%6 = load i32, i32* %3
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 %6, i32* %1
br label %9
9: ; preds = %8, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void end_style() { fprintf(stdout, "\e[0m"); }


x86 assembly (clang, -O0):
<end_style>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<end_style>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [5 x i8] c"\1B[0m\00"
define void @end_style() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [5 x i8] c"\1B[0m\00"
define void @end_style() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ MD5_CTX;

/* Variables and functions */
int /*<<< orphan*/ md5_block_host_order(int /*<<< orphan*/ *,
                                        unsigned char const *, int);
void MD5_Transform(MD5_CTX *c, const unsigned char *data) {
  md5_block_host_order(c, data, 1);
}


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

x86 assembly (clang, -O2):
<MD5_Transform>:
mov    $0x1,%edx
jmp    1030 <md5_block_host_order@plt>

LLVM IR (-O0):
define void @MD5_Transform(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 i32 @md5_block_host_order(i32* %5, i8* %6, i32 1)
ret void
}

LLVM IR (-O2):
define void @MD5_Transform(i32* %0, i8* %1) {
%3 = tail call i32 @md5_block_host_order(i32* %0, i8* %1, i32 1)
ret void
}
/* Type definitions */
struct SN_env {
  int dummy;
};

/* Variables and functions */
struct SN_env *SN_create_env(int /*<<< orphan*/, int, int /*<<< orphan*/);
extern struct SN_env *norwegian_ISO_8859_1_create_env(void) {
  return SN_create_env(0, 2, 0);
}


x86 assembly (clang, -O0):
<norwegian_ISO_8859_1_create_env>:
push   %rbp
mov    %rsp,%rbp
xor    %edx,%edx
mov    $0x2,%esi
mov    %edx,%edi
call   1030 <SN_create_env@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<norwegian_ISO_8859_1_create_env>:
xor    %edi,%edi
mov    $0x2,%esi
xor    %edx,%edx
jmp    1030 <SN_create_env@plt>

LLVM IR (-O0):
%struct.SN_env = type { i32 }
define %struct.SN_env* @norwegian_ISO_8859_1_create_env() {
%1 = call %struct.SN_env* @SN_create_env(i32 0, i32 2, i32 0)
ret %struct.SN_env* %1
}

LLVM IR (-O2):
%struct.SN_env = type { i32 }
define %struct.SN_env* @norwegian_ISO_8859_1_create_env() {
%1 = tail call %struct.SN_env* @SN_create_env(i32 0, i32 2, i32 0)
ret %struct.SN_env* %1
}
/* Type definitions */
typedef int int64_t;
typedef int int32_t;

/* Variables and functions */
int32_t digital_sum(int64_t n) {
  int32_t sum = 0;
  for (; n; n /= 10) {
    sum += n % 10;
  }
  return sum;
}


x86 assembly (clang, -O0):
<digital_sum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113c <digital_sum+0x3c>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    -0x8(%rbp),%edx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <digital_sum+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digital_sum>:
xor    %eax,%eax
test   %edi,%edi
je     113b <digital_sum+0x3b>
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
add    %esi,%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <digital_sum+0x10>
ret

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

LLVM IR (-O2):
define i32 @digital_sum(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = srem i32 %5, 10
%7 = add nsw i32 %4, %6
%8 = sdiv i32 %5, 10
%9 = add i32 %5, 9
%10 = icmp ult i32 %9, 19
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %12
}
void ft_striteri(char *s, void (*f)(unsigned int, char *)) {
  int i;
  if (!s || !(*f))
    return;
  i = 0;
  while (s[i]) {
    (*f)(i, &(s[i]));
    i++;
  }
}


x86 assembly (clang, -O0):
<ft_striteri>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1126 <ft_striteri+0x26>
cmpq   $0x0,-0x10(%rbp)
jne    112b <ft_striteri+0x2b>
jmp    1166 <ft_striteri+0x66>
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1166 <ft_striteri+0x66>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rsi
movslq -0x14(%rbp),%rcx
add    %rcx,%rsi
call   *%rax
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1132 <ft_striteri+0x32>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_striteri>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1135 <ft_striteri+0x35>
mov    %rsi,%r14
test   %rsi,%rsi
je     1135 <ft_striteri+0x35>
mov    %rdi,%r15
cmpb   $0x0,(%rdi)
je     1135 <ft_striteri+0x35>
xor    %ebx,%ebx
nopl   0x0(%rax)
lea    (%r15,%rbx,1),%rsi
mov    %ebx,%edi
call   *%r14
cmpb   $0x0,0x1(%r15,%rbx,1)
lea    0x1(%rbx),%rbx
jne    1120 <ft_striteri+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @ft_striteri(i8* %0, void (i32, i8*)* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne void (i32, i8*)* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, 0
br i1 %8, label %17, label %9
9: ; preds = %6, %9
%10 = phi i64 [ %13, %9 ], [ 0, %6 ]
%11 = phi i8* [ %14, %9 ], [ %0, %6 ]
%12 = trunc i64 %10 to i32
tail call void %1(i32 %12, i8* %11)
%13 = add nuw i64 %10, 1
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %9
17: ; preds = %9, %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void rlHello(void) { puts("Hello, world!"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, world!\00"
define void @rlHello() {
%1 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, world!\00"
define void @rlHello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
void ath11k_debugfs_htt_stats_init(struct ath11k *ar) {}


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

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

LLVM IR (-O0):
%struct.ath11k = type opaque
define void @ath11k_debugfs_htt_stats_init(%struct.ath11k* %0) {
%2 = alloca %struct.ath11k*
store %struct.ath11k* %0, %struct.ath11k** %2
ret void
}

LLVM IR (-O2):
%struct.ath11k = type opaque
define void @ath11k_debugfs_htt_stats_init(%struct.ath11k* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int read_flash_page(int, int *);
int dbg_readpage(uint8_t page, uint8_t *buf) {
  return read_flash_page(page * 1024, buf);
}


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

x86 assembly (clang, -O2):
<dbg_readpage>:
shl    $0xa,%edi
jmp    1030 <read_flash_page@plt>

LLVM IR (-O0):
define i32 @dbg_readpage(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 = mul nsw i32 %5, 1024
%7 = load i32*, i32** %4
%8 = call i32 @read_flash_page(i32 %6, i32* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @dbg_readpage(i32 %0, i32* %1) {
%3 = shl nsw i32 %0, 10
%4 = tail call i32 @read_flash_page(i32 %3, i32* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ LOG_UPTO(int);
int /*<<< orphan*/ setlogmask(int /*<<< orphan*/);
void debug_setmask(int log_level) { setlogmask(LOG_UPTO(log_level)); }


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

x86 assembly (clang, -O2):
<debug_setmask>:
push   %rax
call   1030 <LOG_UPTO@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <setlogmask@plt>

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

LLVM IR (-O2):
define void @debug_setmask(i32 %0) {
%2 = tail call i32 @LOG_UPTO(i32 %0)
%3 = tail call i32 @setlogmask(i32 %2)
ret void
}
/* Variables and functions */
int strlen(char const *);
size_t base64_decoded_max_len(const char *encoded) {
  return (((strlen(encoded) + 4 - 1) / 4) * 3);
}


x86 assembly (clang, -O0):
<base64_decoded_max_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x4,%eax
sub    $0x1,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
imul   $0x3,%eax,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_decoded_max_len>:
push   %rax
call   1030 <strlen@plt>
lea    0x3(%rax),%ecx
add    $0x6,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
sar    $0x2,%eax
lea    (%rax,%rax,2),%eax
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @base64_decoded_max_len(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strlen(i8* %3)
%5 = add nsw i32 %4, 4
%6 = sub nsw i32 %5, 1
%7 = sdiv i32 %6, 4
%8 = mul nsw i32 %7, 3
%9 = sext i32 %8 to i64
ret i64 %9
}

LLVM IR (-O2):
define i64 @base64_decoded_max_len(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 3
%4 = sdiv i32 %3, 4
%5 = mul nsw i32 %4, 3
%6 = sext i32 %5 to i64
ret i64 %6
}
void foo419() {}


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

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

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

LLVM IR (-O2):
define void @foo419() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ serial_write(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void serial_write_str(char *buf) { serial_write(buf, strlen(buf)); }


x86 assembly (clang, -O0):
<serial_write_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <serial_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_write_str>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <serial_write@plt>

LLVM IR (-O0):
define void @serial_write_str(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @serial_write(i8* %3, i32 %5)
ret void
}

LLVM IR (-O2):
define void @serial_write_str(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @serial_write(i8* %0, i32 %2)
ret void
}
double interp_6_pt(double phim2, double phim1, double phi, double phip1,
                   double phip2, double phip3) {
  return ((75.0 / 128.0) * (phi + phip1) - (25.0 / 256.0) * (phim1 + phip2) +
          (3.0 / 256.0) * (phim2 + phip3));
}


x86 assembly (clang, -O0):
<interp_6_pt>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm1
addsd  -0x20(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
addsd  -0x28(%rbp),%xmm2
movsd  0xed2(%rip),%xmm0
mulsd  %xmm2,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xea7(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x8(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  0xe85(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<interp_6_pt>:
addsd  %xmm4,%xmm1
mulsd  0xef4(%rip),%xmm1
addsd  %xmm3,%xmm2
mulsd  0xef0(%rip),%xmm2
addsd  %xmm1,%xmm2
addsd  %xmm5,%xmm0
mulsd  0xee8(%rip),%xmm0
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @interp_6_pt(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%13 = load double, double* %9
%14 = load double, double* %10
%15 = fadd double %13, %14
%16 = load double, double* %8
%17 = load double, double* %11
%18 = fadd double %16, %17
%19 = fmul double 0x3FB9000000000000, %18
%20 = fneg double %19
%21 = call double @llvm.fmuladd.f64(double 0x3FE2C00000000000, double %15, double %20)
%22 = load double, double* %7
%23 = load double, double* %12
%24 = fadd double %22, %23
%25 = call double @llvm.fmuladd.f64(double 0x3F88000000000000, double %24, double %21)
ret double %25
}

LLVM IR (-O2):
define double @interp_6_pt(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = fadd double %2, %3
%8 = fadd double %1, %4
%9 = fmul double %8, 0xBFB9000000000000
%10 = tail call double @llvm.fmuladd.f64(double %7, double 0x3FE2C00000000000, double %9)
%11 = fadd double %0, %5
%12 = tail call double @llvm.fmuladd.f64(double %11, double 0x3F88000000000000, double %10)
ret double %12
}
int imx_sema4_mutex_lock(struct imx_sema4_mutex *mutex_ptr) { return 0; }


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

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

LLVM IR (-O0):
%struct.imx_sema4_mutex = type opaque
define i32 @imx_sema4_mutex_lock(%struct.imx_sema4_mutex* %0) {
%2 = alloca %struct.imx_sema4_mutex*
store %struct.imx_sema4_mutex* %0, %struct.imx_sema4_mutex** %2
ret i32 0
}

LLVM IR (-O2):
%struct.imx_sema4_mutex = type opaque
define i32 @imx_sema4_mutex_lock(%struct.imx_sema4_mutex* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xc7() {
  Assert_real((isdigit(199) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isdigit.c",
              1000, ("isdigit should be 0 for 0xc7"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xc7\00"
define void @t_isdigit_0xc7() {
%1 = tail call i64 @isdigit(i32 199)
%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 1000, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
const char *printHello(void) { return "Hello World!\n"; }


x86 assembly (clang, -O0):
<printHello>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<printHello>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
define i8* @printHello() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello World!\0A\00"
define i8* @printHello() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct timeval {
  int tv_usec;
  scalar_t__ tv_sec;
};
struct tcp {
  int dummy;
};

/* Variables and functions */
int tcp_internal_sleep(struct tcp *, struct timeval *, int, int);
int tcp_usleep(struct tcp *tcp, int usec, int reading, int writing) {
  struct timeval tm;
  tm.tv_sec = 0;
  tm.tv_usec = usec;
  return tcp_internal_sleep(tcp, &tm, reading, writing);
}


x86 assembly (clang, -O0):
<tcp_usleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    -0x28(%rbp),%rsi
call   1030 <tcp_internal_sleep@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcp_usleep>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
mov    %esi,0x8(%rsp)
lea    0x8(%rsp),%rsi
call   1030 <tcp_internal_sleep@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.tcp = type { i32 }
%struct.timeval = type { i32, i64 }
define i32 @tcp_usleep(%struct.tcp* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct.tcp*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca %struct.timeval
store %struct.tcp* %0, %struct.tcp** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %9, i32 0, i32 1
store i64 0, i64* %10
%11 = load i32, i32* %6
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %9, i32 0, i32 0
store i32 %11, i32* %12
%13 = load %struct.tcp*, %struct.tcp** %5
%14 = load i32, i32* %7
%15 = load i32, i32* %8
%16 = call i32 @tcp_internal_sleep(%struct.tcp* %13, %struct.timeval* %9, i32 %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.tcp = type { i32 }
%struct.timeval = type { i32, i64 }
define i32 @tcp_usleep(%struct.tcp* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct.timeval
%6 = bitcast %struct.timeval* %5 to i8*
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i64 0, i32 1
store i64 0, i64* %7
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i64 0, i32 0
store i32 %1, i32* %8
%9 = call i32 @tcp_internal_sleep(%struct.tcp* %0, %struct.timeval* %5, i32 %2, i32 %3)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ fn_glutReshapeWindow(int, int);
void glutReshapeWindow(int width, int height) {
  fn_glutReshapeWindow(width, height);
}


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

x86 assembly (clang, -O2):
<glutReshapeWindow>:
jmp    1030 <fn_glutReshapeWindow@plt>

LLVM IR (-O0):
define void @glutReshapeWindow(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 @fn_glutReshapeWindow(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @glutReshapeWindow(i32 %0, i32 %1) {
%3 = tail call i32 @fn_glutReshapeWindow(i32 %0, i32 %1)
ret void
}