xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ little_endian_read_16(int /*<<< orphan*/ const *, int);
uint16_t hci_event_connection_packet_type_changed_get_packet_types(
    const uint8_t *event) {
  return little_endian_read_16(event, 5);
}


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

x86 assembly (clang, -O2):
<hci_event_connection_packet_type_changed_get_packet_types>:
mov    $0x5,%esi
jmp    1030 <little_endian_read_16@plt>

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

LLVM IR (-O2):
define i32 @hci_event_connection_packet_type_changed_get_packet_types(i32* %0) {
%2 = tail call i32 @little_endian_read_16(i32* %0, i32 5)
ret i32 %2
}
/* Type definitions */
struct vpx_read_bit_buffer {
  int dummy;
};

/* Variables and functions */
scalar_t__ vpx_rb_read_bit(struct vpx_read_bit_buffer *);
int vpx_rb_read_literal(struct vpx_read_bit_buffer *, int);
int vpx_rb_read_signed_literal(struct vpx_read_bit_buffer *rb, int bits) {
  const int value = vpx_rb_read_literal(rb, bits);
  return vpx_rb_read_bit(rb) ? -value : value;
}


x86 assembly (clang, -O0):
<vpx_rb_read_signed_literal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <vpx_rb_read_literal@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <vpx_rb_read_bit@plt>
cmp    $0x0,%rax
je     115e <vpx_rb_read_signed_literal+0x3e>
xor    %eax,%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1164 <vpx_rb_read_signed_literal+0x44>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vpx_rb_read_signed_literal>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <vpx_rb_read_literal@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <vpx_rb_read_bit@plt>
mov    %ebp,%ecx
neg    %ecx
test   %rax,%rax
cmove  %ebp,%ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.vpx_read_bit_buffer = type { i32 }
define i32 @vpx_rb_read_signed_literal(%struct.vpx_read_bit_buffer* %0, i32 %1) {
%3 = alloca %struct.vpx_read_bit_buffer*
%4 = alloca i32
%5 = alloca i32
store %struct.vpx_read_bit_buffer* %0, %struct.vpx_read_bit_buffer** %3
store i32 %1, i32* %4
%6 = load %struct.vpx_read_bit_buffer*, %struct.vpx_read_bit_buffer** %3
%7 = load i32, i32* %4
%8 = call i32 @vpx_rb_read_literal(%struct.vpx_read_bit_buffer* %6, i32 %7)
store i32 %8, i32* %5
%9 = load %struct.vpx_read_bit_buffer*, %struct.vpx_read_bit_buffer** %3
%10 = call i64 @vpx_rb_read_bit(%struct.vpx_read_bit_buffer* %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load i32, i32* %5
%14 = sub nsw i32 0, %13
br label %17
15: ; preds = %2
%16 = load i32, i32* %5
br label %17
17: ; preds = %15, %12
%18 = phi i32 [ %14, %12 ], [ %16, %15 ]
ret i32 %18
}

LLVM IR (-O2):
%struct.vpx_read_bit_buffer = type { i32 }
define i32 @vpx_rb_read_signed_literal(%struct.vpx_read_bit_buffer* %0, i32 %1) {
%3 = tail call i32 @vpx_rb_read_literal(%struct.vpx_read_bit_buffer* %0, i32 %1)
%4 = tail call i64 @vpx_rb_read_bit(%struct.vpx_read_bit_buffer* %0)
%5 = icmp eq i64 %4, 0
%6 = sub nsw i32 0, %3
%7 = select i1 %5, i32 %3, i32 %6
ret i32 %7
}
unsigned getval_163() { return 3223896713U; }


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

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

LLVM IR (-O0):
define i32 @getval_163() {
ret i32 -1071070583
}

LLVM IR (-O2):
define i32 @getval_163() {
ret i32 -1071070583
}
int ini_errline(int err) { return err >> 8; }


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

x86 assembly (clang, -O2):
<ini_errline>:
mov    %edi,%eax
sar    $0x8,%eax
ret

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

LLVM IR (-O2):
define i32 @ini_errline(i32 %0) {
%2 = ashr i32 %0, 8
ret i32 %2
}
int sub3(unsigned long long i) {
  if (i >= 0x80000000)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<sub3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    $0x80000000,%eax
cmp    %rax,-0x10(%rbp)
jb     1123 <sub3+0x23>
movl   $0x0,-0x4(%rbp)
jmp    112a <sub3+0x2a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub3>:
xor    %eax,%eax
test   $0xffffffff80000000,%rdi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @sub3(i64 %0) {
%2 = icmp ult i64 %0, 2147483648
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_key_t;

/* Variables and functions */
int errno;
int pthread_key_delete(int /*<<< orphan*/);
int tosTLS_keyDelete(pthread_key_t key) {
  int res = 0;
  res = pthread_key_delete(key);
  if (res) {
    errno = res;
    res = -1;
  }
  return res;
}


x86 assembly (clang, -O0):
<tosTLS_keyDelete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <pthread_key_delete@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     114a <tosTLS_keyDelete+0x3a>
mov    -0x8(%rbp),%ecx
mov    0x2e9f(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tosTLS_keyDelete>:
push   %rax
call   1030 <pthread_key_delete@plt>
test   %eax,%eax
je     112a <tosTLS_keyDelete+0x1a>
mov    0x2ebf(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @tosTLS_keyDelete(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = call i32 @pthread_key_delete(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i32, i32* %3
store i32 %9, i32* @errno
store i32 -1, i32* %3
br label %10
10: ; preds = %8, %1
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @tosTLS_keyDelete(i32 %0) {
%2 = tail call i32 @pthread_key_delete(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %5, label %4
4: ; preds = %1
store i32 %2, i32* @errno
br label %5
5: ; preds = %4, %1
%6 = phi i32 [ -1, %4 ], [ 0, %1 ]
ret i32 %6
}
/* Variables and functions */
unsigned int Sleep(int);
int /*<<< orphan*/ printf(char *, unsigned int);
int main(void) {
  unsigned int unslept = Sleep(10);
  printf("%u\n", unslept);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1040 <Sleep@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1040 <Sleep@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%u\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @Sleep(i32 10)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%u\0A\00"
define i32 @main() {
%1 = tail call i32 @Sleep(i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ memcpy(float *, float *, int);
int /*<<< orphan*/ memset(float *, int /*<<< orphan*/, int);
float stress_funcret_float1(float);
float __attribute__((no)) stress_funcret_deep_float1(float a) {
  float b;
  (void)memcpy(&b, &a, sizeof(a));
  (void)memset(&a, 0, sizeof(a));
  return stress_funcret_float1(b);
}


x86 assembly (clang, -O0):
<stress_funcret_deep_float1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
lea    -0x4(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
movss  -0x8(%rbp),%xmm0
call   1050 <stress_funcret_float1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stress_funcret_deep_float1>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
lea    0x8(%rsp),%rdi
lea    0xc(%rsp),%rbx
mov    %rbx,%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
movss  0x8(%rsp),%xmm0
call   1050 <stress_funcret_float1@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define float @stress_funcret_deep_float1(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = bitcast float* %3 to i8*
%5 = call i32 @memcpy(float* %3, float* %2, i32 4)
%6 = call i32 @memset(float* %2, i32 0, i32 4)
%7 = load float, float* %3
%8 = call float @stress_funcret_float1(float %7)
ret float %8
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
size_t RapidJson_growing_policy(size_t capacity, size_t elem_size) {
  size_t kDefaultObjectCapacity = 16;
  assert(elem_size > 0);
  return capacity =
             0 ? kDefaultObjectCapacity : (capacity + (capacity + 1) / 2);
}


x86 assembly (clang, -O0):
<RapidJson_growing_policy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x10,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
add    $0x1,%rcx
shr    $0x1,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RapidJson_growing_policy>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rsi,%rsi
setne  %dil
call   1030 <assert@plt>
lea    0x1(%rbx),%rax
shr    %rax
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @RapidJson_growing_policy(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
store i64 16, i64* %5
%6 = load i64, i64* %4
%7 = icmp ugt i64 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i64, i64* %3
%11 = load i64, i64* %3
%12 = add i64 %11, 1
%13 = udiv i64 %12, 2
%14 = add i64 %10, %13
store i64 %14, i64* %3
ret i64 %14
}

LLVM IR (-O2):
define i64 @RapidJson_growing_policy(i64 %0, i64 %1) {
%3 = icmp ne i64 %1, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = add i64 %0, 1
%7 = lshr i64 %6, 1
%8 = add i64 %7, %0
ret i64 %8
}
int main() {
  unsigned int x;
  int y;
  unsigned long long int a;
  long long int b;
  unsigned long long m;
  long long n;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int mount(s, n, f)
char *s, *n;
{ return (0); }


x86 assembly (clang, -O0):
<mount>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @mount(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gmvwrite_units_header();
void fgmvwrite_units_header_() { gmvwrite_units_header(); }


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

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

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

LLVM IR (-O2):
define void @fgmvwrite_units_header_() {
%1 = tail call i32 (...) @gmvwrite_units_header()
ret void
}
int is_numeric(char *buf) {
  while (*buf && *buf >= '0' && *buf <= '9')
    buf++;
  if (!*buf)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_numeric>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1142 <is_numeric+0x42>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x11(%rbp)
jl     1142 <is_numeric+0x42>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1152 <is_numeric+0x52>
jmp    1163 <is_numeric+0x63>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <is_numeric+0x8>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    117c <is_numeric+0x7c>
movl   $0x1,-0x4(%rbp)
jmp    1183 <is_numeric+0x83>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_numeric>:
movzbl (%rdi),%ecx
lea    -0x30(%rcx),%eax
add    $0x1,%rdi
cmp    $0xa,%al
jb     1100 <is_numeric>
xor    %eax,%eax
test   %cl,%cl
sete   %al
ret

LLVM IR (-O0):
define i32 @is_numeric(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
br label %4
4: ; preds = %21, %1
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %19
9: ; preds = %4
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 48
br i1 %13, label %14, label %19
14: ; preds = %9
%15 = load i8*, i8** %3
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 57
br label %19
19: ; preds = %14, %9, %4
%20 = phi i1 [ false, %9 ], [ false, %4 ], [ %18, %14 ]
br i1 %20, label %21, label %24
21: ; preds = %19
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %3
br label %4
24: ; preds = %19
%25 = load i8*, i8** %3
%26 = load i8, i8* %25
%27 = icmp ne i8 %26, 0
br i1 %27, label %29, label %28
28: ; preds = %24
store i32 1, i32* %2
br label %30
29: ; preds = %24
store i32 0, i32* %2
br label %30
30: ; preds = %29, %28
%31 = load i32, i32* %2
ret i32 %31
}

LLVM IR (-O2):
define i32 @is_numeric(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = add i8 %4, -48
%6 = icmp ult i8 %5, 10
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %2, label %8
8: ; preds = %2
%9 = icmp eq i8 %4, 0
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("42");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"42\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"42\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print_time();
int main() {
  int count = 10;
  while (0 < count--)
    print_time();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    %ecx,%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmp    %ecx,%eax
jge    1147 <main+0x37>
mov    $0x0,%al
call   1030 <print_time@plt>
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @print_time()
%2 = tail call i32 (...) @print_time()
%3 = tail call i32 (...) @print_time()
%4 = tail call i32 (...) @print_time()
%5 = tail call i32 (...) @print_time()
%6 = tail call i32 (...) @print_time()
%7 = tail call i32 (...) @print_time()
%8 = tail call i32 (...) @print_time()
%9 = tail call i32 (...) @print_time()
%10 = tail call i32 (...) @print_time()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
int main() {
  unsigned int a, b, c;
  a = 10;
  b = 15;
  c = a - b;
  printf("%d", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0xf,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 -5)
ret i32 0
}
int isInt(float f) { return (f - (int)f == 0); }


x86 assembly (clang, -O0):
<isInt>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvttss2si -0x4(%rbp),%eax
cvtsi2ss %eax,%xmm1
subss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isInt>:
cvttps2dq %xmm0,%xmm1
cvtdq2ps %xmm1,%xmm1
subss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cmpeqss %xmm0,%xmm1
movd   %xmm1,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @isInt(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fptosi float %4 to i32
%6 = sitofp i32 %5 to float
%7 = fsub float %3, %6
%8 = fcmp oeq float %7, 0.000000e+00
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @isInt(float %0) {
%2 = fptosi float %0 to i32
%3 = sitofp i32 %2 to float
%4 = fsub float %0, %3
%5 = fcmp oeq float %4, 0.000000e+00
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int access(char const *, int);
int iposix_access(const char *path, int mode) { return access(path, mode); }


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

x86 assembly (clang, -O2):
<iposix_access>:
jmp    1030 <access@plt>

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

LLVM IR (-O2):
define i32 @iposix_access(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @access(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int getchar();
int read_byte() {
  int n;
  n = getchar();
  if (n < 0)
    n += 256;
  return (n);
}


x86 assembly (clang, -O0):
<read_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1137 <read_byte+0x27>
mov    -0x4(%rbp),%eax
add    $0x100,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_byte>:
push   %rax
xor    %eax,%eax
call   1030 <getchar@plt>
lea    0x100(%rax),%ecx
test   %eax,%eax
cmovs  %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @read_byte() {
%1 = tail call i32 (...) @getchar()
%2 = icmp slt i32 %1, 0
%3 = add nsw i32 %1, 256
%4 = select i1 %2, i32 %3, i32 %1
ret i32 %4
}
void pci_disable_pri(struct pci_dev *pdev) {}


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

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

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
define void @pci_disable_pri(%struct.pci_dev* nocapture %0) {
ret void
}
void c_pomp_single_end_(struct ompregdescr *r) { (void)0; }


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

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

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

LLVM IR (-O2):
%struct.ompregdescr = type opaque
define void @c_pomp_single_end_(%struct.ompregdescr* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int count3(int /*<<< orphan*/ const);
void countDigits3(size_t length, const uint32_t *dataArray, int *countArray) {
  while (length) {
    *countArray = count3(*dataArray);
    countArray++;
    dataArray++;
    length--;
  }
}


x86 assembly (clang, -O0):
<countDigits3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116b <countDigits3+0x5b>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <count3@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
jmp    1124 <countDigits3+0x14>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<countDigits3>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rdi,%rdi
je     1146 <countDigits3+0x36>
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%edi
call   1030 <count3@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <countDigits3+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @countDigits3(i64 %0, i32* nocapture %1, i32* nocapture writeonly %2) {
%4 = icmp eq i64 %0, 0
br i1 %4, label %15, label %5
5: ; preds = %3, %5
%6 = phi i32* [ %11, %5 ], [ %2, %3 ]
%7 = phi i32* [ %12, %5 ], [ %1, %3 ]
%8 = phi i64 [ %13, %5 ], [ %0, %3 ]
%9 = load i32, i32* %7
%10 = tail call i32 @count3(i32 %9)
store i32 %10, i32* %6
%11 = getelementptr inbounds i32, i32* %6, i64 1
%12 = getelementptr inbounds i32, i32* %7, i64 1
%13 = add i64 %8, -1
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %3
ret void
}
float my_pow(float base, int esponente) {
  float ret = base;
  int i;
  for (i = 1; i < esponente; i++) {
    ret = ret * base;
  }
  return ret;
}


x86 assembly (clang, -O0):
<my_pow>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1146 <my_pow+0x46>
movss  -0xc(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111d <my_pow+0x1d>
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_pow>:
cmp    $0x2,%edi
jl     115c <my_pow+0x5c>
lea    -0x1(%rdi),%ecx
add    $0xfffffffe,%edi
mov    %ecx,%eax
and    $0x7,%eax
movaps %xmm0,%xmm1
cmp    $0x7,%edi
jb     1145 <my_pow+0x45>
and    $0xfffffff8,%ecx
movaps %xmm0,%xmm1
xchg   %ax,%ax
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
add    $0xfffffff8,%ecx
jne    1120 <my_pow+0x20>
test   %eax,%eax
je     1159 <my_pow+0x59>
nopl   0x0(%rax)
mulss  %xmm0,%xmm1
add    $0xffffffff,%eax
jne    1150 <my_pow+0x50>
movaps %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @my_pow(float %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %34
4: ; preds = %2
%5 = add i32 %1, -1
%6 = add i32 %1, -2
%7 = and i32 %5, 7
%8 = icmp ult i32 %6, 7
br i1 %8, label %24, label %9
9: ; preds = %4
%10 = and i32 %5, -8
br label %11
11: ; preds = %11, %9
%12 = phi float [ %0, %9 ], [ %21, %11 ]
%13 = phi i32 [ 0, %9 ], [ %22, %11 ]
%14 = fmul float %12, %0
%15 = fmul float %14, %0
%16 = fmul float %15, %0
%17 = fmul float %16, %0
%18 = fmul float %17, %0
%19 = fmul float %18, %0
%20 = fmul float %19, %0
%21 = fmul float %20, %0
%22 = add i32 %13, 8
%23 = icmp eq i32 %22, %10
br i1 %23, label %24, label %11
24: ; preds = %11, %4
%25 = phi float [ undef, %4 ], [ %21, %11 ]
%26 = phi float [ %0, %4 ], [ %21, %11 ]
%27 = icmp eq i32 %7, 0
br i1 %27, label %34, label %28
28: ; preds = %24, %28
%29 = phi float [ %31, %28 ], [ %26, %24 ]
%30 = phi i32 [ %32, %28 ], [ 0, %24 ]
%31 = fmul float %29, %0
%32 = add i32 %30, 1
%33 = icmp eq i32 %32, %7
br i1 %33, label %34, label %28
34: ; preds = %24, %28, %2
%35 = phi float [ %0, %2 ], [ %25, %24 ], [ %31, %28 ]
ret float %35
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ write(int, char *, int);
void oom(void) {
  write(2, "marksman: out of memory.\n", 25);
  exit(1);
}


x86 assembly (clang, -O0):
<oom>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
lea    0xed0(%rip),%rsi
mov    $0x19,%edx
call   1030 <write@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<oom>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x2,%edi
mov    $0x19,%edx
call   1030 <write@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"marksman: out of memory.\0A\00"
define void @oom() {
%1 = call i32 @write(i32 2, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 25)
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [26 x i8] c"marksman: out of memory.\0A\00"
define void @oom() {
%1 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 25)
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int f(uint32_t number) {
  int count = 0;
  for (; number; number >>= 1)
    if (number & 1)
      count++;
  return count;
}


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

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

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %15, %1
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %18
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
br label %15
15: ; preds = %14
%16 = load i32, i32* %2
%17 = ashr i32 %16, 1
store i32 %17, i32* %2
br label %4
18: ; preds = %4
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
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 = ashr 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
}
int test_imm_AAint32_reg(int val) { return ((val) & (0xAA << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_AAint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xaa,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_AAint32_reg(i32 %0) {
%2 = and i32 %0, 170
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ COLOR_BLUE;
int /*<<< orphan*/ COLOR_RED;
int /*<<< orphan*/ COLOR_WHITE;
int /*<<< orphan*/ init_pair(int, int /*<<< orphan*/, int /*<<< orphan*/);
void initPairColors() {
  init_pair(1, COLOR_WHITE, COLOR_BLUE);
  init_pair(2, COLOR_BLUE, COLOR_WHITE);
  init_pair(3, COLOR_RED, COLOR_WHITE);
}


x86 assembly (clang, -O0):
<initPairColors>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
mov    0x2eb4(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
call   1030 <init_pair@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
mov    0x2ea0(%rip),%rax
mov    (%rax),%edx
mov    $0x2,%edi
call   1030 <init_pair@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%esi
mov    0x2e84(%rip),%rax
mov    (%rax),%edx
mov    $0x3,%edi
call   1030 <init_pair@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initPairColors>:
push   %r14
push   %rbx
push   %rax
mov    0x2ec5(%rip),%r14
mov    (%r14),%esi
mov    0x2eb3(%rip),%rbx
mov    (%rbx),%edx
mov    $0x1,%edi
call   1030 <init_pair@plt>
mov    (%rbx),%esi
mov    (%r14),%edx
mov    $0x2,%edi
call   1030 <init_pair@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%esi
mov    (%r14),%edx
mov    $0x3,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <init_pair@plt>

LLVM IR (-O0):
@COLOR_WHITE = global i32 0
@COLOR_BLUE = global i32 0
@COLOR_RED = global i32 0
define void @initPairColors() {
%1 = load i32, i32* @COLOR_WHITE
%2 = load i32, i32* @COLOR_BLUE
%3 = call i32 @init_pair(i32 1, i32 %1, i32 %2)
%4 = load i32, i32* @COLOR_BLUE
%5 = load i32, i32* @COLOR_WHITE
%6 = call i32 @init_pair(i32 2, i32 %4, i32 %5)
%7 = load i32, i32* @COLOR_RED
%8 = load i32, i32* @COLOR_WHITE
%9 = call i32 @init_pair(i32 3, i32 %7, i32 %8)
ret void
}

LLVM IR (-O2):
@COLOR_WHITE = global i32 0
@COLOR_BLUE = global i32 0
@COLOR_RED = global i32 0
define void @initPairColors() {
%1 = load i32, i32* @COLOR_WHITE
%2 = load i32, i32* @COLOR_BLUE
%3 = tail call i32 @init_pair(i32 1, i32 %1, i32 %2)
%4 = load i32, i32* @COLOR_BLUE
%5 = load i32, i32* @COLOR_WHITE
%6 = tail call i32 @init_pair(i32 2, i32 %4, i32 %5)
%7 = load i32, i32* @COLOR_RED
%8 = load i32, i32* @COLOR_WHITE
%9 = tail call i32 @init_pair(i32 3, i32 %7, i32 %8)
ret void
}
/* Variables and functions */
int crunch(char const);
unsigned char get_char_msb(const char c) { return (crunch(c) >> 3) & 0x7; }


x86 assembly (clang, -O0):
<get_char_msb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <crunch@plt>
sar    $0x3,%eax
and    $0x7,%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_char_msb>:
push   %rax
call   1030 <crunch@plt>
shr    $0x3,%al
and    $0x7,%al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @get_char_msb(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @crunch(i8 signext %3)
%5 = ashr i32 %4, 3
%6 = and i32 %5, 7
%7 = trunc i32 %6 to i8
ret i8 %7
}

LLVM IR (-O2):
define zeroext i8 @get_char_msb(i8 signext %0) {
%2 = tail call i32 @crunch(i8 signext %0)
%3 = trunc i32 %2 to i8
%4 = lshr i8 %3, 3
%5 = and i8 %4, 7
ret i8 %5
}
/* Variables and functions */
char encode_char(char);
void encode_str(char *s, int sn) {
  int i;
  for (i = 0; i < sn; i++) {
    s[i] = encode_char(s[i]);
  }
}


x86 assembly (clang, -O0):
<encode_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115e <encode_str+0x4e>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <encode_char@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <encode_str+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode_str>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1147 <encode_str+0x37>
mov    %rdi,%r15
mov    %esi,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1030 <encode_char@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <encode_str+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @encode_str(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call signext i8 @encode_char(i8 signext %9)
store i8 %10, i8* %8
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint8_t get8bit(const uint8_t **ptr) {
  uint32_t t8;
  t8 = (*ptr)[0];
  (*ptr)++;
  return t8;
}


x86 assembly (clang, -O0):
<get8bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x4,%rcx
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get8bit>:
mov    (%rdi),%rcx
mov    (%rcx),%eax
add    $0x4,%rcx
mov    %rcx,(%rdi)
ret

LLVM IR (-O0):
define i32 @get8bit(i32** %0) {
%2 = alloca i32**
%3 = alloca i32
store i32** %0, i32*** %2
%4 = load i32**, i32*** %2
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
store i32 %7, i32* %3
%8 = load i32**, i32*** %2
%9 = load i32*, i32** %8
%10 = getelementptr inbounds i32, i32* %9, i32 1
store i32* %10, i32** %8
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @get8bit(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = load i32, i32* %2
%4 = getelementptr inbounds i32, i32* %2, i64 1
store i32* %4, i32** %0
ret i32 %3
}
int f_test(int x) {
  char arr[127 * 1024];
  return arr[x];
}


x86 assembly (clang, -O0):
<f_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1fb90,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
movsbl -0x1fc10(%rbp,%rax,1),%eax
ff
add    $0x1fb90,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f_test(i32 %0) {
%2 = alloca i32
%3 = alloca [130048 x i8]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [130048 x i8], [130048 x i8]* %3, i64 0, i64 %5
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @f_test(i32 %0) {
ret i32 0
}
void d_instantiate(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<d_instantiate>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_instantiate>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.d_instantiate = [14 x i8] c"d_instantiate\00"
define void @d_instantiate() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.d_instantiate, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.d_instantiate = [14 x i8] c"d_instantiate\00"
define void @d_instantiate() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.d_instantiate, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ actually_recv_file(char *, char *, int);
int /*<<< orphan*/ asprintf(char **, char *, char *);
int mkstemp(char *);
int /*<<< orphan*/ recv_file_nowrite(char *);
void recv_file(char *fname) {
  int tmpfd;
  char *tempfile;
  asprintf(&tempfile, "%s.XXXXXX", fname);
  tmpfd = mkstemp(tempfile);
  if (tmpfd < 0)
    recv_file_nowrite(fname);
  else
    actually_recv_file(fname, tempfile, tmpfd);
}


x86 assembly (clang, -O0):
<recv_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    -0x18(%rbp),%rdi
lea    0xea5(%rip),%rsi
call   1040 <asprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <mkstemp@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1184 <recv_file+0x44>
mov    -0x8(%rbp),%rdi
call   1050 <recv_file_nowrite@plt>
jmp    1194 <recv_file+0x54>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1060 <actually_recv_file@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recv_file>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xeb1(%rip),%rsi
lea    0x8(%rsp),%rdi
mov    %rbx,%rdx
call   1040 <asprintf@plt>
mov    0x8(%rsp),%rdi
call   1030 <mkstemp@plt>
test   %eax,%eax
js     117b <recv_file+0x3b>
mov    0x8(%rsp),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
call   1060 <actually_recv_file@plt>
jmp    1183 <recv_file+0x43>
mov    %rbx,%rdi
call   1050 <recv_file_nowrite@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%s.XXXXXX\00"
define void @recv_file(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @asprintf(i8** %4, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %4
%8 = call i32 @mkstemp(i8* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = load i8*, i8** %2
%13 = call i32 @recv_file_nowrite(i8* %12)
br label %19
14: ; preds = %1
%15 = load i8*, i8** %2
%16 = load i8*, i8** %4
%17 = load i32, i32* %3
%18 = call i32 @actually_recv_file(i8* %15, i8* %16, i32 %17)
br label %19
19: ; preds = %14, %11
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%s.XXXXXX\00"
define void @recv_file(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i32 @asprintf(i8** %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = load i8*, i8** %2
%6 = call i32 @mkstemp(i8* %5)
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @recv_file_nowrite(i8* %0)
br label %13
10: ; preds = %1
%11 = load i8*, i8** %2
%12 = call i32 @actually_recv_file(i8* %0, i8* %11, i32 %6)
br label %13
13: ; preds = %10, %8
ret void
}
long p(long q) { return ((1247 * q + 104729) % 300007); }


x86 assembly (clang, -O0):
<p>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
imul   $0x4df,-0x8(%rbp),%rax
add    $0x19919,%rax
mov    $0x493e7,%ecx
cqto
idiv   %rcx
mov    %rdx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<p>:
imul   $0x4df,%rdi,%rsi
lea    0x19919(%rsi),%rcx
movabs $0xdfb0e4f986a21b7d,%rdx
e4 b0 df
mov    %rcx,%rax
imul   %rdx
lea    (%rdx,%rsi,1),%rax
add    $0x19919,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x12,%rax
add    %rdx,%rax
imul   $0x493e7,%rax,%rax
sub    %rax,%rcx
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @p(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul nsw i64 1247, %3
%5 = add nsw i64 %4, 104729
%6 = srem i64 %5, 300007
ret i64 %6
}

LLVM IR (-O2):
define i64 @p(i64 %0) {
%2 = mul nsw i64 %0, 1247
%3 = add nsw i64 %2, 104729
%4 = srem i64 %3, 300007
ret i64 %4
}
void nn_xpush_in(__attribute__((unused)) struct nn_sockbase *self,
                 __attribute__((unused)) struct nn_pipe *pipe) {}


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

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

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

LLVM IR (-O2):
%struct.nn_sockbase = type opaque
%struct.nn_pipe = type opaque
define void @nn_xpush_in(%struct.nn_sockbase* nocapture %0, %struct.nn_pipe* nocapture %1) {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void ux00ddr_mask_leveling_completed_interrupt(size_t ahbregaddr) {
  (*(volatile uint32_t *)((136 << 2) + (ahbregaddr))) |= (1 << 22);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x220,%rax
mov    (%rax),%ecx
or     $0x400000,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
orl    $0x400000,0x220(%rdi)
ret

LLVM IR (-O0):
define void @ux00ddr_mask_leveling_completed_interrupt(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 544, %3
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = or i32 %6, 4194304
store volatile i32 %7, i32* %5
ret void
}

LLVM IR (-O2):
define void @ux00ddr_mask_leveling_completed_interrupt(i64 %0) {
%2 = add i64 %0, 544
%3 = inttoptr i64 %2 to i32*
%4 = load volatile i32, i32* %3
%5 = or i32 %4, 4194304
store volatile i32 %5, i32* %3
ret void
}
void nseel_asm_2pp_end(void) {}


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

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

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

LLVM IR (-O2):
define void @nseel_asm_2pp_end() {
ret void
}
int ti_wad_start(double const *options) {
  (void)options;
  return 1;
}


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

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

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

LLVM IR (-O2):
define i32 @ti_wad_start(double* nocapture readnone %0) {
ret i32 1
}