xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
void sleep_enable() {
  printf("%s:%d\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/beerriot/blockgame/refs/heads/master/test/"
         "mock/avr/sleep.c",
         10);
}


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

x86 assembly (clang, -O2):
<sleep_enable>:
lea    0xee9(%rip),%rdi
lea    0xee9(%rip),%rsi
mov    $0xa,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%s:%d\0A\00"
@.str.1 = [149 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/beerriot/blockgame/refs/heads/master/test/mock/avr/sleep.c\00"
define void @sleep_enable() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.1, i64 0, i64 0), i32 10)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s:%d\0A\00"
@.str.1 = [149 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/beerriot/blockgame/refs/heads/master/test/mock/avr/sleep.c\00"
define void @sleep_enable() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.1, i64 0, i64 0), i32 10)
ret void
}
void km_onerr_nil(int err, char *file, int line) {
  (void)(err);
  (void)(file);
  (void)(line);
}


x86 assembly (clang, -O0):
<km_onerr_nil>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @km_onerr_nil(i32 %0, i8* nocapture %1, i32 %2) {
ret void
}
void gtk_icon_view_new_with_model() {}


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

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

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

LLVM IR (-O2):
define void @gtk_icon_view_new_with_model() {
ret void
}
/* Type definitions */
struct task_struct {
  int dummy;
};
struct rq {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ add_nr_running(struct rq *, int);
void enqueue_task_stop(struct rq *rq, struct task_struct *p, int flags) {
  add_nr_running(rq, 1);
}


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

x86 assembly (clang, -O2):
<enqueue_task_stop>:
mov    $0x1,%esi
jmp    1030 <add_nr_running@plt>

LLVM IR (-O0):
%struct.rq = type { i32 }
%struct.task_struct = type { i32 }
define void @enqueue_task_stop(%struct.rq* %0, %struct.task_struct* %1, i32 %2) {
%4 = alloca %struct.rq*
%5 = alloca %struct.task_struct*
%6 = alloca i32
store %struct.rq* %0, %struct.rq** %4
store %struct.task_struct* %1, %struct.task_struct** %5
store i32 %2, i32* %6
%7 = load %struct.rq*, %struct.rq** %4
%8 = call i32 @add_nr_running(%struct.rq* %7, i32 1)
ret void
}

LLVM IR (-O2):
%struct.rq = type { i32 }
%struct.task_struct = type { i32 }
define void @enqueue_task_stop(%struct.rq* %0, %struct.task_struct* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @add_nr_running(%struct.rq* %0, i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ SSL;

/* Variables and functions */
int /*<<< orphan*/ SSL_write(int /*<<< orphan*/ *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ print_error(char *);
int /*<<< orphan*/ strlen(char *);
int send_message(SSL *ns, char *message) {
  if (!SSL_write(ns, message, strlen(message))) {
    print_error("send failed");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<send_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1030 <SSL_write@plt>
cmp    $0x0,%eax
jne    1189 <send_message+0x59>
lea    0xe88(%rip),%rdi
call   1040 <print_error@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1190 <send_message+0x60>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_message>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1050 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <SSL_write@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
jne    1168 <send_message+0x38>
lea    0xea2(%rip),%rdi
call   1040 <print_error@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [12 x i8] c"send failed\00"
define i32 @send_message(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 i32*, i32** %4
%7 = load i8*, i8** %5
%8 = load i8*, i8** %5
%9 = call i32 @strlen(i8* %8)
%10 = call i32 @SSL_write(i32* %6, i8* %7, i32 %9)
%11 = icmp ne i32 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %2
%13 = call i32 @print_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %15
14: ; preds = %2
store i32 0, i32* %3
br label %15
15: ; preds = %14, %12
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@.str = [12 x i8] c"send failed\00"
define i32 @send_message(i32* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @SSL_write(i32* %0, i8* %1, i32 %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @print_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ -1, %6 ], [ 0, %2 ]
ret i32 %9
}
/* Variables and functions */
int syscall(int, char const *, unsigned int);
int missing_memfd_create(const char *name, unsigned int flags) {
  return syscall(319, name, flags);
}


x86 assembly (clang, -O0):
<missing_memfd_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0x13f,%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<missing_memfd_create>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x13f,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @missing_memfd_create(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @syscall(i32 319, i8* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @missing_memfd_create(i8* %0, i32 %1) {
%3 = tail call i32 @syscall(i32 319, i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("this is a eclipse checkin ssl!");
  printf("this is a eclipse checkin ssl!\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"this is a eclipse checkin ssl!\00"
@.str.1 = [32 x i8] c"this is a eclipse checkin ssl!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [31 x i8] c"this is a eclipse checkin ssl!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret i32 0
}
unsigned int ft_ullongbaselen(unsigned long long nbr, int base) {
  unsigned int len;
  len = 1;
  while (nbr > (unsigned long long)((base > 0) ? base : -(base))) {
    nbr /= base;
    len++;
  }
  return (len);
}


x86 assembly (clang, -O0):
<ft_ullongbaselen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    112f <ft_ullongbaselen+0x2f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    1137 <ft_ullongbaselen+0x37>
xor    %eax,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
movslq %ecx,%rcx
cmp    %rcx,%rax
jbe    1169 <ft_ullongbaselen+0x69>
movslq -0xc(%rbp),%rcx
mov    -0x8(%rbp),%rax
xor    %edx,%edx
div    %rcx
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <ft_ullongbaselen+0x12>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_ullongbaselen>:
mov    %esi,%r8d
neg    %r8d
cmovs  %esi,%r8d
mov    $0x1,%ecx
cmp    %rdi,%r8
jae    114f <ft_ullongbaselen+0x4f>
mov    %rdi,%rax
movslq %esi,%rdi
mov    $0x1,%ecx
jmp    113d <ft_ullongbaselen+0x3d>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %edx,%edx
div    %rdi
add    $0x1,%ecx
cmp    %r8,%rax
jbe    114f <ft_ullongbaselen+0x4f>
mov    %rax,%rdx
or     %rdi,%rdx
shr    $0x20,%rdx
jne    1130 <ft_ullongbaselen+0x30>
xor    %edx,%edx
div    %esi
jmp    1135 <ft_ullongbaselen+0x35>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_ullongbaselen(i64 %0, i32 %1) {
%3 = tail call i32 @llvm.abs.i32(i32 %1, i1 true)
%4 = zext i32 %3 to i64
%5 = icmp ult i64 %4, %0
br i1 %5, label %6, label %14
6: ; preds = %2
%7 = sext i32 %1 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i32 [ 1, %6 ], [ %12, %8 ]
%10 = phi i64 [ %0, %6 ], [ %11, %8 ]
%11 = udiv i64 %10, %7
%12 = add i32 %9, 1
%13 = icmp ugt i64 %11, %4
br i1 %13, label %8, label %14
14: ; preds = %8, %2
%15 = phi i32 [ 1, %2 ], [ %12, %8 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ getColor(char *);
int /*<<< orphan*/ printn(char *);
int /*<<< orphan*/ setColor(char);
void printnColor(char *str, char color) {
  char bColor;
  getColor(&bColor);
  setColor(color);
  printn(str);
  setColor(bColor);
}


x86 assembly (clang, -O0):
<printnColor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
lea    -0xa(%rbp),%rdi
call   1040 <getColor@plt>
movsbl -0x9(%rbp),%edi
call   1050 <setColor@plt>
mov    -0x8(%rbp),%rdi
call   1030 <printn@plt>
movsbl -0xa(%rbp),%edi
call   1050 <setColor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printnColor>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
lea    0x7(%rsp),%rdi
call   1040 <getColor@plt>
mov    %ebx,%edi
call   1050 <setColor@plt>
mov    %r14,%rdi
call   1030 <printn@plt>
movsbl 0x7(%rsp),%edi
call   1050 <setColor@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @printnColor(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = call i32 @getColor(i8* %5)
%7 = load i8, i8* %4
%8 = call i32 @setColor(i8 signext %7)
%9 = load i8*, i8** %3
%10 = call i32 @printn(i8* %9)
%11 = load i8, i8* %5
%12 = call i32 @setColor(i8 signext %11)
ret void
}

LLVM IR (-O2):
define void @printnColor(i8* %0, i8 signext %1) {
%3 = alloca i8
%4 = call i32 @getColor(i8* %3)
%5 = call i32 @setColor(i8 signext %1)
%6 = call i32 @printn(i8* %0)
%7 = load i8, i8* %3
%8 = call i32 @setColor(i8 signext %7)
ret void
}
/* Variables and functions */
int printf(char *, char const *);
int puts(const char *str) { return printf("%s\n", str); }


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

x86 assembly (clang, -O2):
<puts>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @puts(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 %2
}
__attribute__((no, noclone)) signed __int128 t102_4add(signed __int128 x) {
  signed __int128 y = (0);
  signed __int128 r;
  if (__builtin_add_overflow(x, y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t102_4add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x40(%rbp),%rsi
mov    -0x38(%rbp),%rax
add    %rsi,%rdx
adc    %rax,%rcx
seto   %al
mov    %rdx,-0x50(%rbp)
mov    %rcx,-0x48(%rbp)
test   $0x1,%al
jne    116e <t102_4add+0x5e>
jmp    1175 <t102_4add+0x65>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x50(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t102_4add>:
mov    %rsi,%rdx
mov    %rdi,%rax
ret

LLVM IR (-O0):
define { i64, i64 } @t102_4add(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = alloca i128
%8 = bitcast i128* %4 to { i64, i64 }*
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 0
store i64 %0, i64* %9
%10 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 1
store i64 %1, i64* %10
%11 = load i128, i128* %4
store i128 %11, i128* %5
store i128 0, i128* %6
%12 = load i128, i128* %5
%13 = load i128, i128* %6
%14 = call { i128, i1 } @llvm.sadd.with.overflow.i128(i128 %12, i128 %13)
%15 = extractvalue { i128, i1 } %14, 1
%16 = extractvalue { i128, i1 } %14, 0
store i128 %16, i128* %7
br i1 %15, label %17, label %19
17: ; preds = %2
%18 = call i32 (...) @bar()
br label %19
19: ; preds = %17, %2
%20 = load i128, i128* %7
store i128 %20, i128* %3
%21 = bitcast i128* %3 to { i64, i64 }*
%22 = load { i64, i64 }, { i64, i64 }* %21
ret { i64, i64 } %22
}

LLVM IR (-O2):
define { i64, i64 } @t102_4add(i64 %0, i64 %1) {
%3 = insertvalue { i64, i64 } poison, i64 %0, 0
%4 = insertvalue { i64, i64 } %3, i64 %1, 1
ret { i64, i64 } %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void error(char msg[]) {
  fprintf(stderr, "Error: %s\n", msg);
  exit(1);
}


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

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"Error: %s\0A\00"
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
void rc_quaternion_conjugate_array(float q[4], float c[4]) {
  c[0] = q[0];
  c[1] = -q[1];
  c[2] = -q[2];
  c[3] = -q[3];
  return;
}


x86 assembly (clang, -O0):
<rc_quaternion_conjugate_array>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movss  0xc(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rc_quaternion_conjugate_array>:
movss  (%rdi),%xmm0
movss  %xmm0,(%rsi)
movss  0x4(%rdi),%xmm0
movaps 0xeec(%rip),%xmm1
xorps  %xmm1,%xmm0
movss  %xmm0,0x4(%rsi)
movss  0x8(%rdi),%xmm0
xorps  %xmm1,%xmm0
movss  %xmm0,0x8(%rsi)
movss  0xc(%rdi),%xmm0
xorps  %xmm1,%xmm0
movss  %xmm0,0xc(%rsi)
ret

LLVM IR (-O0):
define void @rc_quaternion_conjugate_array(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float*, float** %4
%9 = getelementptr inbounds float, float* %8, i64 0
store float %7, float* %9
%10 = load float*, float** %3
%11 = getelementptr inbounds float, float* %10, i64 1
%12 = load float, float* %11
%13 = fneg float %12
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 1
store float %13, float* %15
%16 = load float*, float** %3
%17 = getelementptr inbounds float, float* %16, i64 2
%18 = load float, float* %17
%19 = fneg float %18
%20 = load float*, float** %4
%21 = getelementptr inbounds float, float* %20, i64 2
store float %19, float* %21
%22 = load float*, float** %3
%23 = getelementptr inbounds float, float* %22, i64 3
%24 = load float, float* %23
%25 = fneg float %24
%26 = load float*, float** %4
%27 = getelementptr inbounds float, float* %26, i64 3
store float %25, float* %27
ret void
}

LLVM IR (-O2):
define void @rc_quaternion_conjugate_array(float* nocapture %0, float* nocapture writeonly %1) {
%3 = load float, float* %0
store float %3, float* %1
%4 = getelementptr inbounds float, float* %0, i64 1
%5 = load float, float* %4
%6 = fneg float %5
%7 = getelementptr inbounds float, float* %1, i64 1
store float %6, float* %7
%8 = getelementptr inbounds float, float* %0, i64 2
%9 = load float, float* %8
%10 = fneg float %9
%11 = getelementptr inbounds float, float* %1, i64 2
store float %10, float* %11
%12 = getelementptr inbounds float, float* %0, i64 3
%13 = load float, float* %12
%14 = fneg float %13
%15 = getelementptr inbounds float, float* %1, i64 3
store float %14, float* %15
ret void
}
void gtk_icon_theme_get_for_screen() {}


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

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

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

LLVM IR (-O2):
define void @gtk_icon_theme_get_for_screen() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int /*<<< orphan*/);
int /*<<< orphan*/ waiting_time();
void wait_until_next_schedule(void) { sleep(waiting_time()); }


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

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

LLVM IR (-O0):
define void @wait_until_next_schedule() {
%1 = call i32 (...) @waiting_time()
%2 = call i32 @sleep(i32 %1)
ret void
}

LLVM IR (-O2):
define void @wait_until_next_schedule() {
%1 = tail call i32 (...) @waiting_time()
%2 = tail call i32 @sleep(i32 %1)
ret void
}
int naive_strlen(const char *s) {
  const char *p = s;
  while (*p)
    p++;
  return p - s;
}


x86 assembly (clang, -O0):
<naive_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     112e <naive_strlen+0x2e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <naive_strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<naive_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <naive_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @naive_strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
int __attribute__((cold)) foo() { return 0; }


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

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
ret
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)

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

LLVM IR (-O2):
define i32 @foo() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int main() {
  static struct {
    unsigned int : 1;
    unsigned int s : 1;
  } s = {.s = 1};
  if (s.s != 1)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2f03(%rip),%al
shr    $0x1,%al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x1,%eax
je     113d <main+0x2d>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.anon = type { i8, [3 x i8] }
@main.s = internal global %struct.anon { i8 2, [3 x i8] undef }
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i8, i8* getelementptr inbounds (%struct.anon, %struct.anon* @main.s, i32 0, i32 0)
%3 = lshr i8 %2, 1
%4 = and i8 %3, 1
%5 = zext i8 %4 to i32
%6 = icmp ne i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 (...) @abort()
unreachable
9: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ mpz_t;

/* Variables and functions */
int /*<<< orphan*/ mpz_divmod(int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/, int /*<<< orphan*/);
void gmpint_divmodz(mpz_t *r, mpz_t *q, mpz_t *op, mpz_t *op2) {
  mpz_divmod(*r, *q, *op, *op2);
}


x86 assembly (clang, -O0):
<gmpint_divmodz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
call   1030 <mpz_divmod@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gmpint_divmodz>:
mov    (%rdi),%edi
mov    (%rsi),%esi
mov    (%rdx),%edx
mov    (%rcx),%ecx
jmp    1030 <mpz_divmod@plt>

LLVM IR (-O0):
define void @gmpint_divmodz(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = load i32*, i32** %6
%12 = load i32, i32* %11
%13 = load i32*, i32** %7
%14 = load i32, i32* %13
%15 = load i32*, i32** %8
%16 = load i32, i32* %15
%17 = call i32 @mpz_divmod(i32 %10, i32 %12, i32 %14, i32 %16)
ret void
}

LLVM IR (-O2):
define void @gmpint_divmodz(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2, i32* nocapture %3) {
%5 = load i32, i32* %0
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = tail call i32 @mpz_divmod(i32 %5, i32 %6, i32 %7, i32 %8)
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ ENOENT;
scalar_t__ errno;
int stat(char *, struct stat *);
int exists(char *pathname) {
  struct stat st;
  int z;
  z = stat(pathname, &st);
  if (z == 0)
    return 1;
  if (errno == ENOENT)
    return 0;
  return -1;
}


x86 assembly (clang, -O0):
<exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1142 <exists+0x32>
movl   $0x1,-0x4(%rbp)
jmp    116f <exists+0x5f>
mov    0x2e97(%rip),%rax
mov    (%rax),%rax
mov    0x2e7d(%rip),%rcx
cmp    (%rcx),%rax
jne    1168 <exists+0x58>
movl   $0x0,-0x4(%rbp)
jmp    116f <exists+0x5f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    0x2ec0(%rip),%rcx
mov    (%rcx),%rcx
mov    0x2ea6(%rip),%rdx
xor    %esi,%esi
cmp    (%rdx),%rcx
setne  %sil
neg    %esi
test   %eax,%eax
mov    $0x1,%eax
cmovne %esi,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@errno = global i64 0
@ENOENT = global i64 0
define i32 @exists(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @stat(i8* %6, %struct.stat* %4)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 1, i32* %2
br label %17
11: ; preds = %1
%12 = load i64, i64* @errno
%13 = load i64, i64* @ENOENT
%14 = icmp eq i64 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %11
store i32 0, i32* %2
br label %17
16: ; preds = %11
store i32 -1, i32* %2
br label %17
17: ; preds = %16, %15, %10
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@errno = global i64 0
@ENOENT = global i64 0
define i32 @exists(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
%6 = load i64, i64* @errno
%7 = load i64, i64* @ENOENT
%8 = icmp ne i64 %6, %7
%9 = sext i1 %8 to i32
%10 = select i1 %5, i32 1, i32 %9
ret i32 %10
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int st_other;
};
typedef TYPE_1__ Elf32_Sym;

/* Variables and functions */
int __extract_lsb_from_symtab(Elf32_Sym *symtab) {
  static int lsb = 0;
  if (symtab)
    lsb = symtab->st_other & 4;
  return lsb;
}


x86 assembly (clang, -O0):
<__extract_lsb_from_symtab>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1122 <__extract_lsb_from_symtab+0x22>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0x4,%eax
mov    %eax,0x2f02(%rip)
mov    0x2efc(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__extract_lsb_from_symtab>:
test   %rdi,%rdi
je     1111 <__extract_lsb_from_symtab+0x11>
mov    (%rdi),%eax
and    $0x4,%eax
mov    %eax,0x2f14(%rip)
ret
mov    0x2f0d(%rip),%eax
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
@__extract_lsb_from_symtab.lsb = internal global i32 0
define i32 @__extract_lsb_from_symtab(%struct.TYPE_3__* %0) {
%2 = alloca %struct.TYPE_3__*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %2
%3 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%4 = icmp ne %struct.TYPE_3__* %3, null
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%7 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = and i32 %8, 4
store i32 %9, i32* @__extract_lsb_from_symtab.lsb
br label %10
10: ; preds = %5, %1
%11 = load i32, i32* @__extract_lsb_from_symtab.lsb
ret i32 %11
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
@__extract_lsb_from_symtab.lsb = internal unnamed_addr global i32 0
define i32 @__extract_lsb_from_symtab(%struct.TYPE_3__* %0) {
%2 = icmp eq %struct.TYPE_3__* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = load i32, i32* @__extract_lsb_from_symtab.lsb
br label %9
5: ; preds = %1
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%7 = load i32, i32* %6
%8 = and i32 %7, 4
store i32 %8, i32* @__extract_lsb_from_symtab.lsb
br label %9
9: ; preds = %3, %5
%10 = phi i32 [ %4, %3 ], [ %8, %5 ]
ret i32 %10
}
void __attribute__((weak)) __init_registers(void) {}


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

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

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

LLVM IR (-O2):
define weak void @__init_registers() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void prtBin(int n) {
  unsigned mask = 1u << 31;
  for (; mask; mask >>= 1)
    printf("%d", n & mask ? 1 : 0);
  printf("\n");
}


x86 assembly (clang, -O0):
<prtBin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x80000000,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     115b <prtBin+0x4b>
mov    -0x4(%rbp),%ecx
and    -0x8(%rbp),%ecx
xor    %esi,%esi
mov    $0x1,%eax
cmp    $0x0,%ecx
cmovne %eax,%esi
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <prtBin+0x12>
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prtBin>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edi,%r15d
mov    $0x80000000,%ebx
lea    0xeca(%rip),%r14
mov    $0x80000000,%ebp
nopl   0x0(%rax,%rax,1)
xor    %esi,%esi
test   %r15d,%ebx
setne  %sil
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
shr    %ebp
cmp    $0x1,%ebx
mov    %ebp,%ebx
ja     1140 <prtBin+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @prtBin(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 -2147483648, i32* %3
br label %4
4: ; preds = %15, %1
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %18
7: ; preds = %4
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = and i32 %8, %9
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 1, i32 0
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %7
%16 = load i32, i32* %3
%17 = lshr i32 %16, 1
store i32 %17, i32* %3
br label %4
18: ; preds = %4
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @prtBin(i32 %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ -2147483648, %1 ], [ %8, %2 ]
%4 = and i32 %3, %0
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = lshr i32 %3, 1
%9 = icmp ult i32 %3, 2
br i1 %9, label %10, label %2
10: ; preds = %2
%11 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
struct l_class_OC_std_KD__KD_vector {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/
_ZNSt6vectorIPiSaIS0_EEC2Ev(struct l_class_OC_std_KD__KD_vector *);
void _ZNSt6vectorIPiSaIS0_EEC1Ev(
    struct l_class_OC_std_KD__KD_vector *llvm_cbe_this) {
  struct l_class_OC_std_KD__KD_vector *llvm_cbe_this_2e_addr;
  struct l_class_OC_std_KD__KD_vector *llvm_cbe_this1;
  *(&llvm_cbe_this_2e_addr) = llvm_cbe_this;
  llvm_cbe_this1 = *(&llvm_cbe_this_2e_addr);
  _ZNSt6vectorIPiSaIS0_EEC2Ev(llvm_cbe_this1);
  return;
}


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

x86 assembly (clang, -O2):
<_ZNSt6vectorIPiSaIS0_EEC1Ev>:
jmp    1030 <_ZNSt6vectorIPiSaIS0_EEC2Ev@plt>

LLVM IR (-O0):
%struct.l_class_OC_std_KD__KD_vector = type { i32 }
define void @_ZNSt6vectorIPiSaIS0_EEC1Ev(%struct.l_class_OC_std_KD__KD_vector* %0) {
%2 = alloca %struct.l_class_OC_std_KD__KD_vector*
%3 = alloca %struct.l_class_OC_std_KD__KD_vector*
%4 = alloca %struct.l_class_OC_std_KD__KD_vector*
store %struct.l_class_OC_std_KD__KD_vector* %0, %struct.l_class_OC_std_KD__KD_vector** %2
%5 = load %struct.l_class_OC_std_KD__KD_vector*, %struct.l_class_OC_std_KD__KD_vector** %2
store %struct.l_class_OC_std_KD__KD_vector* %5, %struct.l_class_OC_std_KD__KD_vector** %3
%6 = load %struct.l_class_OC_std_KD__KD_vector*, %struct.l_class_OC_std_KD__KD_vector** %3
store %struct.l_class_OC_std_KD__KD_vector* %6, %struct.l_class_OC_std_KD__KD_vector** %4
%7 = load %struct.l_class_OC_std_KD__KD_vector*, %struct.l_class_OC_std_KD__KD_vector** %4
%8 = call i32 @_ZNSt6vectorIPiSaIS0_EEC2Ev(%struct.l_class_OC_std_KD__KD_vector* %7)
ret void
}

LLVM IR (-O2):
%struct.l_class_OC_std_KD__KD_vector = type { i32 }
define void @_ZNSt6vectorIPiSaIS0_EEC1Ev(%struct.l_class_OC_std_KD__KD_vector* %0) {
%2 = tail call i32 @_ZNSt6vectorIPiSaIS0_EEC2Ev(%struct.l_class_OC_std_KD__KD_vector* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ closelog();
__attribute__((destructor)) void exit_logging() { closelog(); }


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

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

LLVM IR (-O0):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @exit_logging, i8* null }]
define void @exit_logging() {
%1 = call i32 (...) @closelog()
ret void
}

LLVM IR (-O2):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @exit_logging, i8* null }]
define void @exit_logging() {
%1 = tail call i32 (...) @closelog()
ret void
}
__attribute__((always_)) int func3b(int x) { return x < 14 ? 1 : 2; }


x86 assembly (clang, -O0):
<func3b>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x2,%eax
mov    $0x1,%ecx
cmp    $0xe,%edx
cmovl  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func3b>:
xor    %ecx,%ecx
cmp    $0xe,%edi
setl   %cl
mov    $0x2,%eax
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @func3b(i32 %0) {
%2 = icmp slt i32 %0, 14
%3 = select i1 %2, i32 1, i32 2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ InitApp();
int /*<<< orphan*/ Sel_mode_LEDs();
void main(void) {
  InitApp();
  while (1) {
    Sel_mode_LEDs();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <InitApp@plt>
mov    $0x0,%al
call   1040 <Sel_mode_LEDs@plt>
jmp    112b <main+0xb>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <InitApp@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <Sel_mode_LEDs@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @InitApp()
br label %2
2: ; preds = %0, %2
%3 = call i32 (...) @Sel_mode_LEDs()
br label %2
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @InitApp()
br label %2
2: ; preds = %0, %2
%3 = tail call i32 (...) @Sel_mode_LEDs()
br label %2
}
__attribute__((always_)) void _NOP(void) { __asm volatile("NOP"); }


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

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

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

LLVM IR (-O2):
define void @_NOP() {
tail call void asm sideeffect "NOP", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
unsigned int bit_align_down(unsigned int n, unsigned int b) { return n & -b; }


x86 assembly (clang, -O0):
<bit_align_down>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_align_down>:
mov    %esi,%eax
neg    %eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @bit_align_down(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub i32 0, %6
%8 = and i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @bit_align_down(i32 %0, i32 %1) {
%3 = sub i32 0, %1
%4 = and i32 %3, %0
ret i32 %4
}
/* Variables and functions */
long double erf(long double);
long double imprecise_erfl(long double v) { return erf(v); }


x86 assembly (clang, -O0):
<imprecise_erfl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <erf@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprecise_erfl>:
jmp    1030 <erf@plt>

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

LLVM IR (-O2):
define x86_fp80 @imprecise_erfl(x86_fp80 %0) {
%2 = tail call x86_fp80 @erf(x86_fp80 %0)
ret x86_fp80 %2
}
int any_odd_one(unsigned x) {
  unsigned all_odd_one = 0XAAAA;
  return !!(x & all_odd_one);
}


x86 assembly (clang, -O0):
<any_odd_one>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xaaaa,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<any_odd_one>:
xor    %eax,%eax
test   $0xaaaa,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @any_odd_one(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 43690, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = and i32 %4, %5
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @any_odd_one(i32 %0) {
%2 = and i32 %0, 43690
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ draw_sketch_area(int, int, int, int, int);
int /*<<< orphan*/ print_text(int);
int /*<<< orphan*/ render_note(int);
void init_edit_mode(int note) {
  render_note(note);
  print_text(note);
  draw_sketch_area(note, 1, 1, 62, 62);
}


x86 assembly (clang, -O0):
<init_edit_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <render_note@plt>
mov    -0x4(%rbp),%edi
call   1030 <print_text@plt>
mov    -0x4(%rbp),%edi
mov    $0x1,%edx
mov    $0x3e,%r8d
mov    %edx,%esi
mov    %r8d,%ecx
call   1040 <draw_sketch_area@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_edit_mode>:
push   %rbx
mov    %edi,%ebx
call   1050 <render_note@plt>
mov    %ebx,%edi
call   1030 <print_text@plt>
mov    %ebx,%edi
mov    $0x1,%esi
mov    $0x1,%edx
mov    $0x3e,%ecx
mov    $0x3e,%r8d
pop    %rbx
jmp    1040 <draw_sketch_area@plt>

LLVM IR (-O0):
define void @init_edit_mode(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @render_note(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @print_text(i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @draw_sketch_area(i32 %7, i32 1, i32 1, i32 62, i32 62)
ret void
}

LLVM IR (-O2):
define void @init_edit_mode(i32 %0) {
%2 = tail call i32 @render_note(i32 %0)
%3 = tail call i32 @print_text(i32 %0)
%4 = tail call i32 @draw_sketch_area(i32 %0, i32 1, i32 1, i32 62, i32 62)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char **);
int /*<<< orphan*/ ft_strdel(char **);
void ft_delete_array(char **array) {
  int i;
  i = 0;
  while (array[i]) {
    ft_strdel(&(array[i]));
    i++;
  }
  free(array);
  array = NULL;
}


x86 assembly (clang, -O0):
<ft_delete_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1168 <ft_delete_array+0x48>
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
call   1040 <ft_strdel@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <ft_delete_array+0x13>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_delete_array>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
cmpq   $0x0,(%rdi)
je     1143 <ft_delete_array+0x23>
mov    %r14,%rbx
mov    %rbx,%rdi
call   1040 <ft_strdel@plt>
cmpq   $0x0,0x8(%rbx)
lea    0x8(%rbx),%rbx
jne    1130 <ft_delete_array+0x10>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @ft_delete_array(i8** %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8** [ %9, %4 ], [ %0, %1 ]
%7 = tail call i32 @ft_strdel(i8** %6)
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8*, i8** %0, i64 %8
%10 = load i8*, i8** %9
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %4
12: ; preds = %4, %1
%13 = tail call i32 @free(i8** %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exec_rcr(int, int, int);
void test_rcr(void) {
  int i;
  for (i = 0; i < 32; i++)
    exec_rcr(0x21ad3d34, 0x12345678, i);
  for (i = 0; i < 32; i++)
    exec_rcr(0x813f3421, 0x82345678, i);
}


x86 assembly (clang, -O0):
<test_rcr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
jge    1149 <test_rcr+0x39>
mov    -0x4(%rbp),%edx
mov    $0x21ad3d34,%edi
mov    $0x12345678,%esi
call   1030 <exec_rcr@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <test_rcr+0xf>
movl   $0x0,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
jge    117a <test_rcr+0x6a>
mov    -0x4(%rbp),%edx
mov    $0x813f3421,%edi
mov    $0x82345678,%esi
call   1030 <exec_rcr@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <test_rcr+0x40>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_rcr>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x21ad3d34,%edi
mov    $0x12345678,%esi
mov    %ebx,%edx
call   1030 <exec_rcr@plt>
add    $0x1,%ebx
cmp    $0x20,%ebx
jne    1120 <test_rcr+0x10>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    $0x813f3421,%edi
mov    $0x82345678,%esi
mov    %ebx,%edx
call   1030 <exec_rcr@plt>
add    $0x1,%ebx
cmp    $0x20,%ebx
jne    1140 <test_rcr+0x30>
pop    %rbx
ret

LLVM IR (-O0):
define void @test_rcr() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %8, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 32
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @exec_rcr(i32 565001524, i32 305419896, i32 %6)
br label %8
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %2
11: ; preds = %2
store i32 0, i32* %1
br label %12
12: ; preds = %18, %11
%13 = load i32, i32* %1
%14 = icmp slt i32 %13, 32
br i1 %14, label %15, label %21
15: ; preds = %12
%16 = load i32, i32* %1
%17 = call i32 @exec_rcr(i32 -2126564319, i32 -2110499208, i32 %16)
br label %18
18: ; preds = %15
%19 = load i32, i32* %1
%20 = add nsw i32 %19, 1
store i32 %20, i32* %1
br label %12
21: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @test_rcr() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @exec_rcr(i32 565001524, i32 305419896, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 32
br i1 %5, label %6, label %1
6: ; preds = %1, %6
%7 = phi i32 [ %9, %6 ], [ 0, %1 ]
%8 = tail call i32 @exec_rcr(i32 -2126564319, i32 -2110499208, i32 %7)
%9 = add nuw nsw i32 %7, 1
%10 = icmp eq i32 %9, 32
br i1 %10, label %11, label %6
11: ; preds = %6
ret void
}