xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ isspace(char);
char *pe_utils_str_inplace_ltrim(char *str) {
  char *ptr = str;
  while (*ptr != '\0' && isspace(*ptr))
    ptr++;
  return ptr;
}


x86 assembly (clang, -O0):
<pe_utils_str_inplace_ltrim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     114f <pe_utils_str_inplace_ltrim+0x3f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    115f <pe_utils_str_inplace_ltrim+0x4f>
jmp    1170 <pe_utils_str_inplace_ltrim+0x60>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <pe_utils_str_inplace_ltrim+0x14>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pe_utils_str_inplace_ltrim>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1139 <pe_utils_str_inplace_ltrim+0x29>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     1139 <pe_utils_str_inplace_ltrim+0x29>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <pe_utils_str_inplace_ltrim+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @pe_utils_str_inplace_ltrim(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i64 @isspace(i8 signext %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}
int lh_ptr_equal(void *k1, void *k2) { return (k1 == k2); }


x86 assembly (clang, -O0):
<lh_ptr_equal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lh_ptr_equal>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @lh_ptr_equal(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
short __mulhi3(short a, short b) {
  int r;
  r = 0;
  while (a) {
    if (a & 1) {
      r += b;
    }
    b <<= 1;
    a >>= 1;
  }
  return r;
}


x86 assembly (clang, -O0):
<__mulhi3>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpw   $0x0,-0x2(%rbp)
je     1159 <__mulhi3+0x59>
movswl -0x2(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     113e <__mulhi3+0x3e>
movswl -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
movswl -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%eax
sar    $0x1,%eax
mov    %ax,-0x2(%rbp)
jmp    1119 <__mulhi3+0x19>
mov    -0x8(%rbp),%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<__mulhi3>:
xor    %eax,%eax
test   %di,%di
je     112b <__mulhi3+0x2b>
nopw   0x0(%rax,%rax,1)
movswl %di,%ecx
and    $0x1,%edi
neg    %edi
and    %esi,%edi
movzwl %di,%edx
add    %edx,%eax
add    %esi,%esi
mov    %ecx,%edi
shr    %edi
cmp    $0x1,%cx
ja     1110 <__mulhi3+0x10>
ret

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

LLVM IR (-O2):
define signext i16 @__mulhi3(i16 signext %0, i16 signext %1) {
%3 = icmp eq i16 %0, 0
br i1 %3, label %18, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %12, %4 ], [ 0, %2 ]
%6 = phi i16 [ %13, %4 ], [ %1, %2 ]
%7 = phi i16 [ %14, %4 ], [ %0, %2 ]
%8 = and i16 %7, 1
%9 = icmp eq i16 %8, 0
%10 = select i1 %9, i16 0, i16 %6
%11 = zext i16 %10 to i32
%12 = add i32 %5, %11
%13 = shl i16 %6, 1
%14 = ashr i16 %7, 1
%15 = icmp ult i16 %7, 2
br i1 %15, label %16, label %4
16: ; preds = %4
%17 = trunc i32 %12 to i16
br label %18
18: ; preds = %16, %2
%19 = phi i16 [ 0, %2 ], [ %17, %16 ]
ret i16 %19
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("oonf_api package compiled!");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"oonf_api package compiled!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"oonf_api package compiled!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int picolcd_resume_lcd(struct picolcd_data *data) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.picolcd_data = type opaque
define i32 @picolcd_resume_lcd(%struct.picolcd_data* nocapture readnone %0) {
ret i32 0
}
char *strcpy(char *dest, const char *src) {
  unsigned i;
  for (i = 0; src[i]; i++)
    dest[i] = src[i];
  dest[i] = 0;
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
cmpb   $0x0,(%rax,%rcx,1)
je     1146 <strcpy+0x46>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <strcpy+0x13>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%dl
xor    %ecx,%ecx
test   %dl,%dl
je     1120 <strcpy+0x20>
nopl   0x0(%rax,%rax,1)
mov    %dl,(%rax,%rcx,1)
add    $0x1,%ecx
movzbl (%rsi,%rcx,1),%edx
test   %dl,%dl
jne    1110 <strcpy+0x10>
mov    %ecx,%ecx
movb   $0x0,(%rax,%rcx,1)
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i64 [ %11, %5 ], [ 0, %2 ]
%8 = phi i32 [ %10, %5 ], [ 0, %2 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %6, i8* %9
%10 = add i32 %8, 1
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %1, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5
%16 = zext i32 %10 to i64
br label %17
17: ; preds = %2, %15
%18 = phi i64 [ %16, %15 ], [ 0, %2 ]
%19 = getelementptr inbounds i8, i8* %0, i64 %18
store i8 0, i8* %19
ret i8* %0
}
const char *hello_world(void) { return 1234; }


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

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

LLVM IR (-O0):
define i8* @hello_world() {
ret i8* inttoptr (i64 1234 to i8*)
}

LLVM IR (-O2):
define i8* @hello_world() {
ret i8* inttoptr (i64 1234 to i8*)
}
void debugfs_remove(struct dentry *dentry) {}


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

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

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

LLVM IR (-O2):
%struct.dentry = type opaque
define void @debugfs_remove(%struct.dentry* nocapture %0) {
ret void
}
void assert_failed(const char *expr, const char *function, const char *file,
                   int line) {
  return;
}


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

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

LLVM IR (-O0):
define void @assert_failed(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @assert_failed(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2, i32 %3) {
ret void
}
int do_381() { return 381; }


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

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

LLVM IR (-O0):
define i32 @do_381() {
ret i32 381
}

LLVM IR (-O2):
define i32 @do_381() {
ret i32 381
}
void create_boolean_true() {}


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

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

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

LLVM IR (-O2):
define void @create_boolean_true() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close_shapes_file();
void shutdown_shape_handler(void) {
  close_shapes_file();
  return;
}


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

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

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

LLVM IR (-O2):
define void @shutdown_shape_handler() {
%1 = tail call i32 (...) @close_shapes_file()
ret void
}
int fun518() { return 518; }


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

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

LLVM IR (-O0):
define i32 @fun518() {
ret i32 518
}

LLVM IR (-O2):
define i32 @fun518() {
ret i32 518
}
/* Type definitions */
struct SerialPort {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct SerialPort *);
void serial_port_free(struct SerialPort *me) { free(me); }


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

x86 assembly (clang, -O2):
<serial_port_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.SerialPort = type { i32 }
define void @serial_port_free(%struct.SerialPort* %0) {
%2 = alloca %struct.SerialPort*
store %struct.SerialPort* %0, %struct.SerialPort** %2
%3 = load %struct.SerialPort*, %struct.SerialPort** %2
%4 = call i32 @free(%struct.SerialPort* %3)
ret void
}

LLVM IR (-O2):
%struct.SerialPort = type { i32 }
define void @serial_port_free(%struct.SerialPort* nocapture %0) {
%2 = tail call i32 @free(%struct.SerialPort* %0)
ret void
}
__attribute__((no, noclone)) unsigned __int128 t104_3mul(signed char y) {
  unsigned __int128 r;
  if (__builtin_mul_overflow((signed char)(-1), y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t104_3mul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %dil,%al
mov    %al,-0x11(%rbp)
movsbq -0x11(%rbp),%rdx
mov    %rdx,%rsi
sar    $0x3f,%rsi
xor    %eax,%eax
neg    %rdx
mov    %rax,%rcx
sbb    %rsi,%rcx
sbb    %rsi,%rax
and    $0x1,%al
mov    %rdx,-0x30(%rbp)
mov    %rcx,-0x28(%rbp)
test   $0x1,%al
jne    114f <t104_3mul+0x3f>
jmp    1156 <t104_3mul+0x46>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x30(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t104_3mul>:
push   %r14
push   %rbx
push   %rax
movslq %edi,%rbx
mov    %rbx,%rax
sar    $0x3f,%rax
xor    %r14d,%r14d
neg    %rbx
sbb    %rax,%r14
test   %dil,%dil
jle    1133 <t104_3mul+0x23>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %rbx,%rax
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t104_3mul(i8 signext %0) {
%2 = alloca i128
%3 = alloca i8
%4 = alloca i128
store i8 %0, i8* %3
%5 = load i8, i8* %3
%6 = sext i8 %5 to i129
%7 = call { i129, i1 } @llvm.smul.with.overflow.i129(i129 -1, i129 %6)
%8 = extractvalue { i129, i1 } %7, 1
%9 = extractvalue { i129, i1 } %7, 0
%10 = trunc i129 %9 to i128
%11 = zext i128 %10 to i129
%12 = icmp ne i129 %9, %11
%13 = or i1 %8, %12
store i128 %10, i128* %4
br i1 %13, label %14, label %16
14: ; preds = %1
%15 = call i32 (...) @bar()
br label %16
16: ; preds = %14, %1
%17 = load i128, i128* %4
store i128 %17, i128* %2
%18 = bitcast i128* %2 to { i64, i64 }*
%19 = load { i64, i64 }, { i64, i64 }* %18
ret { i64, i64 } %19
}

LLVM IR (-O2):
define { i64, i64 } @t104_3mul(i8 signext %0) {
%2 = sext i8 %0 to i129
%3 = sub nsw i129 0, %2
%4 = icmp sgt i8 %0, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (...) @bar()
br label %7
7: ; preds = %5, %1
%8 = trunc i129 %3 to i64
%9 = lshr i129 %3, 64
%10 = trunc i129 %9 to i64
%11 = insertvalue { i64, i64 } poison, i64 %8, 0
%12 = insertvalue { i64, i64 } %11, i64 %10, 1
ret { i64, i64 } %12
}
int firstIndexOf(char *str, char c) {
  int indice = 0;
  while (*str != '\0') {
    if (*str == c) {
      return indice;
    }
    indice++;
    str++;
  }
  return -1;
}


x86 assembly (clang, -O0):
<firstIndexOf>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115d <firstIndexOf+0x5d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    1143 <firstIndexOf+0x43>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1164 <firstIndexOf+0x64>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1115 <firstIndexOf+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<firstIndexOf>:
mov    (%rdi),%dl
mov    $0xffffffff,%eax
test   %dl,%dl
je     1122 <firstIndexOf+0x22>
xor    %ecx,%ecx
nopl   (%rax)
cmp    %sil,%dl
je     1123 <firstIndexOf+0x23>
movzbl 0x1(%rdi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <firstIndexOf+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @firstIndexOf(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %10
%6 = phi i8 [ %13, %10 ], [ %3, %2 ]
%7 = phi i32 [ %11, %10 ], [ 0, %2 ]
%8 = phi i8* [ %12, %10 ], [ %0, %2 ]
%9 = icmp eq i8 %6, %1
br i1 %9, label %15, label %10
10: ; preds = %5
%11 = add nuw nsw i32 %7, 1
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %10, %2
%16 = phi i32 [ -1, %2 ], [ -1, %10 ], [ %7, %5 ]
ret i32 %16
}
/* Variables and functions */
int exp(int);
int fabs(double);
double laplace(double x, double mi, double b) {
  return 1 / (2 * b) * exp(-1 * fabs(x - mi) / b);
}


x86 assembly (clang, -O0):
<laplace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  0xec9(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
movsd  0xeb4(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
call   1030 <fabs@plt>
imul   $0xffffffff,%eax,%eax
cvtsi2sd %eax,%xmm0
divsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <exp@plt>
movsd  -0x20(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<laplace>:
sub    $0x18,%rsp
movsd  %xmm2,0x8(%rsp)
movapd %xmm2,%xmm4
addsd  %xmm2,%xmm4
movsd  0xec6(%rip),%xmm3
divsd  %xmm4,%xmm3
movsd  %xmm3,0x10(%rsp)
subsd  %xmm1,%xmm0
call   1030 <fabs@plt>
neg    %eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  0x8(%rsp),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <exp@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @laplace(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %6
%8 = fmul double 2.000000e+00, %7
%9 = fdiv double 1.000000e+00, %8
%10 = load double, double* %4
%11 = load double, double* %5
%12 = fsub double %10, %11
%13 = call i32 @fabs(double %12)
%14 = mul nsw i32 -1, %13
%15 = sitofp i32 %14 to double
%16 = load double, double* %6
%17 = fdiv double %15, %16
%18 = fptosi double %17 to i32
%19 = call i32 @exp(i32 %18)
%20 = sitofp i32 %19 to double
%21 = fmul double %9, %20
ret double %21
}

LLVM IR (-O2):
define double @laplace(double %0, double %1, double %2) {
%4 = fmul double %2, 2.000000e+00
%5 = fdiv double 1.000000e+00, %4
%6 = fsub double %0, %1
%7 = tail call i32 @fabs(double %6)
%8 = sub nsw i32 0, %7
%9 = sitofp i32 %8 to double
%10 = fdiv double %9, %2
%11 = fptosi double %10 to i32
%12 = tail call i32 @exp(i32 %11)
%13 = sitofp i32 %12 to double
%14 = fmul double %5, %13
ret double %14
}
void RTStrToInt16Ex(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrToInt16Ex() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int Ls() {
  system("ls");
  return 0;
}


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

x86 assembly (clang, -O2):
<Ls>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"ls\00"
define i32 @Ls() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
double __nv_cyl_bessel_i0(double);
double cyl_bessel_i0(double __a) { return __nv_cyl_bessel_i0(__a); }


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

x86 assembly (clang, -O2):
<cyl_bessel_i0>:
jmp    1030 <__nv_cyl_bessel_i0@plt>

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

LLVM IR (-O2):
define double @cyl_bessel_i0(double %0) {
%2 = tail call double @__nv_cyl_bessel_i0(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ __debug_tab_inc(int, int);
void __debug_tab_dec(int category, int space_count) {
  __debug_tab_inc(category, -space_count);
}


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

x86 assembly (clang, -O2):
<__debug_tab_dec>:
neg    %esi
jmp    1030 <__debug_tab_inc@plt>

LLVM IR (-O0):
define void @__debug_tab_dec(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 = sub nsw i32 0, %6
%8 = call i32 @__debug_tab_inc(i32 %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @__debug_tab_dec(i32 %0, i32 %1) {
%3 = sub nsw i32 0, %1
%4 = tail call i32 @__debug_tab_inc(i32 %0, i32 %3)
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ __is_big_endian();
int __swab64(int);
extern int be64_to_native(uint64_t i) {
  if (!__is_big_endian()) {
    return __swab64(i);
  } else {
    return i;
  }
}


x86 assembly (clang, -O0):
<be64_to_native>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__is_big_endian@plt>
cmp    $0x0,%eax
jne    114b <be64_to_native+0x2b>
mov    -0x8(%rbp),%edi
call   1040 <__swab64@plt>
mov    %eax,-0x4(%rbp)
jmp    1151 <be64_to_native+0x31>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<be64_to_native>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <__is_big_endian@plt>
test   %eax,%eax
je     1132 <be64_to_native+0x12>
mov    %ebx,%eax
pop    %rbx
ret
mov    %ebx,%edi
pop    %rbx
jmp    1040 <__swab64@plt>

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

LLVM IR (-O2):
define i32 @be64_to_native(i32 %0) {
%2 = tail call i32 (...) @__is_big_endian()
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @__swab64(i32 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ %0, %1 ]
ret i32 %7
}
/* Variables and functions */
char *strchr(const char *s, int c) {
  do {
    if ((unsigned char)*s == c)
      return (char *)s;
  } while (*s++);
  return NULL;
}


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

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

LLVM IR (-O0):
define i8* @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 = zext 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* @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 = zext 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
}
int fn1(signed char p1, int p2) {
  return (p1 < 0) || (p1 > (1 >> p2)) ? 0 : (p1 << 1);
}


x86 assembly (clang, -O0):
<fn1>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
jl     1132 <fn1+0x32>
movsbl -0x1(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
sar    %cl,%edx
mov    %edx,%ecx
cmp    %ecx,%eax
jle    113c <fn1+0x3c>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1146 <fn1+0x46>
movsbl -0x1(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn1>:
mov    %esi,%ecx
mov    $0x1,%edx
shr    %cl,%edx
lea    (%rdi,%rdi,1),%eax
xor    %ecx,%ecx
cmp    %edi,%edx
cmovl  %ecx,%eax
test   %dil,%dil
cmovs  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @fn1(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = icmp slt i32 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %2
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = load i32, i32* %4
%12 = ashr i32 1, %11
%13 = icmp sgt i32 %10, %12
br i1 %13, label %14, label %15
14: ; preds = %8, %2
br label %19
15: ; preds = %8
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = shl i32 %17, 1
br label %19
19: ; preds = %15, %14
%20 = phi i32 [ 0, %14 ], [ %18, %15 ]
ret i32 %20
}

LLVM IR (-O2):
define i32 @fn1(i8 signext %0, i32 %1) {
%3 = sext i8 %0 to i32
%4 = icmp slt i8 %0, 0
%5 = lshr i32 1, %1
%6 = icmp slt i32 %5, %3
%7 = select i1 %4, i1 true, i1 %6
%8 = shl nsw i32 %3, 1
%9 = select i1 %7, i32 0, i32 %8
ret i32 %9
}
/* Variables and functions */
void *malloc(int);
void *__new(int size) { return malloc(size); }


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

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

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

LLVM IR (-O2):
define noalias i8* @__new(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _mm_div_ss(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_load_ss(float *);
int /*<<< orphan*/ _mm_store_ss(float *, int /*<<< orphan*/);
uint32_t determ_divide_float(uint32_t a, uint32_t b) {
  uint32_t r;
  _mm_store_ss((float *)&r,
               _mm_div_ss(_mm_load_ss((float *)&a), _mm_load_ss((float *)&b)));
  return r;
}


x86 assembly (clang, -O0):
<determ_divide_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x4(%rbp),%rdi
call   1050 <_mm_load_ss@plt>
mov    %eax,-0x1c(%rbp)
lea    -0x8(%rbp),%rdi
call   1050 <_mm_load_ss@plt>
mov    -0x1c(%rbp),%edi
mov    %eax,%esi
call   1030 <_mm_div_ss@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <_mm_store_ss@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<determ_divide_float>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,0xc(%rsp)
mov    %esi,0x8(%rsp)
lea    0xc(%rsp),%rdi
call   1050 <_mm_load_ss@plt>
mov    %eax,%ebx
lea    0x8(%rsp),%rdi
call   1050 <_mm_load_ss@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1030 <_mm_div_ss@plt>
lea    0x4(%rsp),%rdi
mov    %eax,%esi
call   1040 <_mm_store_ss@plt>
mov    0x4(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @determ_divide_float(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = bitcast i32* %5 to float*
%7 = bitcast i32* %3 to float*
%8 = call i32 @_mm_load_ss(float* %7)
%9 = bitcast i32* %4 to float*
%10 = call i32 @_mm_load_ss(float* %9)
%11 = call i32 @_mm_div_ss(i32 %8, i32 %10)
%12 = call i32 @_mm_store_ss(float* %6, i32 %11)
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @determ_divide_float(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = bitcast i32* %5 to i8*
%7 = bitcast i32* %5 to float*
%8 = bitcast i32* %3 to float*
%9 = call i32 @_mm_load_ss(float* %8)
%10 = bitcast i32* %4 to float*
%11 = call i32 @_mm_load_ss(float* %10)
%12 = call i32 @_mm_div_ss(i32 %9, i32 %11)
%13 = call i32 @_mm_store_ss(float* %7, i32 %12)
%14 = load i32, i32* %5
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void iir_free(void *data) { free(data); }


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

x86 assembly (clang, -O2):
<iir_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @iir_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ decl_nonnull(int *);
void call_decl_nonnull(int *a) { decl_nonnull(a); }


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

x86 assembly (clang, -O2):
<call_decl_nonnull>:
jmp    1030 <decl_nonnull@plt>

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

LLVM IR (-O2):
define void @call_decl_nonnull(i32* %0) {
%2 = tail call i32 @decl_nonnull(i32* %0)
ret void
}
int test_imm_8Dint64_highword_reg(long long val) {
  return ((val >> 32) & (0x8D << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_8Dint64_highword_reg(i64 %0) {
%2 = and i64 %0, 605590388736
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char const *, char const *);
FILE *get_config_fp(const char *path, const char *mode) {
  FILE *fp;
  if ((fp = fopen(path, mode)) == NULL)
    return NULL;
  return fp;
}


x86 assembly (clang, -O0):
<get_config_fp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1148 <get_config_fp+0x38>
movq   $0x0,-0x8(%rbp)
jmp    1150 <get_config_fp+0x40>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_config_fp>:
jmp    1030 <fopen@plt>

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

LLVM IR (-O2):
define noalias i32* @get_config_fp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
ret i32* %3
}
int mu_getmaxfd() { return 256; }


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

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

LLVM IR (-O0):
define i32 @mu_getmaxfd() {
ret i32 256
}

LLVM IR (-O2):
define i32 @mu_getmaxfd() {
ret i32 256
}
/* Variables and functions */
int bar();
double hello() {
  int foobar = bar() + 123;
  return (double)foobar;
}


x86 assembly (clang, -O0):
<hello>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <bar@plt>
add    $0x7b,%eax
mov    %eax,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hello>:
push   %rax
xor    %eax,%eax
call   1030 <bar@plt>
add    $0x7b,%eax
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @hello() {
%1 = alloca i32
%2 = call i32 (...) @bar()
%3 = add nsw i32 %2, 123
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = sitofp i32 %4 to double
ret double %5
}

LLVM IR (-O2):
define double @hello() {
%1 = tail call i32 (...) @bar()
%2 = add nsw i32 %1, 123
%3 = sitofp i32 %2 to double
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ set_1_challenge_1();
int /*<<< orphan*/ set_1_challenge_2();
int /*<<< orphan*/ set_1_challenge_3();
int /*<<< orphan*/ set_1_challenge_4();
int /*<<< orphan*/ set_1_challenge_5();
int /*<<< orphan*/ set_1_challenge_6();
int /*<<< orphan*/ set_1_challenge_7();
int main(int argc, char *argv[]) {
  set_1_challenge_1();
  set_1_challenge_2();
  set_1_challenge_3();
  set_1_challenge_4();
  set_1_challenge_5();
  set_1_challenge_6();
  set_1_challenge_7();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <set_1_challenge_1@plt>
mov    $0x0,%al
call   1090 <set_1_challenge_2@plt>
mov    $0x0,%al
call   1060 <set_1_challenge_3@plt>
mov    $0x0,%al
call   1070 <set_1_challenge_4@plt>
mov    $0x0,%al
call   1030 <set_1_challenge_5@plt>
mov    $0x0,%al
call   1080 <set_1_challenge_6@plt>
mov    $0x0,%al
call   1040 <set_1_challenge_7@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <set_1_challenge_1@plt>
xor    %eax,%eax
call   1090 <set_1_challenge_2@plt>
xor    %eax,%eax
call   1060 <set_1_challenge_3@plt>
xor    %eax,%eax
call   1070 <set_1_challenge_4@plt>
xor    %eax,%eax
call   1030 <set_1_challenge_5@plt>
xor    %eax,%eax
call   1080 <set_1_challenge_6@plt>
xor    %eax,%eax
call   1040 <set_1_challenge_7@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @set_1_challenge_1()
%6 = call i32 (...) @set_1_challenge_2()
%7 = call i32 (...) @set_1_challenge_3()
%8 = call i32 (...) @set_1_challenge_4()
%9 = call i32 (...) @set_1_challenge_5()
%10 = call i32 (...) @set_1_challenge_6()
%11 = call i32 (...) @set_1_challenge_7()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @set_1_challenge_1()
%4 = tail call i32 (...) @set_1_challenge_2()
%5 = tail call i32 (...) @set_1_challenge_3()
%6 = tail call i32 (...) @set_1_challenge_4()
%7 = tail call i32 (...) @set_1_challenge_5()
%8 = tail call i32 (...) @set_1_challenge_6()
%9 = tail call i32 (...) @set_1_challenge_7()
ret i32 0
}
void caller_1_2_1_2_1_2_1() {}


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

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

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

LLVM IR (-O2):
define void @caller_1_2_1_2_1_2_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(char *s) {
  fprintf(stderr, "usage: gf_example_6\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"usage: gf_example_6\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"usage: gf_example_6\0A\00"
define void @usage(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int helloPrint() {
  printf("Hello World\n");
  return 1;
}


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

x86 assembly (clang, -O2):
<helloPrint>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [12 x i8] c"Hello World\00"
define i32 @helloPrint() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int sysfs_cpu_exists(unsigned int);
int cpufreq_cpu_exists(unsigned int cpu) { return sysfs_cpu_exists(cpu); }


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

x86 assembly (clang, -O2):
<cpufreq_cpu_exists>:
jmp    1030 <sysfs_cpu_exists@plt>

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

LLVM IR (-O2):
define i32 @cpufreq_cpu_exists(i32 %0) {
%2 = tail call i32 @sysfs_cpu_exists(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char, int);
int /*<<< orphan*/ stderr;
void c(int x) { fprintf(stderr, "%c%d\n", 'c', x); }


x86 assembly (clang, -O0):
<c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%ecx
lea    0xed2(%rip),%rsi
mov    $0x63,%edx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c>:
mov    %edi,%ecx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
mov    $0x63,%edx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [6 x i8] c"%c%d\0A\00"
define void @c(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext 99, i32 %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c"%c%d\0A\00"
define void @c(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext 99, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, char *, size_t);
void gen_swap(void *fst, void *snd, size_t nbytes) {
  char scratch[nbytes];
  memcpy(scratch, fst, nbytes);
  memcpy(fst, snd, nbytes);
  memcpy(snd, scratch, nbytes);
}


x86 assembly (clang, -O0):
<gen_swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x30(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x30(%rbp),%rsi
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_swap>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsp,%rbx
lea    0xf(%rdx),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <memcpy@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
call   1030 <memcpy@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r12,%rdx
call   1030 <memcpy@plt>
lea    -0x20(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @gen_swap(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%9 = load i64, i64* %6
%10 = call i8* @llvm.stacksave()
store i8* %10, i8** %7
%11 = alloca i8, i64 %9
store i64 %9, i64* %8
%12 = load i8*, i8** %4
%13 = load i64, i64* %6
%14 = call i32 @memcpy(i8* %11, i8* %12, i64 %13)
%15 = load i8*, i8** %4
%16 = load i8*, i8** %5
%17 = load i64, i64* %6
%18 = call i32 @memcpy(i8* %15, i8* %16, i64 %17)
%19 = load i8*, i8** %5
%20 = load i64, i64* %6
%21 = call i32 @memcpy(i8* %19, i8* %11, i64 %20)
%22 = load i8*, i8** %7
ret void
}

LLVM IR (-O2):
define void @gen_swap(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8, i64 %2
%5 = call i32 @memcpy(i8* %4, i8* %0, i64 %2)
%6 = call i32 @memcpy(i8* %0, i8* %1, i64 %2)
%7 = call i32 @memcpy(i8* %1, i8* %4, i64 %2)
ret void
}
/* Variables and functions */
int random(int);
int biaseRandom() {
  int i = random(3);
  if (i >= 1)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<biaseRandom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3,%edi
call   1030 <random@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jl     113b <biaseRandom+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <biaseRandom+0x32>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<biaseRandom>:
push   %rax
mov    $0x3,%edi
call   1030 <random@plt>
xor    %ecx,%ecx
test   %eax,%eax
setg   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @biaseRandom() {
%1 = tail call i32 @random(i32 3)
%2 = icmp sgt i32 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}