xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
void fast_memset_zero(void *dst, int width) { memset(dst, 0, width); }


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

x86 assembly (clang, -O2):
<fast_memset_zero>:
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @fast_memset_zero(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 @memset(i8* %5, i32 0, i32 %6)
ret void
}

LLVM IR (-O2):
define void @fast_memset_zero(i8* %0, i32 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "usage: eggshell [-a <alignment>] [-b <buffersize>] "
                        "[-e <eggsize>] [-o <offset>]\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [81 x i8] c"usage: eggshell [-a <alignment>] [-b <buffersize>] [-e <eggsize>] [-o <offset>]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [81 x i8] c"usage: eggshell [-a <alignment>] [-b <buffersize>] [-e <eggsize>] [-o <offset>]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0))
ret void
}
void concatena(char *dest, char *orig) {}


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

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

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

LLVM IR (-O2):
define void @concatena(i8* nocapture %0, i8* nocapture %1) {
ret void
}
char cclass(set, c, af)
register char *set;
register int c;
{
  c &= 0177;
  if (set[c >> 3] & 1 << (c & 7))
    return af;
  return !af;
}


x86 assembly (clang, -O0):
<cclass>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
and    $0x7f,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sar    $0x3,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x14(%rbp),%ecx
and    $0x7,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     114d <cclass+0x4d>
mov    -0x18(%rbp),%eax
mov    %al,-0x1(%rbp)
jmp    115e <cclass+0x5e>
cmpl   $0x0,-0x18(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cclass>:
mov    %esi,%eax
shr    $0x3,%eax
and    $0xf,%eax
movzbl (%rdi,%rax,1),%ecx
and    $0x7,%sil
movzbl %sil,%esi
xor    %eax,%eax
test   %edx,%edx
sete   %al
bt     %esi,%ecx
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define signext i8 @cclass(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %6
%9 = and i32 %8, 127
store i32 %9, i32* %6
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = ashr i32 %11, 3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %10, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = load i32, i32* %6
%18 = and i32 %17, 7
%19 = shl i32 1, %18
%20 = and i32 %16, %19
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %3
%23 = load i32, i32* %7
%24 = trunc i32 %23 to i8
store i8 %24, i8* %4
br label %31
25: ; preds = %3
%26 = load i32, i32* %7
%27 = icmp ne i32 %26, 0
%28 = xor i1 %27, true
%29 = zext i1 %28 to i32
%30 = trunc i32 %29 to i8
store i8 %30, i8* %4
br label %31
31: ; preds = %25, %22
%32 = load i8, i8* %4
ret i8 %32
}

LLVM IR (-O2):
define signext i8 @cclass(i8* nocapture %0, i32 %1, i32 %2) {
%4 = lshr i32 %1, 3
%5 = and i32 %4, 15
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = and i32 %1, 7
%11 = shl nuw nsw i32 1, %10
%12 = and i32 %11, %9
%13 = icmp eq i32 %12, 0
%14 = trunc i32 %2 to i8
%15 = icmp eq i32 %2, 0
%16 = zext i1 %15 to i8
%17 = select i1 %13, i8 %16, i8 %14
ret i8 %17
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
int main(int argc, char **argv) {
  putchar(65);
  putchar(105);
  putchar(110);
  putchar(39);
  putchar(116);
  putchar(32);
  putchar(72);
  putchar(101);
  putchar(114);
  putchar(101);
  putchar(10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x41,%edi
call   1030 <putchar@plt>
mov    $0x69,%edi
call   1030 <putchar@plt>
mov    $0x6e,%edi
call   1030 <putchar@plt>
mov    $0x27,%edi
call   1030 <putchar@plt>
mov    $0x74,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x48,%edi
call   1030 <putchar@plt>
mov    $0x65,%edi
call   1030 <putchar@plt>
mov    $0x72,%edi
call   1030 <putchar@plt>
mov    $0x65,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x41,%edi
call   1030 <putchar@plt>
mov    $0x69,%edi
call   1030 <putchar@plt>
mov    $0x6e,%edi
call   1030 <putchar@plt>
mov    $0x27,%edi
call   1030 <putchar@plt>
mov    $0x74,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x48,%edi
call   1030 <putchar@plt>
mov    $0x65,%edi
call   1030 <putchar@plt>
mov    $0x72,%edi
call   1030 <putchar@plt>
mov    $0x65,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @putchar(i32 65)
%7 = call i32 @putchar(i32 105)
%8 = call i32 @putchar(i32 110)
%9 = call i32 @putchar(i32 39)
%10 = call i32 @putchar(i32 116)
%11 = call i32 @putchar(i32 32)
%12 = call i32 @putchar(i32 72)
%13 = call i32 @putchar(i32 101)
%14 = call i32 @putchar(i32 114)
%15 = call i32 @putchar(i32 101)
%16 = call i32 @putchar(i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @putchar(i32 65)
%4 = tail call i32 @putchar(i32 105)
%5 = tail call i32 @putchar(i32 110)
%6 = tail call i32 @putchar(i32 39)
%7 = tail call i32 @putchar(i32 116)
%8 = tail call i32 @putchar(i32 32)
%9 = tail call i32 @putchar(i32 72)
%10 = tail call i32 @putchar(i32 101)
%11 = tail call i32 @putchar(i32 114)
%12 = tail call i32 @putchar(i32 101)
%13 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
char *strchr(char *, char);
void chop_comment(char *line, char comchar) {
  char *comstart;
  comstart = strchr(line, comchar);
  if (comstart != 0)
    *comstart = 0;
}


x86 assembly (clang, -O0):
<chop_comment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1145 <chop_comment+0x35>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chop_comment>:
push   %rax
call   1030 <strchr@plt>
test   %rax,%rax
je     111e <chop_comment+0xe>
movb   $0x0,(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @chop_comment(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 = load i8*, i8** %3
%7 = load i8, i8* %4
%8 = call i8* @strchr(i8* %6, i8 signext %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i8*, i8** %5
store i8 0, i8* %12
br label %13
13: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
define void @chop_comment(i8* %0, i8 signext %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %2
store i8 0, i8* %3
br label %6
6: ; preds = %5, %2
ret void
}
void args_noop_trigger(void *user_data, const char *used,
                       const char *standard) {
  (void)user_data;
  (void)used;
  (void)standard;
}


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

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

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

LLVM IR (-O2):
define void @args_noop_trigger(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ i2c_ClearRXRdy(int);
void i2c1_ClearRXRdy(void) { i2c_ClearRXRdy(1); }


x86 assembly (clang, -O0):
<i2c1_ClearRXRdy>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <i2c_ClearRXRdy@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c1_ClearRXRdy>:
mov    $0x1,%edi
jmp    1030 <i2c_ClearRXRdy@plt>

LLVM IR (-O0):
define void @i2c1_ClearRXRdy() {
%1 = call i32 @i2c_ClearRXRdy(i32 1)
ret void
}

LLVM IR (-O2):
define void @i2c1_ClearRXRdy() {
%1 = tail call i32 @i2c_ClearRXRdy(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print2(int tab[], int N) {
  int *ptr;
  for (ptr = tab; ptr < tab + N; ptr++)
    printf("%d ", *ptr);
}


x86 assembly (clang, -O0):
<print2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
shl    $0x2,%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
jae    1166 <print2+0x56>
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
jmp    1127 <print2+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print2>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1143 <print2+0x33>
mov    %rdi,%rbx
movslq %esi,%rax
lea    (%rdi,%rax,4),%r15
lea    0xed6(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    (%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x4,%rbx
cmp    %r15,%rbx
jb     1130 <print2+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print2(i32* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %12
6: ; preds = %2, %6
%7 = phi i32* [ %10, %6 ], [ %0, %2 ]
%8 = load i32, i32* %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds i32, i32* %7, i64 1
%11 = icmp ult i32* %10, %4
br i1 %11, label %6, label %12
12: ; preds = %6, %2
ret void
}
/* Variables and functions */
int enum_hashbyte(char);
int enum_hashtriplet(char a, char b, char c) {
  return (((enum_hashbyte(c) % 4) * 4096) + (enum_hashbyte(a) * 64) +
          enum_hashbyte(b));
}


x86 assembly (clang, -O0):
<enum_hashtriplet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movsbl -0x3(%rbp),%edi
call   1030 <enum_hashbyte@plt>
mov    $0x4,%ecx
cltd
idiv   %ecx
shl    $0xc,%edx
mov    %edx,-0xc(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <enum_hashbyte@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
shl    $0x6,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
movsbl -0x2(%rbp),%edi
call   1030 <enum_hashbyte@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enum_hashtriplet>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
mov    %edx,%edi
call   1030 <enum_hashbyte@plt>
mov    %eax,%ebx
lea    0x3(%rbx),%eax
test   %ebx,%ebx
cmovns %ebx,%eax
and    $0xffffc,%eax
sub    %eax,%ebx
shl    $0xc,%ebx
mov    %ebp,%edi
call   1030 <enum_hashbyte@plt>
mov    %eax,%ebp
shl    $0x6,%ebp
add    %ebx,%ebp
mov    %r14d,%edi
call   1030 <enum_hashbyte@plt>
add    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @enum_hashtriplet(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i8, i8* %6
%8 = call i32 @enum_hashbyte(i8 signext %7)
%9 = srem i32 %8, 4
%10 = mul nsw i32 %9, 4096
%11 = load i8, i8* %4
%12 = call i32 @enum_hashbyte(i8 signext %11)
%13 = mul nsw i32 %12, 64
%14 = add nsw i32 %10, %13
%15 = load i8, i8* %5
%16 = call i32 @enum_hashbyte(i8 signext %15)
%17 = add nsw i32 %14, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @enum_hashtriplet(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = tail call i32 @enum_hashbyte(i8 signext %2)
%5 = srem i32 %4, 4
%6 = shl nsw i32 %5, 12
%7 = tail call i32 @enum_hashbyte(i8 signext %0)
%8 = shl nsw i32 %7, 6
%9 = add nsw i32 %6, %8
%10 = tail call i32 @enum_hashbyte(i8 signext %1)
%11 = add nsw i32 %9, %10
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ do1sub(float);
dofeed() { do1sub('f'); }


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

x86 assembly (clang, -O2):
<dofeed>:
movss  0xee8(%rip),%xmm0
jmp    1030 <do1sub@plt>

LLVM IR (-O0):
define i32 @dofeed() {
%1 = alloca i32
%2 = call i32 @do1sub(float 1.020000e+02)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @dofeed() {
%1 = tail call i32 @do1sub(float 1.020000e+02)
ret i32 undef
}
/* Variables and functions */
char rx_at(char *rx, size_t rxn, size_t index) {
  return rxn > index ? rx[index] : 0;
}


x86 assembly (clang, -O0):
<rx_at>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    1132 <rx_at+0x32>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x1c(%rbp)
jmp    113c <rx_at+0x3c>
xor    %eax,%eax
mov    %eax,-0x1c(%rbp)
jmp    113c <rx_at+0x3c>
mov    -0x1c(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rx_at>:
cmp    %rdx,%rsi
jbe    1109 <rx_at+0x9>
mov    (%rdi,%rdx,1),%al
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define signext i8 @rx_at(i8* nocapture %0, i64 %1, i64 %2) {
%4 = icmp ugt i64 %1, %2
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = getelementptr inbounds i8, i8* %0, i64 %2
%7 = load i8, i8* %6
br label %8
8: ; preds = %3, %5
%9 = phi i8 [ %7, %5 ], [ 0, %3 ]
ret i8 %9
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int main(int argc, char **buffer) {
  char buf[10];
  memset(buf, 0, 10);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x1a(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <memset@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xe(%rsp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <memset@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [10 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%8 = call i32 @memset(i8* %7, i32 0, i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = call i32 @memset(i8* %4, i32 0, i32 10)
ret i32 0
}
/* Variables and functions */
int getRowCount(char *);
int getDataRowCount() { return getRowCount("SELECT * FROM data"); }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"SELECT * FROM data\00"
define i32 @getDataRowCount() {
%1 = call i32 @getRowCount(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [19 x i8] c"SELECT * FROM data\00"
define i32 @getDataRowCount() {
%1 = tail call i32 @getRowCount(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
void hwrng_init(void) {}


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

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

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

LLVM IR (-O2):
define void @hwrng_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ NOR_SPI_DisableRxInt();
int /*<<< orphan*/ NOR_SPI_DisableTxInt();
void NOR_SPI_DisableInt(void) {
  NOR_SPI_DisableTxInt();
  NOR_SPI_DisableRxInt();
}


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

x86 assembly (clang, -O2):
<NOR_SPI_DisableInt>:
push   %rax
xor    %eax,%eax
call   1040 <NOR_SPI_DisableTxInt@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <NOR_SPI_DisableRxInt@plt>

LLVM IR (-O0):
define void @NOR_SPI_DisableInt() {
%1 = call i32 (...) @NOR_SPI_DisableTxInt()
%2 = call i32 (...) @NOR_SPI_DisableRxInt()
ret void
}

LLVM IR (-O2):
define void @NOR_SPI_DisableInt() {
%1 = tail call i32 (...) @NOR_SPI_DisableTxInt()
%2 = tail call i32 (...) @NOR_SPI_DisableRxInt()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
void alphabet(int letter) {
  putchar(letter);
  alphabet(letter + 1);
}


x86 assembly (clang, -O0):
<alphabet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1040 <alphabet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alphabet>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
jmp    1120 <alphabet+0x10>

LLVM IR (-O0):
define void @alphabet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @putchar(i32 %3)
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
ret void
}

LLVM IR (-O2):
define void @alphabet(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %5, %2 ]
%4 = tail call i32 @putchar(i32 %3)
%5 = add nsw i32 %3, 1
br label %2
}
/* Variables and functions */
double pow(int, double);
double From_dB(double arg, double zero_db_level) {
  return zero_db_level * pow(10, arg / 10.0);
}


x86 assembly (clang, -O0):
<From_dB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xec7(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    $0xa,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<From_dB>:
push   %rax
movsd  %xmm1,(%rsp)
divsd  0xee2(%rip),%xmm0
mov    $0xa,%edi
call   1030 <pow@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @From_dB(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %3
%7 = fdiv double %6, 1.000000e+01
%8 = call double @pow(i32 10, double %7)
%9 = fmul double %5, %8
ret double %9
}

LLVM IR (-O2):
define double @From_dB(double %0, double %1) {
%3 = fdiv double %0, 1.000000e+01
%4 = tail call double @pow(i32 10, double %3)
%5 = fmul double %4, %1
ret double %5
}
int test_imm_89uint16_mem(unsigned short *val) {
  return ((*val) & (0x89 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_89uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0x89,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_89uint16_mem>:
testb  $0x89,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_89uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, 137
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_89uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 137
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void chrreplace(char *string, char search, char ch) {
  char *ptr = string;
  while (*ptr != 0) {
    if (*ptr == search) {
      *ptr = ch;
    } else {
      ptr++;
    }
  }
}


x86 assembly (clang, -O0):
<chrreplace>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115d <chrreplace+0x5d>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    114c <chrreplace+0x4c>
mov    -0xa(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
jmp    1158 <chrreplace+0x58>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111b <chrreplace+0x1b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<chrreplace>:
mov    (%rdi),%al
test   %al,%al
jne    111c <chrreplace+0x1c>
jmp    1129 <chrreplace+0x29>
nopl   0x0(%rax,%rax,1)
movzbl 0x1(%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     1129 <chrreplace+0x29>
cmp    %sil,%al
jne    1110 <chrreplace+0x10>
mov    %dl,(%rdi)
mov    %edx,%eax
test   %al,%al
jne    111c <chrreplace+0x1c>
ret

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

LLVM IR (-O2):
define void @chrreplace(i8* nocapture %0, i8 signext %1, i8 signext %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %18, label %6
6: ; preds = %3, %14
%7 = phi i8 [ %15, %14 ], [ %4, %3 ]
%8 = phi i8* [ %16, %14 ], [ %0, %3 ]
%9 = icmp eq i8 %7, %1
br i1 %9, label %10, label %11
10: ; preds = %6
store i8 %2, i8* %8
br label %14
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
br label %14
14: ; preds = %11, %10
%15 = phi i8 [ %2, %10 ], [ %13, %11 ]
%16 = phi i8* [ %8, %10 ], [ %12, %11 ]
%17 = icmp eq i8 %15, 0
br i1 %17, label %18, label %6
18: ; preds = %14, %3
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double time_start(void) {
  struct timeval time;
  double seconds, microseconds;
  gettimeofday(&time, NULL);
  seconds = (double)time.tv_sec;
  microseconds = (double)time.tv_usec;
  return seconds + microseconds / 1e6;
}


x86 assembly (clang, -O0):
<time_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  0xeb3(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_start>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
divsd  0xeca(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @time_start() {
%1 = alloca %struct.timeval
%2 = alloca double
%3 = alloca double
%4 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
store double %7, double* %2
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
store double %10, double* %3
%11 = load double, double* %2
%12 = load double, double* %3
%13 = fdiv double %12, 1.000000e+06
%14 = fadd double %11, %13
ret double %14
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @time_start() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = fdiv double %9, 1.000000e+06
%11 = fadd double %10, %6
ret double %11
}
/* Variables and functions */
int isblank(char c) { return c == ' ' || c == '\t'; }


x86 assembly (clang, -O0):
<isblank>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     1129 <isblank+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isblank>:
cmp    $0x20,%dil
sete   %al
cmp    $0x9,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isblank(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 9
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isblank(i8 signext %0) {
%2 = icmp eq i8 %0, 32
%3 = icmp eq i8 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
void yyerror(s) const char *s;
{ error("%s", s); }


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

x86 assembly (clang, -O2):
<yyerror>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
xor    %eax,%eax
jmp    1030 <error@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @yyerror(i8* %0) {
%2 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
char tolower(char);
void lower(char *s) {
  while (*s) {
    *s = tolower(*s);
    s++;
  }
}


x86 assembly (clang, -O0):
<lower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <lower+0x3e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <lower+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <lower+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <lower+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @lower(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 %14
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = call signext i8 @tolower(i8 signext %9)
%11 = load i8*, i8** %2
store i8 %10, i8* %11
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %2
br label %3
14: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @lower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @tolower(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ example1();
int /*<<< orphan*/ example10();
int /*<<< orphan*/ example11();
int /*<<< orphan*/ example2();
int /*<<< orphan*/ example3();
int /*<<< orphan*/ example4();
int /*<<< orphan*/ example5();
int /*<<< orphan*/ example6();
int /*<<< orphan*/ example7();
int /*<<< orphan*/ example8();
int /*<<< orphan*/ example9();
int main(void) {
  example1();
  example2();
  example3();
  example4();
  example5();
  example6();
  example7();
  example8();
  example9();
  example10();
  example11();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   10c0 <example1@plt>
mov    $0x0,%al
call   1060 <example2@plt>
mov    $0x0,%al
call   10d0 <example3@plt>
mov    $0x0,%al
call   1040 <example4@plt>
mov    $0x0,%al
call   10a0 <example5@plt>
mov    $0x0,%al
call   1050 <example6@plt>
mov    $0x0,%al
call   10b0 <example7@plt>
mov    $0x0,%al
call   1030 <example8@plt>
mov    $0x0,%al
call   1090 <example9@plt>
mov    $0x0,%al
call   1070 <example10@plt>
mov    $0x0,%al
call   1080 <example11@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   10c0 <example1@plt>
xor    %eax,%eax
call   1060 <example2@plt>
xor    %eax,%eax
call   10d0 <example3@plt>
xor    %eax,%eax
call   1040 <example4@plt>
xor    %eax,%eax
call   10a0 <example5@plt>
xor    %eax,%eax
call   1050 <example6@plt>
xor    %eax,%eax
call   10b0 <example7@plt>
xor    %eax,%eax
call   1030 <example8@plt>
xor    %eax,%eax
call   1090 <example9@plt>
xor    %eax,%eax
call   1070 <example10@plt>
xor    %eax,%eax
call   1080 <example11@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @example1()
%3 = call i32 (...) @example2()
%4 = call i32 (...) @example3()
%5 = call i32 (...) @example4()
%6 = call i32 (...) @example5()
%7 = call i32 (...) @example6()
%8 = call i32 (...) @example7()
%9 = call i32 (...) @example8()
%10 = call i32 (...) @example9()
%11 = call i32 (...) @example10()
%12 = call i32 (...) @example11()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @example1()
%2 = tail call i32 (...) @example2()
%3 = tail call i32 (...) @example3()
%4 = tail call i32 (...) @example4()
%5 = tail call i32 (...) @example5()
%6 = tail call i32 (...) @example6()
%7 = tail call i32 (...) @example7()
%8 = tail call i32 (...) @example8()
%9 = tail call i32 (...) @example9()
%10 = tail call i32 (...) @example10()
%11 = tail call i32 (...) @example11()
ret i32 0
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int64_t upper_power_of_2(int64_t x) {
  x--;
  x |= x >> 1;
  x |= x >> 2;
  x |= x >> 4;
  x |= x >> 8;
  x |= x >> 16;
  x |= x >> 32;
  x++;
  return x;
}


x86 assembly (clang, -O0):
<upper_power_of_2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @upper_power_of_2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, -1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = ashr i32 %5, 1
%7 = load i32, i32* %2
%8 = or i32 %7, %6
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = ashr i32 %9, 2
%11 = load i32, i32* %2
%12 = or i32 %11, %10
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = ashr i32 %13, 4
%15 = load i32, i32* %2
%16 = or i32 %15, %14
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = ashr i32 %17, 8
%19 = load i32, i32* %2
%20 = or i32 %19, %18
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = ashr i32 %21, 16
%23 = load i32, i32* %2
%24 = or i32 %23, %22
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = ashr i32 %25, 32
%27 = load i32, i32* %2
%28 = or i32 %27, %26
store i32 %28, i32* %2
%29 = load i32, i32* %2
%30 = add nsw i32 %29, 1
store i32 %30, i32* %2
%31 = load i32, i32* %2
ret i32 %31
}

LLVM IR (-O2):
define i32 @upper_power_of_2(i32 %0) {
ret i32 poison
}
void print(void *para) {
  int a;
  a = (int *)para;
  printf("%d\n", a);
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @print(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = ptrtoint i32* %5 to i32
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @print(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void callback(char *str) { printf("%s\n", str); }


x86 assembly (clang, -O0):
<callback>:
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):
<callback>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @callback(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 void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @callback(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int do_572() { return 572; }


x86 assembly (clang, -O0):
<do_572>:
push   %rbp
mov    %rsp,%rbp
mov    $0x23c,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_572>:
mov    $0x23c,%eax
ret

LLVM IR (-O0):
define i32 @do_572() {
ret i32 572
}

LLVM IR (-O2):
define i32 @do_572() {
ret i32 572
}
double fbor(double a, double b) { return (int)a | (int)b; }


x86 assembly (clang, -O0):
<fbor>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
cvttsd2si -0x8(%rbp),%eax
cvttsd2si -0x10(%rbp),%ecx
or     %ecx,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fbor>:
cvttsd2si %xmm0,%eax
cvttsd2si %xmm1,%ecx
or     %eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
ret

LLVM IR (-O0):
define double @fbor(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fptosi double %5 to i32
%7 = load double, double* %4
%8 = fptosi double %7 to i32
%9 = or i32 %6, %8
%10 = sitofp i32 %9 to double
ret double %10
}

LLVM IR (-O2):
define double @fbor(double %0, double %1) {
%3 = fptosi double %0 to i32
%4 = fptosi double %1 to i32
%5 = or i32 %4, %3
%6 = sitofp i32 %5 to double
ret double %6
}
/* Variables and functions */
int strcmp(char const *, char const *);
int module_libc_strcmp(const char *s1, const char *s2) {
  return strcmp(s1, s2);
}


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

x86 assembly (clang, -O2):
<module_libc_strcmp>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @module_libc_strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ llround(double);
int /*<<< orphan*/ llroundf(float);
int /*<<< orphan*/ llroundl(long double);
void uninitvar_llround(void) {
  float f;
  (void)llroundf(f);
  double d;
  (void)llround(d);
  long double ld;
  (void)llroundl(ld);
}


x86 assembly (clang, -O0):
<uninitvar_llround>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  -0x4(%rbp),%xmm0
call   1050 <llroundf@plt>
movsd  -0x10(%rbp),%xmm0
call   1030 <llround@plt>
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <llroundl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_llround>:
sub    $0x18,%rsp
call   1050 <llroundf@plt>
call   1030 <llround@plt>
call   1040 <llroundl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @uninitvar_llround() {
%1 = alloca float
%2 = alloca double
%3 = alloca x86_fp80
%4 = load float, float* %1
%5 = call i32 @llroundf(float %4)
%6 = load double, double* %2
%7 = call i32 @llround(double %6)
%8 = load x86_fp80, x86_fp80* %3
%9 = call i32 @llroundl(x86_fp80 %8)
ret void
}

LLVM IR (-O2):
define void @uninitvar_llround() {
%1 = tail call i32 @llroundf(float undef)
%2 = tail call i32 @llround(double undef)
%3 = tail call i32 @llroundl(x86_fp80 undef)
ret void
}
void http_debug(const char *format, ...) {}


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

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

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

LLVM IR (-O2):
define void @http_debug(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void orderly_internal_free(void *ctx, void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<orderly_internal_free>:
mov    %rsi,%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @orderly_internal_free(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
/* Variables and functions */
scalar_t__ snprintf(int /*<<< orphan*/ *, int /*<<< orphan*/, char *, int,
                    char);
int /*<<< orphan*/ sprintf(char *, char *, int, char);
char *xmalloc(scalar_t__);
char *get_fixed_fmt_width(int w, char type) {
  char *fmt = xmalloc(snprintf(NULL, 0, "%%%d%c", w, type) + 1);
  sprintf(fmt, "%%%d%c", w, type);
  return fmt;
}


x86 assembly (clang, -O0):
<get_fixed_fmt_width>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
lea    0xeaf(%rip),%rdx
movsbl -0x5(%rbp),%r8d
call   1030 <snprintf@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1040 <xmalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xe87(%rip),%rsi
movsbl -0x5(%rbp),%ecx
call   1050 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_fixed_fmt_width>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r15d
mov    %edi,%ebp
lea    0xebd(%rip),%r14
xor    %edi,%edi
xor    %esi,%esi
mov    %r14,%rdx
mov    %ebp,%ecx
mov    %r15d,%r8d
call   1030 <snprintf@plt>
lea    0x1(%rax),%rdi
call   1040 <xmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
mov    %r15d,%ecx
call   1050 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%%%d%c\00"
define i8* @get_fixed_fmt_width(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i8*
store i32 %0, i32* %3
store i8 %1, i8* %4
%6 = load i32, i32* %3
%7 = load i8, i8* %4
%8 = call i64 @snprintf(i32* null, i32 0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %6, i8 signext %7)
%9 = add nsw i64 %8, 1
%10 = call i8* @xmalloc(i64 %9)
store i8* %10, i8** %5
%11 = load i8*, i8** %5
%12 = load i32, i32* %3
%13 = load i8, i8* %4
%14 = call i32 @sprintf(i8* %11, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %12, i8 signext %13)
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
@.str = [7 x i8] c"%%%d%c\00"
define i8* @get_fixed_fmt_width(i32 %0, i8 signext %1) {
%3 = tail call i64 @snprintf(i32* null, i32 0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0, i8 signext %1)
%4 = add nsw i64 %3, 1
%5 = tail call i8* @xmalloc(i64 %4)
%6 = tail call i32 @sprintf(i8* dereferenceable(1) %5, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0, i8 signext %1)
ret i8* %5
}
int DefaultValue_int() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @DefaultValue_int() {
ret i32 0
}