xunge/DecIR huggingface dataset:
unsigned int three_bytes_to_uint(const unsigned char *source) {
  return (source[2] + source[1] * 256 + source[0] * 65536);
}


x86 assembly (clang, -O0):
<three_bytes_to_uint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<three_bytes_to_uint>:
movzwl 0x1(%rdi),%ecx
shl    $0x10,%ecx
bswap  %ecx
movzbl (%rdi),%eax
shl    $0x10,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @three_bytes_to_uint(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 2
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = mul nsw i32 %10, 256
%12 = add nsw i32 %6, %11
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 0
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = mul nsw i32 %16, 65536
%18 = add nsw i32 %12, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @three_bytes_to_uint(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 8
%9 = or i32 %8, %4
%10 = load i8, i8* %0
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %9, %12
ret i32 %13
}
int count_bits(int num) {
  int count;
  count = 0;
  while (num > 0) {
    if (num & 0x1) {
      count++;
    }
    num >>= 1;
  }
  return count;
}


x86 assembly (clang, -O0):
<count_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    113e <count_bits+0x3e>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1130 <count_bits+0x30>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <count_bits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_bits>:
xor    %eax,%eax
test   %edi,%edi
jle    1120 <count_bits+0x20>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x1,%edx
add    %edx,%eax
shr    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <count_bits+0x10>
ret

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

LLVM IR (-O2):
define i32 @count_bits(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %10
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = and i32 %5, 1
%7 = add nuw nsw i32 %4, %6
%8 = lshr i32 %5, 1
%9 = icmp ult i32 %5, 2
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
const char *Slice_Brief(void) { return "Partial Iterable"; }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"Partial Iterable\00"
define i8* @Slice_Brief() {
ret i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [17 x i8] c"Partial Iterable\00"
define i8* @Slice_Brief() {
ret i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0)
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;
struct TYPE_2__ {
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
uint64_t cl_key_from_mac(uint8_t hw[6]) {
  union {
    uint8_t hw[6];
    uint64_t key;
  } key = {{0}};
  memcpy(key.hw, hw, sizeof(key.hw));
  return key.key;
}


x86 assembly (clang, -O0):
<cl_key_from_mac>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1030 <memset@plt>
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x18,%edx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cl_key_from_mac>:
sub    $0x18,%rsp
mov    %rdi,%rsi
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movq   $0x0,0x10(%rsp)
mov    %rsp,%rdi
mov    $0x18,%edx
call   1030 <memcpy@plt>
mov    (%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%union.anon = type { [6 x i32] }
define i32 @cl_key_from_mac(i32* %0) {
%2 = alloca i32*
%3 = alloca %union.anon
store i32* %0, i32** %2
%4 = bitcast %union.anon* %3 to i8*
%5 = bitcast %union.anon* %3 to [6 x i32]*
%6 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 0
%7 = load i32*, i32** %2
%8 = call i32 @memcpy(i32* %6, i32* %7, i32 24)
%9 = bitcast %union.anon* %3 to i32*
%10 = load i32, i32* %9
ret i32 %10
}

LLVM IR (-O2):
%union.anon = type { [6 x i32] }
define i32 @cl_key_from_mac(i32* %0) {
%2 = alloca %union.anon
%3 = bitcast %union.anon* %2 to i8*
%4 = getelementptr inbounds %union.anon, %union.anon* %2, i64 0, i32 0, i64 0
%5 = call i32 @memcpy(i32* %4, i32* %0, i32 24)
%6 = load i32, i32* %4
ret i32 %6
}
int vlan_gvrp_request_join(const struct net_device *dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.net_device = type opaque
define i32 @vlan_gvrp_request_join(%struct.net_device* nocapture readnone %0) {
ret i32 0
}
int check(x, y, v)
int x, y, v;
{ return (four_elems(x, y, v) || fixed_elems(x, y) || check_wall_cap()); }


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    $0x0,%al
call   1030 <four_elems@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
jne    118e <check+0x5e>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x0,%al
call   1040 <fixed_elems@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
jne    118e <check+0x5e>
mov    $0x0,%al
call   1050 <check_wall_cap@plt>
cmp    $0x0,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <four_elems@plt>
mov    $0x1,%r14d
test   %eax,%eax
jne    1168 <check+0x38>
mov    %ebx,%edi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <fixed_elems@plt>
test   %eax,%eax
jne    1168 <check+0x38>
xor    %eax,%eax
call   1050 <check_wall_cap@plt>
xor    %r14d,%r14d
test   %eax,%eax
setne  %r14b
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @check(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @four_elems to i32 (i32, i32, i32, ...)*)(i32 %7, i32 %8, i32 %9)
%11 = icmp ne i32 %10, 0
br i1 %11, label %20, label %12
12: ; preds = %3
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = call i32 (i32, i32, ...) bitcast (i32 (...)* @fixed_elems to i32 (i32, i32, ...)*)(i32 %13, i32 %14)
%16 = icmp ne i32 %15, 0
br i1 %16, label %20, label %17
17: ; preds = %12
%18 = call i32 (...) @check_wall_cap()
%19 = icmp ne i32 %18, 0
br label %20
20: ; preds = %17, %12, %3
%21 = phi i1 [ true, %12 ], [ true, %3 ], [ %19, %17 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @check(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @four_elems to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @fixed_elems to i32 (i32, i32, ...)*)(i32 %0, i32 %1)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = tail call i32 (...) @check_wall_cap()
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %9, %6, %3
%14 = phi i32 [ 1, %6 ], [ 1, %3 ], [ %12, %9 ]
ret i32 %14
}
extern void timer_initialize_rate(unsigned char divisor) {
  *(volatile unsigned char *)(0 + 0x3b) = divisor;
}


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

x86 assembly (clang, -O2):
<timer_initialize_rate>:
mov    %dil,0x3b
ret

LLVM IR (-O0):
define void @timer_initialize_rate(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
store volatile i8 %3, i8* inttoptr (i64 59 to i8*)
ret void
}

LLVM IR (-O2):
define void @timer_initialize_rate(i8 zeroext %0) {
store volatile i8 %0, i8* inttoptr (i64 59 to i8*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LC_ALL;
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int toupper(int);
int ls_toupper(int c) {
  int ret;
  setlocale(LC_ALL, "");
  ret = toupper(c);
  setlocale(LC_ALL, "C");
  return ret;
}


x86 assembly (clang, -O0):
<ls_toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec6(%rip),%rsi
call   1040 <setlocale@plt>
mov    -0x4(%rbp),%edi
call   1030 <toupper@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
lea    0xea5(%rip),%rsi
call   1040 <setlocale@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_toupper>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2eb3(%rip),%r14
mov    (%r14),%edi
lea    0xeca(%rip),%rsi
call   1040 <setlocale@plt>
mov    %ebx,%edi
call   1030 <toupper@plt>
mov    %eax,%ebx
mov    (%r14),%edi
lea    0xeb1(%rip),%rsi
call   1040 <setlocale@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [2 x i8] c"C\00"
define i32 @ls_toupper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* @LC_ALL
%5 = call i32 @setlocale(i32 %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %2
%7 = call i32 @toupper(i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* @LC_ALL
%9 = call i32 @setlocale(i32 %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [2 x i8] c"C\00"
define i32 @ls_toupper(i32 %0) {
%2 = load i32, i32* @LC_ALL
%3 = tail call i32 @setlocale(i32 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @toupper(i32 %0)
%5 = load i32, i32* @LC_ALL
%6 = tail call i32 @setlocale(i32 %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 %4
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int copy_dobldobl_Laurent_target_system_to_container(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(787, a, b, c, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<copy_dobldobl_Laurent_target_system_to_container>:
mov    $0x313,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

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

LLVM IR (-O2):
define i32 @copy_dobldobl_Laurent_target_system_to_container() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 787, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int findContentChildren(int *, int, int *, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int g[] = {1, 2};
  int s[] = {1, 2, 3};
  int c = findContentChildren(g, 2, s, 3);
  printf("%d\n", c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x14(%rbp)
mov    0xecc(%rip),%eax
mov    %eax,-0xc(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0x14(%rbp),%rdx
mov    $0x2,%esi
mov    $0x3,%ecx
call   1040 <findContentChildren@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x200000001,%rax
mov    %rax,0x10(%rsp)
mov    0xecf(%rip),%eax
mov    %eax,0x8(%rsp)
mov    0xebc(%rip),%rax
mov    %rax,(%rsp)
lea    0x10(%rsp),%rdi
mov    %rsp,%rdx
mov    $0x2,%esi
mov    $0x3,%ecx
call   1040 <findContentChildren@plt>
lea    0xea6(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.s = [3 x i32] [i32 1, i32 2, i32 3]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca [3 x i32]
%3 = bitcast i64* %1 to i8*
store i64 8589934593, i64* %1
%4 = bitcast [3 x i32]* %2 to i8*
%5 = bitcast i64* %1 to i32*
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%7 = call i32 @findContentChildren(i32* %5, i32 2, i32* %6, i32 3)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
int gcd(int a, int b) {
  int t;
  while (b > 0)
    t = a % b, a = b, b = t;
  return a;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    112f <gcd+0x2f>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    110a <gcd+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
test   %esi,%esi
jle    111d <gcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jg     1110 <gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = srem i32 %5, %6
%8 = icmp sgt i32 %7, 0
br i1 %8, label %4, label %9
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %6, %4 ]
ret i32 %10
}
/* Variables and functions */
int yyparse();
int main() { return (yyparse()); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @yyparse()
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
pid_t xserver_start() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @xserver_start() {
ret i32 0
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
float uniform_rand() { return ((float)rand() / (float)(RAND_MAX + 1.0f)); }


x86 assembly (clang, -O0):
<uniform_rand>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2ec1(%rip),%rax
cvtsi2ssq (%rax),%xmm1
movss  0xecc(%rip),%xmm2
addss  %xmm2,%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<uniform_rand>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2ec4(%rip),%rax
cvtsi2ssq (%rax),%xmm1
addss  0xecf(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define float @uniform_rand() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to float
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to float
%5 = fadd float %4, 1.000000e+00
%6 = fdiv float %2, %5
ret float %6
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define float @uniform_rand() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to float
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to float
%5 = fadd float %4, 1.000000e+00
%6 = fdiv float %2, %5
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char a, b;
  scanf("%c", &a);
  a = a - 'a';
  b = 'z' - a;
  printf("%c", b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x1(%rbp),%eax
sub    $0x61,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x7a,%eax
sub    %ecx,%eax
mov    %al,-0x2(%rbp)
lea    0xea9(%rip),%rdi
movsbl -0x2(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xf(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xf(%rsp),%al
lea    -0x61(%rax),%ecx
mov    %cl,0xf(%rsp)
mov    $0xdb,%cl
sub    %al,%cl
movsbl %cl,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i8
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
%6 = sub nsw i32 %5, 97
%7 = trunc i32 %6 to i8
store i8 %7, i8* %1
%8 = load i8, i8* %1
%9 = sext i8 %8 to i32
%10 = sub nsw i32 122, %9
%11 = trunc i32 %10 to i8
store i8 %11, i8* %2
%12 = load i8, i8* %2
%13 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = add i8 %3, -97
store i8 %4, i8* %1
%5 = sub i8 -37, %3
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bar(int);
void foo(int n) {
  int i;
#pragma omp for schedule(guided)
  for (i = 0; i < n; ++i)
    bar(i);
}


x86 assembly (clang, -O0):
<foo>:
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    1144 <foo+0x34>
mov    -0x8(%rbp),%edi
call   1030 <bar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <foo+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
jle    112e <foo+0x1e>
mov    %edi,%ebx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1030 <bar@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1120 <foo+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @foo(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @bar(i32 %4)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
int ml_mod(int n1, int n2) {
  int mod, q;
  q = n1 / n2;
  mod = n1 - (n2 * q);
  return mod;
}


x86 assembly (clang, -O0):
<ml_mod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   -0x10(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ml_mod>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @ml_mod(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
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = sdiv i32 %7, %8
store i32 %9, i32* %6
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = load i32, i32* %6
%13 = mul nsw i32 %11, %12
%14 = sub nsw i32 %10, %13
store i32 %14, i32* %5
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
define i32 @ml_mod(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
ret i32 %3
}
/* Variables and functions */
float __rinff(float);
scalar_t__ signbit(float);
float truncf(float);
float floorf(float x) { return signbit(x) ? __rinff(x) : truncf(x); }


x86 assembly (clang, -O0):
<floorf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <signbit@plt>
cmp    $0x0,%rax
je     1165 <floorf+0x35>
movss  -0x4(%rbp),%xmm0
call   1030 <__rinff@plt>
movss  %xmm0,-0x8(%rbp)
jmp    1174 <floorf+0x44>
movss  -0x4(%rbp),%xmm0
call   1050 <truncf@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<floorf>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1040 <signbit@plt>
test   %rax,%rax
je     114d <floorf+0x1d>
movss  0x4(%rsp),%xmm0
pop    %rax
jmp    1030 <__rinff@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
jmp    1050 <truncf@plt>

LLVM IR (-O0):
define float @floorf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @signbit(float %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load float, float* %2
%8 = call float @__rinff(float %7)
br label %12
9: ; preds = %1
%10 = load float, float* %2
%11 = call float @llvm.trunc.f32(float %10)
br label %12
12: ; preds = %9, %6
%13 = phi float [ %8, %6 ], [ %11, %9 ]
ret float %13
}

LLVM IR (-O2):
define float @floorf(float %0) {
%2 = tail call i64 @signbit(float %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call float @__rinff(float %0)
br label %8
6: ; preds = %1
%7 = tail call float @llvm.trunc.f32(float %0)
br label %8
8: ; preds = %6, %4
%9 = phi float [ %5, %4 ], [ %7, %6 ]
ret float %9
}
void CFGMR3GetName(void) {}


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

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

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

LLVM IR (-O2):
define void @CFGMR3GetName() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_lock();
int main(int argc, char **args) {
  test_lock();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @test_lock()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_lock()
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint64_t;

/* Variables and functions */
void ext_shift(uint64_t ch, uint8_t pos, uint64_t retval[2]) {
  retval[0] = ch << pos;
  if (pos == 0)
    retval[1] = 0;
  else
    retval[1] = ch >> ((sizeof(uint64_t) * 8) - pos);
  return;
}


x86 assembly (clang, -O0):
<ext_shift>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
cmpl   $0x0,-0x8(%rbp)
jne    1138 <ext_shift+0x38>
mov    -0x10(%rbp),%rax
movl   $0x0,0x4(%rax)
jmp    1152 <ext_shift+0x52>
mov    -0x4(%rbp),%eax
movslq -0x8(%rbp),%rdx
mov    $0x20,%ecx
sub    %rdx,%rcx
sar    %cl,%eax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ext_shift>:
mov    %edi,%eax
mov    %esi,%ecx
shl    %cl,%eax
mov    %eax,(%rdx)
neg    %cl
sar    %cl,%edi
test   %esi,%esi
cmove  %esi,%edi
mov    %edi,0x4(%rdx)
ret

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

LLVM IR (-O2):
define void @ext_shift(i32 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = shl i32 %0, %1
store i32 %4, i32* %2
%5 = icmp eq i32 %1, 0
%6 = sub i32 32, %1
%7 = ashr i32 %0, %6
%8 = select i1 %5, i32 0, i32 %7
%9 = getelementptr inbounds i32, i32* %2, i64 1
store i32 %8, i32* %9
ret void
}
/* Variables and functions */
int qwerty(int);
int f(int i) { return qwerty(i) + 1; }


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

x86 assembly (clang, -O2):
<f>:
push   %rax
call   1030 <qwerty@plt>
add    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = tail call i32 @qwerty(i32 %0)
%3 = add nsw i32 %2, 1
ret i32 %3
}
/* Variables and functions */
scalar_t__ prompt();
int /*<<< orphan*/ puts(char *);
int main(int argc, char **argv) {
  while (prompt())
    ;
  puts("\nDone.");
  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   1040 <prompt@plt>
cmp    $0x0,%rax
je     114c <main+0x2c>
jmp    1136 <main+0x16>
lea    0xead(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <prompt@plt>
test   %rax,%rax
jne    1130 <main+0x10>
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"\0ADone.\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
br label %6
6: ; preds = %9, %2
%7 = call i64 (...) @prompt()
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %6
br label %6
10: ; preds = %6
%11 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"\0ADone.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i64 (...) @prompt()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %3
6: ; preds = %3
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ select_track();
int /*<<< orphan*/ test_read_performance(int, int, int);
void run_test() {
  if (!select_track())
    return;
  test_read_performance(0, 16, 3);
  test_read_performance(0, 2048, 3);
  test_read_performance(1, 16, 3);
  test_read_performance(1, 2048, 3);
}


x86 assembly (clang, -O0):
<run_test>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <select_track@plt>
cmp    $0x0,%eax
jne    1139 <run_test+0x19>
jmp    1183 <run_test+0x63>
xor    %edi,%edi
mov    $0x10,%esi
mov    $0x3,%edx
call   1030 <test_read_performance@plt>
xor    %edi,%edi
mov    $0x800,%esi
mov    $0x3,%edx
call   1030 <test_read_performance@plt>
mov    $0x1,%edi
mov    $0x10,%esi
mov    $0x3,%edx
call   1030 <test_read_performance@plt>
mov    $0x1,%edi
mov    $0x800,%esi
mov    $0x3,%edx
call   1030 <test_read_performance@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_test>:
push   %rax
xor    %eax,%eax
call   1040 <select_track@plt>
test   %eax,%eax
je     1177 <run_test+0x57>
xor    %edi,%edi
mov    $0x10,%esi
mov    $0x3,%edx
call   1030 <test_read_performance@plt>
xor    %edi,%edi
mov    $0x800,%esi
mov    $0x3,%edx
call   1030 <test_read_performance@plt>
mov    $0x1,%edi
mov    $0x10,%esi
mov    $0x3,%edx
call   1030 <test_read_performance@plt>
mov    $0x1,%edi
mov    $0x800,%esi
mov    $0x3,%edx
pop    %rax
jmp    1030 <test_read_performance@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @run_test() {
%1 = call i32 (...) @select_track()
%2 = icmp ne i32 %1, 0
br i1 %2, label %4, label %3
3: ; preds = %0
br label %9
4: ; preds = %0
%5 = call i32 @test_read_performance(i32 0, i32 16, i32 3)
%6 = call i32 @test_read_performance(i32 0, i32 2048, i32 3)
%7 = call i32 @test_read_performance(i32 1, i32 16, i32 3)
%8 = call i32 @test_read_performance(i32 1, i32 2048, i32 3)
br label %9
9: ; preds = %4, %3
ret void
}

LLVM IR (-O2):
define void @run_test() {
%1 = tail call i32 (...) @select_track()
%2 = icmp eq i32 %1, 0
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = tail call i32 @test_read_performance(i32 0, i32 16, i32 3)
%5 = tail call i32 @test_read_performance(i32 0, i32 2048, i32 3)
%6 = tail call i32 @test_read_performance(i32 1, i32 16, i32 3)
%7 = tail call i32 @test_read_performance(i32 1, i32 2048, i32 3)
br label %8
8: ; preds = %0, %3
ret void
}
int max3(int a, int b, int c) {}


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

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

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

LLVM IR (-O2):
define i32 @max3(i32 %0, i32 %1, i32 %2) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ x509_unpack(unsigned char *, int, unsigned char **, int *,
                               int *, int);
void x509_skip(unsigned char **bpp, int *lp, int expected) {
  unsigned char *dp;
  int dl, cl;
  x509_unpack(*bpp, *lp, &dp, &dl, &cl, expected);
  *bpp = dp + dl;
  *lp -= cl;
}


x86 assembly (clang, -O0):
<x509_skip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x14(%rbp),%r9d
lea    -0x20(%rbp),%rdx
lea    -0x24(%rbp),%rcx
lea    -0x28(%rbp),%r8
call   1030 <x509_unpack@plt>
mov    -0x20(%rbp),%rcx
movslq -0x24(%rbp),%rax
add    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%edx
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
sub    %edx,%ecx
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x509_skip>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %edx,%r9d
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%rdi
mov    (%rsi),%esi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
call   1030 <x509_unpack@plt>
movslq 0xc(%rsp),%rax
add    0x10(%rsp),%rax
mov    %rax,(%rbx)
mov    0x8(%rsp),%eax
sub    %eax,(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @x509_skip(i8** nocapture %0, i32* nocapture %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = bitcast i8** %4 to i8*
%8 = bitcast i32* %5 to i8*
%9 = bitcast i32* %6 to i8*
%10 = load i8*, i8** %0
%11 = load i32, i32* %1
%12 = call i32 @x509_unpack(i8* %10, i32 %11, i8** %4, i32* %5, i32* %6, i32 %2)
%13 = load i8*, i8** %4
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
store i8* %16, i8** %0
%17 = load i32, i32* %6
%18 = load i32, i32* %1
%19 = sub nsw i32 %18, %17
store i32 %19, i32* %1
ret void
}
void XDrawRectangles() {}


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

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

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

LLVM IR (-O2):
define void @XDrawRectangles() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr,
          "DBBUILD : usage -\n\tdbbuild [-w] input_data_file db_number\n");
  fflush(stderr);
  exit(-1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ea8(%rip),%rbx
mov    (%rbx),%edi
lea    0xebf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [59 x i8] c"DBBUILD : usage -\0A\09dbbuild [-w] input_data_file db_number\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fflush(i32 %3)
%5 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [59 x i8] c"DBBUILD : usage -\0A\09dbbuild [-w] input_data_file db_number\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fflush(i32 %3)
%5 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sub(int n, int a) {
  if (n > 0) {
    printf("%d ", n);
    sub(n - 5, a);
  }
  if (n <= a)
    printf("%d ", n);
}


x86 assembly (clang, -O0):
<sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1155 <sub+0x35>
mov    -0x8(%rbp),%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
sub    $0x5,%edi
mov    -0xc(%rbp),%esi
call   1040 <sub@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1170 <sub+0x50>
mov    -0x8(%rbp),%esi
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
test   %edi,%edi
jle    1143 <sub+0x23>
lea    0xece(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
lea    -0x5(%rbx),%edi
mov    %ebp,%esi
call   1040 <sub@plt>
cmp    %ebp,%ebx
jg     1155 <sub+0x35>
lea    0xeb2(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define i32 @sub(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = add nsw i32 %0, -5
%7 = tail call i32 @sub(i32 %6, i32 %1)
br label %8
8: ; preds = %4, %2
%9 = icmp sgt i32 %0, %1
br i1 %9, label %12, label %10
10: ; preds = %8
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %12
12: ; preds = %10, %8
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ arm_arith_cmp(int /*<<< orphan*/);
int /*<<< orphan*/ arm_data_regi_op();
void arm_cmp_regi() { arm_arith_cmp(arm_data_regi_op()); }


x86 assembly (clang, -O0):
<arm_cmp_regi>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <arm_data_regi_op@plt>
mov    %eax,%edi
call   1030 <arm_arith_cmp@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<arm_cmp_regi>:
push   %rax
xor    %eax,%eax
call   1040 <arm_data_regi_op@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <arm_arith_cmp@plt>

LLVM IR (-O0):
define void @arm_cmp_regi() {
%1 = call i32 (...) @arm_data_regi_op()
%2 = call i32 @arm_arith_cmp(i32 %1)
ret void
}

LLVM IR (-O2):
define void @arm_cmp_regi() {
%1 = tail call i32 (...) @arm_data_regi_op()
%2 = tail call i32 @arm_arith_cmp(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clrscr();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  clrscr();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <clrscr@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <clrscr@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @clrscr()
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @clrscr()
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int ptr_f(int *);
int main() {
  int a;
  return ptr_f(&a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <ptr_f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <ptr_f@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @ptr_f(i32* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ roadmap_trip_remove_point(int /*<<< orphan*/ *);
void roadmap_start_delete_waypoint(void) { roadmap_trip_remove_point(NULL); }


x86 assembly (clang, -O0):
<roadmap_start_delete_waypoint>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <roadmap_trip_remove_point@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<roadmap_start_delete_waypoint>:
xor    %edi,%edi
jmp    1030 <roadmap_trip_remove_point@plt>

LLVM IR (-O0):
define void @roadmap_start_delete_waypoint() {
%1 = call i32 @roadmap_trip_remove_point(i32* null)
ret void
}

LLVM IR (-O2):
define void @roadmap_start_delete_waypoint() {
%1 = tail call i32 @roadmap_trip_remove_point(i32* null)
ret void
}
unsigned int dictStringHashFunction(const char *str, const unsigned int len) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @dictStringHashFunction(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ T();
int /*<<< orphan*/ cnext();
scalar_t__ isNext(char *);
int /*<<< orphan*/ printf(char *);
int E() {
  printf("<E>");
  T();
  if (isNext("+-*/")) {
    cnext();
    E();
  }
  printf("</E>");
}


x86 assembly (clang, -O0):
<E>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xea1(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <T@plt>
lea    0xe92(%rip),%rdi
call   1040 <isNext@plt>
cmp    $0x0,%rax
je     118d <E+0x3d>
mov    $0x0,%al
call   1060 <cnext@plt>
call   1070 <E@plt>
lea    0xe75(%rip),%rdi
call   1050 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<E>:
push   %rax
lea    0xea8(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1030 <T@plt>
lea    0xe99(%rip),%rdi
call   1040 <isNext@plt>
test   %rax,%rax
je     1181 <E+0x31>
xor    %eax,%eax
call   1060 <cnext@plt>
call   1070 <E@plt>
lea    0xe81(%rip),%rdi
pop    %rax
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"<E>\00"
@.str.1 = [5 x i8] c"+-*/\00"
@.str.2 = [5 x i8] c"</E>\00"
define i32 @E() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @T()
%4 = call i64 @isNext(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = call i32 (...) @cnext()
%8 = call i32 @E()
br label %9
9: ; preds = %6, %0
%10 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str = [4 x i8] c"<E>\00"
@.str.1 = [5 x i8] c"+-*/\00"
@.str.2 = [5 x i8] c"</E>\00"
define i32 @E() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @T()
%3 = tail call i64 @isNext(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %0
%6 = tail call i32 (...) @cnext()
%7 = tail call i32 @E()
br label %8
8: ; preds = %5, %0
%9 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
ret i32 undef
}
void reboot() { asm("int $0x16"); }


x86 assembly (clang, -O0):
<reboot>:
push   %rbp
mov    %rsp,%rbp
int    $0x16
pop    %rbp
ret

x86 assembly (clang, -O2):
<reboot>:
int    $0x16
ret

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

LLVM IR (-O2):
define void @reboot() {
tail call void asm sideeffect "int $$0x16", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void dma_debug_add_bus(struct bus_type *bus) {}


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

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

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

LLVM IR (-O2):
%struct.bus_type = type opaque
define void @dma_debug_add_bus(%struct.bus_type* nocapture %0) {
ret void
}