xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ try_a(int);
int main(void) {
  if (try_a(42) < 0)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2a,%edi
call   1030 <try_a@plt>
cmp    $0x0,%rax
jge    114a <main+0x2a>
mov    $0x0,%al
call   1040 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2a,%edi
call   1030 <try_a@plt>
test   %rax,%rax
js     1134 <main+0x14>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @try_a(i32 42)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @try_a(i32 42)
%2 = icmp slt i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
void swap(int arr[], int x, int y) {
  int t;
  t = arr[x];
  arr[x] = arr[y];
  arr[y] = t;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage() {
  printf("Usage:\n");
  printf("-h\thelp\n");
  printf("-w N\twait for response N sec (0 - forever)\n");
}


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"Usage:\0A\00"
@.str.1 = [9 x i8] c"-h\09help\0A\00"
@.str.2 = [44 x i8] c"-w N\09wait for response N sec (0 - forever)\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"Usage:\00"
@str.3 = [8 x i8] c"-h\09help\00"
@str.4 = [43 x i8] c"-w N\09wait for response N sec (0 - forever)\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.4, i64 0, i64 0))
ret void
}
int IsLeapYear(int Year) {
  int LeapYear = 0;
  if (!(Year % 4)) {
    if (!(Year % 100)) {
      if (!(Year % 400))
        LeapYear = 1;
    } else
      LeapYear = 1;
  }
  return LeapYear;
}


x86 assembly (clang, -O0):
<IsLeapYear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1162 <IsLeapYear+0x62>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1156 <IsLeapYear+0x56>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1151 <IsLeapYear+0x51>
movl   $0x1,-0x8(%rbp)
jmp    115d <IsLeapYear+0x5d>
movl   $0x1,-0x8(%rbp)
jmp    1162 <IsLeapYear+0x62>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsLeapYear>:
xor    %eax,%eax
test   $0x3,%dil
je     1109 <IsLeapYear+0x9>
ret
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
mov    $0x1,%eax
cmp    $0x28f5c28,%edx
ja     1108 <IsLeapYear+0x8>
ror    $0x4,%ecx
xor    %eax,%eax
cmp    $0xa3d70b,%ecx
setb   %al
ret

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

LLVM IR (-O2):
define i32 @IsLeapYear(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = srem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 0, %1 ], [ %10, %7 ], [ 1, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_arm_clrex();
void test_clrex() { __builtin_arm_clrex(); }


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

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

LLVM IR (-O0):
define void @test_clrex() {
%1 = call i32 (...) @__builtin_arm_clrex()
ret void
}

LLVM IR (-O2):
define void @test_clrex() {
%1 = tail call i32 (...) @__builtin_arm_clrex()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set(int, int, int, int, int, int);
void vlen_vs_alpha(int y, int invert) {
  set(100, y, 620, 300, (invert ? 0x7F : 0), 0x0001 | 0x0010);
  set(100, y, 620, 420, (invert ? 0 : 0x7F), 0x0001 | 0x0010);
}


x86 assembly (clang, -O0):
<vlen_vs_alpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%ecx
xor    %r8d,%r8d
mov    $0x7f,%eax
cmp    $0x0,%ecx
cmovne %eax,%r8d
mov    $0x64,%edi
mov    $0x26c,%edx
mov    $0x12c,%ecx
mov    $0x11,%r9d
call   1030 <set@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%ecx
mov    $0x7f,%r8d
xor    %eax,%eax
cmp    $0x0,%ecx
cmovne %eax,%r8d
mov    $0x64,%edi
mov    $0x26c,%edx
mov    $0x1a4,%ecx
mov    $0x11,%r9d
call   1030 <set@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vlen_vs_alpha>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%r8d
mov    %edi,%ebx
xor    %ebp,%ebp
test   %esi,%esi
mov    $0x7f,%eax
cmovne %eax,%r8d
cmove  %eax,%ebp
mov    $0x64,%edi
mov    %ebx,%esi
mov    $0x26c,%edx
mov    $0x12c,%ecx
mov    $0x11,%r9d
call   1030 <set@plt>
mov    $0x64,%edi
mov    %ebx,%esi
mov    $0x26c,%edx
mov    $0x1a4,%ecx
mov    %ebp,%r8d
mov    $0x11,%r9d
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <set@plt>

LLVM IR (-O0):
define void @vlen_vs_alpha(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 ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 127, i32 0
%10 = call i32 @set(i32 100, i32 %5, i32 620, i32 300, i32 %9, i32 17)
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 0
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 0, i32 127
%16 = call i32 @set(i32 100, i32 %11, i32 620, i32 420, i32 %15, i32 17)
ret void
}

LLVM IR (-O2):
define void @vlen_vs_alpha(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i32 0, i32 127
%5 = tail call i32 @set(i32 100, i32 %0, i32 620, i32 300, i32 %4, i32 17)
%6 = select i1 %3, i32 127, i32 0
%7 = tail call i32 @set(i32 100, i32 %0, i32 620, i32 420, i32 %6, i32 17)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ testpipe_with_exec(char **);
int main(int argc, char *argv[], char *envp[]) {
  testpipe_with_exec(envp);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rdx,%rdi
call   1030 <testpipe_with_exec@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** %2) {
%4 = tail call i32 @testpipe_with_exec(i8** %2)
ret i32 0
}
void ramips_register_gpio_leds(int id, unsigned num_leds,
                               struct gpio_led *leds) {}


x86 assembly (clang, -O0):
<ramips_register_gpio_leds>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.gpio_led = type opaque
define void @ramips_register_gpio_leds(i32 %0, i32 %1, %struct.gpio_led* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.gpio_led*
store i32 %0, i32* %4
store i32 %1, i32* %5
store %struct.gpio_led* %2, %struct.gpio_led** %6
ret void
}

LLVM IR (-O2):
%struct.gpio_led = type opaque
define void @ramips_register_gpio_leds(i32 %0, i32 %1, %struct.gpio_led* nocapture %2) {
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
uint32_t log10Pow2(const int32_t e) {
  assert(e >= 0);
  assert(e <= 1650);
  return (((uint32_t)e) * 78913) >> 18;
}


x86 assembly (clang, -O0):
<log10Pow2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x672,-0x4(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
imul   $0x13441,-0x4(%rbp),%eax
sar    $0x12,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log10Pow2>:
push   %rbx
mov    %edi,%ebx
not    %edi
shr    $0x1f,%edi
call   1030 <assert@plt>
xor    %edi,%edi
cmp    $0x673,%ebx
setl   %dil
call   1030 <assert@plt>
imul   $0x13441,%ebx,%eax
sar    $0x12,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @log10Pow2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i32, i32* %2
%8 = icmp sle i32 %7, 1650
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i32, i32* %2
%12 = mul nsw i32 %11, 78913
%13 = ashr i32 %12, 18
ret i32 %13
}

LLVM IR (-O2):
define i32 @log10Pow2(i32 %0) {
%2 = xor i32 %0, -1
%3 = lshr i32 %2, 31
%4 = tail call i32 @assert(i32 %3)
%5 = icmp slt i32 %0, 1651
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = mul nsw i32 %0, 78913
%9 = ashr i32 %8, 18
ret i32 %9
}
void http_lib_done(void) {}


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

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

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

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


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @g_signal_add_emission_hook() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_inthash();
int /*<<< orphan*/ test_many();
int /*<<< orphan*/ test_strhash();
int main() {
  test_inthash();
  test_strhash();
  test_many();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <test_inthash@plt>
mov    $0x0,%al
call   1040 <test_strhash@plt>
mov    $0x0,%al
call   1030 <test_many@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <test_inthash@plt>
xor    %eax,%eax
call   1040 <test_strhash@plt>
xor    %eax,%eax
call   1030 <test_many@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_inthash()
%3 = call i32 (...) @test_strhash()
%4 = call i32 (...) @test_many()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_inthash()
%2 = tail call i32 (...) @test_strhash()
%3 = tail call i32 (...) @test_many()
ret i32 0
}
unsigned int djb(value)
unsigned int value;
{
  unsigned int hash = 5381;
  hash = ((hash << 5) + hash) + ((value >> 0) & 0xFF);
  hash = ((hash << 5) + hash) + ((value >> 8) & 0xFF);
  hash = ((hash << 5) + hash) + ((value >> 16) & 0xFF);
  hash = ((hash << 5) + hash) + ((value >> 24) & 0xFF);
  return (hash & 0x7FFFFFFF);
}


x86 assembly (clang, -O0):
<djb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1505,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x5,%eax
add    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x0,%ecx
and    $0xff,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x5,%eax
add    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x8,%ecx
and    $0xff,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x5,%eax
add    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x10,%ecx
and    $0xff,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x5,%eax
add    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x18,%ecx
and    $0xff,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x7fffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<djb>:
mov    %edi,%eax
movzbl %al,%ecx
mov    %ecx,%edx
shl    $0x5,%edx
add    %ecx,%edx
movzbl %ah,%ecx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x5,%edx
add    %ecx,%edx
mov    %edi,%ecx
shr    $0x10,%ecx
movzbl %cl,%ecx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x5,%edx
add    %ecx,%edx
shr    $0x18,%eax
add    %edx,%eax
add    $0x7c5d0f85,%eax
ret

LLVM IR (-O0):
define i32 @djb(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 5381, i32* %3
%4 = load i32, i32* %3
%5 = shl i32 %4, 5
%6 = load i32, i32* %3
%7 = add i32 %5, %6
%8 = load i32, i32* %2
%9 = lshr i32 %8, 0
%10 = and i32 %9, 255
%11 = add i32 %7, %10
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = shl i32 %12, 5
%14 = load i32, i32* %3
%15 = add i32 %13, %14
%16 = load i32, i32* %2
%17 = lshr i32 %16, 8
%18 = and i32 %17, 255
%19 = add i32 %15, %18
store i32 %19, i32* %3
%20 = load i32, i32* %3
%21 = shl i32 %20, 5
%22 = load i32, i32* %3
%23 = add i32 %21, %22
%24 = load i32, i32* %2
%25 = lshr i32 %24, 16
%26 = and i32 %25, 255
%27 = add i32 %23, %26
store i32 %27, i32* %3
%28 = load i32, i32* %3
%29 = shl i32 %28, 5
%30 = load i32, i32* %3
%31 = add i32 %29, %30
%32 = load i32, i32* %2
%33 = lshr i32 %32, 24
%34 = and i32 %33, 255
%35 = add i32 %31, %34
store i32 %35, i32* %3
%36 = load i32, i32* %3
%37 = and i32 %36, 2147483647
ret i32 %37
}

LLVM IR (-O2):
define i32 @djb(i32 %0) {
%2 = and i32 %0, 255
%3 = mul nuw nsw i32 %2, 33
%4 = add nuw nsw i32 %3, 5859909
%5 = lshr i32 %0, 8
%6 = and i32 %5, 255
%7 = add nuw nsw i32 %4, %6
%8 = mul nuw nsw i32 %7, 33
%9 = lshr i32 %0, 16
%10 = and i32 %9, 255
%11 = add nuw nsw i32 %8, %10
%12 = mul i32 %11, 33
%13 = lshr i32 %0, 24
%14 = add nuw nsw i32 %12, %13
ret i32 %14
}
void os_chk_robin(void) { ; }


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

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

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

LLVM IR (-O2):
define void @os_chk_robin() {
ret void
}
int parse_command_line(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @parse_command_line() {
ret i32 1
}

LLVM IR (-O2):
define i32 @parse_command_line() {
ret i32 1
}
/* Variables and functions */
size_t skip_multibyte_char(char c) { return 0; }


x86 assembly (clang, -O0):
<skip_multibyte_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @skip_multibyte_char(i8 signext %0) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ fun3();
int /*<<< orphan*/ fun4();
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  fun3();
  printf("---\n");
  fun4();
  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   1050 <fun3@plt>
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <fun4@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"---\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 (...) @fun3()
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (...) @fun4()
ret i32 0
}

LLVM IR (-O2):
@str = [4 x i8] c"---\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @fun3()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 (...) @fun4()
ret i32 0
}
int test_imm_C4uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0xC4 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_C4uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 841813590016
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
size_t mem_size(char *);
size_t str_capacity(char *str) { return (mem_size(str)); }


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

x86 assembly (clang, -O2):
<str_capacity>:
jmp    1030 <mem_size@plt>

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

LLVM IR (-O2):
define i64 @str_capacity(i8* %0) {
%2 = tail call i64 @mem_size(i8* %0)
ret i64 %2
}
void pcp_print_net_etcp_stats(struct activity *a, int curr) {}


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

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

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

LLVM IR (-O2):
%struct.activity = type opaque
define void @pcp_print_net_etcp_stats(%struct.activity* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int, int);
int main(void) {
  foo(5, 6);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
mov    $0x6,%esi
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0x6,%esi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 5, i32 6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 5, i32 6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ buzzer_OFF();
int /*<<< orphan*/ buzzer_ON();
int /*<<< orphan*/ buzzer_init();
int /*<<< orphan*/ delay();
int main() {
  buzzer_init();
  buzzer_ON();
  delay();
  buzzer_OFF();
  delay();
  buzzer_ON();
  delay();
  buzzer_OFF();
  delay();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <buzzer_init@plt>
mov    $0x0,%al
call   1050 <buzzer_ON@plt>
mov    $0x0,%al
call   1030 <delay@plt>
mov    $0x0,%al
call   1040 <buzzer_OFF@plt>
mov    $0x0,%al
call   1030 <delay@plt>
mov    $0x0,%al
call   1050 <buzzer_ON@plt>
mov    $0x0,%al
call   1030 <delay@plt>
mov    $0x0,%al
call   1040 <buzzer_OFF@plt>
mov    $0x0,%al
call   1030 <delay@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <buzzer_init@plt>
xor    %eax,%eax
call   1050 <buzzer_ON@plt>
xor    %eax,%eax
call   1030 <delay@plt>
xor    %eax,%eax
call   1040 <buzzer_OFF@plt>
xor    %eax,%eax
call   1030 <delay@plt>
xor    %eax,%eax
call   1050 <buzzer_ON@plt>
xor    %eax,%eax
call   1030 <delay@plt>
xor    %eax,%eax
call   1040 <buzzer_OFF@plt>
xor    %eax,%eax
call   1030 <delay@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @buzzer_init()
%3 = call i32 (...) @buzzer_ON()
%4 = call i32 (...) @delay()
%5 = call i32 (...) @buzzer_OFF()
%6 = call i32 (...) @delay()
%7 = call i32 (...) @buzzer_ON()
%8 = call i32 (...) @delay()
%9 = call i32 (...) @buzzer_OFF()
%10 = call i32 (...) @delay()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @buzzer_init()
%2 = tail call i32 (...) @buzzer_ON()
%3 = tail call i32 (...) @delay()
%4 = tail call i32 (...) @buzzer_OFF()
%5 = tail call i32 (...) @delay()
%6 = tail call i32 (...) @buzzer_ON()
%7 = tail call i32 (...) @delay()
%8 = tail call i32 (...) @buzzer_OFF()
%9 = tail call i32 (...) @delay()
ret i32 0
}
/* Variables and functions */
char thermo_hi_threshold_get();
int /*<<< orphan*/ thermo_hi_threshold_set(char);
void thermo_hi_threshold_dec() {
  char val;
  val = thermo_hi_threshold_get();
  if (val == (128))
    return;
  if (val > (-55)) {
    val--;
    thermo_hi_threshold_set(val);
  }
}


x86 assembly (clang, -O0):
<thermo_hi_threshold_dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <thermo_hi_threshold_get@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x80,%eax
jne    1146 <thermo_hi_threshold_dec+0x26>
jmp    1164 <thermo_hi_threshold_dec+0x44>
movsbl -0x1(%rbp),%eax
cmp    $0xffffffc9,%eax
jle    1164 <thermo_hi_threshold_dec+0x44>
mov    -0x1(%rbp),%al
add    $0xff,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <thermo_hi_threshold_set@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thermo_hi_threshold_dec>:
push   %rax
xor    %eax,%eax
call   1040 <thermo_hi_threshold_get@plt>
cmp    $0xca,%al
jl     1137 <thermo_hi_threshold_dec+0x17>
add    $0xff,%al
movsbl %al,%edi
pop    %rax
jmp    1030 <thermo_hi_threshold_set@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @thermo_hi_threshold_dec() {
%1 = alloca i8
%2 = call signext i8 (...) @thermo_hi_threshold_get()
store i8 %2, i8* %1
%3 = load i8, i8* %1
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 128
br i1 %5, label %6, label %7
6: ; preds = %0
br label %16
7: ; preds = %0
%8 = load i8, i8* %1
%9 = sext i8 %8 to i32
%10 = icmp sgt i32 %9, -55
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8, i8* %1
%13 = add i8 %12, -1
store i8 %13, i8* %1
%14 = load i8, i8* %1
%15 = call i32 @thermo_hi_threshold_set(i8 signext %14)
br label %16
16: ; preds = %6, %11, %7
ret void
}

LLVM IR (-O2):
define void @thermo_hi_threshold_dec() {
%1 = tail call signext i8 (...) @thermo_hi_threshold_get()
%2 = icmp sgt i8 %1, -55
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = add nsw i8 %1, -1
%5 = tail call i32 @thermo_hi_threshold_set(i8 signext %4)
br label %6
6: ; preds = %0, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ useconds_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int usleep(useconds_t useconds) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<usleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usleep>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @usleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @ENOSYS
%4 = call i32 @__set_errno(i32 %3)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @usleep(i32 %0) {
%2 = load i32, i32* @ENOSYS
%3 = tail call i32 @__set_errno(i32 %2)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ ABMON_2;
char *nl_langinfo(int /*<<< orphan*/);
char *langinfo_abmon_2() { return nl_langinfo(ABMON_2); }


x86 assembly (clang, -O0):
<langinfo_abmon_2>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <nl_langinfo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<langinfo_abmon_2>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <nl_langinfo@plt>

LLVM IR (-O0):
@ABMON_2 = global i32 0
define i8* @langinfo_abmon_2() {
%1 = load i32, i32* @ABMON_2
%2 = call i8* @nl_langinfo(i32 %1)
ret i8* %2
}

LLVM IR (-O2):
@ABMON_2 = global i32 0
define i8* @langinfo_abmon_2() {
%1 = load i32, i32* @ABMON_2
%2 = tail call i8* @nl_langinfo(i32 %1)
ret i8* %2
}
float idf(float x) { return (x); }


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

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

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

LLVM IR (-O2):
define float @idf(float returned %0) {
ret float %0
}
unsigned long long int startTimer(void) {
  unsigned a, d;
  __asm__ volatile("CPUID\n\t"
                   "RDTSC\n\t"
                   "mov %%edx, %0\n\t"
                   "mov %%eax, %1\n\t"
                   : "=r"(d), "=r"(a)::"%rax", "%rbx", "%rcx", "%rdx");
  return ((unsigned long long)a) | (((unsigned long long)d) << 32);
  ;
}


x86 assembly (clang, -O0):
<startTimer>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
cpuid
rdtsc
mov    %edx,%esi
mov    %eax,%edi
mov    %edi,-0x14(%rbp)
mov    %esi,-0x18(%rbp)
mov    -0x18(%rbp),%ecx
mov    -0x14(%rbp),%eax
mov    %ecx,-0x10(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    $0x20,%rcx
or     %rcx,%rax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<startTimer>:
push   %rbx
cpuid
rdtsc
mov    %edx,%esi
mov    %eax,%edi
mov    %edi,%eax
shl    $0x20,%rsi
or     %rax,%rsi
mov    %rsi,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @startTimer() {
%1 = alloca i32
%2 = alloca i32
%3 = call { i32, i32 } asm sideeffect "CPUID\0A\09RDTSC\0A\09mov %edx, $0\0A\09mov %eax, $1\0A\09", "=r,=r,~{rax},~{rbx},~{rcx},~{rdx},~{dirflag},~{fpsr},~{flags}"()
%4 = extractvalue { i32, i32 } %3, 0
%5 = extractvalue { i32, i32 } %3, 1
store i32 %4, i32* %2
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = zext i32 %6 to i64
%8 = load i32, i32* %2
%9 = zext i32 %8 to i64
%10 = shl i64 %9, 32
%11 = or i64 %7, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @startTimer() {
%1 = tail call { i32, i32 } asm sideeffect "CPUID\0A\09RDTSC\0A\09mov %edx, $0\0A\09mov %eax, $1\0A\09", "=r,=r,~{rax},~{rbx},~{rcx},~{rdx},~{dirflag},~{fpsr},~{flags}"()
%2 = extractvalue { i32, i32 } %1, 0
%3 = extractvalue { i32, i32 } %1, 1
%4 = zext i32 %3 to i64
%5 = zext i32 %2 to i64
%6 = shl nuw i64 %5, 32
%7 = or i64 %6, %4
ret i64 %7
}
void calc_sum(int *n, int upper) {
  int sum;
  int i;
  sum = 0;
  for (i = 0; i < upper; ++i) {
    sum += i;
  }
  *n = sum;
}


x86 assembly (clang, -O0):
<calc_sum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113c <calc_sum+0x3c>
mov    -0x14(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1119 <calc_sum+0x19>
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_sum>:
test   %esi,%esi
jle    111a <calc_sum+0x1a>
lea    -0x1(%rsi),%eax
lea    -0x2(%rsi),%ecx
imul   %rax,%rcx
shr    %rcx
lea    (%rcx,%rsi,1),%eax
add    $0xffffffff,%eax
mov    %eax,(%rdi)
ret
xor    %eax,%eax
mov    %eax,(%rdi)
ret

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

LLVM IR (-O2):
define void @calc_sum(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = add nsw i32 %1, -1
%6 = zext i32 %5 to i33
%7 = add nsw i32 %1, -2
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %11, %1
%13 = add i32 %12, -1
br label %14
14: ; preds = %4, %2
%15 = phi i32 [ 0, %2 ], [ %13, %4 ]
store i32 %15, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void shl_closep(int *p) {
  if (*p >= 0)
    close(*p);
}


x86 assembly (clang, -O0):
<shl_closep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jl     1134 <shl_closep+0x24>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shl_closep>:
mov    (%rdi),%edi
test   %edi,%edi
js     111b <shl_closep+0xb>
jmp    1030 <close@plt>
ret

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

LLVM IR (-O2):
define void @shl_closep(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp sgt i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @close(i32 %2)
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar1(char *, int);
void foo1(int size) {
  char temp[size];
  temp[size - 1] = '\0';
  bar1(temp, size);
}


x86 assembly (clang, -O0):
<foo1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,%rsp
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
cltq
movb   $0x0,(%rdi,%rax,1)
mov    -0x4(%rbp),%esi
call   1030 <bar1@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,%ecx
mov    %rsp,%rax
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
sub    %rcx,%rax
mov    %rax,%rsp
movslq %edi,%rsi
movb   $0x0,-0x1(%rsi,%rax,1)
mov    %rax,%rdi
call   1030 <bar1@plt>
mov    %rbp,%rsp
pop    %rbp
ret

LLVM IR (-O0):
define void @foo1(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %3
%8 = alloca i8, i64 %6
store i64 %6, i64* %4
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %8, i64 %11
store i8 0, i8* %12
%13 = load i32, i32* %2
%14 = call i32 @bar1(i8* %8, i32 %13)
%15 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
define void @foo1(i32 %0) {
%2 = zext i32 %0 to i64
%3 = alloca i8, i64 %2
%4 = add nsw i32 %0, -1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %3, i64 %5
store i8 0, i8* %6
%7 = call i32 @bar1(i8* %3, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_ada_comment_entities();
int /*<<< orphan*/ test_ada_comments();
void all_ada_tests() {
  test_ada_comments();
  test_ada_comment_entities();
}


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

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

LLVM IR (-O0):
define void @all_ada_tests() {
%1 = call i32 (...) @test_ada_comments()
%2 = call i32 (...) @test_ada_comment_entities()
ret void
}

LLVM IR (-O2):
define void @all_ada_tests() {
%1 = tail call i32 (...) @test_ada_comments()
%2 = tail call i32 (...) @test_ada_comment_entities()
ret void
}
A0AX1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{ (*((short *)10000000)) = (((short *)11111111)[x1]); }


x86 assembly (clang, -O0):
<A0AX1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movslq -0x10(%rbp),%rcx
mov    $0xa98ac7,%eax
mov    (%rax,%rcx,2),%cx
mov    $0x989680,%eax
mov    %cx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<A0AX1>:
movslq %ecx,%rax
movzwl 0xa98ac7(%rax,%rax,1),%eax
mov    %ax,0x989680
ret

LLVM IR (-O0):
define i32 @A0AX1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i32, i32* %11
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i16, i16* inttoptr (i64 11111111 to i16*), i64 %17
%19 = load i16, i16* %18
store i16 %19, i16* inttoptr (i64 10000000 to i16*)
%20 = load i32, i32* %7
ret i32 %20
}

LLVM IR (-O2):
define i32 @A0AX1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture readnone %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i16, i16* inttoptr (i64 11111111 to i16*), i64 %7
%9 = load i16, i16* %8
store i16 %9, i16* inttoptr (i64 10000000 to i16*)
ret i32 undef
}
/* Type definitions */
struct rlimit {
  int dummy;
};
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int syscall(int, int /*<<< orphan*/, int, struct rlimit const *,
            struct rlimit *);
int prlimit(pid_t pid, int resource, const struct rlimit *new_limit,
            struct rlimit *old_limit) {
  return syscall(369, pid, resource, new_limit, old_limit);
}


x86 assembly (clang, -O0):
<prlimit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    $0x171,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prlimit>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %esi,%edx
mov    %edi,%esi
mov    $0x171,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.rlimit = type { i32 }
define i32 @prlimit(i32 %0, i32 %1, %struct.rlimit* %2, %struct.rlimit* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.rlimit*
%8 = alloca %struct.rlimit*
store i32 %0, i32* %5
store i32 %1, i32* %6
store %struct.rlimit* %2, %struct.rlimit** %7
store %struct.rlimit* %3, %struct.rlimit** %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load %struct.rlimit*, %struct.rlimit** %7
%12 = load %struct.rlimit*, %struct.rlimit** %8
%13 = call i32 @syscall(i32 369, i32 %9, i32 %10, %struct.rlimit* %11, %struct.rlimit* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.rlimit = type { i32 }
define i32 @prlimit(i32 %0, i32 %1, %struct.rlimit* %2, %struct.rlimit* %3) {
%5 = tail call i32 @syscall(i32 369, i32 %0, i32 %1, %struct.rlimit* %2, %struct.rlimit* %3)
ret i32 %5
}
void foo_2_1_1_1_1_2_1_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_1_1_1_2_1_2_2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ err_exit(char *, char *, int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void lsd_fatal_error(char *file, int line, char *mesg) {
  err_exit("LSD FATAL ERROR(%s:%d) %s: %s", file, line, mesg, strerror(errno));
}


x86 assembly (clang, -O0):
<lsd_fatal_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x30(%rbp),%rsi
mov    -0x24(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    %eax,%r8d
lea    0xe94(%rip),%rdi
call   1030 <err_exit@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lsd_fatal_error>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xebf(%rip),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
mov    %r14,%rcx
mov    %eax,%r8d
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <err_exit@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"LSD FATAL ERROR(%s:%d) %s: %s\00"
@errno = global i32 0
define void @lsd_fatal_error(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = load i32, i32* @errno
%11 = call i32 @strerror(i32 %10)
%12 = call i32 @err_exit(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8, i8* %9, i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"LSD FATAL ERROR(%s:%d) %s: %s\00"
@errno = global i32 0
define void @lsd_fatal_error(i8* %0, i32 %1, i8* %2) {
%4 = load i32, i32* @errno
%5 = tail call i32 @strerror(i32 %4)
%6 = tail call i32 @err_exit(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %2, i32 %5)
ret void
}
void yyerror(s) char *s;
{
  printf("%s\n", s);
  printf("Exiting with -1 status\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<yyerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [24 x i8] c"Exiting with -1 status\0A\00"
define void @yyerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
unreachable
}

LLVM IR (-O2):
@str = [23 x i8] c"Exiting with -1 status\00"
define void @yyerror(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
tail call void @exit(i32 -1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int setgidx(int, int /*<<< orphan*/);
int __setegid(gid_t gid) { return setgidx(0x01, gid); }


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

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

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

LLVM IR (-O2):
define i32 @__setegid(i32 %0) {
%2 = tail call i32 @setgidx(i32 1, i32 %0)
ret i32 %2
}
void do_gen_test(int got_num, int base_seed) {}


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

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

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

LLVM IR (-O2):
define void @do_gen_test(i32 %0, i32 %1) {
ret void
}
int is_barebox_arm_head(const char *head) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @is_barebox_arm_head(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void handle_error(char *message) {
  printf("error: %s", message);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<handle_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<handle_error>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"error: %s\00"
@EXIT_SUCCESS = global i32 0
define void @handle_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @EXIT_SUCCESS
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@.str = [10 x i8] c"error: %s\00"
@EXIT_SUCCESS = global i32 0
define void @handle_error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int tst_dir_is_empty_(void (*)(), char const *, int);
int tst_dir_is_empty(void (*cleanup)(void), const char *name, int verbose) {
  return tst_dir_is_empty_(cleanup, name, verbose);
}


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

x86 assembly (clang, -O2):
<tst_dir_is_empty>:
jmp    1030 <tst_dir_is_empty_@plt>

LLVM IR (-O0):
define i32 @tst_dir_is_empty(void ()* %0, i8* %1, i32 %2) {
%4 = alloca void ()*
%5 = alloca i8*
%6 = alloca i32
store void ()* %0, void ()** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load void ()*, void ()** %4
%8 = bitcast void ()* %7 to void (...)*
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @tst_dir_is_empty_(void (...)* %8, i8* %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @tst_dir_is_empty(void ()* %0, i8* %1, i32 %2) {
%4 = bitcast void ()* %0 to void (...)*
%5 = tail call i32 @tst_dir_is_empty_(void (...)* %4, i8* %1, i32 %2)
ret i32 %5
}