xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ is_valid_block_size(size_t);
size_t round_up_to_block_size(const size_t n) {
  size_t ans =
      2 * sizeof(size_t) *
      (n / (2 * sizeof(size_t)) + ((n & (2 * sizeof(size_t) - 1)) > 0));
  if (ans < 2 * sizeof(size_t))
    ans = 2 * sizeof(size_t);
  assert(is_valid_block_size(ans));
  return ans;
}


x86 assembly (clang, -O0):
<round_up_to_block_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x4,%rax
mov    -0x8(%rbp),%rcx
and    $0xf,%rcx
cmp    $0x0,%rcx
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
shl    $0x4,%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x10,-0x10(%rbp)
jae    116a <round_up_to_block_size+0x4a>
movq   $0x10,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <is_valid_block_size@plt>
mov    %eax,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_up_to_block_size>:
push   %rbx
xor    %eax,%eax
test   $0xf,%dil
setne  %al
shl    $0x4,%rax
add    %rdi,%rax
and    $0xfffffffffffffff0,%rax
mov    $0x10,%ebx
cmovne %rax,%rbx
mov    %rbx,%rdi
call   1030 <is_valid_block_size@plt>
mov    %eax,%edi
call   1040 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @round_up_to_block_size(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = udiv i64 %4, 16
%6 = load i64, i64* %2
%7 = and i64 %6, 15
%8 = icmp ugt i64 %7, 0
%9 = zext i1 %8 to i32
%10 = sext i32 %9 to i64
%11 = add i64 %5, %10
%12 = mul i64 16, %11
store i64 %12, i64* %3
%13 = load i64, i64* %3
%14 = icmp ult i64 %13, 16
br i1 %14, label %15, label %16
15: ; preds = %1
store i64 16, i64* %3
br label %16
16: ; preds = %15, %1
%17 = load i64, i64* %3
%18 = call i32 @is_valid_block_size(i64 %17)
%19 = call i32 @assert(i32 %18)
%20 = load i64, i64* %3
ret i64 %20
}

LLVM IR (-O2):
define i64 @round_up_to_block_size(i64 %0) {
%2 = and i64 %0, 15
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i64 0, i64 16
%5 = add i64 %4, %0
%6 = and i64 %5, -16
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i64 16, i64 %6
%9 = tail call i32 @is_valid_block_size(i64 %8)
%10 = tail call i32 @assert(i32 %9)
ret i64 %8
}
unsigned long ERR_get_error(void) { return 0; }


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

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

LLVM IR (-O0):
define i64 @ERR_get_error() {
ret i64 0
}

LLVM IR (-O2):
define i64 @ERR_get_error() {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
scalar_t__ strcmp(char const *, char *);
int process_builtin(int argc, const char **argv) {
  if (strcmp(argv[0], "?") == 0) {
    printf("Type 'help' for help, 'exit' to quit.\n");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<process_builtin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xec3(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1164 <process_builtin+0x44>
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    116b <process_builtin+0x4b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_builtin>:
push   %rax
mov    (%rsi),%rdi
lea    0xed5(%rip),%rsi
call   1040 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     113c <process_builtin+0x1c>
pop    %rcx
ret
lea    0xebf(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"?\00"
@.str.1 = [39 x i8] c"Type 'help' for help, 'exit' to quit.\0A\00"
define i32 @process_builtin(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
br label %14
13: ; preds = %2
store i32 0, i32* %3
br label %14
14: ; preds = %13, %11
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@.str = [2 x i8] c"?\00"
@str = [38 x i8] c"Type 'help' for help, 'exit' to quit.\00"
define i32 @process_builtin(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ 1, %6 ], [ 0, %2 ]
ret i32 %9
}
void av_codec_next() {}


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

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

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

LLVM IR (-O2):
define void @av_codec_next() {
ret void
}
void feed(void) {
  (*((volatile unsigned char *)0xE01FC08C)) = 0xAA;
  (*((volatile unsigned char *)0xE01FC08C)) = 0x55;
}


x86 assembly (clang, -O0):
<feed>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe01fc08c,%eax
movb   $0xaa,(%rax)
mov    $0xe01fc08c,%eax
movb   $0x55,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<feed>:
mov    $0xe01fc08c,%eax
movb   $0xaa,(%rax)
movb   $0x55,(%rax)
ret

LLVM IR (-O0):
define void @feed() {
store volatile i8 -86, i8* inttoptr (i64 3760177292 to i8*)
store volatile i8 85, i8* inttoptr (i64 3760177292 to i8*)
ret void
}

LLVM IR (-O2):
define void @feed() {
store volatile i8 -86, i8* inttoptr (i64 3760177292 to i8*)
store volatile i8 85, i8* inttoptr (i64 3760177292 to i8*)
ret void
}
int test11(int fd, int argc, const char **argv) { return 0; }


x86 assembly (clang, -O0):
<test11>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test11(i32 %0, i32 %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
ret i32 0
}

LLVM IR (-O2):
define i32 @test11(i32 %0, i32 %1, i8** nocapture readnone %2) {
ret i32 0
}
void wifi_evt_hardware_rtc_alarm(const void *nul) {}


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

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

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

LLVM IR (-O2):
define void @wifi_evt_hardware_rtc_alarm(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x33_teardown() {
  char cmd[256];
  sprintf(cmd,
          "iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x33_teardown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x33_teardown>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x33_teardown() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x33_teardown() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M560_f(char *s) {
  debug("M560_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M560_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M560_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M560_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M560_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M560_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M560_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ YM2151Init(int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int sigcatch(void) {
  printf("stop\n");
  YM2151Init(0, 0, 0);
  return 0;
}


x86 assembly (clang, -O0):
<sigcatch>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edx,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1040 <YM2151Init@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigcatch>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <YM2151Init@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [5 x i8] c"stop\00"
define i32 @sigcatch() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @YM2151Init(i32 0, i32 0, i32 0)
ret i32 0
}
main() {
  (struct { int i, j, k; }){.k = 3}.i = 3;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x3,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.anon = type { i32, i32, i32 }
define i32 @main() {
%1 = alloca %struct.anon
%2 = getelementptr inbounds %struct.anon, %struct.anon* %1, i32 0, i32 0
store i32 0, i32* %2
%3 = getelementptr inbounds %struct.anon, %struct.anon* %1, i32 0, i32 1
store i32 0, i32* %3
%4 = getelementptr inbounds %struct.anon, %struct.anon* %1, i32 0, i32 2
store i32 3, i32* %4
%5 = getelementptr inbounds %struct.anon, %struct.anon* %1, i32 0, i32 0
store i32 3, i32* %5
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void personal_sort(unsigned long *vector, unsigned long lenght) {}


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

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

LLVM IR (-O0):
define void @personal_sort(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
ret void
}

LLVM IR (-O2):
define void @personal_sort(i64* nocapture %0, i64 %1) {
ret void
}
/* Type definitions */
struct avl_table {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
void **avl_probe(struct avl_table *, void *);
void(avl_assert_insert)(struct avl_table *table, void *item) {
  void **p = avl_probe(table, item);
  assert(p != NULL && *p == item);
}


x86 assembly (clang, -O0):
<avl_assert_insert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <avl_probe@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x18(%rbp)
mov    %al,-0x19(%rbp)
je     1162 <avl_assert_insert+0x42>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
cmp    -0x10(%rbp),%rax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<avl_assert_insert>:
push   %rbx
mov    %rsi,%rbx
call   1040 <avl_probe@plt>
xor    %edi,%edi
test   %rax,%rax
je     1137 <avl_assert_insert+0x17>
cmp    %rbx,(%rax)
sete   %dil
pop    %rbx
jmp    1030 <assert@plt>

LLVM IR (-O0):
%struct.avl_table = type { i32 }
define void @avl_assert_insert(%struct.avl_table* %0, i8* %1) {
%3 = alloca %struct.avl_table*
%4 = alloca i8*
%5 = alloca i8**
store %struct.avl_table* %0, %struct.avl_table** %3
store i8* %1, i8** %4
%6 = load %struct.avl_table*, %struct.avl_table** %3
%7 = load i8*, i8** %4
%8 = call i8** @avl_probe(%struct.avl_table* %6, i8* %7)
store i8** %8, i8*** %5
%9 = load i8**, i8*** %5
%10 = icmp ne i8** %9, null
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = load i8*, i8** %12
%14 = load i8*, i8** %4
%15 = icmp eq i8* %13, %14
br label %16
16: ; preds = %11, %2
%17 = phi i1 [ false, %2 ], [ %15, %11 ]
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
ret void
}

LLVM IR (-O2):
%struct.avl_table = type { i32 }
define void @avl_assert_insert(%struct.avl_table* %0, i8* %1) {
%3 = tail call i8** @avl_probe(%struct.avl_table* %0, i8* %1)
%4 = icmp eq i8** %3, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, %1
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 0, %2 ], [ %8, %5 ]
%11 = tail call i32 @assert(i32 %10)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ushort;

/* Variables and functions */
scalar_t__ calloc(size_t, int);
int /*<<< orphan*/ nrerror(char *);
ushort *usvector0(long nl, long nh) {
  ushort *v;
  v = (ushort *)calloc((size_t)(nh - nl + 1 + 0), sizeof(ushort));
  if (!v)
    nrerror("allocation failure in usvector0()");
  return v - nl + 0;
}


x86 assembly (clang, -O0):
<usvector0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
sub    -0x8(%rbp),%rdi
add    $0x1,%rdi
add    $0x0,%rdi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1165 <usvector0+0x45>
lea    0xea0(%rip),%rdi
call   1030 <nrerror@plt>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    -0x8(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usvector0>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
sub    %rdi,%rsi
lea    0x1(%rsi),%rdi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114c <usvector0+0x2c>
lea    0xeb9(%rip),%rdi
call   1030 <nrerror@plt>
shl    $0x2,%r14
sub    %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [34 x i8] c"allocation failure in usvector0()\00"
define i32* @usvector0(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = add nsw i64 %8, 1
%10 = add nsw i64 %9, 0
%11 = call i64 @calloc(i64 %10, i32 4)
%12 = inttoptr i64 %11 to i32*
store i32* %12, i32** %5
%13 = load i32*, i32** %5
%14 = icmp ne i32* %13, null
br i1 %14, label %17, label %15
15: ; preds = %2
%16 = call i32 @nrerror(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %15, %2
%18 = load i32*, i32** %5
%19 = load i64, i64* %3
%20 = sub i64 0, %19
%21 = getelementptr inbounds i32, i32* %18, i64 %20
%22 = getelementptr inbounds i32, i32* %21, i64 0
ret i32* %22
}

LLVM IR (-O2):
@.str = [34 x i8] c"allocation failure in usvector0()\00"
define i32* @usvector0(i64 %0, i64 %1) {
%3 = sub i64 1, %0
%4 = add i64 %3, %1
%5 = tail call i64 @calloc(i64 %4, i32 4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @nrerror(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
%10 = sub i64 0, %0
%11 = inttoptr i64 %5 to i32*
%12 = getelementptr inbounds i32, i32* %11, i64 %10
ret i32* %12
}
unsigned short int f70(unsigned short int x, long int y) {
  return (x << y) + (x >> ((-y) & (8 * 2 - 1)));
}


x86 assembly (clang, -O0):
<f70>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
mov    -0x10(%rbp),%rcx
shl    %cl,%eax
movzwl -0x2(%rbp),%edx
xor    %ecx,%ecx
sub    -0x10(%rbp),%rcx
and    $0xf,%rcx
sar    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f70>:
mov    %rsi,%rcx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
and    $0xf,%cl
shr    %cl,%edi
add    %edi,%eax
ret

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

LLVM IR (-O2):
define zeroext i16 @f70(i16 zeroext %0, i64 %1) {
%3 = zext i16 %0 to i32
%4 = trunc i64 %1 to i32
%5 = shl i32 %3, %4
%6 = sub i32 0, %4
%7 = and i32 %6, 15
%8 = lshr i32 %3, %7
%9 = add nsw i32 %8, %5
%10 = trunc i32 %9 to i16
ret i16 %10
}
void RTTestPrintfNl(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTestPrintfNl() {
ret void
}
void lenovo_g505s_ec_init(void) {}


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

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

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

LLVM IR (-O2):
define void @lenovo_g505s_ec_init() {
ret void
}
/* Variables and functions */
char getchar();
void discardStdinEnter(void) {
  while (getchar() != '\n')
    ;
}


x86 assembly (clang, -O0):
<discardStdinEnter>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <discardStdinEnter+0x9>
mov    $0x0,%al
call   1030 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     1131 <discardStdinEnter+0x21>
jmp    1119 <discardStdinEnter+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<discardStdinEnter>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
jne    1120 <discardStdinEnter+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @discardStdinEnter() {
br label %1
1: ; preds = %5, %0
%2 = call signext i8 (...) @getchar()
%3 = sext i8 %2 to i32
%4 = icmp ne i32 %3, 10
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @discardStdinEnter() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getchar()
%3 = icmp eq i8 %2, 10
br i1 %3, label %4, label %1
4: ; preds = %1
ret void
}
/* Variables and functions */
int sr_compare_u64(char *, char *);
__attribute__((hot)) int sr_cmpu64_raw(char *a, int asz __attribute__((unused)),
                                       char *b, int bsz __attribute__((unused)),
                                       void *arg __attribute__((unused))) {
  return sr_compare_u64(a, b);
}


x86 assembly (clang, -O0):
<sr_cmpu64_raw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <sr_compare_u64@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sr_cmpu64_raw>:
mov    %rdx,%rsi
jmp    1030 <sr_compare_u64@plt>
nopl   0x0(%rax,%rax,1)

LLVM IR (-O0):
define i32 @sr_cmpu64_raw(i8* %0, i32 %1, i8* %2, i32 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %8
%13 = call i32 @sr_compare_u64(i8* %11, i8* %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @sr_cmpu64_raw(i8* %0, i32 %1, i8* %2, i32 %3, i8* nocapture readnone %4) {
%6 = tail call i32 @sr_compare_u64(i8* %0, i8* %2)
ret i32 %6
}
char *mcparminfo_double(char *parmname) { return "double"; }


x86 assembly (clang, -O0):
<mcparminfo_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0xef1(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"double\00"
define i8* @mcparminfo_double(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [7 x i8] c"double\00"
define i8* @mcparminfo_double(i8* nocapture readnone %0) {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
void test4_GlobalInterrupts_enable__E() {}


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

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

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

LLVM IR (-O2):
define void @test4_GlobalInterrupts_enable__E() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gmove_cp_3a3t_b();
int /*<<< orphan*/ gmove_cp_3a3t_b_bc();
int /*<<< orphan*/ gmove_cp_3a3t_bc();
int /*<<< orphan*/ gmove_cp_3a3t_c();
int main() {
  gmove_cp_3a3t_b_bc();
  gmove_cp_3a3t_b();
  gmove_cp_3a3t_bc();
  gmove_cp_3a3t_c();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <gmove_cp_3a3t_b_bc@plt>
mov    $0x0,%al
call   1050 <gmove_cp_3a3t_b@plt>
mov    $0x0,%al
call   1060 <gmove_cp_3a3t_bc@plt>
mov    $0x0,%al
call   1040 <gmove_cp_3a3t_c@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <gmove_cp_3a3t_b_bc@plt>
xor    %eax,%eax
call   1050 <gmove_cp_3a3t_b@plt>
xor    %eax,%eax
call   1060 <gmove_cp_3a3t_bc@plt>
xor    %eax,%eax
call   1040 <gmove_cp_3a3t_c@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @gmove_cp_3a3t_b_bc()
%3 = call i32 (...) @gmove_cp_3a3t_b()
%4 = call i32 (...) @gmove_cp_3a3t_bc()
%5 = call i32 (...) @gmove_cp_3a3t_c()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @gmove_cp_3a3t_b_bc()
%2 = tail call i32 (...) @gmove_cp_3a3t_b()
%3 = tail call i32 (...) @gmove_cp_3a3t_bc()
%4 = tail call i32 (...) @gmove_cp_3a3t_c()
ret i32 0
}
/* Variables and functions */
char *strchr(char const *, int);
size_t strlen(char const *);
size_t G_get_num_decimals(const char *str) {
  int sep = '.';
  size_t len;
  char *sep_ptr = strchr(str, sep);
  if (sep_ptr == NULL)
    return 0;
  len = strlen(str);
  return len - (size_t)(sep_ptr - str) - 1;
}


x86 assembly (clang, -O0):
<G_get_num_decimals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x2e,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <strchr@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    115b <G_get_num_decimals+0x3b>
movq   $0x0,-0x8(%rbp)
jmp    1182 <G_get_num_decimals+0x62>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    -0x10(%rbp),%rdx
sub    %rdx,%rcx
sub    %rcx,%rax
sub    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<G_get_num_decimals>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x2e,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     114c <G_get_num_decimals+0x2c>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
not    %rbx
add    %r14,%rbx
add    %rax,%rbx
jmp    114e <G_get_num_decimals+0x2e>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @G_get_num_decimals(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 46)
%3 = icmp eq i8* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%6 = ptrtoint i8* %2 to i64
%7 = ptrtoint i8* %0 to i64
%8 = xor i64 %6, -1
%9 = add i64 %8, %7
%10 = add i64 %9, %5
br label %11
11: ; preds = %1, %4
%12 = phi i64 [ %10, %4 ], [ 0, %1 ]
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  char ent_char;
  float flottant;
  flottant = 1.456789;
  scanf("%f", &flottant);
  printf("%f\n", flottant);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xec9(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
lea    0xec1(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0xc(%rbp),%xmm0
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x3fba7810,0x4(%rsp)
3f
lea    0xed0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
store float 0x3FF74F0200000000, float* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%4 = load float, float* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float %4)
ret i32 0
}
/* Variables and functions */
int doo(int);
int boo(int a, int b) { return doo(a + b); }


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

x86 assembly (clang, -O2):
<boo>:
add    %esi,%edi
jmp    1030 <doo@plt>

LLVM IR (-O0):
define i32 @boo(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 = add nsw i32 %5, %6
%8 = call i32 @doo(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @boo(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = tail call i32 @doo(i32 %3)
ret i32 %4
}
double deg2rad(double x) { return x * 3.14159265358979323846 / 180.0; }


x86 assembly (clang, -O0):
<deg2rad>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xee2(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<deg2rad>:
mulsd  0xef8(%rip),%xmm0
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @deg2rad(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 0x400921FB54442D18
%5 = fdiv double %4, 1.800000e+02
ret double %5
}

LLVM IR (-O2):
define double @deg2rad(double %0) {
%2 = fmul double %0, 0x400921FB54442D18
%3 = fdiv double %2, 1.800000e+02
ret double %3
}
/* Variables and functions */
int event_playback_start();
int cmdline_help(const char *param, void *extra_param) {
  return event_playback_start();
}


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

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

LLVM IR (-O0):
define i32 @cmdline_help(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 (...) @event_playback_start()
ret i32 %5
}

LLVM IR (-O2):
define i32 @cmdline_help(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 (...) @event_playback_start()
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int G20_f(char *s) {
  debug("G20_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<G20_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<G20_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf05(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"G20_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G20_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [46 x i8] c"G20_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G20_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
float cosf(float);
float cbuiltin_cosf(float x) { return cosf(x); }


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

x86 assembly (clang, -O2):
<cbuiltin_cosf>:
jmp    1030 <cosf@plt>

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

LLVM IR (-O2):
define float @cbuiltin_cosf(float %0) {
%2 = tail call float @cosf(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ return_struct_empty();
int /*<<< orphan*/ take_struct_empty(int /*<<< orphan*/);
void test_struct_empty() { take_struct_empty(return_struct_empty()); }


x86 assembly (clang, -O0):
<test_struct_empty>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <return_struct_empty@plt>
mov    %eax,%edi
call   1030 <take_struct_empty@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_struct_empty>:
push   %rax
xor    %eax,%eax
call   1040 <return_struct_empty@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <take_struct_empty@plt>

LLVM IR (-O0):
define void @test_struct_empty() {
%1 = call i32 (...) @return_struct_empty()
%2 = call i32 @take_struct_empty(i32 %1)
ret void
}

LLVM IR (-O2):
define void @test_struct_empty() {
%1 = tail call i32 (...) @return_struct_empty()
%2 = tail call i32 @take_struct_empty(i32 %1)
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ runEDF(int, int, int, int);
int main() {
  runEDF(10, 20, 25, 50);
  runEDF(25, 50, 35, 80);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
mov    $0x14,%esi
mov    $0x19,%edx
mov    $0x32,%ecx
call   1030 <runEDF@plt>
mov    $0x19,%edi
mov    $0x32,%esi
mov    $0x23,%edx
mov    $0x50,%ecx
call   1030 <runEDF@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
mov    $0x14,%esi
mov    $0x19,%edx
mov    $0x32,%ecx
call   1030 <runEDF@plt>
mov    $0x19,%edi
mov    $0x32,%esi
mov    $0x23,%edx
mov    $0x50,%ecx
call   1030 <runEDF@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @runEDF(i32 10, i32 20, i32 25, i32 50)
%3 = call i32 @runEDF(i32 25, i32 50, i32 35, i32 80)
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @runEDF(i32 10, i32 20, i32 25, i32 50)
%2 = tail call i32 @runEDF(i32 25, i32 50, i32 35, i32 80)
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
int lws_tls_server_conn_alpn(struct lws *wsi) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.lws = type opaque
define i32 @lws_tls_server_conn_alpn(%struct.lws* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write_src(char *);
void logand_handler(void) {
  write_src("{\n");
  write_src("imm_t b = POP();\n");
  write_src("imm_t a = POP();\n");
  write_src("PUSH(a&&b);\n");
  write_src("}\n");
}


x86 assembly (clang, -O0):
<logand_handler>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <write_src@plt>
lea    0xedc(%rip),%rdi
call   1030 <write_src@plt>
lea    0xee2(%rip),%rdi
call   1030 <write_src@plt>
lea    0xee8(%rip),%rdi
call   1030 <write_src@plt>
lea    0xee9(%rip),%rdi
call   1030 <write_src@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<logand_handler>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <write_src@plt>
lea    0xedf(%rip),%rdi
call   1030 <write_src@plt>
lea    0xee5(%rip),%rdi
call   1030 <write_src@plt>
lea    0xeeb(%rip),%rdi
call   1030 <write_src@plt>
lea    0xeec(%rip),%rdi
pop    %rax
jmp    1030 <write_src@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"{\0A\00"
@.str.1 = [18 x i8] c"imm_t b = POP();\0A\00"
@.str.2 = [18 x i8] c"imm_t a = POP();\0A\00"
@.str.3 = [13 x i8] c"PUSH(a&&b);\0A\00"
@.str.4 = [3 x i8] c"}\0A\00"
define void @logand_handler() {
%1 = call i32 @write_src(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @write_src(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @write_src(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @write_src(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @write_src(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"{\0A\00"
@.str.1 = [18 x i8] c"imm_t b = POP();\0A\00"
@.str.2 = [18 x i8] c"imm_t a = POP();\0A\00"
@.str.3 = [13 x i8] c"PUSH(a&&b);\0A\00"
@.str.4 = [3 x i8] c"}\0A\00"
define void @logand_handler() {
%1 = tail call i32 @write_src(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @write_src(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @write_src(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @write_src(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @write_src(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
ret void
}
void builtins(int ret, int a) {
  ret += (__builtin_constant_p(a++) + (a++) + (a++));
  ret += (__builtin_constant_p(a++) + (a++));
  ret += ((__builtin_constant_p(a++) && (a++)) || (a++));
  ret += ((__builtin_constant_p(a++) + (a++)) + (a++) + (a++));
  ret += ((__builtin_constant_p(a++) + (a++)) + (a++));
}


x86 assembly (clang, -O0):
<builtins>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
add    $0x0,%eax
mov    -0x8(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x8(%rbp)
add    %ecx,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
add    $0x0,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
add    $0x0,%eax
mov    -0x8(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x8(%rbp)
add    %ecx,%eax
mov    -0x8(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x8(%rbp)
add    %ecx,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
add    $0x0,%eax
mov    -0x8(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x8(%rbp)
add    %ecx,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @builtins(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = add nsw i32 %5, 1
store i32 %6, i32* %4
%7 = add nsw i32 0, %5
%8 = load i32, i32* %4
%9 = add nsw i32 %8, 1
store i32 %9, i32* %4
%10 = add nsw i32 %7, %8
%11 = load i32, i32* %3
%12 = add nsw i32 %11, %10
store i32 %12, i32* %3
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 1
store i32 %14, i32* %4
%15 = add nsw i32 0, %13
%16 = load i32, i32* %3
%17 = add nsw i32 %16, %15
store i32 %17, i32* %3
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
store i32 %19, i32* %4
%20 = icmp ne i32 %18, 0
%21 = zext i1 %20 to i32
%22 = load i32, i32* %3
%23 = add nsw i32 %22, %21
store i32 %23, i32* %3
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
store i32 %25, i32* %4
%26 = add nsw i32 0, %24
%27 = load i32, i32* %4
%28 = add nsw i32 %27, 1
store i32 %28, i32* %4
%29 = add nsw i32 %26, %27
%30 = load i32, i32* %4
%31 = add nsw i32 %30, 1
store i32 %31, i32* %4
%32 = add nsw i32 %29, %30
%33 = load i32, i32* %3
%34 = add nsw i32 %33, %32
store i32 %34, i32* %3
%35 = load i32, i32* %4
%36 = add nsw i32 %35, 1
store i32 %36, i32* %4
%37 = add nsw i32 0, %35
%38 = load i32, i32* %4
%39 = add nsw i32 %38, 1
store i32 %39, i32* %4
%40 = add nsw i32 %37, %38
%41 = load i32, i32* %3
%42 = add nsw i32 %41, %40
store i32 %42, i32* %3
ret void
}

LLVM IR (-O2):
define void @builtins(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ a();
int /*<<< orphan*/ b();
int /*<<< orphan*/ d();
int /*<<< orphan*/ f();
int /*<<< orphan*/ q();
int /*<<< orphan*/ s();
int main() {
  a();
  s();
  d();
  f();
  b();
  b();
  q();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <a@plt>
mov    $0x0,%al
call   1070 <s@plt>
mov    $0x0,%al
call   1030 <d@plt>
mov    $0x0,%al
call   1050 <f@plt>
mov    $0x0,%al
call   1040 <b@plt>
mov    $0x0,%al
call   1040 <b@plt>
mov    $0x0,%al
call   1080 <q@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <a@plt>
xor    %eax,%eax
call   1070 <s@plt>
xor    %eax,%eax
call   1030 <d@plt>
xor    %eax,%eax
call   1050 <f@plt>
xor    %eax,%eax
call   1040 <b@plt>
xor    %eax,%eax
call   1040 <b@plt>
xor    %eax,%eax
call   1080 <q@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @a()
%2 = call i32 (...) @s()
%3 = call i32 (...) @d()
%4 = call i32 (...) @f()
%5 = call i32 (...) @b()
%6 = call i32 (...) @b()
%7 = call i32 (...) @q()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @a()
%2 = tail call i32 (...) @s()
%3 = tail call i32 (...) @d()
%4 = tail call i32 (...) @f()
%5 = tail call i32 (...) @b()
%6 = tail call i32 (...) @b()
%7 = tail call i32 (...) @q()
ret i32 0
}
/* Variables and functions */
char **realloc(char **, int);
void _string_array_push(char ***array, char *text, int size) {
  *array = realloc(*array, sizeof(char *) * (size + 2));
  (*array)[size] = text;
  (*array)[size + 1] = NULL;
}


x86 assembly (clang, -O0):
<_string_array_push>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x14(%rbp),%eax
add    $0x2,%eax
cltq
shl    $0x3,%rax
mov    %eax,%esi
call   1030 <realloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movslq -0x14(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movq   $0x0,(%rax,%rcx,8)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_string_array_push>:
push   %r15
push   %r14
push   %rbx
mov    %edx,%r15d
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%rdi
lea    0x10(,%r15,8),%esi
call   1030 <realloc@plt>
mov    %rax,(%rbx)
movslq %r15d,%rcx
mov    %r14,(%rax,%rcx,8)
mov    (%rbx),%rax
movq   $0x0,0x8(%rax,%rcx,8)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @_string_array_push(i8*** %0, i8* %1, i32 %2) {
%4 = alloca i8***
%5 = alloca i8*
%6 = alloca i32
store i8*** %0, i8**** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8***, i8**** %4
%8 = load i8**, i8*** %7
%9 = load i32, i32* %6
%10 = add nsw i32 %9, 2
%11 = sext i32 %10 to i64
%12 = mul i64 8, %11
%13 = trunc i64 %12 to i32
%14 = call i8** @realloc(i8** %8, i32 %13)
%15 = load i8***, i8**** %4
store i8** %14, i8*** %15
%16 = load i8*, i8** %5
%17 = load i8***, i8**** %4
%18 = load i8**, i8*** %17
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8*, i8** %18, i64 %20
store i8* %16, i8** %21
%22 = load i8***, i8**** %4
%23 = load i8**, i8*** %22
%24 = load i32, i32* %6
%25 = add nsw i32 %24, 1
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8*, i8** %23, i64 %26
store i8* null, i8** %27
ret void
}

LLVM IR (-O2):
define void @_string_array_push(i8*** nocapture %0, i8* %1, i32 %2) {
%4 = load i8**, i8*** %0
%5 = shl i32 %2, 3
%6 = add i32 %5, 16
%7 = tail call i8** @realloc(i8** %4, i32 %6)
store i8** %7, i8*** %0
%8 = sext i32 %2 to i64
%9 = getelementptr inbounds i8*, i8** %7, i64 %8
store i8* %1, i8** %9
%10 = load i8**, i8*** %0
%11 = add nsw i32 %2, 1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8*, i8** %10, i64 %12
store i8* null, i8** %13
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, void *, int);
void memWrite(char **pPt, void *buf, int size) {
  memcpy(*pPt, buf, size);
  *pPt += size;
}


x86 assembly (clang, -O0):
<memWrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
movslq %edx,%rdx
add    %rdx,%rcx
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memWrite>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <memcpy@plt>
movslq %ebp,%rax
add    %rax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @memWrite(i8** %0, i8* %1, i32 %2) {
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i32
store i8** %0, i8*** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8**, i8*** %4
%8 = load i8*, i8** %7
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @memcpy(i8* %8, i8* %9, i32 %10)
%12 = load i32, i32* %6
%13 = load i8**, i8*** %4
%14 = load i8*, i8** %13
%15 = sext i32 %12 to i64
%16 = getelementptr inbounds i8, i8* %14, i64 %15
store i8* %16, i8** %13
ret void
}

LLVM IR (-O2):
define void @memWrite(i8** nocapture %0, i8* %1, i32 %2) {
%4 = load i8*, i8** %0
%5 = tail call i32 @memcpy(i8* %4, i8* %1, i32 %2)
%6 = load i8*, i8** %0
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* %6, i64 %7
store i8* %8, i8** %0
ret void
}
/* Variables and functions */
char *strstr(char *, char *);
int startsWith(char *base, char *str) {
  return (strstr(base, str) - base) == 0;
}


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

x86 assembly (clang, -O2):
<startsWith>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @startsWith(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* @strstr(i8* %5, i8* %6)
%8 = load i8*, i8** %3
%9 = ptrtoint i8* %7 to i64
%10 = ptrtoint i8* %8 to i64
%11 = sub i64 %9, %10
%12 = icmp eq i64 %11, 0
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @startsWith(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = tail call i32 @strncmp(i8* %0, i8* %1, i64 %3)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}