xunge/DecIR huggingface dataset:
/* Variables and functions */
int magic_string_len(char *, int);
int /*<<< orphan*/ printf(char *, int);
int strlen(char *);
void main() {
  char str[] = "<<>>";
  int len = strlen(str);
  int res = magic_string_len(str, len);
  printf("magic str len is %d", res);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xec2(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xebd(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x5(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
lea    -0x5(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <magic_string_len@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe96(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xc(%rsp)
movl   $0x3e3e3c3c,0x8(%rsp)
3e
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <magic_string_len@plt>
lea    0xea5(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str = [5 x i8] c"<<>>\00"
@.str = [20 x i8] c"magic str len is %d\00"
define void @main() {
%1 = alloca [5 x i8]
%2 = alloca i32
%3 = alloca i32
%4 = bitcast [5 x i8]* %1 to i8*
%5 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %2
%7 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%8 = load i32, i32* %2
%9 = call i32 @magic_string_len(i8* %7, i32 %8)
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %10)
ret void
}

LLVM IR (-O2):
@__const.main.str = [5 x i8] c"<<>>\00"
@.str = [20 x i8] c"magic str len is %d\00"
define void @main() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = call i32 @strlen(i8* %2)
%4 = call i32 @magic_string_len(i8* %2, i32 %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
int aic7xxx_patch0_func(struct aic7xxx_host *p) { return (0); }


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

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

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

LLVM IR (-O2):
%struct.aic7xxx_host = type opaque
define i32 @aic7xxx_patch0_func(%struct.aic7xxx_host* nocapture readnone %0) {
ret i32 0
}
int execute_epoll_ctl() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_epoll_ctl() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo(char);
int main(void) { foo((char)5); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @foo(i8 signext 5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i8 signext 5)
ret i32 0
}
double sin(double x) {}


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

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

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

LLVM IR (-O2):
define double @sin(double %0) {
ret double undef
}
/* Variables and functions */
int test_sat_parser_should_fail(char *);
int test01(void) { return test_sat_parser_should_fail(""); }


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

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @test01() {
%1 = call i32 @test_sat_parser_should_fail(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @test01() {
%1 = tail call i32 @test_sat_parser_should_fail(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int get_num_divisors(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int last = 500 >> 1;
  int num = 0;
  int i = 0;
  int j = 1;
  while (num < last) {
    i = i + j;
    num = get_num_divisors(i);
    j++;
  }
  printf("%d\n", i);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xfa,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1189 <main+0x59>
mov    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1040 <get_num_divisors@plt>
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    115b <main+0x2b>
mov    -0x10(%rbp),%esi
lea    0xe6d(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
mov    $0x1,%ebp
nopw   0x0(%rax,%rax,1)
add    %ebp,%ebx
mov    %ebx,%edi
call   1040 <get_num_divisors@plt>
add    $0x1,%ebp
cmp    $0xfa,%eax
jl     1140 <main+0x10>
lea    0xea6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %6, %1 ]
%3 = phi i32 [ 0, %0 ], [ %4, %1 ]
%4 = add nuw nsw i32 %2, %3
%5 = tail call i32 @get_num_divisors(i32 %4)
%6 = add nuw nsw i32 %2, 1
%7 = icmp slt i32 %5, 250
br i1 %7, label %1, label %8
8: ; preds = %1
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%10 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
size_t strlen(char *);
void strcpy_strlen_Bad() {
  char src[5] = "test";
  char dst[10];
  strcpy(dst, src);
  int a[4];
  a[strlen(dst)] = 0;
}


x86 assembly (clang, -O0):
<strcpy_strlen_Bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xecd(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0xf(%rbp),%rdi
lea    -0x5(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0xf(%rbp),%rdi
call   1040 <strlen@plt>
movl   $0x0,-0x20(%rbp,%rax,4)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy_strlen_Bad>:
sub    $0x18,%rsp
movb   $0x0,0xc(%rsp)
movl   $0x74736574,0x8(%rsp)
74
lea    0xe(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <strcpy@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.strcpy_strlen_Bad.src = [5 x i8] c"test\00"
define void @strcpy_strlen_Bad() {
%1 = alloca [5 x i8]
%2 = alloca [10 x i8]
%3 = alloca [4 x i32]
%4 = bitcast [5 x i8]* %1 to i8*
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%7 = call i32 @strcpy(i8* %5, i8* %6)
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%9 = call i64 @strlen(i8* %8)
%10 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 %9
store i32 0, i32* %10
ret void
}

LLVM IR (-O2):
@__const.strcpy_strlen_Bad.src = [5 x i8] c"test\00"
define void @strcpy_strlen_Bad() {
%1 = alloca [5 x i8]
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* %3)
ret void
}
/* Type definitions */
struct b6_list {
  int dummy;
};
struct b6_dref {
  int dummy;
};

/* Variables and functions */
struct b6_dref *b6_list_add(int /*<<< orphan*/, struct b6_dref *);
int /*<<< orphan*/ b6_list_first(struct b6_list *);
struct b6_dref *b6_list_add_first(struct b6_list *list, struct b6_dref *dref) {
  return b6_list_add(b6_list_first(list), dref);
}


x86 assembly (clang, -O0):
<b6_list_add_first>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <b6_list_first@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1040 <b6_list_add@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b6_list_add_first>:
push   %rbx
mov    %rsi,%rbx
call   1030 <b6_list_first@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <b6_list_add@plt>

LLVM IR (-O0):
%struct.b6_list = type { i32 }
%struct.b6_dref = type { i32 }
define %struct.b6_dref* @b6_list_add_first(%struct.b6_list* %0, %struct.b6_dref* %1) {
%3 = alloca %struct.b6_list*
%4 = alloca %struct.b6_dref*
store %struct.b6_list* %0, %struct.b6_list** %3
store %struct.b6_dref* %1, %struct.b6_dref** %4
%5 = load %struct.b6_list*, %struct.b6_list** %3
%6 = call i32 @b6_list_first(%struct.b6_list* %5)
%7 = load %struct.b6_dref*, %struct.b6_dref** %4
%8 = call %struct.b6_dref* @b6_list_add(i32 %6, %struct.b6_dref* %7)
ret %struct.b6_dref* %8
}

LLVM IR (-O2):
%struct.b6_list = type { i32 }
%struct.b6_dref = type { i32 }
define %struct.b6_dref* @b6_list_add_first(%struct.b6_list* %0, %struct.b6_dref* %1) {
%3 = tail call i32 @b6_list_first(%struct.b6_list* %0)
%4 = tail call %struct.b6_dref* @b6_list_add(i32 %3, %struct.b6_dref* %1)
ret %struct.b6_dref* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ date_get_by_epoch(char *, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ mk_time_(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int date_normalize(char *ps_date_d, char *ps_date_s, char *ps_format) {
  time_t t_mt;
  char s_ndate[255];
  t_mt = mk_time_(ps_date_s, ps_format);
  date_get_by_epoch(s_ndate, ps_format, &t_mt);
  strcpy(ps_date_d, s_ndate);
  return 0;
}


x86 assembly (clang, -O0):
<date_normalize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <mk_time_@plt>
mov    %eax,-0x1c(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1050 <date_get_by_epoch@plt>
mov    -0x8(%rbp),%rdi
lea    -0x120(%rbp),%rsi
call   1030 <strcpy@plt>
xor    %eax,%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<date_normalize>:
push   %r15
push   %r14
push   %rbx
sub    $0x110,%rsp
mov    %rdx,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1040 <mk_time_@plt>
mov    %eax,0xc(%rsp)
lea    0x10(%rsp),%r15
lea    0xc(%rsp),%rdx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <date_get_by_epoch@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @date_normalize(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca [255 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = call i32 @mk_time_(i8* %9, i8* %10)
store i32 %11, i32* %7
%12 = getelementptr inbounds [255 x i8], [255 x i8]* %8, i64 0, i64 0
%13 = load i8*, i8** %6
%14 = call i32 @date_get_by_epoch(i8* %12, i8* %13, i32* %7)
%15 = load i8*, i8** %4
%16 = getelementptr inbounds [255 x i8], [255 x i8]* %8, i64 0, i64 0
%17 = call i32 @strcpy(i8* %15, i8* %16)
ret i32 0
}

LLVM IR (-O2):
define i32 @date_normalize(i8* %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca [255 x i8]
%6 = bitcast i32* %4 to i8*
%7 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
%8 = tail call i32 @mk_time_(i8* %1, i8* %2)
store i32 %8, i32* %4
%9 = call i32 @date_get_by_epoch(i8* %7, i8* %2, i32* %4)
%10 = call i32 @strcpy(i8* %0, i8* %7)
ret i32 0
}
int az_imax(int a, int b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<az_imax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <az_imax+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <az_imax+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<az_imax>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @az_imax(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @az_imax(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ f();
int main(void) { f(); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @f()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void rot_word(uint8_t *w) {
  uint8_t tmp;
  uint8_t i;
  tmp = w[0];
  for (i = 0; i < 3; i++) {
    w[i] = w[i + 1];
  }
  w[3] = tmp;
}


x86 assembly (clang, -O0):
<rot_word>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jge    114b <rot_word+0x4b>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1118 <rot_word+0x18>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rot_word>:
mov    (%rdi),%eax
mov    0x4(%rdi),%rcx
mov    0xc(%rdi),%edx
mov    %edx,0x8(%rdi)
mov    %rcx,(%rdi)
mov    %eax,0xc(%rdi)
ret

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

LLVM IR (-O2):
define void @rot_word(i32* nocapture %0) {
%2 = bitcast i32* %0 to i8*
%3 = load i32, i32* %0
%4 = getelementptr i32, i32* %0, i64 1
%5 = bitcast i32* %4 to i8*
%6 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %3, i32* %6
ret void
}
void nseel_asm_log_end(void) {}


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

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

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

LLVM IR (-O2):
define void @nseel_asm_log_end() {
ret void
}
/* Variables and functions */
double __builtin_setrnd(int volatile);
void test_builtin_ppc_setrnd() {
  volatile double res;
  volatile int x = 100;
  res = __builtin_setrnd(2);
  res = __builtin_setrnd(100);
  res = __builtin_setrnd(x);
}


x86 assembly (clang, -O0):
<test_builtin_ppc_setrnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x64,-0xc(%rbp)
mov    $0x2,%edi
call   1030 <__builtin_setrnd@plt>
movsd  %xmm0,-0x8(%rbp)
mov    $0x64,%edi
call   1030 <__builtin_setrnd@plt>
movsd  %xmm0,-0x8(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <__builtin_setrnd@plt>
movsd  %xmm0,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_builtin_ppc_setrnd>:
sub    $0x18,%rsp
movl   $0x64,0xc(%rsp)
mov    $0x2,%edi
call   1030 <__builtin_setrnd@plt>
movsd  %xmm0,0x10(%rsp)
mov    $0x64,%edi
call   1030 <__builtin_setrnd@plt>
movsd  %xmm0,0x10(%rsp)
mov    0xc(%rsp),%edi
call   1030 <__builtin_setrnd@plt>
movsd  %xmm0,0x10(%rsp)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @test_builtin_ppc_setrnd() {
%1 = alloca double
%2 = alloca i32
store volatile i32 100, i32* %2
%3 = call double @__builtin_setrnd(i32 2)
store volatile double %3, double* %1
%4 = call double @__builtin_setrnd(i32 100)
store volatile double %4, double* %1
%5 = load volatile i32, i32* %2
%6 = call double @__builtin_setrnd(i32 %5)
store volatile double %6, double* %1
ret void
}

LLVM IR (-O2):
define void @test_builtin_ppc_setrnd() {
%1 = alloca double
%2 = alloca i32
%3 = bitcast double* %1 to i8*
%4 = bitcast i32* %2 to i8*
store volatile i32 100, i32* %2
%5 = tail call double @__builtin_setrnd(i32 2)
store volatile double %5, double* %1
%6 = tail call double @__builtin_setrnd(i32 100)
store volatile double %6, double* %1
%7 = load volatile i32, i32* %2
%8 = tail call double @__builtin_setrnd(i32 %7)
store volatile double %8, double* %1
ret void
}
/* Variables and functions */
int pipe(int *);
int s_pipe_posix_pipe(int filedes[2]) { return pipe(filedes); }


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

x86 assembly (clang, -O2):
<s_pipe_posix_pipe>:
jmp    1030 <pipe@plt>

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

LLVM IR (-O2):
define i32 @s_pipe_posix_pipe(i32* %0) {
%2 = tail call i32 @pipe(i32* %0)
ret i32 %2
}
void ecm_sfe_ipv4_stop(int num) { return; }


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

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

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

LLVM IR (-O2):
define void @ecm_sfe_ipv4_stop(i32 %0) {
ret void
}
/* Variables and functions */
int atoi(char const *);
char *miget_cfg_str(int);
int miget_cfg_int(int id) {
  const char *_var = miget_cfg_str(id);
  return atoi(_var);
}


x86 assembly (clang, -O0):
<miget_cfg_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <miget_cfg_str@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <atoi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<miget_cfg_int>:
push   %rax
call   1030 <miget_cfg_str@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <atoi@plt>

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

LLVM IR (-O2):
define i32 @miget_cfg_int(i32 %0) {
%2 = tail call i8* @miget_cfg_str(i32 %0)
%3 = tail call i32 @atoi(i8* %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void flush_stderr(int level) {
  fprintf(stderr, "\n");
  fflush(stderr);
}


x86 assembly (clang, -O0):
<flush_stderr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flush_stderr>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [2 x i8] c"\0A\00"
define void @flush_stderr(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = tail call i32 @fflush(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit2(int);
double empty_return_double2(double *a) {
  if (*a > 0.0) {
    return 1.0;
  } else {
    exit2(-1);
  }
}


x86 assembly (clang, -O0):
<empty_return_double2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1143 <empty_return_double2+0x33>
movsd  0xec7(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    114d <empty_return_double2+0x3d>
mov    $0xffffffff,%edi
call   1030 <exit2@plt>
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<empty_return_double2>:
push   %rax
movsd  (%rdi),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
ja     1129 <empty_return_double2+0x19>
mov    $0xffffffff,%edi
call   1030 <exit2@plt>
movsd  0xecf(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @empty_return_double2(double* %0) {
%2 = alloca double
%3 = alloca double*
store double* %0, double** %3
%4 = load double*, double** %3
%5 = load double, double* %4
%6 = fcmp ogt double %5, 0.000000e+00
br i1 %6, label %7, label %8
7: ; preds = %1
store double 1.000000e+00, double* %2
br label %10
8: ; preds = %1
%9 = call i32 @exit2(i32 -1)
br label %10
10: ; preds = %7, %8
%11 = load double, double* %2
ret double %11
}

LLVM IR (-O2):
define double @empty_return_double2(double* nocapture %0) {
%2 = load double, double* %0
%3 = fcmp ogt double %2, 0.000000e+00
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @exit2(i32 -1)
br label %6
6: ; preds = %1, %4
ret double 1.000000e+00
}
/* Variables and functions */
size_t Max(const size_t a, const size_t b) {
  if (a > b)
    return a;
  return b;
}


x86 assembly (clang, -O0):
<Max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    1127 <Max+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <Max+0x2f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Max>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmova  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @Max(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = load i64, i64* %5
%8 = icmp ugt i64 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i64, i64* %4
store i64 %10, i64* %3
br label %13
11: ; preds = %2
%12 = load i64, i64* %5
store i64 %12, i64* %3
br label %13
13: ; preds = %11, %9
%14 = load i64, i64* %3
ret i64 %14
}

LLVM IR (-O2):
define i64 @Max(i64 %0, i64 %1) {
%3 = icmp ugt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int naive_scanf(char *, char *);
void mygets(char *p) {
  while (naive_scanf("%c", p) == 1 && *p++ != '\n')
    ;
}


x86 assembly (clang, -O0):
<mygets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <naive_scanf@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
mov    %al,-0x9(%rbp)
jne    1157 <mygets+0x47>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1167 <mygets+0x57>
jmp    116c <mygets+0x5c>
jmp    111c <mygets+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mygets>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xee2(%rip),%r14
xchg   %ax,%ax
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <naive_scanf@plt>
cmp    $0x1,%eax
jne    1139 <mygets+0x29>
cmpb   $0xa,(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <mygets+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @mygets(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %15, %1
%4 = load i8*, i8** %2
%5 = call i32 @naive_scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %2
%10 = load i8, i8* %8
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 10
br label %13
13: ; preds = %7, %3
%14 = phi i1 [ false, %3 ], [ %12, %7 ]
br i1 %14, label %15, label %16
15: ; preds = %13
br label %3
16: ; preds = %13
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @mygets(i8* %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = tail call i32 @naive_scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = load i8, i8* %3
%9 = icmp eq i8 %8, 10
br i1 %9, label %10, label %2
10: ; preds = %2, %6
ret void
}
/* Variables and functions */
int ft_mini_atoi(char *, int);
int ft_key_len(char *str) {
  int i;
  int j;
  i = 0;
  j = 0;
  while (str[i] != '\n')
    i++;
  return (ft_mini_atoi(str, i - 3));
}


x86 assembly (clang, -O0):
<ft_key_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
je     114d <ft_key_len+0x3d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112a <ft_key_len+0x1a>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sub    $0x3,%esi
call   1030 <ft_mini_atoi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_key_len>:
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0xa,(%rdi,%rsi,1)
lea    0x1(%rsi),%rsi
jne    1120 <ft_key_len+0x10>
add    $0xfffffffc,%esi
jmp    1030 <ft_mini_atoi@plt>

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

LLVM IR (-O2):
define i32 @ft_key_len(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 10
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
%10 = add nsw i32 %9, -3
%11 = tail call i32 @ft_mini_atoi(i8* %0, i32 %10)
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ arr_get(char *, void *, size_t);
int /*<<< orphan*/ arr_put(void *, char *, size_t);
void arr_pop(void *dst, void *src, size_t size) {
  char tmp[size];
  arr_get(tmp, src, size);
  arr_put(dst, tmp, size);
}


x86 assembly (clang, -O0):
<arr_pop>:
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    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <arr_get@plt>
mov    -0x30(%rbp),%rsi
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
call   1030 <arr_put@plt>
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @arr_pop(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** %5
%13 = load i64, i64* %6
%14 = call i32 @arr_get(i8* %11, i8* %12, i64 %13)
%15 = load i8*, i8** %4
%16 = load i64, i64* %6
%17 = call i32 @arr_put(i8* %15, i8* %11, i64 %16)
%18 = load i8*, i8** %7
ret void
}

LLVM IR (-O2):
define void @arr_pop(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8, i64 %2
%5 = call i32 @arr_get(i8* %4, i8* %1, i64 %2)
%6 = call i32 @arr_put(i8* %0, i8* %4, i64 %2)
ret void
}
/* Variables and functions */
void *malloc(int);
void *__attribute__((malloc)) __dpl_malloc(size_t len) {
  void *ptr = NULL;
  ptr = malloc(len);
  if ((!ptr) && (!len)) {
    ptr = malloc(1);
  }
  if (!ptr) {
  }
  return ptr;
}


x86 assembly (clang, -O0):
<__dpl_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1157 <__dpl_malloc+0x47>
cmpq   $0x0,-0x8(%rbp)
jne    1157 <__dpl_malloc+0x47>
mov    $0x1,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1167 <__dpl_malloc+0x57>
jmp    1167 <__dpl_malloc+0x57>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__dpl_malloc>:
push   %rbx
mov    %rdi,%rbx
call   1030 <malloc@plt>
test   %rbx,%rbx
jne    112e <__dpl_malloc+0x1e>
test   %rax,%rax
jne    112e <__dpl_malloc+0x1e>
mov    $0x1,%edi
pop    %rbx
jmp    1030 <malloc@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @__dpl_malloc(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i8* @malloc(i32 %2)
%4 = icmp ne i8* %3, null
%5 = icmp ne i64 %0, 0
%6 = or i1 %5, %4
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
br label %9
9: ; preds = %7, %1
%10 = phi i8* [ %3, %1 ], [ %8, %7 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x4d() {
  Assert_real((isbdigit(77) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              390, ("isbdigit should be 0 for M"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0x4d>:
push   %rax
mov    $0x4d,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x186,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for M\00"
define void @t_isbdigit_0x4d() {
%1 = call i64 @isbdigit(i32 77)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 390, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for M\00"
define void @t_isbdigit_0x4d() {
%1 = tail call i64 @isbdigit(i32 77)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 390, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void f(int x, int *inout) {
  int tmp = *inout;
  *inout = 2 * tmp;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
shll   (%rsi)
ret

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

LLVM IR (-O2):
define void @f(i32 %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = shl nsw i32 %3, 1
store i32 %4, i32* %1
ret void
}
void uartA_puts(const char *s) {}


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

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

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

LLVM IR (-O2):
define void @uartA_puts(i8* nocapture %0) {
ret void
}
void cac(int a, int b, int c) {}


x86 assembly (clang, -O0):
<cac>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @cac(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
ret void
}

LLVM IR (-O2):
define void @cac(i32 %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf(
      "\nConvert a Xilinx FPGA configuration bitstream into a C array.\n"
      "\nUSAGE: bit2c [-o newfile.c] [-i identifier] bitstream.bit\n\n"
      "\t-o newfile.c      write bitstream array into 'newfile.c'\n"
      "\t                  (defaults to bitstream filename + \".c\")\n"
      "\t-i identifier     use 'identifier' as name of bitstream variable\n"
      "\t                  (defaults to \"bitstream\")\n"
      "\t-f                force file creation even if no sync word is found\n"
      "\t bitstream.bit    file name of bitstream to convert\n\n");
}


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

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

LLVM IR (-O0):
@.str = [475 x i8] c"\0AConvert a Xilinx FPGA configuration bitstream into a C array.\0A\0AUSAGE: bit2c [-o newfile.c] [-i identifier] bitstream.bit\0A\0A\09-o newfile.c write bitstream array into 'newfile.c'\0A\09 (defaults to bitstream filename + \22.c\22)\0A\09-i identifier use 'identifier' as name of bitstream variable\0A\09 (defaults to \22bitstream\22)\0A\09-f force file creation even if no sync word is found\0A\09 bitstream.bit file name of bitstream to convert\0A\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([475 x i8], [475 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [474 x i8] c"\0AConvert a Xilinx FPGA configuration bitstream into a C array.\0A\0AUSAGE: bit2c [-o newfile.c] [-i identifier] bitstream.bit\0A\0A\09-o newfile.c write bitstream array into 'newfile.c'\0A\09 (defaults to bitstream filename + \22.c\22)\0A\09-i identifier use 'identifier' as name of bitstream variable\0A\09 (defaults to \22bitstream\22)\0A\09-f force file creation even if no sync word is found\0A\09 bitstream.bit file name of bitstream to convert\0A\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([474 x i8], [474 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct percpu {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct percpu *);
void percpu_free(struct percpu *p) { free(p); }


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

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

LLVM IR (-O2):
%struct.percpu = type { i32 }
define void @percpu_free(%struct.percpu* nocapture %0) {
%2 = tail call i32 @free(%struct.percpu* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printw(char *);
int cmd_example_test(int argc, char *argv[]) {
  printw("Example test command\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"Example test command\0A\00"
define i32 @cmd_example_test(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printw(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"Example test command\0A\00"
define i32 @cmd_example_test(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printw(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void timeout() { exit(0); }


x86 assembly (clang, -O0):
<timeout>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<timeout>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @timeout() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @timeout() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
char *test_myHash_small(const char **_ja_name) {
  char *word = "";
  do {
    *_ja_name = __func__;
    if (!(myHash(word) == 0))
      return "myHash(\"\") == 0";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<test_myHash_small>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xefe(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
lea    0xece(%rip),%rcx
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1030 <myHash@plt>
cmp    $0x0,%eax
je     1159 <test_myHash_small+0x49>
lea    0xec2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1166 <test_myHash_small+0x56>
jmp    115e <test_myHash_small+0x4e>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_myHash_small>:
push   %rbx
lea    0xee8(%rip),%rax
mov    %rax,(%rdi)
lea    0xeff(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <myHash@plt>
test   %eax,%eax
lea    0xede(%rip),%rax
cmovne %rax,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@__func__.test_myHash_small = [18 x i8] c"test_myHash_small\00"
@.str.1 = [16 x i8] c"myHash(\22\22) == 0\00"
define i8* @test_myHash_small(i8** %0) {
%2 = alloca i8*
%3 = alloca i8**
%4 = alloca i8*
store i8** %0, i8*** %3
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %4
br label %5
5: ; preds = %1
%6 = load i8**, i8*** %3
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.test_myHash_small, i64 0, i64 0), i8** %6
%7 = load i8*, i8** %4
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @myHash to i32 (i8*, ...)*)(i8* %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %5
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %13
11: ; preds = %5
br label %12
12: ; preds = %11
store i8* null, i8** %2
br label %13
13: ; preds = %12, %10
%14 = load i8*, i8** %2
ret i8* %14
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@__func__.test_myHash_small = [18 x i8] c"test_myHash_small\00"
@.str.1 = [16 x i8] c"myHash(\22\22) == 0\00"
define i8* @test_myHash_small(i8** nocapture writeonly %0) {
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.test_myHash_small, i64 0, i64 0), i8** %0
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @myHash to i32 (i8*, ...)*)(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i8* null, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0)
ret i8* %4
}
ortho_(left, right, bottom, top, hither, yon) float *left, *right, *bottom,
    *top, *hither, *yon;
{ ortho(*left, *right, *bottom, *top, *hither, *yon); }


x86 assembly (clang, -O0):
<ortho_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm1
cvtss2sd %xmm1,%xmm1
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm2
cvtss2sd %xmm2,%xmm2
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm3
cvtss2sd %xmm3,%xmm3
mov    -0x30(%rbp),%rax
movss  (%rax),%xmm4
cvtss2sd %xmm4,%xmm4
mov    -0x38(%rbp),%rax
movss  (%rax),%xmm5
cvtss2sd %xmm5,%xmm5
mov    $0x6,%al
call   1030 <ortho@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ortho_>:
movss  (%rdi),%xmm0
cvtss2sd %xmm0,%xmm0
movss  (%rsi),%xmm1
cvtss2sd %xmm1,%xmm1
movss  (%rdx),%xmm2
cvtss2sd %xmm2,%xmm2
movss  (%rcx),%xmm3
cvtss2sd %xmm3,%xmm3
movss  (%r8),%xmm4
cvtss2sd %xmm4,%xmm4
movss  (%r9),%xmm5
cvtss2sd %xmm5,%xmm5
mov    $0x6,%al
jmp    1030 <ortho@plt>

LLVM IR (-O0):
define i32 @ortho_(float* %0, float* %1, float* %2, float* %3, float* %4, float* %5) {
%7 = alloca i32
%8 = alloca float*
%9 = alloca float*
%10 = alloca float*
%11 = alloca float*
%12 = alloca float*
%13 = alloca float*
store float* %0, float** %8
store float* %1, float** %9
store float* %2, float** %10
store float* %3, float** %11
store float* %4, float** %12
store float* %5, float** %13
%14 = load float*, float** %8
%15 = load float, float* %14
%16 = fpext float %15 to double
%17 = load float*, float** %9
%18 = load float, float* %17
%19 = fpext float %18 to double
%20 = load float*, float** %10
%21 = load float, float* %20
%22 = fpext float %21 to double
%23 = load float*, float** %11
%24 = load float, float* %23
%25 = fpext float %24 to double
%26 = load float*, float** %12
%27 = load float, float* %26
%28 = fpext float %27 to double
%29 = load float*, float** %13
%30 = load float, float* %29
%31 = fpext float %30 to double
%32 = call i32 (double, double, double, double, double, double, ...) bitcast (i32 (...)* @ortho to i32 (double, double, double, double, double, double, ...)*)(double %16, double %19, double %22, double %25, double %28, double %31)
%33 = load i32, i32* %7
ret i32 %33
}

LLVM IR (-O2):
define i32 @ortho_(float* nocapture %0, float* nocapture %1, float* nocapture %2, float* nocapture %3, float* nocapture %4, float* nocapture %5) {
%7 = load float, float* %0
%8 = fpext float %7 to double
%9 = load float, float* %1
%10 = fpext float %9 to double
%11 = load float, float* %2
%12 = fpext float %11 to double
%13 = load float, float* %3
%14 = fpext float %13 to double
%15 = load float, float* %4
%16 = fpext float %15 to double
%17 = load float, float* %5
%18 = fpext float %17 to double
%19 = tail call i32 (double, double, double, double, double, double, ...) bitcast (i32 (...)* @ortho to i32 (double, double, double, double, double, double, ...)*)(double %8, double %10, double %12, double %14, double %16, double %18)
ret i32 undef
}