xunge/DecIR huggingface dataset:
/* Variables and functions */
int ax2om(double *, double *, int);
int ho2ax(double *, double *, int);
int ho2om(double *ho, double *om, int p) {
  double ax[4];
  int trash;
  trash = ho2ax(ho, ax, p);
  trash = ax2om(ax, om, p);
  return 1;
}


x86 assembly (clang, -O0):
<ho2om>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <ho2ax@plt>
mov    %eax,-0x44(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <ax2om@plt>
mov    %eax,-0x44(%rbp)
mov    $0x1,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ho2om>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rsp,%r15
mov    %r15,%rsi
call   1040 <ho2ax@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1030 <ax2om@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @ho2om(double* %0, double* %1, i32 %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i32
%7 = alloca [4 x double]
%8 = alloca i32
store double* %0, double** %4
store double* %1, double** %5
store i32 %2, i32* %6
%9 = load double*, double** %4
%10 = getelementptr inbounds [4 x double], [4 x double]* %7, i64 0, i64 0
%11 = load i32, i32* %6
%12 = call i32 @ho2ax(double* %9, double* %10, i32 %11)
store i32 %12, i32* %8
%13 = getelementptr inbounds [4 x double], [4 x double]* %7, i64 0, i64 0
%14 = load double*, double** %5
%15 = load i32, i32* %6
%16 = call i32 @ax2om(double* %13, double* %14, i32 %15)
store i32 %16, i32* %8
ret i32 1
}

LLVM IR (-O2):
define i32 @ho2om(double* %0, double* %1, i32 %2) {
%4 = alloca [4 x double]
%5 = bitcast [4 x double]* %4 to i8*
%6 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%7 = call i32 @ho2ax(double* %0, double* %6, i32 %2)
%8 = call i32 @ax2om(double* %6, double* %1, i32 %2)
ret i32 1
}
int int_ops_xnor(int l, int r) { return ~(l ^ r); }


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

x86 assembly (clang, -O2):
<int_ops_xnor>:
mov    %edi,%eax
xor    %esi,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @int_ops_xnor(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 = xor i32 %5, %6
%8 = xor i32 %7, -1
ret i32 %8
}

LLVM IR (-O2):
define i32 @int_ops_xnor(i32 %0, i32 %1) {
%3 = xor i32 %0, %1
%4 = xor i32 %3, -1
ret i32 %4
}
char *strend(char *cp) {
  while (*cp)
    cp++;
  return (cp);
}


x86 assembly (clang, -O0):
<strend>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1126 <strend+0x26>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <strend+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @strend(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %2
br label %3
10: ; preds = %3
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
define i8* @strend(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
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ strncat(char *, char const *, int);
void append_char(char *dest, __const char *source, int max_num) {
  strncat(dest, source, max_num);
}


x86 assembly (clang, -O0):
<append_char>:
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    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strncat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<append_char>:
jmp    1030 <strncat@plt>

LLVM IR (-O0):
define void @append_char(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** %5
%9 = load i32, i32* %6
%10 = call i32 @strncat(i8* %7, i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @append_char(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @strncat(i8* %0, i8* %1, i32 %2)
ret void
}
int base64_encode_length(int plainInLength, int charsPerLine) {
  int n = plainInLength;
  int l = (n + 2 - ((n + 2) % 3)) / 3 * 4;
  int result = l;
  if (charsPerLine > 0)
    result += l / charsPerLine;
  return result;
}


x86 assembly (clang, -O0):
<base64_encode_length>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    -0x18(%rbp),%eax
sub    %edx,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
shl    $0x2,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1157 <base64_encode_length+0x57>
mov    -0x10(%rbp),%eax
cltd
idivl  -0x8(%rbp)
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_encode_length>:
add    $0x2,%edi
movslq %edi,%rax
imul   $0x55555556,%rax,%rcx
mov    %rcx,%rax
shr    $0x3f,%rax
shr    $0x20,%rcx
add    %eax,%ecx
shl    $0x2,%ecx
test   %esi,%esi
jle    112a <base64_encode_length+0x2a>
mov    %ecx,%eax
cltd
idiv   %esi
add    %ecx,%eax
mov    %eax,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @base64_encode_length(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 2
%4 = sdiv i32 %3, 3
%5 = shl nsw i32 %4, 2
%6 = icmp sgt i32 %1, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = sdiv i32 %5, %1
%9 = add nsw i32 %8, %5
br label %10
10: ; preds = %7, %2
%11 = phi i32 [ %9, %7 ], [ %5, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, int);
int strlen(char const *);
int getInfo(char *buf, int bufLen) {
  static const char *INFO = "info { name=Farbe }";
  int reqLen = strlen(INFO) + 1;
  if (buf != 0 && reqLen <= bufLen) {
    memcpy(buf, INFO, reqLen);
  }
  return reqLen;
}


x86 assembly (clang, -O0):
<getInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2efa(%rip),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116b <getInfo+0x4b>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     116b <getInfo+0x4b>
mov    -0x8(%rbp),%rdi
mov    0x2ecd(%rip),%rsi
mov    -0x10(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getInfo>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%ebp
test   %rbx,%rbx
je     1154 <getInfo+0x34>
cmp    %r14d,%eax
jge    1154 <getInfo+0x34>
lea    0xeb6(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
call   1040 <memcpy@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@getInfo.INFO = internal global i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i32 0, i32 0)
@.str = [20 x i8] c"info { name=Farbe }\00"
define i32 @getInfo(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** @getInfo.INFO
%7 = call i32 @strlen(i8* %6)
%8 = add nsw i32 %7, 1
store i32 %8, i32* %5
%9 = load i8*, i8** %3
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %20
11: ; preds = %2
%12 = load i32, i32* %5
%13 = load i32, i32* %4
%14 = icmp sle i32 %12, %13
br i1 %14, label %15, label %20
15: ; preds = %11
%16 = load i8*, i8** %3
%17 = load i8*, i8** @getInfo.INFO
%18 = load i32, i32* %5
%19 = call i32 @memcpy(i8* %16, i8* %17, i32 %18)
br label %20
20: ; preds = %15, %11, %2
%21 = load i32, i32* %5
ret i32 %21
}

LLVM IR (-O2):
@.str = [20 x i8] c"info { name=Farbe }\00"
define i32 @getInfo(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = add nsw i32 %3, 1
%5 = icmp ne i8* %0, null
%6 = icmp slt i32 %3, %1
%7 = select i1 %5, i1 %6, i1 false
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @memcpy(i8* %0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %10
10: ; preds = %8, %2
ret i32 %4
}
void foo(int *x) {
foo_label:
  *x = 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movl   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @foo(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
br label %3
3: ; preds = %1
%4 = load i32*, i32** %2
store i32 0, i32* %4
ret void
}

LLVM IR (-O2):
define void @foo(i32* nocapture writeonly %0) {
store i32 0, i32* %0
ret void
}
void goto_loop() {
  int i = 0;
  char a[10];
loop_start:
  if (i >= 10)
    goto loop_end;
  a[i] = 'a';
  i++;
  goto loop_start;
loop_end:
  a[i] = 'a';
}


x86 assembly (clang, -O0):
<goto_loop>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jl     111a <goto_loop+0x1a>
jmp    1131 <goto_loop+0x31>
movslq -0x4(%rbp),%rax
movb   $0x61,-0xe(%rbp,%rax,1)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <goto_loop+0xb>
movslq -0x4(%rbp),%rax
movb   $0x61,-0xe(%rbp,%rax,1)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @goto_loop() {
%1 = alloca i32
%2 = alloca [10 x i8]
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = load i32, i32* %1
%5 = icmp sge i32 %4, 10
br i1 %5, label %6, label %7
6: ; preds = %3
br label %13
7: ; preds = %3
%8 = load i32, i32* %1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 %9
store i8 97, i8* %10
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 1
store i32 %12, i32* %1
br label %3
13: ; preds = %6
%14 = load i32, i32* %1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 %15
store i8 97, i8* %16
ret void
}

LLVM IR (-O2):
define void @goto_loop() {
ret void
}
/* Variables and functions */
unsigned char outb(unsigned char, int);
unsigned char outb_p(unsigned char val, int port) { return (outb(val, port)); }


x86 assembly (clang, -O0):
<outb_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x1(%rbp),%al
mov    -0x8(%rbp),%esi
movzbl %al,%edi
call   1030 <outb@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outb_p>:
jmp    1030 <outb@plt>

LLVM IR (-O0):
define zeroext i8 @outb_p(i8 zeroext %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 zeroext i8 @outb(i8 zeroext %5, i32 %6)
ret i8 %7
}

LLVM IR (-O2):
define zeroext i8 @outb_p(i8 zeroext %0, i32 %1) {
%3 = tail call zeroext i8 @outb(i8 zeroext %0, i32 %1)
ret i8 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
size_t write_FD_BE(int, int /*<<< orphan*/ const *, int);
size_t uint32WriteToFD(int fd, const uint32_t *data) {
  return write_FD_BE(fd, data, sizeof(uint32_t));
}


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

x86 assembly (clang, -O2):
<uint32WriteToFD>:
mov    $0x4,%edx
jmp    1030 <write_FD_BE@plt>

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

LLVM IR (-O2):
define i64 @uint32WriteToFD(i32 %0, i32* %1) {
%3 = tail call i64 @write_FD_BE(i32 %0, i32* %1, i32 4)
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
void __rehash_alter_set(void *cc, void *k, void *v, bool n) {
  *(uint64_t *)v = *(uint64_t *)cc;
}


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

x86 assembly (clang, -O2):
<__rehash_alter_set>:
mov    (%rdi),%eax
mov    %eax,(%rdx)
ret

LLVM IR (-O0):
define void @__rehash_alter_set(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
%12 = load i8*, i8** %7
%13 = bitcast i8* %12 to i32*
store i32 %11, i32* %13
ret void
}

LLVM IR (-O2):
define void @__rehash_alter_set(i8* nocapture %0, i8* nocapture readnone %1, i8* nocapture writeonly %2, i32 %3) {
%5 = bitcast i8* %0 to i32*
%6 = load i32, i32* %5
%7 = bitcast i8* %2 to i32*
store i32 %6, i32* %7
ret void
}
void copy_str(char dst[], char src[]) {
  while (*dst++ = *src++)
    ;
}


x86 assembly (clang, -O0):
<copy_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     113b <copy_str+0x3b>
jmp    110c <copy_str+0xc>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @copy_str(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %12, %2
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %4
%8 = load i8, i8* %6
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %3
store i8 %8, i8* %9
%11 = icmp ne i8 %8, 0
br i1 %11, label %12, label %13
12: ; preds = %5
br label %5
13: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @copy_str(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int strncmp(char const *, char const *, int /*<<< orphan*/);
int strcmp(const char *a, const char *b) { return strncmp(a, b, strlen(a)); }


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strncmp@plt>

LLVM IR (-O0):
define i32 @strcmp(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 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @strncmp(i8* %5, i8* %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strncmp(i8* %0, i8* %1, i32 %3)
ret i32 %4
}
double ffi_test_5(void) { return 1.5; }


x86 assembly (clang, -O0):
<ffi_test_5>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffi_test_5>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @ffi_test_5() {
ret double 1.500000e+00
}

LLVM IR (-O2):
define double @ffi_test_5() {
ret double 1.500000e+00
}
void disable_watch_dog(void) { (*(volatile unsigned long *)0x53000000) = 0; }


x86 assembly (clang, -O0):
<disable_watch_dog>:
push   %rbp
mov    %rsp,%rbp
mov    $0x53000000,%eax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<disable_watch_dog>:
movq   $0x0,0x53000000
ret

LLVM IR (-O0):
define void @disable_watch_dog() {
store volatile i64 0, i64* inttoptr (i64 1392508928 to i64*)
ret void
}

LLVM IR (-O2):
define void @disable_watch_dog() {
store volatile i64 0, i64* inttoptr (i64 1392508928 to i64*)
ret void
}
/* Variables and functions */
float __infer_nondet_float();
float atanf(float x) { return __infer_nondet_float(); }


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

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

LLVM IR (-O0):
define float @atanf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = call float (...) @__infer_nondet_float()
ret float %3
}

LLVM IR (-O2):
define float @atanf(float %0) {
%2 = tail call float (...) @__infer_nondet_float()
ret float %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ EOF;
scalar_t__ putc(char, int /*<<< orphan*/ *);
int /*<<< orphan*/ writeerror();
void myputc(char c, FILE *ostream) {
  if (putc(c, ostream) == EOF) {
    writeerror();
  }
}


x86 assembly (clang, -O0):
<myputc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x1(%rbp),%al
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1030 <putc@plt>
mov    0x2ea0(%rip),%rcx
cmp    (%rcx),%rax
jne    1158 <myputc+0x38>
mov    $0x0,%al
call   1040 <writeerror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myputc>:
push   %rax
call   1030 <putc@plt>
mov    0x2ebb(%rip),%rcx
cmp    (%rcx),%rax
jne    113a <myputc+0x1a>
xor    %eax,%eax
pop    %rcx
jmp    1040 <writeerror@plt>
pop    %rax
ret

LLVM IR (-O0):
@EOF = global i64 0
define void @myputc(i8 signext %0, i32* %1) {
%3 = alloca i8
%4 = alloca i32*
store i8 %0, i8* %3
store i32* %1, i32** %4
%5 = load i8, i8* %3
%6 = load i32*, i32** %4
%7 = call i64 @putc(i8 signext %5, i32* %6)
%8 = load i64, i64* @EOF
%9 = icmp eq i64 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 (...) @writeerror()
br label %12
12: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
@EOF = global i64 0
define void @myputc(i8 signext %0, i32* nocapture %1) {
%3 = tail call i64 @putc(i8 signext %0, i32* %1)
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (...) @writeerror()
br label %8
8: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void hw_set_current_dac(uint16_t i_dac) { (void)i_dac; }


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

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

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

LLVM IR (-O2):
define void @hw_set_current_dac(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fibonacci(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int n;
  printf("Enter the value of n\n");
  scanf("%d", &n);
  printf("The Fibonacci number is %lld\n", fibonacci(n));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
lea    0xeac(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <fibonacci@plt>
lea    0xe95(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Enter the value of n\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [30 x i8] c"The Fibonacci number is %lld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @fibonacci(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [30 x i8] c"The Fibonacci number is %lld\0A\00"
@str = [21 x i8] c"Enter the value of n\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @fibonacci(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t swap_bytes(uint16_t word) {
  return ((word & 0xFF00) >> 8) | ((word & 0x00FF) << 8);
}


x86 assembly (clang, -O0):
<swap_bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_bytes>:
rol    $0x8,%di
movzwl %di,%eax
ret

LLVM IR (-O0):
define i32 @swap_bytes(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65280
%5 = ashr i32 %4, 8
%6 = load i32, i32* %2
%7 = and i32 %6, 255
%8 = shl i32 %7, 8
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @swap_bytes(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
%4 = zext i16 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int x = 10;
  for (int i = 0; i < 100; i++) {
    printf("hello!");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jge    1151 <main+0x41>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x64,%ebp
lea    0xee1(%rip),%rbx
nop
mov    %rbx,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"hello!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %9, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 100
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %4
12: ; preds = %4
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str = [7 x i8] c"hello!\00"
define i32 @main() {
br label %2
1: ; preds = %2
ret i32 0
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %5, %2 ]
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 100
br i1 %6, label %1, label %2
}
int main() {
  unsigned char t = 12;
  signed char r = 1;
  char sum = t << r;
  sum %= r / r + t / t;
  sum *= r >> t;
  sum -= t % r;
  return sum;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movb   $0xc,-0x5(%rbp)
movb   $0x1,-0x6(%rbp)
movzbl -0x5(%rbp),%eax
movsbl -0x6(%rbp),%ecx
shl    %cl,%eax
mov    %al,-0x7(%rbp)
movsbl -0x6(%rbp),%eax
movsbl -0x6(%rbp),%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
movzbl -0x5(%rbp),%eax
movzbl -0x5(%rbp),%esi
cltd
idiv   %esi
add    %eax,%ecx
movsbl -0x7(%rbp),%eax
cltd
idiv   %ecx
mov    %dl,%al
mov    %al,-0x7(%rbp)
movsbl -0x6(%rbp),%eax
movzbl -0x5(%rbp),%ecx
sar    %cl,%eax
mov    %eax,%ecx
movsbl -0x7(%rbp),%eax
imul   %ecx,%eax
mov    %al,-0x7(%rbp)
movzbl -0x5(%rbp),%eax
movsbl -0x6(%rbp),%ecx
cltd
idiv   %ecx
movsbl -0x7(%rbp),%eax
sub    %edx,%eax
mov    %al,-0x7(%rbp)
movsbl -0x7(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
store i32 0, i32* %1
store i8 12, i8* %2
store i8 1, i8* %3
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = load i8, i8* %3
%8 = sext i8 %7 to i32
%9 = shl i32 %6, %8
%10 = trunc i32 %9 to i8
store i8 %10, i8* %4
%11 = load i8, i8* %3
%12 = sext i8 %11 to i32
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = sdiv i32 %12, %14
%16 = load i8, i8* %2
%17 = zext i8 %16 to i32
%18 = load i8, i8* %2
%19 = zext i8 %18 to i32
%20 = sdiv i32 %17, %19
%21 = add nsw i32 %15, %20
%22 = load i8, i8* %4
%23 = sext i8 %22 to i32
%24 = srem i32 %23, %21
%25 = trunc i32 %24 to i8
store i8 %25, i8* %4
%26 = load i8, i8* %3
%27 = sext i8 %26 to i32
%28 = load i8, i8* %2
%29 = zext i8 %28 to i32
%30 = ashr i32 %27, %29
%31 = load i8, i8* %4
%32 = sext i8 %31 to i32
%33 = mul nsw i32 %32, %30
%34 = trunc i32 %33 to i8
store i8 %34, i8* %4
%35 = load i8, i8* %2
%36 = zext i8 %35 to i32
%37 = load i8, i8* %3
%38 = sext i8 %37 to i32
%39 = srem i32 %36, %38
%40 = load i8, i8* %4
%41 = sext i8 %40 to i32
%42 = sub nsw i32 %41, %39
%43 = trunc i32 %42 to i8
store i8 %43, i8* %4
%44 = load i8, i8* %4
%45 = sext i8 %44 to i32
ret i32 %45
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int system(char *);
int main(void) { return system("x128.exe -sounddev dummy"); }


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"x128.exe -sounddev dummy\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @system(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}

LLVM IR (-O2):
@.str = [25 x i8] c"x128.exe -sounddev dummy\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ putc(char, int /*<<< orphan*/ *);
int my_fclose(FILE *the_file) {
  putc('\n', the_file);
  fflush(the_file);
  return fclose(the_file);
}


x86 assembly (clang, -O0):
<my_fclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0xa,%edi
call   1040 <putc@plt>
mov    -0x8(%rbp),%rdi
call   1050 <fflush@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_fclose>:
push   %rbx
mov    %rdi,%rbx
mov    $0xa,%edi
mov    %rbx,%rsi
call   1040 <putc@plt>
mov    %rbx,%rdi
call   1050 <fflush@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>

LLVM IR (-O0):
define i32 @my_fclose(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @putc(i8 signext 10, i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @fflush(i32* %5)
%7 = load i32*, i32** %2
%8 = call i32 @fclose(i32* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @my_fclose(i32* nocapture %0) {
%2 = tail call i32 @putc(i8 signext 10, i32* %0)
%3 = tail call i32 @fflush(i32* %0)
%4 = tail call i32 @fclose(i32* %0)
ret i32 %4
}
int bucket_exists(unsigned long *buckets, int with_value) {
  int i;
  for (i = 2; i < buckets[0] * 2 + 2; i += 2) {
    if (buckets[i + 1] == with_value)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<bucket_exists>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x2,-0x18(%rbp)
movslq -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rcx
shl    $0x1,%rcx
add    $0x2,%rcx
cmp    %rcx,%rax
jae    116b <bucket_exists+0x6b>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x14(%rbp),%rcx
cmp    %rcx,%rax
jne    1158 <bucket_exists+0x58>
movl   $0x1,-0x4(%rbp)
jmp    1172 <bucket_exists+0x72>
jmp    115d <bucket_exists+0x5d>
mov    -0x18(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <bucket_exists+0x12>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bucket_exists>:
mov    (%rdi),%rax
lea    (%rax,%rax,1),%rcx
add    $0x2,%rcx
xor    %eax,%eax
cmp    $0x3,%rcx
jb     1130 <bucket_exists+0x30>
movslq %esi,%rdx
mov    $0x2,%esi
nopl   0x0(%rax,%rax,1)
cmp    %rdx,0x8(%rdi,%rsi,8)
je     1131 <bucket_exists+0x31>
add    $0x2,%rsi
cmp    %rsi,%rcx
ja     1120 <bucket_exists+0x20>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @bucket_exists(i64* nocapture %0, i32 %1) {
%3 = load i64, i64* %0
%4 = shl i64 %3, 1
%5 = add i64 %4, 2
%6 = icmp ugt i64 %5, 2
br i1 %6, label %7, label %18
7: ; preds = %2
%8 = sext i32 %1 to i64
br label %11
9: ; preds = %11
%10 = icmp ugt i64 %5, %17
br i1 %10, label %11, label %18
11: ; preds = %7, %9
%12 = phi i64 [ 2, %7 ], [ %17, %9 ]
%13 = or i64 %12, 1
%14 = getelementptr inbounds i64, i64* %0, i64 %13
%15 = load i64, i64* %14
%16 = icmp eq i64 %15, %8
%17 = add nuw i64 %12, 2
br i1 %16, label %18, label %9
18: ; preds = %11, %9, %2
%19 = phi i32 [ 0, %2 ], [ 0, %9 ], [ 1, %11 ]
ret i32 %19
}
/* Variables and functions */
bool is_valid_url(char value[]) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @is_valid_url(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void test() {
  puts("test.a");
  puts("test.b");
}


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

x86 assembly (clang, -O2):
<test>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee3(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"test.a\00"
@.str.1 = [7 x i8] c"test.b\00"
define void @test() {
%1 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"test.a\00"
@.str.1 = [7 x i8] c"test.b\00"
define void @test() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}
long long int longlongint_ignoring_unsignedshort(long long int x,
                                                 unsigned short y) {
  return x;
}


x86 assembly (clang, -O0):
<longlongint_ignoring_unsignedshort>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @longlongint_ignoring_unsignedshort(i64 %0, i16 zeroext %1) {
%3 = alloca i64
%4 = alloca i16
store i64 %0, i64* %3
store i16 %1, i16* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @longlongint_ignoring_unsignedshort(i64 returned %0, i16 zeroext %1) {
ret i64 %0
}
/* Type definitions */
struct page {
  int dummy;
};

/* Variables and functions */
char *mdup(struct page *, char const *, scalar_t__);
scalar_t__ strlen(char const *);
char *sdup(struct page *page, const char *src) {
  return mdup(page, src, strlen(src) + 1);
}


x86 assembly (clang, -O0):
<sdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1040 <mdup@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdup>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <mdup@plt>

LLVM IR (-O0):
%struct.page = type { i32 }
define i8* @sdup(%struct.page* %0, i8* %1) {
%3 = alloca %struct.page*
%4 = alloca i8*
store %struct.page* %0, %struct.page** %3
store i8* %1, i8** %4
%5 = load %struct.page*, %struct.page** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
%9 = add nsw i64 %8, 1
%10 = call i8* @mdup(%struct.page* %5, i8* %6, i64 %9)
ret i8* %10
}

LLVM IR (-O2):
%struct.page = type { i32 }
define i8* @sdup(%struct.page* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = add nsw i64 %3, 1
%5 = tail call i8* @mdup(%struct.page* %0, i8* %1, i64 %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ qsort(void *, int, int, int (*)(void const *, void const *));
void glulx_sort(void *addr, int count, int size,
                int (*comparefunc)(void *p1, void *p2)) {
  qsort(addr, count, size, (int (*)(const void *, const void *))comparefunc);
}


x86 assembly (clang, -O0):
<glulx_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1030 <qsort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glulx_sort>:
jmp    1030 <qsort@plt>

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

LLVM IR (-O2):
define void @glulx_sort(i8* %0, i32 %1, i32 %2, i32 (i8*, i8*)* nocapture %3) {
%5 = tail call i32 @qsort(i8* %0, i32 %1, i32 %2, i32 (i8*, i8*)* %3)
ret void
}
void gtk_icon_theme_lookup_icon() {}


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

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

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

LLVM IR (-O2):
define void @gtk_icon_theme_lookup_icon() {
ret void
}
int f() {
  int x;
  x = 0;
  return (x);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @f() {
ret i32 0
}
char int_to_leds_m$leds$green_off(void) {
  char result;
  result = leds$leds$green_off();
  return result;
}


x86 assembly (clang, -O0):
<int_to_leds_m$leds$green_off>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <leds$leds$green_off@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_to_leds_m$leds$green_off>:
push   %rax
xor    %eax,%eax
call   1030 <leds$leds$green_off@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @"int_to_leds_m$leds$green_off"() {
%1 = alloca i8
%2 = call i32 (...) @"leds$leds$green_off"()
%3 = trunc i32 %2 to i8
store i8 %3, i8* %1
%4 = load i8, i8* %1
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @"int_to_leds_m$leds$green_off"() {
%1 = tail call i32 (...) @"leds$leds$green_off"()
%2 = trunc i32 %1 to i8
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int citire(int *v, int n) {
  int i;
  printf("Vector=");
  for (i = 0; i < n; i++) {
    scanf("%d", &v[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<citire>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1177 <citire+0x57>
mov    -0x8(%rbp),%rsi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xea4(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1142 <citire+0x22>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<citire>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
test   %ebp,%ebp
jle    1165 <citire+0x45>
mov    %ebp,%ebp
lea    0xec6(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
add    $0x4,%rbx
add    $0xffffffffffffffff,%rbp
jne    1150 <citire+0x30>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"Vector=\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @citire(i32* %0, i32 %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %13
5: ; preds = %2
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %11, %7 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %9)
%11 = add nuw nsw i64 %8, 1
%12 = icmp eq i64 %11, %6
br i1 %12, label %13, label %7
13: ; preds = %7, %2
ret i32 0
}
int conn_close() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @conn_close() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, short);
void myprint(short *buf, int n) {
  int i;
  for (i = 0; i < n; i++) {
    printf("%08x\n", buf[i]);
  }
}


x86 assembly (clang, -O0):
<myprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1158 <myprint+0x48>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
lea    0xebf(%rip),%rdi
movswl (%rax,%rcx,2),%esi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <myprint+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myprint>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1146 <myprint+0x36>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
movswl (%r15,%rbx,2),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <myprint+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%08x\0A\00"
define void @myprint(i16* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i16, i16* %0, i64 %7
%9 = load i16, i16* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i16 signext %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_wifi_display_status_usage(void) {
  printf("\nUsage : wifi_display [STATUS]");
  printf("\nOptions: STATUS :     0 - stop wfd display");
  printf("\n                      1 - start wfd display");
  printf("\n                  empty - get current wfd display status\n");
  return;
}


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

x86 assembly (clang, -O2):
<print_wifi_display_status_usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
lea    0xeeb(%rip),%rdi
call   1040 <printf@plt>
lea    0xf0b(%rip),%rdi
call   1040 <printf@plt>
lea    0xf2c(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"\0AUsage : wifi_display [STATUS]\00"
@.str.1 = [44 x i8] c"\0AOptions: STATUS : 0 - stop wfd display\00"
@.str.2 = [45 x i8] c"\0A 1 - start wfd display\00"
@.str.3 = [59 x i8] c"\0A empty - get current wfd display status\0A\00"
define void @print_wifi_display_status_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"\0AUsage : wifi_display [STATUS]\00"
@.str.1 = [44 x i8] c"\0AOptions: STATUS : 0 - stop wfd display\00"
@.str.2 = [45 x i8] c"\0A 1 - start wfd display\00"
@str = [58 x i8] c"\0A empty - get current wfd display status\00"
define void @print_wifi_display_status_usage() {
%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 @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str, i64 0, i64 0))
ret void
}