xunge/DecIR huggingface dataset:
/* Variables and functions */
int even(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
void main(void) {
  int n;
  scanf("%d", &n);
  printf("%d", even(n));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1040 <even@plt>
mov    %eax,%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
call   1040 <even@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @even(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}
/* Variables and functions */
int strlen(char *);
int string_checkmaxsz(char *src) { return strlen(src) >= 2048; }


x86 assembly (clang, -O0):
<string_checkmaxsz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x800,%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_checkmaxsz>:
push   %rax
call   1030 <strlen@plt>
xor    %ecx,%ecx
cmp    $0x800,%eax
setge  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @string_checkmaxsz(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strlen(i8* %3)
%5 = icmp sge i32 %4, 2048
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @string_checkmaxsz(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 2047
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
float remquo(float, float, int *);
float remquof(float x, float y, int *quo) { return remquo(x, y, quo); }


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

x86 assembly (clang, -O2):
<remquof>:
jmp    1030 <remquo@plt>

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

LLVM IR (-O2):
define float @remquof(float %0, float %1, i32* %2) {
%4 = tail call float @remquo(float %0, float %1, i32* %2)
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(char const *);
int save_compiled_database(char const *);
char const *smaunch_fs_has_database();
int smaunch_fs_save_database_compiled(const char *path) {
  assert(path);
  assert(smaunch_fs_has_database());
  return save_compiled_database(path);
}


x86 assembly (clang, -O0):
<smaunch_fs_save_database_compiled>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <assert@plt>
mov    $0x0,%al
call   1050 <smaunch_fs_has_database@plt>
mov    %rax,%rdi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <save_compiled_database@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smaunch_fs_save_database_compiled>:
push   %rbx
mov    %rdi,%rbx
call   1040 <assert@plt>
xor    %eax,%eax
call   1050 <smaunch_fs_has_database@plt>
mov    %rax,%rdi
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <save_compiled_database@plt>

LLVM IR (-O0):
define i32 @smaunch_fs_save_database_compiled(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @assert(i8* %3)
%5 = call i8* (...) @smaunch_fs_has_database()
%6 = call i32 @assert(i8* %5)
%7 = load i8*, i8** %2
%8 = call i32 @save_compiled_database(i8* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @smaunch_fs_save_database_compiled(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
%3 = tail call i8* (...) @smaunch_fs_has_database()
%4 = tail call i32 @assert(i8* %3)
%5 = tail call i32 @save_compiled_database(i8* %0)
ret i32 %5
}
/* Variables and functions */
int drv_generic_graphic_gray(int const, int const);
unsigned char drv_generic_graphic_black(const int row, const int col) {
  return drv_generic_graphic_gray(row, col) < 127;
}


x86 assembly (clang, -O0):
<drv_generic_graphic_black>:
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 <drv_generic_graphic_gray@plt>
cmp    $0x7f,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drv_generic_graphic_black>:
push   %rax
call   1030 <drv_generic_graphic_gray@plt>
cmp    $0x7f,%eax
setl   %al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @drv_generic_graphic_black(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 @drv_generic_graphic_gray(i32 %5, i32 %6)
%8 = icmp slt i32 %7, 127
%9 = zext i1 %8 to i32
%10 = trunc i32 %9 to i8
ret i8 %10
}

LLVM IR (-O2):
define zeroext i8 @drv_generic_graphic_black(i32 %0, i32 %1) {
%3 = tail call i32 @drv_generic_graphic_gray(i32 %0, i32 %1)
%4 = icmp slt i32 %3, 127
%5 = zext i1 %4 to i8
ret i8 %5
}
/* Type definitions */
typedef unsigned long uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
void I2CFIFODataPut(uint32_t ui32Base, uint8_t ui8Data) {
  ;
  while ((*((volatile unsigned long *)(ui32Base + 0x00000F08))) & 0x00000002) {
  }
  (*((volatile unsigned long *)(ui32Base + 0x00000F00))) = ui8Data;
}


x86 assembly (clang, -O0):
<I2CFIFODataPut>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0xf08(%rax),%rax
and    $0x2,%rax
cmp    $0x0,%rax
je     112a <I2CFIFODataPut+0x2a>
jmp    110c <I2CFIFODataPut+0xc>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0xf00(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CFIFODataPut>:
testq  $0x2,0xf08(%rdi)
jne    1100 <I2CFIFODataPut>
mov    %rsi,0xf00(%rdi)
ret

LLVM IR (-O0):
define void @I2CFIFODataPut(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
br label %5
5: ; preds = %12, %2
%6 = load i64, i64* %3
%7 = add nsw i64 %6, 3848
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = and i64 %9, 2
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %5
br label %5
13: ; preds = %5
%14 = load i64, i64* %4
%15 = load i64, i64* %3
%16 = add nsw i64 %15, 3840
%17 = inttoptr i64 %16 to i64*
store volatile i64 %14, i64* %17
ret void
}

LLVM IR (-O2):
define void @I2CFIFODataPut(i64 %0, i64 %1) {
%3 = add nsw i64 %0, 3848
%4 = inttoptr i64 %3 to i64*
br label %5
5: ; preds = %5, %2
%6 = load volatile i64, i64* %4
%7 = and i64 %6, 2
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %5
9: ; preds = %5
%10 = add nsw i64 %0, 3840
%11 = inttoptr i64 %10 to i64*
store volatile i64 %1, i64* %11
ret void
}
/* Type definitions */
struct ev_loop {
  int dummy;
};

/* Variables and functions */
struct ev_loop *ev_default_loop_uc_();
int ev_is_default_loop(struct ev_loop *loop) {
  return loop == ev_default_loop_uc_();
}


x86 assembly (clang, -O0):
<ev_is_default_loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <ev_default_loop_uc_@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ev_is_default_loop>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <ev_default_loop_uc_@plt>
xor    %ecx,%ecx
cmp    %rbx,%rax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.ev_loop = type { i32 }
define i32 @ev_is_default_loop(%struct.ev_loop* %0) {
%2 = alloca %struct.ev_loop*
store %struct.ev_loop* %0, %struct.ev_loop** %2
%3 = load %struct.ev_loop*, %struct.ev_loop** %2
%4 = call %struct.ev_loop* (...) @ev_default_loop_uc_()
%5 = icmp eq %struct.ev_loop* %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
%struct.ev_loop = type { i32 }
define i32 @ev_is_default_loop(%struct.ev_loop* readnone %0) {
%2 = tail call %struct.ev_loop* (...) @ev_default_loop_uc_()
%3 = icmp eq %struct.ev_loop* %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
int msm_dump_gpios(struct seq_file *m, int curr_len, char *gpio_buffer) {}


x86 assembly (clang, -O0):
<msm_dump_gpios>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.seq_file = type opaque
define i32 @msm_dump_gpios(%struct.seq_file* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
ret i32 undef
}
/* Type definitions */
struct tree_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct tree_node *);
void destroy_tree_node(struct tree_node *n) { free(n); }


x86 assembly (clang, -O0):
<destroy_tree_node>:
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):
<destroy_tree_node>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.tree_node = type { i32 }
define void @destroy_tree_node(%struct.tree_node* nocapture %0) {
%2 = tail call i32 @free(%struct.tree_node* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ catalan(unsigned int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, unsigned int *);
int main() {
  unsigned int n;
  printf("Input n \nNth Catalan you want :");
  scanf("%d", &n);
  printf("Nth Catalan number is: %lu", catalan(n));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeda(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <catalan@plt>
lea    0xec3(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Input n \0ANth Catalan you want :\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [27 x i8] c"Nth Catalan number is: %lu\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @catalan(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"Input n \0ANth Catalan you want :\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [27 x i8] c"Nth Catalan number is: %lu\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @catalan(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
void marca_red(char maze[23][30], int red[3]) { maze[red[0]][red[1]] = 'R'; }


x86 assembly (clang, -O0):
<marca_red>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
imul   $0x1e,%rcx,%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%rcx
movslq 0x4(%rcx),%rcx
movb   $0x52,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<marca_red>:
movslq (%rsi),%rax
movslq 0x4(%rsi),%rcx
mov    %rax,%rdx
shl    $0x5,%rdx
sub    %rax,%rdx
sub    %rax,%rdx
add    %rdi,%rdx
movb   $0x52,(%rcx,%rdx,1)
ret

LLVM IR (-O0):
define void @marca_red([30 x i8]* %0, i32* %1) {
%3 = alloca [30 x i8]*
%4 = alloca i32*
store [30 x i8]* %0, [30 x i8]** %3
store i32* %1, i32** %4
%5 = load [30 x i8]*, [30 x i8]** %3
%6 = load i32*, i32** %4
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [30 x i8], [30 x i8]* %5, i64 %9
%11 = load i32*, i32** %4
%12 = getelementptr inbounds i32, i32* %11, i64 1
%13 = load i32, i32* %12
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [30 x i8], [30 x i8]* %10, i64 0, i64 %14
store i8 82, i8* %15
ret void
}

LLVM IR (-O2):
define void @marca_red([30 x i8]* nocapture writeonly %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %1, i64 1
%6 = load i32, i32* %5
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [30 x i8], [30 x i8]* %0, i64 %4, i64 %7
store i8 82, i8* %8
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int same_screen;
};
typedef TYPE_1__ XLeaveWindowEvent;

/* Variables and functions */
void set_XLeaveWindowEvent_same_screen(void *_p, int _v) {
  ((XLeaveWindowEvent *)_p)->same_screen = (int)_v;
}


x86 assembly (clang, -O0):
<set_XLeaveWindowEvent_same_screen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XLeaveWindowEvent_same_screen>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XLeaveWindowEvent_same_screen(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XLeaveWindowEvent_same_screen(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
long gcd(long a, long b) { return b == 0 ? a : gcd(b, a % b); }


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1138 <gcd+0x28>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <gcd+0x42>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    %rdx,%rsi
call   1030 <gcd@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %rdi,%rax
test   %rsi,%rsi
je     1135 <gcd+0x35>
mov    %rsi,%rdx
jmp    111d <gcd+0x1d>
nopl   (%rax)
cqto
idiv   %rcx
mov    %rcx,%rax
test   %rdx,%rdx
je     1132 <gcd+0x32>
mov    %rdx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
jne    1110 <gcd+0x10>
xor    %edx,%edx
div    %ecx
jmp    1115 <gcd+0x15>
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @gcd(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i64, i64* %3
br label %15
9: ; preds = %2
%10 = load i64, i64* %4
%11 = load i64, i64* %3
%12 = load i64, i64* %4
%13 = srem i64 %11, %12
%14 = call i64 @gcd(i64 %10, i64 %13)
br label %15
15: ; preds = %9, %7
%16 = phi i64 [ %8, %7 ], [ %14, %9 ]
ret i64 %16
}

LLVM IR (-O2):
define i64 @gcd(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %7, %4 ], [ %1, %2 ]
%6 = phi i64 [ %5, %4 ], [ %0, %2 ]
%7 = srem i64 %6, %5
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i64 [ %0, %2 ], [ %5, %4 ]
ret i64 %10
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ printf(char *, int);
main() { printf("EOF: %d\n", EOF); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"EOF: %d\0A\00"
@EOF = global i32 0
define i32 @main() {
%1 = load i32, i32* @EOF
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, double);
int main() {
  double nc = 0;
  for (nc = 0; getchar() != EOF; ++nc)
    ;
  printf("count: %f\n", nc);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2e9b(%rip),%rcx
cmp    (%rcx),%rax
je     1172 <main+0x52>
jmp    115b <main+0x3b>
movsd  0xe9d(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    113f <main+0x1f>
movsd  -0x10(%rbp),%xmm0
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb5(%rip),%rbx
xorpd  %xmm0,%xmm0
cmp    (%rbx),%rax
je     1160 <main+0x40>
xorpd  %xmm0,%xmm0
addsd  0xeb8(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1040 <getchar@plt>
movsd  0x8(%rsp),%xmm0
cmp    (%rbx),%rax
jne    1140 <main+0x20>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i64 0
@.str = [11 x i8] c"count: %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
store double 0.000000e+00, double* %2
store double 0.000000e+00, double* %2
br label %3
3: ; preds = %8, %0
%4 = call i64 (...) @getchar()
%5 = load i64, i64* @EOF
%6 = icmp ne i64 %4, %5
br i1 %6, label %7, label %11
7: ; preds = %3
br label %8
8: ; preds = %7
%9 = load double, double* %2
%10 = fadd double %9, 1.000000e+00
store double %10, double* %2
br label %3
11: ; preds = %3
%12 = load double, double* %2
%13 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), double %12)
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [11 x i8] c"count: %f\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @getchar()
%2 = load i64, i64* @EOF
%3 = icmp eq i64 %1, %2
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = phi double [ %6, %4 ], [ 0.000000e+00, %0 ]
%6 = fadd double %5, 1.000000e+00
%7 = tail call i64 (...) @getchar()
%8 = load i64, i64* @EOF
%9 = icmp eq i64 %7, %8
br i1 %9, label %10, label %4
10: ; preds = %4, %0
%11 = phi double [ 0.000000e+00, %0 ], [ %6, %4 ]
%12 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), double %11)
ret i32 0
}
/* Type definitions */
typedef char *__m128i;

/* Variables and functions */
char *_mm_unpackhi_epi8(char *, char *);
__m128i __attribute__((no, unused)) test(__m128i s1, __m128i s2) {
  __asm("" : "+v"(s1), "+v"(s2));
  return _mm_unpackhi_epi8(s1, s2);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
movq   %rcx,%xmm0
movq   %rax,%xmm1
movq   %xmm1,%rax
movq   %xmm0,%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <_mm_unpackhi_epi8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
movq   %rdi,%xmm0
movq   %rsi,%xmm1
movq   %xmm0,%rdi
movq   %xmm1,%rsi
jmp    1030 <_mm_unpackhi_epi8@plt>

LLVM IR (-O0):
define i8* @test(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call { i8*, i8* } asm "", "=v,=v,0,1,~{dirflag},~{fpsr},~{flags}"(i8* %5, i8* %6)
%8 = extractvalue { i8*, i8* } %7, 0
%9 = extractvalue { i8*, i8* } %7, 1
store i8* %8, i8** %3
store i8* %9, i8** %4
%10 = load i8*, i8** %3
%11 = load i8*, i8** %4
%12 = call i8* @_mm_unpackhi_epi8(i8* %10, i8* %11)
ret i8* %12
}

LLVM IR (-O2):
define i8* @test(i8* %0, i8* %1) {
%3 = tail call { i8*, i8* } asm "", "=v,=v,0,1,~{dirflag},~{fpsr},~{flags}"(i8* %0, i8* %1)
%4 = extractvalue { i8*, i8* } %3, 0
%5 = extractvalue { i8*, i8* } %3, 1
%6 = tail call i8* @_mm_unpackhi_epi8(i8* %4, i8* %5)
ret i8* %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ write_tape_record(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                     int /*<<< orphan*/);
void write_tape_mark(FILE *f) { write_tape_record(f, NULL, 0); }


x86 assembly (clang, -O0):
<write_tape_mark>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <write_tape_record@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_tape_mark>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <write_tape_record@plt>

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

LLVM IR (-O2):
define void @write_tape_mark(i32* %0) {
%2 = tail call i32 @write_tape_record(i32* %0, i32* null, i32 0)
ret void
}
const char *rndrm00_get_description(void) {
  return "Create a directory named rndrm00_test_dir_pid, where "
         "pid is the process id.  Within that directory, "
         "randomly create and remove "
         "a number of sub-directories and small files, "
         "but do more creates than removes. "
         "When the total size of all sub-directories and files "
         "is greater than the size specified by the size parameter, "
         "start to do more removes than creates. "
         "The size parameter is given by the -z or --size option, "
         "otherwise it defaults to 1000000. "
         "A size of zero fills the file system until there is no "
         "space left. "
         "The task repeats, sleeping in between each iteration. "
         "The repeat count is set by the -n or --repeat option, "
         "otherwise it defaults to 1. "
         "A repeat count of zero repeats forever. "
         "The sleep value is given by the -p or --sleep option, "
         "otherwise it defaults to 0. "
         "Sleep is specified in milliseconds.";
}


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

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

LLVM IR (-O0):
@.str = [807 x i8] c"Create a directory named rndrm00_test_dir_pid, where pid is the process id. Within that directory, randomly create and remove a number of sub-directories and small files, but do more creates than removes. When the total size of all sub-directories and files is greater than the size specified by the size parameter, start to do more removes than creates. The size parameter is given by the -z or --size option, otherwise it defaults to 1000000. A size of zero fills the file system until there is no space left. The task repeats, sleeping in between each iteration. The repeat count is set by the -n or --repeat option, otherwise it defaults to 1. A repeat count of zero repeats forever. The sleep value is given by the -p or --sleep option, otherwise it defaults to 0. Sleep is specified in milliseconds.\00"
define i8* @rndrm00_get_description() {
ret i8* getelementptr inbounds ([807 x i8], [807 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [807 x i8] c"Create a directory named rndrm00_test_dir_pid, where pid is the process id. Within that directory, randomly create and remove a number of sub-directories and small files, but do more creates than removes. When the total size of all sub-directories and files is greater than the size specified by the size parameter, start to do more removes than creates. The size parameter is given by the -z or --size option, otherwise it defaults to 1000000. A size of zero fills the file system until there is no space left. The task repeats, sleeping in between each iteration. The repeat count is set by the -n or --repeat option, otherwise it defaults to 1. A repeat count of zero repeats forever. The sleep value is given by the -p or --sleep option, otherwise it defaults to 0. Sleep is specified in milliseconds.\00"
define i8* @rndrm00_get_description() {
ret i8* getelementptr inbounds ([807 x i8], [807 x i8]* @.str, i64 0, i64 0)
}
unsigned reverse_num(unsigned n, unsigned radix) {
  unsigned i = 0;
  while (n > 0) {
    i = i * radix + (n % radix);
    n = n / radix;
  }
  return i;
}


x86 assembly (clang, -O0):
<reverse_num>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
jbe    1145 <reverse_num+0x45>
mov    -0xc(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    -0x10(%rbp),%eax
add    %edx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %eax,-0x4(%rbp)
jmp    1111 <reverse_num+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse_num>:
xor    %ecx,%ecx
test   %edi,%edi
je     1121 <reverse_num+0x21>
cs nopw 0x0(%rax,%rax,1)
mov    %edi,%eax
xor    %edx,%edx
div    %esi
imul   %esi,%ecx
add    %edx,%ecx
cmp    %esi,%edi
mov    %eax,%edi
jae    1110 <reverse_num+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @reverse_num(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %9, %4 ], [ 0, %2 ]
%6 = phi i32 [ %10, %4 ], [ %0, %2 ]
%7 = mul i32 %5, %1
%8 = urem i32 %6, %1
%9 = add i32 %8, %7
%10 = udiv i32 %6, %1
%11 = icmp ult i32 %6, %1
br i1 %11, label %12, label %4
12: ; preds = %4, %2
%13 = phi i32 [ 0, %2 ], [ %9, %4 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ msg(char *, char *, char *, int);
void *lsd_nomem_error(char *file, int line, char *mesg) {
  msg("out of memory: %s: %s::%d", mesg, file, line);
  return NULL;
}


x86 assembly (clang, -O0):
<lsd_nomem_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xecb(%rip),%rdi
call   1030 <msg@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lsd_nomem_error>:
push   %rax
mov    %esi,%ecx
mov    %rdi,%rax
lea    0xee3(%rip),%rdi
mov    %rdx,%rsi
mov    %rax,%rdx
call   1030 <msg@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"out of memory: %s: %s::%d\00"
define i8* @lsd_nomem_error(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = call i32 @msg(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8, i32 %9)
ret i8* null
}

LLVM IR (-O2):
@.str = [26 x i8] c"out of memory: %s: %s::%d\00"
define noalias i8* @lsd_nomem_error(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @msg(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %0, i32 %1)
ret i8* null
}
/* Type definitions */
struct pci_driver {
  int dummy;
};
struct pci_device_id {
  int dummy;
};
struct pci_dev {
  int dummy;
};

/* Variables and functions */
struct pci_device_id *pci_match_device(struct pci_driver *, struct pci_dev *);
int pci_bus_match(struct pci_dev *pci_dev, struct pci_driver *pci_drv) {
  struct pci_device_id *found_id;
  found_id = pci_match_device(pci_drv, pci_dev);
  if (found_id) {
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<pci_bus_match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <pci_match_device@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1148 <pci_bus_match+0x38>
movl   $0x1,-0x4(%rbp)
jmp    114f <pci_bus_match+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pci_bus_match>:
push   %rax
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <pci_match_device@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.pci_dev = type { i32 }
%struct.pci_driver = type { i32 }
%struct.pci_device_id = type { i32 }
define i32 @pci_bus_match(%struct.pci_dev* %0, %struct.pci_driver* %1) {
%3 = alloca i32
%4 = alloca %struct.pci_dev*
%5 = alloca %struct.pci_driver*
%6 = alloca %struct.pci_device_id*
store %struct.pci_dev* %0, %struct.pci_dev** %4
store %struct.pci_driver* %1, %struct.pci_driver** %5
%7 = load %struct.pci_driver*, %struct.pci_driver** %5
%8 = load %struct.pci_dev*, %struct.pci_dev** %4
%9 = call %struct.pci_device_id* @pci_match_device(%struct.pci_driver* %7, %struct.pci_dev* %8)
store %struct.pci_device_id* %9, %struct.pci_device_id** %6
%10 = load %struct.pci_device_id*, %struct.pci_device_id** %6
%11 = icmp ne %struct.pci_device_id* %10, null
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 1, i32* %3
br label %14
13: ; preds = %2
store i32 0, i32* %3
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
%struct.pci_dev = type { i32 }
%struct.pci_driver = type { i32 }
%struct.pci_device_id = type { i32 }
define i32 @pci_bus_match(%struct.pci_dev* %0, %struct.pci_driver* %1) {
%3 = tail call %struct.pci_device_id* @pci_match_device(%struct.pci_driver* %1, %struct.pci_dev* %0)
%4 = icmp ne %struct.pci_device_id* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}
float foo(float x, float y) {
  volatile int i = 0;
  return i == 0 ? x : y;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    $0x0,%eax
jne    1130 <foo+0x30>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    113a <foo+0x3a>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movl   $0x0,-0x4(%rsp)
cmpl   $0x0,-0x4(%rsp)
je     1112 <foo+0x12>
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @foo(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca i32
store float %0, float* %3
store float %1, float* %4
store volatile i32 0, i32* %5
%6 = load volatile i32, i32* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @foo(float %0, float %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store volatile i32 0, i32* %3
%5 = load volatile i32, i32* %3
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, float %0, float %1
ret float %7
}
int nn_xsurveyor_ispeer(int socktype) {
  return socktype == (6 * 16 + 3) ? 1 : 0;
}


x86 assembly (clang, -O0):
<nn_xsurveyor_ispeer>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x63,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nn_xsurveyor_ispeer>:
xor    %eax,%eax
cmp    $0x63,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @nn_xsurveyor_ispeer(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 99
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 0
ret i32 %6
}

LLVM IR (-O2):
define i32 @nn_xsurveyor_ispeer(i32 %0) {
%2 = icmp eq i32 %0, 99
%3 = zext i1 %2 to i32
ret i32 %3
}
void del_split_array(char **arr, int count) {
  int i;
  for (i = 0; i < count; i++)
    free(arr[i]);
  free(arr);
}


x86 assembly (clang, -O0):
<del_split_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <del_split_array+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <del_split_array+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<del_split_array>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <del_split_array+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <del_split_array+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @del_split_array(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
%5 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %16, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = 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
br label %16
16: ; preds = %10
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
br label %6
19: ; preds = %6
%20 = load i8**, i8*** %3
%21 = bitcast i8** %20 to i8*
ret void
}

LLVM IR (-O2):
define void @del_split_array(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
tail call void @free(i8* %9)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
%13 = bitcast i8** %0 to i8*
tail call void @free(i8* %13)
ret void
}
/* Variables and functions */
scalar_t__ pow(int, int);
int triplet(int a, int b, int c) { return pow(a, 2) + pow(b, 2) == pow(c, 2); }


x86 assembly (clang, -O0):
<triplet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x2,%esi
call   1030 <pow@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x2,%esi
call   1030 <pow@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x2,%esi
call   1030 <pow@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<triplet>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    $0x2,%esi
call   1030 <pow@plt>
mov    %rax,%rbx
mov    %ebp,%edi
mov    $0x2,%esi
call   1030 <pow@plt>
mov    %rax,%rbp
add    %rbx,%rbp
mov    %r14d,%edi
mov    $0x2,%esi
call   1030 <pow@plt>
xor    %ecx,%ecx
cmp    %rax,%rbp
sete   %cl
mov    %ecx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @triplet(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 = call i64 @pow(i32 %7, i32 2)
%9 = load i32, i32* %5
%10 = call i64 @pow(i32 %9, i32 2)
%11 = add nsw i64 %8, %10
%12 = load i32, i32* %6
%13 = call i64 @pow(i32 %12, i32 2)
%14 = icmp eq i64 %11, %13
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @triplet(i32 %0, i32 %1, i32 %2) {
%4 = tail call i64 @pow(i32 %0, i32 2)
%5 = tail call i64 @pow(i32 %1, i32 2)
%6 = add nsw i64 %5, %4
%7 = tail call i64 @pow(i32 %2, i32 2)
%8 = icmp eq i64 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
scalar_t__ I2C_setup();
int /*<<< orphan*/ VCNL4000_writeCmd(int, int);
void setupProximity() {
  if (I2C_setup() < 0) {
    return;
  }
  VCNL4000_writeCmd(0x80 + 0x3, 0x14);
  VCNL4000_writeCmd(0x80 + 0x9, 0x2);
  VCNL4000_writeCmd(0x80 + 0xa, 0x81);
}


x86 assembly (clang, -O0):
<setupProximity>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <I2C_setup@plt>
cmp    $0x0,%rax
jge    113a <setupProximity+0x1a>
jmp    1167 <setupProximity+0x47>
mov    $0x83,%edi
mov    $0x14,%esi
call   1030 <VCNL4000_writeCmd@plt>
mov    $0x89,%edi
mov    $0x2,%esi
call   1030 <VCNL4000_writeCmd@plt>
mov    $0x8a,%edi
mov    $0x81,%esi
call   1030 <VCNL4000_writeCmd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setupProximity>:
push   %rax
xor    %eax,%eax
call   1040 <I2C_setup@plt>
test   %rax,%rax
js     115b <setupProximity+0x3b>
mov    $0x83,%edi
mov    $0x14,%esi
call   1030 <VCNL4000_writeCmd@plt>
mov    $0x89,%edi
mov    $0x2,%esi
call   1030 <VCNL4000_writeCmd@plt>
mov    $0x8a,%edi
mov    $0x81,%esi
pop    %rax
jmp    1030 <VCNL4000_writeCmd@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @setupProximity() {
%1 = call i64 (...) @I2C_setup()
%2 = icmp slt i64 %1, 0
br i1 %2, label %3, label %4
3: ; preds = %0
br label %8
4: ; preds = %0
%5 = call i32 @VCNL4000_writeCmd(i32 131, i32 20)
%6 = call i32 @VCNL4000_writeCmd(i32 137, i32 2)
%7 = call i32 @VCNL4000_writeCmd(i32 138, i32 129)
br label %8
8: ; preds = %4, %3
ret void
}

LLVM IR (-O2):
define void @setupProximity() {
%1 = tail call i64 (...) @I2C_setup()
%2 = icmp slt i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i32 @VCNL4000_writeCmd(i32 131, i32 20)
%5 = tail call i32 @VCNL4000_writeCmd(i32 137, i32 2)
%6 = tail call i32 @VCNL4000_writeCmd(i32 138, i32 129)
br label %7
7: ; preds = %0, %3
ret void
}
int calc_fib(int n) {
  if (n == 0) {
    return 0;
  } else if (n == 1) {
    return 1;
  } else
    return ((calc_fib(n - 2) + calc_fib(n - 1)));
}


x86 assembly (clang, -O0):
<calc_fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <calc_fib+0x21>
movl   $0x0,-0x4(%rbp)
jmp    116a <calc_fib+0x5a>
cmpl   $0x1,-0x8(%rbp)
jne    1147 <calc_fib+0x37>
movl   $0x1,-0x4(%rbp)
jmp    116a <calc_fib+0x5a>
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <calc_fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <calc_fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_fib>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%ebx
jb     1132 <calc_fib+0x22>
nopl   0x0(%rax)
lea    -0x2(%rbx),%edi
call   1030 <calc_fib@plt>
add    %eax,%ebp
add    $0xffffffff,%ebx
cmp    $0x2,%ebx
jae    1120 <calc_fib+0x10>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @calc_fib(i32 %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i32 [ 0, %1 ], [ %10, %6 ]
%4 = phi i32 [ %0, %1 ], [ %9, %6 ]
%5 = icmp ult i32 %4, 2
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = add nsw i32 %4, -2
%8 = tail call i32 @calc_fib(i32 %7)
%9 = add nsw i32 %4, -1
%10 = add nsw i32 %8, %3
br label %2
11: ; preds = %2
%12 = add nsw i32 %4, %3
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_channel_check_connectivity_state() {
  fprintf(stderr, "Should never reach here");
  abort();
}


x86 assembly (clang, -O0):
<grpcsharp_channel_check_connectivity_state>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<grpcsharp_channel_check_connectivity_state>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_channel_check_connectivity_state() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_channel_check_connectivity_state() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
void __yotta_dummy_lib_symbol_mbed_hal_nordic() {}


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

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

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

LLVM IR (-O2):
define void @__yotta_dummy_lib_symbol_mbed_hal_nordic() {
ret void
}
/* Type definitions */
typedef scalar_t__ const wchar_t;

/* Variables and functions */
wchar_t *wcschr(const wchar_t *str, wchar_t c) {
  for (; *str; str++) {
    if (*str == c)
      return ((wchar_t *)str);
  }
  return NULL;
}


x86 assembly (clang, -O0):
<wcschr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     114e <wcschr+0x4e>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
cmp    -0x18(%rbp),%rax
jne    1138 <wcschr+0x38>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1156 <wcschr+0x56>
jmp    113d <wcschr+0x3d>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <wcschr+0xc>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcschr>:
mov    (%rdi),%rcx
test   %rcx,%rcx
je     1122 <wcschr+0x22>
mov    %rdi,%rax
nopl   0x0(%rax,%rax,1)
cmp    %rsi,%rcx
je     1124 <wcschr+0x24>
mov    0x8(%rax),%rcx
add    $0x8,%rax
test   %rcx,%rcx
jne    1110 <wcschr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64* @wcschr(i64* %0, i64 %1) {
%3 = load i64, i64* %0
%4 = icmp eq i64 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %9
%6 = phi i64 [ %11, %9 ], [ %3, %2 ]
%7 = phi i64* [ %10, %9 ], [ %0, %2 ]
%8 = icmp eq i64 %6, %1
br i1 %8, label %13, label %9
9: ; preds = %5
%10 = getelementptr inbounds i64, i64* %7, i64 1
%11 = load i64, i64* %10
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %9, %2
%14 = phi i64* [ null, %2 ], [ null, %9 ], [ %7, %5 ]
ret i64* %14
}