xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ IO_output_low(int);
void LEDS_on(int mask) {
  if (mask & (1 << 22))
    IO_output_low((22 | (1 << 8)));
  if (mask & (1 << 21))
    IO_output_low((21 | (1 << 8)));
  if (mask & (1 << 20))
    IO_output_low((20 | (1 << 8)));
}


x86 assembly (clang, -O0):
<LEDS_on>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x400000,%eax
cmp    $0x0,%eax
je     1136 <LEDS_on+0x26>
mov    $0x116,%edi
call   1030 <IO_output_low@plt>
mov    -0x4(%rbp),%eax
and    $0x200000,%eax
cmp    $0x0,%eax
je     1151 <LEDS_on+0x41>
mov    $0x115,%edi
call   1030 <IO_output_low@plt>
mov    -0x4(%rbp),%eax
and    $0x100000,%eax
cmp    $0x0,%eax
je     116c <LEDS_on+0x5c>
mov    $0x114,%edi
call   1030 <IO_output_low@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LEDS_on>:
push   %rbx
mov    %edi,%ebx
test   $0x400000,%edi
jne    112d <LEDS_on+0x1d>
test   $0x200000,%ebx
jne    113f <LEDS_on+0x2f>
test   $0x100000,%ebx
jne    1151 <LEDS_on+0x41>
pop    %rbx
ret
mov    $0x116,%edi
call   1030 <IO_output_low@plt>
test   $0x200000,%ebx
je     1123 <LEDS_on+0x13>
mov    $0x115,%edi
call   1030 <IO_output_low@plt>
test   $0x100000,%ebx
je     112b <LEDS_on+0x1b>
mov    $0x114,%edi
pop    %rbx
jmp    1030 <IO_output_low@plt>

LLVM IR (-O0):
define void @LEDS_on(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 4194304
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @IO_output_low(i32 278)
br label %8
8: ; preds = %6, %1
%9 = load i32, i32* %2
%10 = and i32 %9, 2097152
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 @IO_output_low(i32 277)
br label %14
14: ; preds = %12, %8
%15 = load i32, i32* %2
%16 = and i32 %15, 1048576
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = call i32 @IO_output_low(i32 276)
br label %20
20: ; preds = %18, %14
ret void
}

LLVM IR (-O2):
define void @LEDS_on(i32 %0) {
%2 = and i32 %0, 4194304
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @IO_output_low(i32 278)
br label %6
6: ; preds = %4, %1
%7 = and i32 %0, 2097152
%8 = icmp eq i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = tail call i32 @IO_output_low(i32 277)
br label %11
11: ; preds = %9, %6
%12 = and i32 %0, 1048576
%13 = icmp eq i32 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %11
%15 = tail call i32 @IO_output_low(i32 276)
br label %16
16: ; preds = %14, %11
ret void
}
/* Variables and functions */
int strlen(char *);
char *ClearEnd(register char *cp) {
  register char *end = cp + strlen(cp) - 1;
  while (*end < 33)
    *end-- = 0;
  return (cp);
}


x86 assembly (clang, -O0):
<ClearEnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x21,%eax
jge    1168 <ClearEnd+0x58>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x0,(%rax)
jmp    1141 <ClearEnd+0x31>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ClearEnd>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
cmpb   $0x20,-0x1(%rbx,%rax,1)
jg     113d <ClearEnd+0x2d>
add    %rbx,%rax
add    $0xffffffffffffffff,%rax
nopl   0x0(%rax)
movb   $0x0,(%rax)
cmpb   $0x21,-0x1(%rax)
lea    -0x1(%rax),%rax
jl     1130 <ClearEnd+0x20>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @ClearEnd(i8* returned %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = getelementptr inbounds i8, i8* %4, i64 -1
%6 = load i8, i8* %5
%7 = icmp slt i8 %6, 33
br i1 %7, label %8, label %13
8: ; preds = %1, %8
%9 = phi i8* [ %10, %8 ], [ %5, %1 ]
store i8 0, i8* %9
%10 = getelementptr inbounds i8, i8* %9, i64 -1
%11 = load i8, i8* %10
%12 = icmp slt i8 %11, 33
br i1 %12, label %8, label %13
13: ; preds = %8, %1
ret i8* %0
}
void test5_stack_overflow(void) {
  int a, b, i;
  a = 0x90909090;
  b = 0x91919191;
  for (i = 0; i <= sizeof(b); i++)
    *(((unsigned char *)(&b)) + i) = 'E';
}


x86 assembly (clang, -O0):
<test5_stack_overflow>:
push   %rbp
mov    %rsp,%rbp
movl   $0x90909090,-0x4(%rbp)
movl   $0x91919191,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movslq -0xc(%rbp),%rax
cmp    $0x4,%rax
ja     113e <test5_stack_overflow+0x3e>
movslq -0xc(%rbp),%rax
movb   $0x45,-0x8(%rbp,%rax,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1119 <test5_stack_overflow+0x19>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test5_stack_overflow() {
ret void
}
/* Variables and functions */
char getch();
int /*<<< orphan*/ printf(char *, char);
void main() {
  char ch = 'k';
  do {
    ch = getch();
    printf("%c", ch);
  } while (ch == 'k');
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x6b,-0x1(%rbp)
mov    $0x0,%al
call   1040 <getch@plt>
mov    %al,-0x1(%rbp)
lea    0xec3(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
movsbl -0x1(%rbp),%eax
cmp    $0x6b,%eax
je     112c <main+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xed6(%rip),%rbx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getch@plt>
movsbl %al,%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
cmp    $0x6b,%bpl
je     1130 <main+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @main() {
%1 = alloca i8
store i8 107, i8* %1
br label %2
2: ; preds = %6, %0
%3 = call signext i8 (...) @getch()
store i8 %3, i8* %1
%4 = load i8, i8* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %4)
br label %6
6: ; preds = %2
%7 = load i8, i8* %1
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 107
br i1 %9, label %2, label %10
10: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getch()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %2)
%4 = icmp eq i8 %2, 107
br i1 %4, label %1, label %5
5: ; preds = %1
ret void
}
void foo() { char c = *(char *)(0xffffffff); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%eax
mov    (%rax),%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @foo() {
%1 = alloca i8
%2 = load i8, i8* inttoptr (i64 4294967295 to i8*)
store i8 %2, i8* %1
ret void
}

LLVM IR (-O2):
define void @foo() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
scalar_t__ random16_max(scalar_t__);
uint16_t random16_min_max(uint16_t min, uint16_t lim) {
  uint16_t delta = lim - min;
  uint16_t r = random16_max(delta) + min;
  return r;
}


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

x86 assembly (clang, -O2):
<random16_min_max>:
push   %rbx
mov    %rdi,%rbx
sub    %rdi,%rsi
mov    %rsi,%rdi
call   1030 <random16_max@plt>
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @random16_min_max(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %4
%8 = load i64, i64* %3
%9 = sub nsw i64 %7, %8
store i64 %9, i64* %5
%10 = load i64, i64* %5
%11 = call i64 @random16_max(i64 %10)
%12 = load i64, i64* %3
%13 = add nsw i64 %11, %12
store i64 %13, i64* %6
%14 = load i64, i64* %6
ret i64 %14
}

LLVM IR (-O2):
define i64 @random16_min_max(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = tail call i64 @random16_max(i64 %3)
%5 = add nsw i64 %4, %0
ret i64 %5
}
void gdk_color_hash() {}


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

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

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

LLVM IR (-O2):
define void @gdk_color_hash() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ F_RDLCK;
int /*<<< orphan*/ fd_test_lock(int, int /*<<< orphan*/);
pid_t fd_is_read_lock_blocked(int fd) { return (fd_test_lock(fd, F_RDLCK)); }


x86 assembly (clang, -O0):
<fd_is_read_lock_blocked>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb3(%rip),%rax
mov    (%rax),%esi
call   1030 <fd_test_lock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd_is_read_lock_blocked>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <fd_test_lock@plt>

LLVM IR (-O0):
@F_RDLCK = global i32 0
define i32 @fd_is_read_lock_blocked(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @F_RDLCK
%5 = call i32 @fd_test_lock(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@F_RDLCK = global i32 0
define i32 @fd_is_read_lock_blocked(i32 %0) {
%2 = load i32, i32* @F_RDLCK
%3 = tail call i32 @fd_test_lock(i32 %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int sqrt(int);
int bulbSwitch(int n) { return sqrt(n); }


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

x86 assembly (clang, -O2):
<bulbSwitch>:
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define i32 @bulbSwitch(i32 %0) {
%2 = tail call i32 @sqrt(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ playsound(int, int, int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/);
void hit(void) { playsound(12, 22050, 0, 0, 0); }


x86 assembly (clang, -O0):
<hit>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc,%edi
mov    $0x5622,%esi
xor    %r8d,%r8d
mov    %r8d,%edx
mov    %r8d,%ecx
call   1030 <playsound@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hit>:
mov    $0xc,%edi
mov    $0x5622,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <playsound@plt>

LLVM IR (-O0):
define void @hit() {
%1 = call i32 @playsound(i32 12, i32 22050, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @hit() {
%1 = tail call i32 @playsound(i32 12, i32 22050, i32 0, i32 0, i32 0)
ret void
}
int test_imm_F3uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xF3 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F3uint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0xf3,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_F3uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 243
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ set_rock_blocks(char **, double **, int, int, int);
void InitRockStripes(char **type_of_rock, double **topography) {
  if ((0) > 3) {
    int y;
    for (y = 0; y < 2 * (200); y++) {
      int x;
      for (x = 0; x < (0) - 3; x++) {
        type_of_rock[x][y] = 'f';
        topography[x][y] = (30.0);
      }
    }
    set_rock_blocks(type_of_rock + (0) - 3, topography + (0) - 3,
                    (50) - ((0) - 3), 2 * (200), (9));
  }
}


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

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

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

LLVM IR (-O2):
define void @InitRockStripes(i8** nocapture %0, double** nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outputcar(int /*<<< orphan*/);
void output(char *s) {
  while (*s) {
    outputcar(*s++);
  }
}


x86 assembly (clang, -O0):
<output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <output+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <outputcar@plt>
jmp    111c <output+0xc>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @output(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @outputcar(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
float vectors_scalar_product(const float u[3], const float v[3]) {
  float scp = (u[0] * v[0] + u[1] * v[1] + u[2] * v[2]);
  return scp;
}


x86 assembly (clang, -O0):
<vectors_scalar_product>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulss  0x4(%rax),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<vectors_scalar_product>:
movss  0x4(%rdi),%xmm0
mulss  0x4(%rsi),%xmm0
movss  (%rdi),%xmm1
mulss  (%rsi),%xmm1
addss  %xmm0,%xmm1
movss  0x8(%rdi),%xmm0
mulss  0x8(%rsi),%xmm0
addss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @vectors_scalar_product(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = fmul float %6, %8
%10 = tail call float @llvm.fmuladd.f32(float %3, float %4, float %9)
%11 = getelementptr inbounds float, float* %0, i64 2
%12 = load float, float* %11
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = tail call float @llvm.fmuladd.f32(float %12, float %14, float %10)
ret float %15
}
void MovLowByte(int *p, int i) { *p = (*p & 0xff00) | (i & 0xff); }


x86 assembly (clang, -O0):
<MovLowByte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
and    $0xff00,%ecx
mov    -0xc(%rbp),%eax
and    $0xff,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<MovLowByte>:
movzbl 0x1(%rdi),%eax
shl    $0x8,%eax
movzbl %sil,%ecx
or     %eax,%ecx
mov    %ecx,(%rdi)
ret

LLVM IR (-O0):
define void @MovLowByte(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* %5
%7 = and i32 %6, 65280
%8 = load i32, i32* %4
%9 = and i32 %8, 255
%10 = or i32 %7, %9
%11 = load i32*, i32** %3
store i32 %10, i32* %11
ret void
}

LLVM IR (-O2):
define void @MovLowByte(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = and i32 %3, 65280
%5 = and i32 %1, 255
%6 = or i32 %4, %5
store i32 %6, i32* %0
ret void
}
void GLUE_SET_PX_FROM_P1(void *b, int wv) {
  *(unsigned int *)b = 0xe1a00000 | (wv << 12);
}


x86 assembly (clang, -O0):
<GLUE_SET_PX_FROM_P1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
shl    $0xc,%ecx
or     $0xe1a00000,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GLUE_SET_PX_FROM_P1>:
shl    $0xc,%esi
or     $0xe1a00000,%esi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @GLUE_SET_PX_FROM_P1(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 = shl i32 %5, 12
%7 = or i32 -509607936, %6
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i32*
store i32 %7, i32* %9
ret void
}

LLVM IR (-O2):
define void @GLUE_SET_PX_FROM_P1(i8* nocapture writeonly %0, i32 %1) {
%3 = shl i32 %1, 12
%4 = or i32 %3, -509607936
%5 = bitcast i8* %0 to i32*
store i32 %4, i32* %5
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t ms2ns(uint64_t msec) {
  uint64_t const ns = msec * 1000000;
  return ns;
}


x86 assembly (clang, -O0):
<ms2ns>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0xf4240,-0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ms2ns>:
imul   $0xf4240,%edi,%eax
ret

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

LLVM IR (-O2):
define i32 @ms2ns(i32 %0) {
%2 = mul nsw i32 %0, 1000000
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void setb_reg8(unsigned int reg8) {
  put8(0x40);
  put8(0x0F);
  put8(0x92);
  put8(0xC0 | reg8);
}


x86 assembly (clang, -O0):
<setb_reg8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x40,%edi
call   1030 <put8@plt>
mov    $0xf,%edi
call   1030 <put8@plt>
mov    $0x92,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
or     $0xc0,%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setb_reg8>:
push   %rbx
mov    %edi,%ebx
mov    $0x40,%edi
call   1030 <put8@plt>
mov    $0xf,%edi
call   1030 <put8@plt>
mov    $0x92,%edi
call   1030 <put8@plt>
or     $0xc0,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @setb_reg8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @put8(i32 64)
%4 = call i32 @put8(i32 15)
%5 = call i32 @put8(i32 146)
%6 = load i32, i32* %2
%7 = or i32 192, %6
%8 = call i32 @put8(i32 %7)
ret void
}

LLVM IR (-O2):
define void @setb_reg8(i32 %0) {
%2 = tail call i32 @put8(i32 64)
%3 = tail call i32 @put8(i32 15)
%4 = tail call i32 @put8(i32 146)
%5 = or i32 %0, 192
%6 = tail call i32 @put8(i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void draw_y(int offset) {
  for (int i = 0; i < offset; i++)
    printf(" ");
}


x86 assembly (clang, -O0):
<draw_y>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <draw_y+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <draw_y+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_y>:
push   %rbx
test   %edi,%edi
jle    112f <draw_y+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <draw_y+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @draw_y(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %4, %1
ret void
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = tail call i32 @putchar(i32 32)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %3, label %4
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void fprint_pop(FILE *stream, uint8_t direct) {
  fprintf(stream,
          "POP   "
          "0x%02X"
          "                      ",
          direct);
}


x86 assembly (clang, -O0):
<fprint_pop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fprint_pop>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"POP 0x%02X \00"
define void @fprint_pop(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"POP 0x%02X \00"
define void @fprint_pop(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
void v3scale(float *v, float div) {
  v[0] *= div;
  v[1] *= div;
  v[2] *= div;
}


x86 assembly (clang, -O0):
<v3scale>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulss  (%rax),%xmm0
movss  %xmm0,(%rax)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulss  0x4(%rax),%xmm0
movss  %xmm0,0x4(%rax)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulss  0x8(%rax),%xmm0
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<v3scale>:
movss  (%rdi),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,(%rdi)
movss  0x4(%rdi),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0x4(%rdi)
mulss  0x8(%rdi),%xmm0
movss  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @v3scale(float* %0, float %1) {
%3 = alloca float*
%4 = alloca float
store float* %0, float** %3
store float %1, float* %4
%5 = load float, float* %4
%6 = load float*, float** %3
%7 = getelementptr inbounds float, float* %6, i64 0
%8 = load float, float* %7
%9 = fmul float %8, %5
store float %9, float* %7
%10 = load float, float* %4
%11 = load float*, float** %3
%12 = getelementptr inbounds float, float* %11, i64 1
%13 = load float, float* %12
%14 = fmul float %13, %10
store float %14, float* %12
%15 = load float, float* %4
%16 = load float*, float** %3
%17 = getelementptr inbounds float, float* %16, i64 2
%18 = load float, float* %17
%19 = fmul float %18, %15
store float %19, float* %17
ret void
}

LLVM IR (-O2):
define void @v3scale(float* nocapture %0, float %1) {
%3 = load float, float* %0
%4 = fmul float %3, %1
store float %4, float* %0
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = fmul float %6, %1
store float %7, float* %5
%8 = getelementptr inbounds float, float* %0, i64 2
%9 = load float, float* %8
%10 = fmul float %9, %1
store float %10, float* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check(void *, int, char *, char const *);
void __is_true(void *context, const char *desc, const void *subject) {
  check(context, !subject, "%s is not true", desc);
}


x86 assembly (clang, -O0):
<__is_true>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
cmpq   $0x0,-0x18(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%esi
mov    -0x10(%rbp),%rcx
lea    0xebe(%rip),%rdx
call   1030 <check@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__is_true>:
mov    %rsi,%rcx
xor    %esi,%esi
test   %rdx,%rdx
sete   %sil
lea    0xedd(%rip),%rdx
jmp    1030 <check@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s is not true\00"
define void @__is_true(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %6
%9 = icmp ne i8* %8, null
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
%12 = load i8*, i8** %5
%13 = call i32 @check(i8* %7, i32 %11, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s is not true\00"
define void @__is_true(i8* %0, i8* %1, i8* readnone %2) {
%4 = icmp eq i8* %2, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @check(i8* %0, i32 %5, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
unsigned int _evhtp_quick_hash(const char *str) {
  unsigned int h = 0;
  for (; *str; str++) {
    h = 31 * h + *str;
  }
  return h;
}


x86 assembly (clang, -O0):
<_evhtp_quick_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113d <_evhtp_quick_hash+0x3d>
imul   $0x1f,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <_evhtp_quick_hash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_evhtp_quick_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <_evhtp_quick_hash+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
mov    %eax,%edx
shl    $0x5,%edx
sub    %eax,%edx
movsbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <_evhtp_quick_hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @_evhtp_quick_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 31
%9 = sext i8 %5 to i32
%10 = add i32 %8, %9
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %15
}
void PDMCritSectTryEnter(void) {}


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

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

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

LLVM IR (-O2):
define void @PDMCritSectTryEnter() {
ret void
}
void mdp4_wfd_pipe_queue(int cndx, struct mdp4_overlay_pipe *pipe) {}


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

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

LLVM IR (-O0):
%struct.mdp4_overlay_pipe = type opaque
define void @mdp4_wfd_pipe_queue(i32 %0, %struct.mdp4_overlay_pipe* %1) {
%3 = alloca i32
%4 = alloca %struct.mdp4_overlay_pipe*
store i32 %0, i32* %3
store %struct.mdp4_overlay_pipe* %1, %struct.mdp4_overlay_pipe** %4
ret void
}

LLVM IR (-O2):
%struct.mdp4_overlay_pipe = type opaque
define void @mdp4_wfd_pipe_queue(i32 %0, %struct.mdp4_overlay_pipe* nocapture %1) {
ret void
}
/* Variables and functions */
scalar_t__ is_pow2(int);
int pow2_next(int);
int pow2_prev(int n) {
  if (n <= 2) {
    return 1;
  }
  if (n <= 4) {
    return 2;
  }
  if (is_pow2(n)) {
    return n >> 1;
  }
  int n2 = n >> 1;
  return pow2_next(n2);
}


x86 assembly (clang, -O0):
<pow2_prev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jg     1141 <pow2_prev+0x21>
movl   $0x1,-0x4(%rbp)
jmp    118b <pow2_prev+0x6b>
cmpl   $0x4,-0x8(%rbp)
jg     1157 <pow2_prev+0x37>
movl   $0x2,-0x4(%rbp)
jmp    118b <pow2_prev+0x6b>
mov    -0x8(%rbp),%edi
call   1040 <is_pow2@plt>
cmp    $0x0,%rax
je     1177 <pow2_prev+0x57>
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    118b <pow2_prev+0x6b>
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <pow2_next@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow2_prev>:
push   %rbx
mov    $0x1,%eax
cmp    $0x3,%edi
jl     1147 <pow2_prev+0x27>
mov    %edi,%ebx
mov    $0x2,%eax
cmp    $0x5,%edi
jb     1147 <pow2_prev+0x27>
mov    %ebx,%edi
call   1040 <is_pow2@plt>
shr    %ebx
test   %rax,%rax
je     1149 <pow2_prev+0x29>
mov    %ebx,%eax
pop    %rbx
ret
mov    %ebx,%edi
pop    %rbx
jmp    1030 <pow2_next@plt>

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

LLVM IR (-O2):
define i32 @pow2_prev(i32 %0) {
%2 = icmp slt i32 %0, 3
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 5
br i1 %4, label %11, label %5
5: ; preds = %3
%6 = tail call i64 @is_pow2(i32 %0)
%7 = icmp eq i64 %6, 0
%8 = lshr i32 %0, 1
br i1 %7, label %9, label %11
9: ; preds = %5
%10 = tail call i32 @pow2_next(i32 %8)
br label %11
11: ; preds = %5, %3, %1, %9
%12 = phi i32 [ %10, %9 ], [ 1, %1 ], [ 2, %3 ], [ %8, %5 ]
ret i32 %12
}
int do_327() { return 327; }


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

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

LLVM IR (-O0):
define i32 @do_327() {
ret i32 327
}

LLVM IR (-O2):
define i32 @do_327() {
ret i32 327
}
char *ltostr(val, radix, uppercase)
long val;
int radix;
int uppercase;
{
  char *p;
  int flg = 0;
  if (val < 0) {
    flg++;
    val = -val;
  }
  p = ultostr(val, radix, uppercase);
  if (p && flg)
    *--p = '-';
  return p;
}


x86 assembly (clang, -O0):
<ltostr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1147 <ltostr+0x37>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    $0x0,%al
call   1030 <ultostr@plt>
cltq
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1186 <ltostr+0x76>
cmpl   $0x0,-0x1c(%rbp)
je     1186 <ltostr+0x76>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x2d,-0x1(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltostr>:
push   %rbx
mov    %rdi,%rbx
neg    %rdi
cmovs  %rbx,%rdi
xor    %eax,%eax
call   1030 <ultostr@plt>
mov    %eax,%ecx
cltq
test   %rbx,%rbx
jns    1137 <ltostr+0x27>
test   %ecx,%ecx
je     1137 <ltostr+0x27>
movb   $0x2d,-0x1(%rax)
add    $0xffffffffffffffff,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @ltostr(i64 %0, i32 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i64 %0, i64* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %8
%9 = load i64, i64* %4
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %3
%12 = load i32, i32* %8
%13 = add nsw i32 %12, 1
store i32 %13, i32* %8
%14 = load i64, i64* %4
%15 = sub nsw i64 0, %14
store i64 %15, i64* %4
br label %16
16: ; preds = %11, %3
%17 = load i64, i64* %4
%18 = load i32, i32* %5
%19 = load i32, i32* %6
%20 = call i32 (i64, i32, i32, ...) bitcast (i32 (...)* @ultostr to i32 (i64, i32, i32, ...)*)(i64 %17, i32 %18, i32 %19)
%21 = sext i32 %20 to i64
%22 = inttoptr i64 %21 to i8*
store i8* %22, i8** %7
%23 = load i8*, i8** %7
%24 = icmp ne i8* %23, null
br i1 %24, label %25, label %31
25: ; preds = %16
%26 = load i32, i32* %8
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %31
28: ; preds = %25
%29 = load i8*, i8** %7
%30 = getelementptr inbounds i8, i8* %29, i32 -1
store i8* %30, i8** %7
store i8 45, i8* %30
br label %31
31: ; preds = %28, %25, %16
%32 = load i8*, i8** %7
ret i8* %32
}

LLVM IR (-O2):
define i8* @ltostr(i64 %0, i32 %1, i32 %2) {
%4 = icmp slt i64 %0, 0
%5 = sub nsw i64 0, %0
%6 = select i1 %4, i64 %5, i64 %0
%7 = tail call i32 (i64, i32, i32, ...) bitcast (i32 (...)* @ultostr to i32 (i64, i32, i32, ...)*)(i64 %6, i32 %1, i32 %2)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
%10 = icmp ne i32 %7, 0
%11 = and i1 %4, %10
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = getelementptr inbounds i8, i8* %9, i64 -1
store i8 45, i8* %13
br label %14
14: ; preds = %12, %3
%15 = phi i8* [ %13, %12 ], [ %9, %3 ]
ret i8* %15
}
/* Variables and functions */
int /*<<< orphan*/ FatalUnexpected(char *);
void *malloc(size_t);
void *xcfmalloc(size_t size) {
  void *ptr = malloc(size);
  if (!ptr)
    FatalUnexpected(("Out of memory"));
  return ptr;
}


x86 assembly (clang, -O0):
<xcfmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <xcfmalloc+0x30>
lea    0xeb5(%rip),%rdi
call   1040 <FatalUnexpected@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcfmalloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xcfmalloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <FatalUnexpected@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Out of memory\00"
define i8* @xcfmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @FatalUnexpected(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [14 x i8] c"Out of memory\00"
define noalias i8* @xcfmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @FatalUnexpected(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
scalar_t__ getfname(char *, char *, int);
int /*<<< orphan*/ showfile(char *);
int /*<<< orphan*/ strcpy(char *, char *);
void subfunc2(void) {
  char fname[256];
  strcpy(fname, "../demos/tui.c");
  if (getfname("File to browse:", fname, 50))
    showfile(fname);
}


x86 assembly (clang, -O0):
<subfunc2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xeb7(%rip),%rsi
call   1040 <strcpy@plt>
lea    -0x100(%rbp),%rsi
lea    0xeb3(%rip),%rdi
mov    $0x32,%edx
call   1050 <getfname@plt>
cmp    $0x0,%rax
je     117c <subfunc2+0x4c>
lea    -0x100(%rbp),%rdi
call   1030 <showfile@plt>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<subfunc2>:
push   %rbx
sub    $0x100,%rsp
lea    0xec1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <strcpy@plt>
lea    0xebe(%rip),%rdi
mov    %rbx,%rsi
mov    $0x32,%edx
call   1050 <getfname@plt>
test   %rax,%rax
je     116b <subfunc2+0x3b>
mov    %rsp,%rdi
call   1030 <showfile@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"../demos/tui.c\00"
@.str.1 = [16 x i8] c"File to browse:\00"
define void @subfunc2() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i64 @getfname(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %4, i32 50)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%9 = call i32 @showfile(i8* %8)
br label %10
10: ; preds = %7, %0
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"../demos/tui.c\00"
@.str.1 = [16 x i8] c"File to browse:\00"
define void @subfunc2() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i64 @getfname(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %2, i32 50)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = call i32 @showfile(i8* %2)
br label %8
8: ; preds = %6, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error_msg(char *, char const *);
void dispatch_error(const char *msg) {
  error_msg("kernel.c dispatch_input: %s\n", msg);
}


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

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

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

LLVM IR (-O2):
@.str = [29 x i8] c"kernel.c dispatch_input: %s\0A\00"
define void @dispatch_error(i8* %0) {
%2 = tail call i32 @error_msg(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void signal_handler(int signo) {
  printf("do not fuck with a hacker!\n");
  exit(1);
}


x86 assembly (clang, -O0):
<signal_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<signal_handler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"do not fuck with a hacker!\0A\00"
define void @signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [27 x i8] c"do not fuck with a hacker!\00"
define void @signal_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
int dr_meet_ints(int x, int y) { return (x == y ? x : -1); }


x86 assembly (clang, -O0):
<dr_meet_ints>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1121 <dr_meet_ints+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    112e <dr_meet_ints+0x2e>
mov    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    112e <dr_meet_ints+0x2e>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dr_meet_ints>:
cmp    %esi,%edi
mov    $0xffffffff,%eax
cmove  %edi,%eax
ret

LLVM IR (-O0):
define i32 @dr_meet_ints(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 = icmp eq i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %11
10: ; preds = %2
br label %11
11: ; preds = %10, %8
%12 = phi i32 [ %9, %8 ], [ -1, %10 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @dr_meet_ints(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = select i1 %3, i32 %0, i32 -1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_setzero_si128();
int /*<<< orphan*/ clnh_partial_block_non_zero(int /*<<< orphan*/ *,
                                               int /*<<< orphan*/ *, size_t,
                                               int /*<<< orphan*/ *,
                                               int /*<<< orphan*/ *);
void clnh_partial_block(__m128i *k, __m128i *m, size_t len, __m128i *sum1,
                        __m128i *sum2) {
  *sum1 = _mm_setzero_si128();
  *sum2 = _mm_setzero_si128();
  clnh_partial_block_non_zero(k, m, len, sum1, sum2);
}


x86 assembly (clang, -O0):
<clnh_partial_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    $0x0,%al
call   1030 <_mm_setzero_si128@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1030 <_mm_setzero_si128@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1040 <clnh_partial_block_non_zero@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clnh_partial_block>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %r8,%r14
mov    %rcx,%rbx
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%r13
xor    %eax,%eax
call   1030 <_mm_setzero_si128@plt>
mov    %eax,(%rbx)
xor    %eax,%eax
call   1030 <_mm_setzero_si128@plt>
mov    %eax,(%r14)
mov    %r13,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %rbx,%rcx
mov    %r14,%r8
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1040 <clnh_partial_block_non_zero@plt>

LLVM IR (-O0):
define void @clnh_partial_block(i32* %0, i32* %1, i64 %2, i32* %3, i32* %4) {
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i64
%9 = alloca i32*
%10 = alloca i32*
store i32* %0, i32** %6
store i32* %1, i32** %7
store i64 %2, i64* %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = call i32 (...) @_mm_setzero_si128()
%12 = load i32*, i32** %9
store i32 %11, i32* %12
%13 = call i32 (...) @_mm_setzero_si128()
%14 = load i32*, i32** %10
store i32 %13, i32* %14
%15 = load i32*, i32** %6
%16 = load i32*, i32** %7
%17 = load i64, i64* %8
%18 = load i32*, i32** %9
%19 = load i32*, i32** %10
%20 = call i32 @clnh_partial_block_non_zero(i32* %15, i32* %16, i64 %17, i32* %18, i32* %19)
ret void
}

LLVM IR (-O2):
define void @clnh_partial_block(i32* %0, i32* %1, i64 %2, i32* %3, i32* %4) {
%6 = tail call i32 (...) @_mm_setzero_si128()
store i32 %6, i32* %3
%7 = tail call i32 (...) @_mm_setzero_si128()
store i32 %7, i32* %4
%8 = tail call i32 @clnh_partial_block_non_zero(i32* %0, i32* %1, i64 %2, i32* %3, i32* %4)
ret void
}
/* Variables and functions */
scalar_t__ ceil(double);
unsigned long long test3(double x) { return (unsigned long long)ceil(x); }


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

x86 assembly (clang, -O2):
<test3>:
jmp    1030 <ceil@plt>

LLVM IR (-O0):
define i64 @test3(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @ceil(double %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @test3(double %0) {
%2 = tail call i64 @ceil(double %0)
ret i64 %2
}
void ScaleRowDown34_16_C() {}


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

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

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

LLVM IR (-O2):
define void @ScaleRowDown34_16_C() {
ret void
}