xunge/DecIR huggingface dataset:
void netbuf_add_16bitnum(unsigned char *buf, int buflen, int *offset,
                         unsigned short num) {
  unsigned char *start = buf + *offset;
  unsigned char *p = start;
  *p++ = (num >> 8) & 0xff;
  *p++ = (num)&0xff;
  *offset += 2;
}


x86 assembly (clang, -O0):
<netbuf_add_16bitnum>:
push   %rbp
mov    %rsp,%rbp
mov    %cx,%ax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ax,-0x1a(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq (%rcx),%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
movzwl -0x1a(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x30(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x30(%rbp)
mov    %cl,(%rax)
movzwl -0x1a(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x30(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x30(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x2,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<netbuf_add_16bitnum>:
movslq (%rdx),%rax
rol    $0x8,%cx
mov    %cx,(%rdi,%rax,1)
addl   $0x2,(%rdx)
ret

LLVM IR (-O0):
define void @netbuf_add_16bitnum(i8* %0, i32 %1, i32* %2, i16 zeroext %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i16
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i16 %3, i16* %8
%11 = load i8*, i8** %5
%12 = load i32*, i32** %7
%13 = load i32, i32* %12
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %11, i64 %14
store i8* %15, i8** %9
%16 = load i8*, i8** %9
store i8* %16, i8** %10
%17 = load i16, i16* %8
%18 = zext i16 %17 to i32
%19 = ashr i32 %18, 8
%20 = and i32 %19, 255
%21 = trunc i32 %20 to i8
%22 = load i8*, i8** %10
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %10
store i8 %21, i8* %22
%24 = load i16, i16* %8
%25 = zext i16 %24 to i32
%26 = and i32 %25, 255
%27 = trunc i32 %26 to i8
%28 = load i8*, i8** %10
%29 = getelementptr inbounds i8, i8* %28, i32 1
store i8* %29, i8** %10
store i8 %27, i8* %28
%30 = load i32*, i32** %7
%31 = load i32, i32* %30
%32 = add nsw i32 %31, 2
store i32 %32, i32* %30
ret void
}

LLVM IR (-O2):
define void @netbuf_add_16bitnum(i8* nocapture writeonly %0, i32 %1, i32* nocapture %2, i16 zeroext %3) {
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = lshr i16 %3, 8
%9 = trunc i16 %8 to i8
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %9, i8* %7
%11 = trunc i16 %3 to i8
store i8 %11, i8* %10
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 2
store i32 %13, i32* %2
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void Initialize(uint32_t *s) {
  s[0] = 0x6a09e667ul;
  s[1] = 0xbb67ae85ul;
  s[2] = 0x3c6ef372ul;
  s[3] = 0xa54ff53aul;
  s[4] = 0x510e527ful;
  s[5] = 0x9b05688cul;
  s[6] = 0x1f83d9abul;
  s[7] = 0x5be0cd19ul;
}


x86 assembly (clang, -O0):
<Initialize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x6a09e667,(%rax)
mov    -0x8(%rbp),%rax
movl   $0xbb67ae85,0x4(%rax)
mov    -0x8(%rbp),%rax
movl   $0x3c6ef372,0x8(%rax)
mov    -0x8(%rbp),%rax
movl   $0xa54ff53a,0xc(%rax)
mov    -0x8(%rbp),%rax
movl   $0x510e527f,0x10(%rax)
mov    -0x8(%rbp),%rax
movl   $0x9b05688c,0x14(%rax)
mov    -0x8(%rbp),%rax
movl   $0x1f83d9ab,0x18(%rax)
mov    -0x8(%rbp),%rax
movl   $0x5be0cd19,0x1c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Initialize>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
movaps 0xeff(%rip),%xmm0
movups %xmm0,0x10(%rdi)
ret

LLVM IR (-O0):
define void @Initialize(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
store i32 1779033703, i32* %4
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 1
store i32 -1150833019, i32* %6
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 2
store i32 1013904242, i32* %8
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 3
store i32 -1521486534, i32* %10
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 4
store i32 1359893119, i32* %12
%13 = load i32*, i32** %2
%14 = getelementptr inbounds i32, i32* %13, i64 5
store i32 -1694144372, i32* %14
%15 = load i32*, i32** %2
%16 = getelementptr inbounds i32, i32* %15, i64 6
store i32 528734635, i32* %16
%17 = load i32*, i32** %2
%18 = getelementptr inbounds i32, i32* %17, i64 7
store i32 1541459225, i32* %18
ret void
}

LLVM IR (-O2):
define void @Initialize(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> <i32 1779033703, i32 -1150833019, i32 1013904242, i32 -1521486534>, <4 x i32>* %2
%3 = getelementptr inbounds i32, i32* %0, i64 4
%4 = bitcast i32* %3 to <4 x i32>*
store <4 x i32> <i32 1359893119, i32 -1694144372, i32 528734635, i32 1541459225>, <4 x i32>* %4
ret void
}
void InitKeyHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @InitKeyHandler() {
ret void
}
char *FS_getFileName(char *path) {
  char *last;
  last = path;
  while (*path) {
    if (*path == '/') {
      last = path + 1;
    }
    path++;
  }
  return last;
}


x86 assembly (clang, -O0):
<FS_getFileName>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114a <FS_getFileName+0x4a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1139 <FS_getFileName+0x39>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <FS_getFileName+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FS_getFileName>:
mov    %rdi,%rax
lea    0x1(%rdi),%rcx
jmp    1117 <FS_getFileName+0x17>
nopl   0x0(%rax)
mov    %rcx,%rax
add    $0x1,%rcx
movzbl -0x1(%rcx),%edx
cmp    $0x2f,%dl
je     1110 <FS_getFileName+0x10>
test   %dl,%dl
jne    1113 <FS_getFileName+0x13>
ret

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

LLVM IR (-O2):
define i8* @FS_getFileName(i8* %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %10, %8 ]
%4 = phi i8* [ %0, %1 ], [ %9, %8 ]
%5 = load i8, i8* %3
switch i8 %5, label %8 [
i8 0, label %11
i8 47, label %6
]
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %8
8: ; preds = %2, %6
%9 = phi i8* [ %7, %6 ], [ %4, %2 ]
%10 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
11: ; preds = %2
ret i8* %4
}
void halt(void) { asm volatile("hlt\n\t" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @halt() {
tail call void asm sideeffect "hlt\0A\09", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef double M_PI_2;

/* Variables and functions */
double atan(int);
int cos(double);
int sin(double);
double B(double phi) {
  return (atan((2 + 4 * cos(phi)) / (4 * sin(phi))) - ((M_PI_2)-phi));
}


x86 assembly (clang, -O0):
<B>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1050 <cos@plt>
shl    $0x2,%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
shl    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <atan@plt>
movsd  -0x8(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<B>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1050 <cos@plt>
lea    0x2(,%rax,4),%ebx
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
mov    %eax,%ecx
shl    $0x2,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <atan@plt>
addsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @B(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @cos(double %3)
%5 = mul nsw i32 4, %4
%6 = add nsw i32 2, %5
%7 = load double, double* %2
%8 = call i32 @sin(double %7)
%9 = mul nsw i32 4, %8
%10 = sdiv i32 %6, %9
%11 = call double @atan(i32 %10)
%12 = load double, double* %2
%13 = fneg double %12
%14 = fsub double %11, %13
ret double %14
}

LLVM IR (-O2):
define double @B(double %0) {
%2 = tail call i32 @cos(double %0)
%3 = shl nsw i32 %2, 2
%4 = or i32 %3, 2
%5 = tail call i32 @sin(double %0)
%6 = shl nsw i32 %5, 2
%7 = sdiv i32 %4, %6
%8 = tail call double @atan(i32 %7)
%9 = fadd double %8, %0
ret double %9
}
int trace_early_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @trace_early_init() {
ret i32 0
}
void thread_done(void) {}


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

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

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

LLVM IR (-O2):
define void @thread_done() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0xda() {
  Assert_real((isprint(218) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              1095, ("isprint should be 0 for 0xda"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0xda>:
push   %rax
mov    $0xda,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x447,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xda\00"
define void @t_isprint_0xda() {
%1 = tail call i64 @isprint(i32 218)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1095, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ yescrypt_hash_sp(char const *, char *);
void yescrypt_hash(const char *input, char *output) {
  yescrypt_hash_sp(input, output);
}


x86 assembly (clang, -O0):
<yescrypt_hash>:
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 <yescrypt_hash_sp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yescrypt_hash>:
jmp    1030 <yescrypt_hash_sp@plt>

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

LLVM IR (-O2):
define void @yescrypt_hash(i8* %0, i8* %1) {
%3 = tail call i32 @yescrypt_hash_sp(i8* %0, i8* %1)
ret void
}
char *checksum_shortdesc(void) { return "compute checksum on STDIN data"; }


x86 assembly (clang, -O0):
<checksum_shortdesc>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [31 x i8] c"compute checksum on STDIN data\00"
define i8* @checksum_shortdesc() {
ret i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [31 x i8] c"compute checksum on STDIN data\00"
define i8* @checksum_shortdesc() {
ret i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0)
}
int little_endian() {
  int i = 1;
  char *p = (char *)&i;
  if (p[0] == 1)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<little_endian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x1,%eax
jne    112f <little_endian+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    1136 <little_endian+0x36>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @little_endian() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void india() { printf("I am in INDIA.\n"); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"I am in INDIA.\0A\00"
define void @india() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [15 x i8] c"I am in INDIA.\00"
define void @india() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_lines_printf();
int main(int argc, char **argv) {
  printf("Testing lines_printf...\n");
  test_lines_printf();
  printf("All tests completed successfully!\n");
  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)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <test_lines_printf@plt>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [25 x i8] c"Testing lines_printf...\0A\00"
@.str.1 = [35 x i8] c"All tests completed successfully!\0A\00"
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 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @test_lines_printf()
%8 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [24 x i8] c"Testing lines_printf...\00"
@str.2 = [34 x i8] c"All tests completed successfully!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @test_lines_printf()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char *corta_string(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char *s = "Campos Verdes";
  while (*s != ' ') {
    s = corta_string(s);
  }
  printf("%s\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     115c <main+0x3c>
mov    -0x10(%rbp),%rdi
call   1040 <corta_string@plt>
mov    %rax,-0x10(%rbp)
jmp    113a <main+0x1a>
mov    -0x10(%rbp),%rsi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rax
nopl   0x0(%rax,%rax,1)
mov    %rax,%rdi
call   1040 <corta_string@plt>
cmpb   $0x20,(%rax)
jne    1130 <main+0x10>
lea    0xeca(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Campos Verdes\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %2
br label %3
3: ; preds = %8, %0
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 32
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = call i8* @corta_string(i8* %9)
store i8* %10, i8** %2
br label %3
11: ; preds = %3
%12 = load i8*, i8** %2
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Campos Verdes\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i8* [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), %0 ], [ %3, %1 ]
%3 = tail call i8* @corta_string(i8* %2)
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 32
br i1 %5, label %6, label %1
6: ; preds = %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void caml_regexp_exec() { exit(1); }


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

x86 assembly (clang, -O2):
<caml_regexp_exec>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @caml_regexp_exec() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
void u16_pb(char *o, uint16_t i) {
  o[0] = i >> 8;
  o[1] = i & 255;
}


x86 assembly (clang, -O0):
<u16_pb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<u16_pb>:
rol    $0x8,%si
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @u16_pb(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 8
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 %7, i8* %9
%10 = load i32, i32* %4
%11 = and i32 %10, 255
%12 = trunc i32 %11 to i8
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 1
store i8 %12, i8* %14
ret void
}

LLVM IR (-O2):
define void @u16_pb(i8* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = trunc i32 %3 to i8
store i8 %4, i8* %0
%5 = trunc i32 %1 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
ret void
}
/* Variables and functions */
int EOF;
int getch();
int /*<<< orphan*/ printf(char *, char *);
void error(int c, char *s) {
  printf("%s\n", s);
  while (c != EOF && c != '\n')
    c = getch();
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
mov    0x2e9d(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x11(%rbp)
je     1160 <error+0x40>
cmpl   $0xa,-0x4(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1170 <error+0x50>
jmp    117f <error+0x5f>
mov    $0x0,%al
call   1040 <getch@plt>
mov    %eax,-0x4(%rbp)
jmp    113f <error+0x1f>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
cmp    $0xa,%ebp
je     1160 <error+0x40>
mov    0x2eab(%rip),%rbx
cmp    %ebp,(%rbx)
je     1160 <error+0x40>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getch@plt>
cmp    $0xa,%eax
je     1160 <error+0x40>
cmp    (%rbx),%eax
jne    1150 <error+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@EOF = global i32 0
define void @error(i32 %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = load i32, i32* @EOF
%5 = icmp ne i32 %4, %0
%6 = icmp ne i32 %0, 10
%7 = and i1 %6, %5
br i1 %7, label %8, label %14
8: ; preds = %2, %8
%9 = tail call i32 (...) @getch()
%10 = load i32, i32* @EOF
%11 = icmp ne i32 %9, %10
%12 = icmp ne i32 %9, 10
%13 = and i1 %12, %11
br i1 %13, label %8, label %14
14: ; preds = %8, %2
ret void
}
int next_highest_power(int v) {
  v--;
  v |= v >> 1;
  v |= v >> 2;
  v |= v >> 4;
  v |= v >> 8;
  v |= v >> 16;
  v++;
  return v;
}


x86 assembly (clang, -O0):
<next_highest_power>:
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
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_highest_power>:
lea    -0x1(%rdi),%eax
mov    %eax,%ecx
sar    %ecx
or     %eax,%ecx
mov    %ecx,%eax
sar    $0x2,%eax
or     %ecx,%eax
mov    %eax,%ecx
sar    $0x4,%ecx
or     %eax,%ecx
mov    %ecx,%edx
sar    $0x8,%edx
or     %ecx,%edx
mov    %edx,%eax
sar    $0x10,%eax
or     %edx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @next_highest_power(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 = add nsw i32 %25, 1
store i32 %26, i32* %2
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @next_highest_power(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = ashr i32 %2, 1
%4 = or i32 %3, %2
%5 = ashr i32 %4, 2
%6 = or i32 %5, %4
%7 = ashr i32 %6, 4
%8 = or i32 %7, %6
%9 = ashr i32 %8, 8
%10 = or i32 %9, %8
%11 = ashr i32 %10, 16
%12 = or i32 %11, %10
%13 = add nsw i32 %12, 1
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int usage(char *progname) {
  printf("Usage:\n");
  printf("%s\n", progname);
  printf("\t-h\tDisplays this message\n");
  printf("\t-i\tinterface to use\t(example: wlan0)\n");
  printf("\t-c\tchannel to use\n");
  return (0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"Usage:\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [27 x i8] c"\09-h\09Displays this message\0A\00"
@.str.3 = [39 x i8] c"\09-i\09interface to use\09(example: wlan0)\0A\00"
@.str.4 = [20 x i8] c"\09-c\09channel to use\0A\00"
define i32 @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [7 x i8] c"Usage:\00"
@str.5 = [26 x i8] c"\09-h\09Displays this message\00"
@str.6 = [38 x i8] c"\09-i\09interface to use\09(example: wlan0)\00"
@str.7 = [19 x i8] c"\09-c\09channel to use\00"
define i32 @usage(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.5, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.6, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.7, i64 0, i64 0))
ret i32 0
}
void synced_cb(void *app_ctx __attribute__((unused))) {}


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

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

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

LLVM IR (-O2):
define void @synced_cb(i8* nocapture %0) {
ret void
}
unsigned int premul_noextents(unsigned int val, unsigned char alpha) {
  return ((((val & 0x00FF00FF) * alpha) >> 8) & 0x00FF00FF) |
         ((((val & 0xFF00FF00) >> 8) * alpha) & 0xFF00FF00);
}


x86 assembly (clang, -O0):
<premul_noextents>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00ff,%eax
movzbl -0x5(%rbp),%ecx
imul   %ecx,%eax
shr    $0x8,%eax
and    $0xff00ff,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00ff00,%ecx
shr    $0x8,%ecx
movzbl -0x5(%rbp),%edx
imul   %edx,%ecx
and    $0xff00ff00,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<premul_noextents>:
mov    %edi,%eax
and    $0xff00ff,%eax
imul   %esi,%eax
shr    $0x8,%eax
and    $0xff00ff,%eax
shr    $0x8,%edi
and    $0xff00ff,%edi
imul   %esi,%edi
and    $0xff00ff00,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @premul_noextents(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = load i32, i32* %3
%6 = and i32 %5, 16711935
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = mul i32 %6, %8
%10 = lshr i32 %9, 8
%11 = and i32 %10, 16711935
%12 = load i32, i32* %3
%13 = and i32 %12, -16711936
%14 = lshr i32 %13, 8
%15 = load i8, i8* %4
%16 = zext i8 %15 to i32
%17 = mul i32 %14, %16
%18 = and i32 %17, -16711936
%19 = or i32 %11, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @premul_noextents(i32 %0, i8 zeroext %1) {
%3 = and i32 %0, 16711935
%4 = zext i8 %1 to i32
%5 = mul nuw i32 %3, %4
%6 = lshr i32 %5, 8
%7 = and i32 %6, 16711935
%8 = lshr i32 %0, 8
%9 = and i32 %8, 16711935
%10 = mul nuw i32 %9, %4
%11 = and i32 %10, -16711936
%12 = or i32 %7, %11
ret i32 %12
}
char *kth_word_in_mth_sentence_of_nth_paragraph(char ****document, int k, int m,
                                                int n) {
  return document[n - 1][m - 1][k - 1];
}


x86 assembly (clang, -O0):
<kth_word_in_mth_sentence_of_nth_paragraph>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kth_word_in_mth_sentence_of_nth_paragraph>:
movslq %ecx,%rax
mov    -0x8(%rdi,%rax,8),%rax
movslq %edx,%rcx
mov    -0x8(%rax,%rcx,8),%rax
movslq %esi,%rcx
mov    -0x8(%rax,%rcx,8),%rax
ret

LLVM IR (-O0):
define i8* @kth_word_in_mth_sentence_of_nth_paragraph(i8**** %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8****
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8**** %0, i8***** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8****, i8***** %5
%10 = load i32, i32* %8
%11 = sub nsw i32 %10, 1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8***, i8**** %9, i64 %12
%14 = load i8***, i8**** %13
%15 = load i32, i32* %7
%16 = sub nsw i32 %15, 1
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8**, i8*** %14, i64 %17
%19 = load i8**, i8*** %18
%20 = load i32, i32* %6
%21 = sub nsw i32 %20, 1
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8*, i8** %19, i64 %22
%24 = load i8*, i8** %23
ret i8* %24
}

LLVM IR (-O2):
define i8* @kth_word_in_mth_sentence_of_nth_paragraph(i8**** nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %3, -1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8***, i8**** %0, i64 %6
%8 = load i8***, i8**** %7
%9 = add nsw i32 %2, -1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8**, i8*** %8, i64 %10
%12 = load i8**, i8*** %11
%13 = add nsw i32 %1, -1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %12, i64 %14
%16 = load i8*, i8** %15
ret i8* %16
}
int fibbonaci(int n) {
  if (n < 3) {
    return 1;
  }
  int a = n + 2;
  return fibbonaci(n - 2) + fibbonaci(n - 1);
}


x86 assembly (clang, -O0):
<fibbonaci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1131 <fibbonaci+0x21>
movl   $0x1,-0x4(%rbp)
jmp    115d <fibbonaci+0x4d>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibbonaci@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibbonaci@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibbonaci>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
cmp    $0x3,%edi
jl     1145 <fibbonaci+0x35>
mov    %edi,%ebx
add    $0x1,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    -0x3(%rbx),%edi
call   1030 <fibbonaci@plt>
add    %eax,%ebp
add    $0xffffffff,%ebx
cmp    $0x3,%ebx
ja     1130 <fibbonaci+0x20>
add    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fibbonaci(i32 %0) {
%2 = icmp slt i32 %0, 3
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -2
%7 = tail call i32 @fibbonaci(i32 %6)
%8 = add nsw i32 %4, -1
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 4
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = add i32 %9, 1
br label %13
13: ; preds = %11, %1
%14 = phi i32 [ 1, %1 ], [ %12, %11 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ serror(char *);
badoperand() { serror("bad operands"); }


x86 assembly (clang, -O0):
<badoperand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <serror@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"bad operands\00"
define i32 @badoperand() {
%1 = alloca i32
%2 = call i32 @serror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [13 x i8] c"bad operands\00"
define i32 @badoperand() {
%1 = tail call i32 @serror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
float roundavgpts(int players, int (*pointsys)(int, int)) {
  int i, total = 0;
  for (i = players; --i; total += i * pointsys(players, i))
    ;
  return total / (float)players;
}


x86 assembly (clang, -O0):
<roundavgpts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1158 <roundavgpts+0x58>
jmp    1133 <roundavgpts+0x33>
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
call   *%rax
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
imul   %ecx,%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    111c <roundavgpts+0x1c>
cvtsi2ssl -0x18(%rbp),%xmm0
cvtsi2ssl -0x4(%rbp),%xmm1
divss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundavgpts>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edi,%r14d
mov    %edi,%ebp
add    $0xffffffff,%ebp
je     1138 <roundavgpts+0x38>
mov    %rsi,%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %r14d,%edi
mov    %ebp,%esi
call   *%r15
imul   %ebp,%eax
add    %eax,%ebx
add    $0xffffffff,%ebp
jne    1120 <roundavgpts+0x20>
cvtsi2ss %ebx,%xmm0
jmp    113b <roundavgpts+0x3b>
xorps  %xmm0,%xmm0
cvtsi2ss %r14d,%xmm1
divss  %xmm1,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define float @roundavgpts(i32 %0, i32 (i32, i32)* nocapture %1) {
%3 = add nsw i32 %0, -1
%4 = icmp eq i32 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %11, %5 ], [ %3, %2 ]
%7 = phi i32 [ %10, %5 ], [ 0, %2 ]
%8 = tail call i32 %1(i32 %0, i32 %6)
%9 = mul nsw i32 %8, %6
%10 = add nsw i32 %9, %7
%11 = add nsw i32 %6, -1
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = sitofp i32 %10 to float
br label %15
15: ; preds = %13, %2
%16 = phi float [ 0.000000e+00, %2 ], [ %14, %13 ]
%17 = sitofp i32 %0 to float
%18 = fdiv float %16, %17
ret float %18
}
__attribute__((always_)) void writeb(unsigned char val, volatile void *addr) {
  asm volatile("mov"
               "b"
               " %0,%1"
               :
               : "q"(val), "m"(*(volatile unsigned char *)addr)
               : "memory");
}


x86 assembly (clang, -O0):
<writeb>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x1(%rbp),%al
mov    -0x10(%rbp),%rcx
mov    %al,(%rcx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeb>:
mov    %dil,(%rsi)
ret

LLVM IR (-O0):
define void @writeb(i8 zeroext %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
ret void
}

LLVM IR (-O2):
define void @writeb(i8 zeroext %0, i8* %1) {
tail call void asm sideeffect "movb $0,$1", "q,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i8 %0, i8* elementtype(i8) %1)
ret void
}
/* Variables and functions */
void stub1(long long, int);
void testClosureLLIrV(void (*closure)(long long, int), long long a1, int a2) {
  if (closure != NULL)
    (*closure)(a1, a2);
}


x86 assembly (clang, -O0):
<testClosureLLIrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     112b <testClosureLLIrV+0x2b>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureLLIrV>:
test   %rdi,%rdi
je     110f <testClosureLLIrV+0xf>
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %edx,%esi
jmp    *%rax
ret

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

LLVM IR (-O2):
define void @testClosureLLIrV(void (i64, i32)* %0, i64 %1, i32 %2) {
%4 = icmp eq void (i64, i32)* %0, null
br i1 %4, label %6, label %5
5: ; preds = %3
tail call void %0(i64 %1, i32 %2)
br label %6
6: ; preds = %5, %3
ret void
}
int test_imm_83uint8_reg(unsigned char val) {
  return ((val) & (0x83 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_83uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x83,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_83uint8_reg>:
test   $0x83,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_83uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -125
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int sarwaitbar_std_update(int);
int sarwaitbar_update(int percent) { return sarwaitbar_std_update(percent); }


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

x86 assembly (clang, -O2):
<sarwaitbar_update>:
jmp    1030 <sarwaitbar_std_update@plt>

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

LLVM IR (-O2):
define i32 @sarwaitbar_update(i32 %0) {
%2 = tail call i32 @sarwaitbar_std_update(i32 %0)
ret i32 %2
}
int is_big_endian(void) {
  int w = sizeof(int) << 3;
  int x = 1 << (w - 8);
  return (int)(*(char *)&x);
}


x86 assembly (clang, -O0):
<is_big_endian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x20,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
sub    $0x8,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x8(%rbp)
movsbl -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @is_big_endian() {
%1 = alloca i32
%2 = alloca i32
store i32 32, i32* %1
%3 = load i32, i32* %1
%4 = sub nsw i32 %3, 8
%5 = shl i32 1, %4
store i32 %5, i32* %2
%6 = bitcast i32* %2 to i8*
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_big_endian() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void scratchpad_free(char *p) { free(p); }


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

x86 assembly (clang, -O2):
<scratchpad_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @scratchpad_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int yahoo_M1Common(unsigned int, int);
int yahoo_f01_21(int Salt, int Parameter) {
  unsigned b = Salt * 0x2417591b + 0x177b;
  return yahoo_M1Common(b, Parameter);
}


x86 assembly (clang, -O0):
<yahoo_f01_21>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0x2417591b,-0x4(%rbp),%eax
add    $0x177b,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <yahoo_M1Common@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yahoo_f01_21>:
imul   $0x2417591b,%edi,%edi
add    $0x177b,%edi
jmp    1030 <yahoo_M1Common@plt>

LLVM IR (-O0):
define i32 @yahoo_f01_21(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
%7 = mul nsw i32 %6, 605509915
%8 = add nsw i32 %7, 6011
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = call i32 @yahoo_M1Common(i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @yahoo_f01_21(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, 605509915
%4 = add nsw i32 %3, 6011
%5 = tail call i32 @yahoo_M1Common(i32 %4, i32 %1)
ret i32 %5
}
double product_center_1D(double alphaa, double xa, double alphab, double xb) {
  return (alphaa * xa + alphab * xb) / (alphaa + alphab);
}


x86 assembly (clang, -O0):
<product_center_1D>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm1
addsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<product_center_1D>:
mulsd  %xmm2,%xmm3
mulsd  %xmm0,%xmm1
addsd  %xmm3,%xmm1
addsd  %xmm2,%xmm0
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @product_center_1D(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %6
%11 = load double, double* %7
%12 = load double, double* %8
%13 = fmul double %11, %12
%14 = call double @llvm.fmuladd.f64(double %9, double %10, double %13)
%15 = load double, double* %5
%16 = load double, double* %7
%17 = fadd double %15, %16
%18 = fdiv double %14, %17
ret double %18
}

LLVM IR (-O2):
define double @product_center_1D(double %0, double %1, double %2, double %3) {
%5 = fmul double %2, %3
%6 = tail call double @llvm.fmuladd.f64(double %0, double %1, double %5)
%7 = fadd double %0, %2
%8 = fdiv double %6, %7
ret double %8
}
void test53_Mod1_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test53_Mod1_targetInit__I() {
ret void
}
int loop1(int m) {
  int i = 0;
  while (i < m) {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<loop1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1128 <loop1+0x28>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <loop1+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<loop1>:
xor    %eax,%eax
test   %edi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @loop1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %8, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
br label %4
11: ; preds = %4
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @loop1(i32 %0) {
%2 = call i32 @llvm.smax.i32(i32 %0, i32 0)
ret i32 %2
}