xunge/DecIR huggingface dataset:
error(fmt, a1, a2, a3, a4, a5) char *fmt, *a1, *a2, *a3, *a4, *a5;
{ do_error(0, fmt, a1, a2, a3, a4, a5); }


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    -0x38(%rbp),%rax
xor    %edi,%edi
mov    %rax,(%rsp)
mov    $0x0,%al
call   1030 <do_error@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %r8,%rax
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %r9,(%rsp)
xor    %edi,%edi
mov    %rax,%r9
xor    %eax,%eax
call   1030 <do_error@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @error(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
store i8* %0, i8** %8
store i8* %1, i8** %9
store i8* %2, i8** %10
store i8* %3, i8** %11
store i8* %4, i8** %12
store i8* %5, i8** %13
%14 = load i8*, i8** %8
%15 = load i8*, i8** %9
%16 = load i8*, i8** %10
%17 = load i8*, i8** %11
%18 = load i8*, i8** %12
%19 = load i8*, i8** %13
%20 = call i32 (i32, i8*, i8*, i8*, i8*, i8*, i8*, ...) bitcast (i32 (...)* @do_error to i32 (i32, i8*, i8*, i8*, i8*, i8*, i8*, ...)*)(i32 0, i8* %14, i8* %15, i8* %16, i8* %17, i8* %18, i8* %19)
%21 = load i32, i32* %7
ret i32 %21
}

LLVM IR (-O2):
define i32 @error(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5) {
%7 = tail call i32 (i32, i8*, i8*, i8*, i8*, i8*, i8*, ...) bitcast (i32 (...)* @do_error to i32 (i32, i8*, i8*, i8*, i8*, i8*, i8*, ...)*)(i32 0, i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5)
ret i32 undef
}
int rtc_is_leap(int org_year) {
  if (org_year % 400 == 0)
    return 1;
  if (org_year % 100 == 0)
    return 0;
  if (org_year % 4 == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<rtc_is_leap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1127 <rtc_is_leap+0x27>
movl   $0x1,-0x4(%rbp)
jmp    116e <rtc_is_leap+0x6e>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1147 <rtc_is_leap+0x47>
movl   $0x0,-0x4(%rbp)
jmp    116e <rtc_is_leap+0x6e>
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1167 <rtc_is_leap+0x67>
movl   $0x1,-0x4(%rbp)
jmp    116e <rtc_is_leap+0x6e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtc_is_leap>:
imul   $0xc28f5c29,%edi,%eax
add    $0x51eb850,%eax
mov    %eax,%ecx
ror    $0x4,%ecx
cmp    $0xa3d70b,%ecx
jb     112c <rtc_is_leap+0x2c>
ror    $0x2,%eax
cmp    $0x28f5c29,%eax
jb     1132 <rtc_is_leap+0x32>
xor    %eax,%eax
test   $0x3,%dil
sete   %al
ret
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @rtc_is_leap(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = srem i32 %4, 400
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %19
8: ; preds = %1
%9 = load i32, i32* %3
%10 = srem i32 %9, 100
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 0, i32* %2
br label %19
13: ; preds = %8
%14 = load i32, i32* %3
%15 = srem i32 %14, 4
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 1, i32* %2
br label %19
18: ; preds = %13
store i32 0, i32* %2
br label %19
19: ; preds = %18, %17, %12, %7
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @rtc_is_leap(i32 %0) {
%2 = srem i32 %0, 400
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = and i32 %0, 3
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 1, %1 ], [ 0, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Hello\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    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"Hello\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 ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [6 x i8] c"Hello\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void rwbuffer_deinit(struct rwbuffer *buf) {}


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

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

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

LLVM IR (-O2):
%struct.rwbuffer = type opaque
define void @rwbuffer_deinit(%struct.rwbuffer* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ leftShift(int, int);
int rightShift(int /*<<< orphan*/, int);
int getRS(int instruction) { return rightShift(leftShift(instruction, 6), 27); }


x86 assembly (clang, -O0):
<getRS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x6,%esi
call   1040 <leftShift@plt>
mov    %eax,%edi
mov    $0x1b,%esi
call   1030 <rightShift@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRS>:
push   %rax
mov    $0x6,%esi
call   1040 <leftShift@plt>
mov    %eax,%edi
mov    $0x1b,%esi
pop    %rax
jmp    1030 <rightShift@plt>

LLVM IR (-O0):
define i32 @getRS(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @leftShift(i32 %3, i32 6)
%5 = call i32 @rightShift(i32 %4, i32 27)
ret i32 %5
}

LLVM IR (-O2):
define i32 @getRS(i32 %0) {
%2 = tail call i32 @leftShift(i32 %0, i32 6)
%3 = tail call i32 @rightShift(i32 %2, i32 27)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ outputc(char);
void outputs(char *s) {
  register char *t, c;
  for (t = s; (c = *t++) != 0; outputc(c))
    ;
}


x86 assembly (clang, -O0):
<outputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     1157 <outputs+0x47>
jmp    1149 <outputs+0x39>
movsbl -0x11(%rbp),%edi
call   1030 <outputc@plt>
jmp    1124 <outputs+0x14>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @outputs(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* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = tail call i32 @outputc(i8 signext %5)
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ be64toh(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, void *, int);
uint64_t pbe64_to_h(void *v) {
  uint64_t u;
  memcpy(&u, v, sizeof(uint64_t));
  return be64toh(u);
}


x86 assembly (clang, -O0):
<pbe64_to_h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    -0xc(%rbp),%edi
call   1030 <be64toh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pbe64_to_h>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    0x4(%rsp),%edi
call   1030 <be64toh@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @pbe64_to_h(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @memcpy(i32* %3, i8* %4, i32 4)
%6 = load i32, i32* %3
%7 = call i32 @be64toh(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @pbe64_to_h(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 4)
%5 = load i32, i32* %2
%6 = call i32 @be64toh(i32 %5)
ret i32 %6
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ nrerror(char *);
long *lvector(long nl, long nh) {
  long *v;
  v = (long *)malloc((size_t)((nh - nl + 1 + 1) * sizeof(long)));
  if (!v)
    nrerror("allocation failure in lvector()");
  return v - nl + 1;
}


x86 assembly (clang, -O0):
<lvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
sub    -0x8(%rbp),%rdi
add    $0x1,%rdi
add    $0x1,%rdi
shl    $0x3,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1164 <lvector+0x44>
lea    0xea1(%rip),%rdi
call   1030 <nrerror@plt>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    -0x8(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
add    $0x8,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lvector>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
sub    %rdi,%rsi
lea    0x10(,%rsi,8),%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114b <lvector+0x2b>
lea    0xeba(%rip),%rdi
call   1030 <nrerror@plt>
shl    $0x3,%r14
sub    %r14,%rbx
add    $0x8,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [32 x i8] c"allocation failure in lvector()\00"
define i64* @lvector(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = shl i64 %3, 3
%5 = add i64 %4, 16
%6 = tail call i64 @malloc(i64 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @nrerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = inttoptr i64 %6 to i64*
%12 = sub i64 0, %0
%13 = getelementptr inbounds i64, i64* %11, i64 %12
%14 = getelementptr inbounds i64, i64* %13, i64 1
ret i64* %14
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void mpeg_file_close(FILE *fp) {
  if (fp) {
    fclose(fp);
  }
}


x86 assembly (clang, -O0):
<mpeg_file_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <mpeg_file_close+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpeg_file_close>:
test   %rdi,%rdi
je     111a <mpeg_file_close+0xa>
jmp    1030 <fclose@plt>
ret

LLVM IR (-O0):
define void @mpeg_file_close(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32*, i32** %2
%7 = call i32 @fclose(i32* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @mpeg_file_close(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @fclose(i32* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ p18_int_pin();
int /*<<< orphan*/ p18_int_portb();
int /*<<< orphan*/ p18_tmr0();
int /*<<< orphan*/ p18_tmr1();
int /*<<< orphan*/ p18_tmr2();
int /*<<< orphan*/ p18_wdt();
int /*<<< orphan*/ serial(int /*<<< orphan*/);
void PIC18F46J50_periferic(void) {
  p18_int_pin();
  p18_int_portb();
  p18_tmr0();
  p18_wdt();
  p18_tmr1();
  p18_tmr2();
  serial(0);
  ;
}


x86 assembly (clang, -O0):
<PIC18F46J50_periferic>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <p18_int_pin@plt>
mov    $0x0,%al
call   1070 <p18_int_portb@plt>
mov    $0x0,%al
call   1040 <p18_tmr0@plt>
mov    $0x0,%al
call   1080 <p18_wdt@plt>
mov    $0x0,%al
call   1090 <p18_tmr1@plt>
mov    $0x0,%al
call   1030 <p18_tmr2@plt>
xor    %edi,%edi
call   1050 <serial@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PIC18F46J50_periferic>:
push   %rax
xor    %eax,%eax
call   1060 <p18_int_pin@plt>
xor    %eax,%eax
call   1070 <p18_int_portb@plt>
xor    %eax,%eax
call   1040 <p18_tmr0@plt>
xor    %eax,%eax
call   1080 <p18_wdt@plt>
xor    %eax,%eax
call   1090 <p18_tmr1@plt>
xor    %eax,%eax
call   1030 <p18_tmr2@plt>
xor    %edi,%edi
pop    %rax
jmp    1050 <serial@plt>

LLVM IR (-O0):
define void @PIC18F46J50_periferic() {
%1 = call i32 (...) @p18_int_pin()
%2 = call i32 (...) @p18_int_portb()
%3 = call i32 (...) @p18_tmr0()
%4 = call i32 (...) @p18_wdt()
%5 = call i32 (...) @p18_tmr1()
%6 = call i32 (...) @p18_tmr2()
%7 = call i32 @serial(i32 0)
ret void
}

LLVM IR (-O2):
define void @PIC18F46J50_periferic() {
%1 = tail call i32 (...) @p18_int_pin()
%2 = tail call i32 (...) @p18_int_portb()
%3 = tail call i32 (...) @p18_tmr0()
%4 = tail call i32 (...) @p18_wdt()
%5 = tail call i32 (...) @p18_tmr1()
%6 = tail call i32 (...) @p18_tmr2()
%7 = tail call i32 @serial(i32 0)
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int print_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(21, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<print_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x15,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_system>:
mov    $0x15,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @print_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 21, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @print_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 21, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Type definitions */
typedef int uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int MWC_MulMod64(int, int, int);
int MWC_PowMod64(int, int /*<<< orphan*/, int);
uint64_t MWC_SeedImpl(uint64_t A, uint64_t M, uint32_t range, uint64_t seed) {
  uint64_t m = MWC_PowMod64(A, range, M);
  uint64_t x = MWC_MulMod64(seed, m, M);
  uint64_t res = x / A;
  res |= (x % A) << 32;
  return res;
}


x86 assembly (clang, -O0):
<MWC_SeedImpl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1030 <MWC_PowMod64@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1040 <MWC_MulMod64@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
mov    $0x20,%ecx
shl    %cl,%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MWC_SeedImpl>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %esi,%ebp
mov    %edx,%esi
mov    %ebp,%edx
call   1030 <MWC_PowMod64@plt>
mov    %ebx,%edi
mov    %eax,%esi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <MWC_MulMod64@plt>

LLVM IR (-O0):
define i32 @MWC_SeedImpl(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%12 = load i32, i32* %5
%13 = load i32, i32* %7
%14 = load i32, i32* %6
%15 = call i32 @MWC_PowMod64(i32 %12, i32 %13, i32 %14)
store i32 %15, i32* %9
%16 = load i32, i32* %8
%17 = load i32, i32* %9
%18 = load i32, i32* %6
%19 = call i32 @MWC_MulMod64(i32 %16, i32 %17, i32 %18)
store i32 %19, i32* %10
%20 = load i32, i32* %10
%21 = load i32, i32* %5
%22 = sdiv i32 %20, %21
store i32 %22, i32* %11
%23 = load i32, i32* %10
%24 = load i32, i32* %5
%25 = srem i32 %23, %24
%26 = shl i32 %25, 32
%27 = load i32, i32* %11
%28 = or i32 %27, %26
store i32 %28, i32* %11
%29 = load i32, i32* %11
ret i32 %29
}

LLVM IR (-O2):
define i32 @MWC_SeedImpl(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @MWC_PowMod64(i32 %0, i32 %2, i32 %1)
%6 = tail call i32 @MWC_MulMod64(i32 %3, i32 %5, i32 %1)
ret i32 poison
}
float multiplex_2_extended_types_s9_encode(double value) {
  return (float)(value);
}


x86 assembly (clang, -O0):
<multiplex_2_extended_types_s9_encode>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiplex_2_extended_types_s9_encode>:
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @multiplex_2_extended_types_s9_encode(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptrunc double %3 to float
ret float %4
}

LLVM IR (-O2):
define float @multiplex_2_extended_types_s9_encode(double %0) {
%2 = fptrunc double %0 to float
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void caml_js_node_children() { exit(1); }


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

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

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

LLVM IR (-O2):
define void @caml_js_node_children() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
int foo(unsigned long long int x) {
  if ((x | 0x190000000ULL) != -1879048192)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movabs $0x190000000,%rax
or     -0x10(%rbp),%rax
cmp    $0xffffffff90000000,%rax
je     112e <foo+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1135 <foo+0x35>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movabs $0xfffffffe00000000,%rcx
ff ff ff
lea    0x6fffffff(%rcx),%rdx
and    %rdi,%rdx
xor    %eax,%eax
cmp    %rcx,%rdx
sete   %al
ret

LLVM IR (-O0):
define i32 @foo(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = or i64 %4, 6710886400
%6 = icmp ne i64 %5, -1879048192
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %9
8: ; preds = %1
store i32 1, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @foo(i64 %0) {
%2 = and i64 %0, -6710886401
%3 = icmp eq i64 %2, -8589934592
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
void stub1(long long, long long);
void testClosureLLLLrV(void (*closure)(long long, long long), long long a1,
                       long long a2) {
  if (closure != NULL)
    (*closure)(a1, a2);
}


x86 assembly (clang, -O0):
<testClosureLLLLrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     112d <testClosureLLLLrV+0x2d>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureLLLLrV>:
test   %rdi,%rdi
je     1110 <testClosureLLLLrV+0x10>
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    *%rax
ret

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

LLVM IR (-O2):
define void @testClosureLLLLrV(void (i64, i64)* %0, i64 %1, i64 %2) {
%4 = icmp eq void (i64, i64)* %0, null
br i1 %4, label %6, label %5
5: ; preds = %3
tail call void %0(i64 %1, i64 %2)
br label %6
6: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ a_daemon();
int /*<<< orphan*/ sleep(int);
int main(int argc, char *argv[]) {
  a_daemon();
  while (1) {
    sleep(10000);
  }
  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    $0x0,%al
call   1030 <a_daemon@plt>
mov    $0x2710,%edi
call   1040 <sleep@plt>
jmp    113d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <a_daemon@plt>
nopl   0x0(%rax,%rax,1)
mov    $0x2710,%edi
call   1040 <sleep@plt>
jmp    1130 <main+0x10>

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 (...) @a_daemon()
br label %7
7: ; preds = %2, %7
%8 = call i32 @sleep(i32 10000)
br label %7
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @a_daemon()
br label %4
4: ; preds = %2, %4
%5 = tail call i32 @sleep(i32 10000)
br label %4
}
/* Variables and functions */
double omp_get_wtime();
int /*<<< orphan*/ printf(char *, double, double, double);
int /*<<< orphan*/ sleep(int);
int main() {
  double start = omp_get_wtime();
  sleep(3);
  double end = omp_get_wtime();
  printf("start:%.16g\nend:%.16g\nTime:%.16g\n", start, end, end - start);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <omp_get_wtime@plt>
movsd  %xmm0,-0x10(%rbp)
mov    $0x3,%edi
call   1050 <sleep@plt>
mov    $0x0,%al
call   1030 <omp_get_wtime@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
subsd  -0x10(%rbp),%xmm2
lea    0xe84(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <omp_get_wtime@plt>
movsd  %xmm0,(%rsp)
mov    $0x3,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
call   1030 <omp_get_wtime@plt>
movapd %xmm0,%xmm1
movapd %xmm0,%xmm2
movsd  (%rsp),%xmm0
subsd  %xmm0,%xmm2
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"start:%.16g\0Aend:%.16g\0ATime:%.16g\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
%4 = call double (...) @omp_get_wtime()
store double %4, double* %2
%5 = call i32 @sleep(i32 3)
%6 = call double (...) @omp_get_wtime()
store double %6, double* %3
%7 = load double, double* %2
%8 = load double, double* %3
%9 = load double, double* %3
%10 = load double, double* %2
%11 = fsub double %9, %10
%12 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), double %7, double %8, double %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"start:%.16g\0Aend:%.16g\0ATime:%.16g\0A\00"
define i32 @main() {
%1 = tail call double (...) @omp_get_wtime()
%2 = tail call i32 @sleep(i32 3)
%3 = tail call double (...) @omp_get_wtime()
%4 = fsub double %3, %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), double %1, double %3, double %4)
ret i32 0
}
int htoxl(int in) {
  unsigned char r[4];
  r[0] = in;
  r[1] = in >> 8;
  r[2] = in >> 16;
  r[3] = in >> 24;
  return *((int *)r);
}


x86 assembly (clang, -O0):
<htoxl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    %al,-0x7(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
mov    %al,-0x6(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
mov    %al,-0x5(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<htoxl>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @htoxl(i32 %0) {
%2 = alloca i32
%3 = alloca [4 x i8]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
store i8 %5, i8* %6
%7 = load i32, i32* %2
%8 = ashr i32 %7, 8
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
store i8 %9, i8* %10
%11 = load i32, i32* %2
%12 = ashr i32 %11, 16
%13 = trunc i32 %12 to i8
%14 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
store i8 %13, i8* %14
%15 = load i32, i32* %2
%16 = ashr i32 %15, 24
%17 = trunc i32 %16 to i8
%18 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
store i8 %17, i8* %18
%19 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%20 = bitcast i8* %19 to i32*
%21 = load i32, i32* %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @htoxl(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int ath9k_cmn_count_streams(unsigned int chainmask, int max) {
  int streams = 0;
  do {
    if (++streams == max)
      break;
  } while ((chainmask = chainmask & (chainmask - 1)));
  return streams;
}


x86 assembly (clang, -O0):
<ath9k_cmn_count_streams>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmp    -0x8(%rbp),%eax
jne    1128 <ath9k_cmn_count_streams+0x28>
jmp    1144 <ath9k_cmn_count_streams+0x44>
jmp    112d <ath9k_cmn_count_streams+0x2d>
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jne    1111 <ath9k_cmn_count_streams+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ath9k_cmn_count_streams>:
lea    -0x1(%rsi),%ecx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nop
cmp    %eax,%ecx
je     1121 <ath9k_cmn_count_streams+0x21>
lea    -0x1(%rdi),%edx
add    $0x1,%eax
and    %edi,%edx
mov    %edx,%edi
jne    1110 <ath9k_cmn_count_streams+0x10>
ret
mov    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @ath9k_cmn_count_streams(i32 %0, i32 %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i32 [ %0, %2 ], [ %10, %8 ]
%5 = phi i32 [ 0, %2 ], [ %6, %8 ]
%6 = add nuw nsw i32 %5, 1
%7 = icmp eq i32 %6, %1
br i1 %7, label %12, label %8
8: ; preds = %3
%9 = add i32 %4, -1
%10 = and i32 %9, %4
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %3
12: ; preds = %3, %8
%13 = phi i32 [ %1, %3 ], [ %6, %8 ]
ret i32 %13
}
signed char sc_sc_test(signed char data) {
  printf("Entered %s:\n", __FUNCTION__);
  printf("Data In: %d\n", (signed int)data);
  printf("Exited  %s:\n", __FUNCTION__);
  return data;
}


x86 assembly (clang, -O0):
<sc_sc_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
lea    0xee1(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x1(%rbp),%esi
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
lea    0xeba(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sc_sc_test>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xee3(%rip),%rdi
lea    0xee9(%rip),%r14
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Entered %s:\0A\00"
@__FUNCTION__.sc_sc_test = [11 x i8] c"sc_sc_test\00"
@.str.1 = [13 x i8] c"Data In: %d\0A\00"
@.str.2 = [13 x i8] c"Exited %s:\0A\00"
define signext i8 @sc_sc_test(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.sc_sc_test, i64 0, i64 0))
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.sc_sc_test, i64 0, i64 0))
%8 = load i8, i8* %2
ret i8 %8
}

LLVM IR (-O2):
@.str = [13 x i8] c"Entered %s:\0A\00"
@__FUNCTION__.sc_sc_test = [11 x i8] c"sc_sc_test\00"
@.str.1 = [13 x i8] c"Data In: %d\0A\00"
@.str.2 = [13 x i8] c"Exited %s:\0A\00"
define signext i8 @sc_sc_test(i8 returned signext %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.sc_sc_test, i64 0, i64 0))
%3 = sext i8 %0 to i32
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.sc_sc_test, i64 0, i64 0))
ret i8 %0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t lsb_first(uint8_t value) {
  uint8_t result = 0;
  for (int i = 0; i < 8; i++) {
    result = result << 1;
    if (value & 0x01) {
      result += 1;
    }
    value = value >> 1;
  }
  return result;
}


x86 assembly (clang, -O0):
<lsb_first>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    1157 <lsb_first+0x57>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1140 <lsb_first+0x40>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <lsb_first+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lsb_first>:
rol    $0x4,%dil
mov    %edi,%eax
and    $0x33,%al
shl    $0x2,%al
shr    $0x2,%dil
and    $0x33,%dil
or     %al,%dil
mov    %edi,%eax
and    $0x55,%al
add    %al,%al
shr    %dil
and    $0x55,%dil
or     %al,%dil
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @lsb_first(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %20, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 8
br i1 %7, label %8, label %23
8: ; preds = %5
%9 = load i32, i32* %3
%10 = shl i32 %9, 1
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = and i32 %11, 1
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %8
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %17
17: ; preds = %14, %8
%18 = load i32, i32* %2
%19 = ashr i32 %18, 1
store i32 %19, i32* %2
br label %20
20: ; preds = %17
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
br label %5
23: ; preds = %5
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @lsb_first(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = call i8 @llvm.bitreverse.i8(i8 %2)
%4 = zext i8 %3 to i32
ret i32 %4
}
void sound_init(void) {}


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

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

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

LLVM IR (-O2):
define void @sound_init() {
ret void
}
int is_whitespace(char c) {
  return c == '\n' || c == '\r' || c == '\t' || c == ' ';
}


x86 assembly (clang, -O0):
<is_whitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     114d <is_whitespace+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x2(%rbp)
je     114d <is_whitespace+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x2(%rbp)
je     114d <is_whitespace+0x4d>
movsbl -0x1(%rbp),%eax
cmp    $0x20,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_whitespace>:
cmp    $0xd,%dil
ja     111b <is_whitespace+0x1b>
mov    $0x1,%eax
movzbl %dil,%ecx
mov    $0x2600,%edx
bt     %rcx,%rdx
jae    111b <is_whitespace+0x1b>
ret
xor    %eax,%eax
cmp    $0x20,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_whitespace(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, 10
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 13
br i1 %9, label %18, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 9
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 32
br label %18
18: ; preds = %14, %10, %6, %1
%19 = phi i1 [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @is_whitespace(i8 signext %0) {
switch i8 %0, label %2 [
i8 13, label %5
i8 10, label %5
i8 9, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 32
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int find(int *, int, int, int);
int test_found() {
  int array[] = {12, 32, 45, 61, 78, 15, 34, 47, 79, 81,
                 21, 42, 51, 82, 87, 33, 54, 63, 94, 99};
  return find(array, 4, 5, 42);
}


x86 assembly (clang, -O0):
<test_found>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x50(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x50,%edx
call   1030 <memcpy@plt>
lea    -0x50(%rbp),%rdi
mov    $0x4,%esi
mov    $0x5,%edx
mov    $0x2a,%ecx
call   1040 <find@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_found>:
sub    $0x58,%rsp
movaps 0xf25(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xf09(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xeed(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xed1(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
mov    $0x5,%edx
mov    $0x2a,%ecx
call   1030 <find@plt>
add    $0x58,%rsp
ret

LLVM IR (-O0):
@__const.test_found.array = [20 x i32] [i32 12, i32 32, i32 45, i32 61, i32 78, i32 15, i32 34, i32 47, i32 79, i32 81, i32 21, i32 42, i32 51, i32 82, i32 87, i32 33, i32 54, i32 63, i32 94, i32 99]
define i32 @test_found() {
%1 = alloca [20 x i32]
%2 = bitcast [20 x i32]* %1 to i8*
%3 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 0
%4 = call i32 @find(i32* %3, i32 4, i32 5, i32 42)
ret i32 %4
}

LLVM IR (-O2):
@__const.test_found.array = [20 x i32] [i32 12, i32 32, i32 45, i32 61, i32 78, i32 15, i32 34, i32 47, i32 79, i32 81, i32 21, i32 42, i32 51, i32 82, i32 87, i32 33, i32 54, i32 63, i32 94, i32 99]
define i32 @test_found() {
%1 = alloca [20 x i32]
%2 = bitcast [20 x i32]* %1 to i8*
%3 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 0
%4 = call i32 @find(i32* %3, i32 4, i32 5, i32 42)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ glutBitmapCharacter(void *, char const);
void DrawBitmapString(void *font, const char *string) {
  int i;
  for (i = 0; string[i]; i++)
    glutBitmapCharacter(font, string[i]);
}


x86 assembly (clang, -O0):
<DrawBitmapString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     115c <DrawBitmapString+0x4c>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
call   1030 <glutBitmapCharacter@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <DrawBitmapString+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DrawBitmapString>:
push   %r14
push   %rbx
push   %rax
mov    (%rsi),%al
test   %al,%al
je     1146 <DrawBitmapString+0x36>
mov    %rsi,%rbx
mov    %rdi,%r14
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <glutBitmapCharacter@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <DrawBitmapString+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @DrawBitmapString(i8* %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = tail call i32 @glutBitmapCharacter(i8* %0, i8 signext %7)
%9 = add nuw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret void
}
/* Variables and functions */
int crash3(int);
__attribute__((no)) int crash2(int a) {
  a = crash3(a) + 2;
  return a * 3;
}


x86 assembly (clang, -O0):
<crash2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <crash3@plt>
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
imul   $0x3,-0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crash2>:
push   %rax
call   1030 <crash3@plt>
lea    (%rax,%rax,2),%eax
add    $0x6,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @crash2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @crash3(i32 %3)
%5 = add nsw i32 %4, 2
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = mul nsw i32 %6, 3
ret i32 %7
}

LLVM IR (-O2):
define i32 @crash2(i32 %0) {
%2 = tail call i32 @crash3(i32 %0)
%3 = mul i32 %2, 3
%4 = add i32 %3, 6
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int *);
void printAdress(int *pointer, int size) {
  for (int i = 0; i < size; i++) {
    printf("%cp[%d] = %p\n", 38, i, (pointer + i));
  }
}


x86 assembly (clang, -O0):
<printAdress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1163 <printAdress+0x53>
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rcx
lea    0xeb5(%rip),%rdi
mov    $0x26,%esi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printAdress+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printAdress>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    114f <printAdress+0x3f>
mov    %rdi,%r14
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    $0x26,%esi
mov    %ebx,%edx
mov    %r14,%rcx
call   1030 <printf@plt>
add    $0x1,%rbx
add    $0x4,%r14
cmp    %rbx,%r12
jne    1130 <printAdress+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"%cp[%d] = %p\0A\00"
define void @printAdress(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = trunc i64 %8 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 38, i32 %10, i32* %9)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
void tautologyGE(unsigned a) {
  char *b = malloc(1);
  if (a >= 0)
    free(b);
  return;
}


x86 assembly (clang, -O0):
<tautologyGE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jb     114c <tautologyGE+0x2c>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tautologyGE>:
push   %rax
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @tautologyGE(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = call i8* @malloc(i32 1)
store i8* %4, i8** %3
%5 = load i32, i32* %2
%6 = icmp uge i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32 @free(i8* %8)
br label %10
10: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @tautologyGE(i32 %0) {
%2 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
%3 = tail call i32 @free(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ stderr;
void usage(char *progname) {
  fprintf(stderr,
          "Usage: %s -c NCPU -h -p [fifo:rr:other] -t THREADS -v\n"
          "\t -c Number of CUPS in the machine. User MUST provide\n"
          "\t -h Help!\n"
          "\t -p Scheduling policy, choice: fifo, rr, other. Default: fifo\n"
          "\t -t Number of threads to create.                Default: %d\n"
          "\t -v Verbose out put, print ugly!.               Default: OFF\n",
          progname, 100);
  exit(-1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [306 x i8] c"Usage: %s -c NCPU -h -p [fifo:rr:other] -t THREADS -v\0A\09 -c Number of CUPS in the machine. User MUST provide\0A\09 -h Help!\0A\09 -p Scheduling policy, choice: fifo, rr, other. Default: fifo\0A\09 -t Number of threads to create. Default: %d\0A\09 -v Verbose out put, print ugly!. Default: OFF\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([306 x i8], [306 x i8]* @.str, i64 0, i64 0), i8* %4, i32 100)
%6 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [306 x i8] c"Usage: %s -c NCPU -h -p [fifo:rr:other] -t THREADS -v\0A\09 -c Number of CUPS in the machine. User MUST provide\0A\09 -h Help!\0A\09 -p Scheduling policy, choice: fifo, rr, other. Default: fifo\0A\09 -t Number of threads to create. Default: %d\0A\09 -v Verbose out put, print ugly!. Default: OFF\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([306 x i8], [306 x i8]* @.str, i64 0, i64 0), i8* %0, i32 100)
%4 = tail call i32 @exit(i32 -1)
unreachable
}
int foo(int x, int c) { return x >> c; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %esi,%ecx
mov    %edi,%eax
sar    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
ret i32 %3
}