xunge/DecIR huggingface dataset:
int test_imm_95int8_mem(signed char *val) {
  return ((*val) & (0x95 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_95int8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0x95,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_95int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -107
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
FILE *open_uptime_file(void) {
  FILE *fp = fopen("/proc/uptime", "r");
  return fp;
}


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

x86 assembly (clang, -O2):
<open_uptime_file>:
lea    0xee9(%rip),%rdi
lea    0xeef(%rip),%rsi
jmp    1030 <fopen@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"/proc/uptime\00"
@.str.1 = [2 x i8] c"r\00"
define i32* @open_uptime_file() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
ret i32* %3
}

LLVM IR (-O2):
@.str = [13 x i8] c"/proc/uptime\00"
@.str.1 = [2 x i8] c"r\00"
define noalias i32* @open_uptime_file() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32* %1
}
int test_imm_18uint8_reg(unsigned char val) {
  return ((val) & (0x18 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_18uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x18,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_18uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 24
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t min32(int32_t v1, int32_t v2) { return v1 < v2 ? v1 : v2; }


x86 assembly (clang, -O0):
<min32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1127 <min32+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <min32+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min32>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @min32(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ part1(int);
int /*<<< orphan*/ part2(int, int);
int /*<<< orphan*/ printf(char *);
int main() {
  int x = 4, y = 5;
  printf("Part 1:\n\n");
  part1(x);
  printf("Part 2:\n\n");
  part2(x, y);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x4,%edi
call   1040 <part1@plt>
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
mov    $0x4,%edi
mov    $0x5,%esi
call   1050 <part2@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [9 x i8] c"Part 1:\0A\00"
@str.2 = [9 x i8] c"Part 2:\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @part1(i32 4)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.2, i64 0, i64 0))
%4 = tail call i32 @part2(i32 4, i32 5)
ret i32 0
}
void out(struct graphics *gc, int transparency, double gamma, int invert,
         int bg, int color, int color2, int saturate, int mask,
         double color_cap, int cie) {}


x86 assembly (clang, -O0):
<out>:
push   %rbp
mov    %rsp,%rbp
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
movsd  %xmm1,-0x30(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.graphics = type opaque
define void @out(%struct.graphics* %0, i32 %1, double %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, double %9, i32 %10) {
%12 = alloca %struct.graphics*
%13 = alloca i32
%14 = alloca double
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca double
%22 = alloca i32
store %struct.graphics* %0, %struct.graphics** %12
store i32 %1, i32* %13
store double %2, double* %14
store i32 %3, i32* %15
store i32 %4, i32* %16
store i32 %5, i32* %17
store i32 %6, i32* %18
store i32 %7, i32* %19
store i32 %8, i32* %20
store double %9, double* %21
store i32 %10, i32* %22
ret void
}

LLVM IR (-O2):
%struct.graphics = type opaque
define void @out(%struct.graphics* nocapture %0, i32 %1, double %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, double %9, i32 %10) {
ret void
}
int is_valid_sym_algo(const int algo) {
  switch (algo) {
  case 1:
  case 2:
  case 3:
  case 4:
  case 7:
  case 8:
  case 9:
  case 10:
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_valid_sym_algo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xffffffff,%eax
sub    $0x4,%eax
jb     1132 <is_valid_sym_algo+0x32>
jmp    111e <is_valid_sym_algo+0x1e>
mov    -0xc(%rbp),%eax
add    $0xfffffff9,%eax
sub    $0x3,%eax
ja     113e <is_valid_sym_algo+0x3e>
jmp    1132 <is_valid_sym_algo+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1145 <is_valid_sym_algo+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_sym_algo>:
add    $0xffffffff,%edi
xor    %eax,%eax
cmp    $0x9,%edi
ja     1117 <is_valid_sym_algo+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @is_valid_sym_algo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 1, label %5
i32 2, label %5
i32 3, label %5
i32 4, label %5
i32 7, label %5
i32 8, label %5
i32 9, label %5
i32 10, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
@switch.table.is_valid_sym_algo = [10 x i32] [i32 1, i32 1, i32 1, i32 1, i32 0, i32 0, i32 1, i32 1, i32 1, i32 1]
define i32 @is_valid_sym_algo(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 10
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [10 x i32], [10 x i32]* @switch.table.is_valid_sym_algo, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
int test_imm_B5uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xB5 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_B5uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 181
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ random();
int /*<<< orphan*/ srandom(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/);
void generate_data(unsigned int *array, unsigned int size) {
  unsigned int i;
  srandom(time(0));
  for (i = 0; i < size; i++) {
    array[i] = (unsigned int)random();
  }
}


x86 assembly (clang, -O0):
<generate_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srandom@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1181 <generate_data+0x51>
mov    $0x0,%al
call   1050 <random@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1154 <generate_data+0x24>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_data>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srandom@plt>
test   %ebp,%ebp
je     1164 <generate_data+0x34>
mov    %ebp,%ebp
xor    %ebx,%ebx
nop
xor    %eax,%eax
call   1050 <random@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1150 <generate_data+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @generate_data(i32* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @time(i32 0)
%4 = tail call i32 @srandom(i32 %3)
%5 = icmp eq i32 %1, 0
br i1 %5, label %15, label %6
6: ; preds = %2
%7 = zext i32 %1 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %13, %8 ]
%10 = tail call i64 (...) @random()
%11 = trunc i64 %10 to i32
%12 = getelementptr inbounds i32, i32* %0, i64 %9
store i32 %11, i32* %12
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %7
br i1 %14, label %15, label %8
15: ; preds = %8, %2
ret void
}
int test1(int b, int c) {
  char x;
  if (b)
    return x / c;
  else
    return 1;
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1124 <test1+0x24>
movsbl -0xd(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x4(%rbp)
jmp    112b <test1+0x2b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @test1(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
void *ERR_PTR(long err) { return (void *)err; }


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

x86 assembly (clang, -O2):
<ERR_PTR>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @ERR_PTR(i64 %0) {
%2 = inttoptr i64 %0 to i8*
ret i8* %2
}
void mem_destroy() {}


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

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

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

LLVM IR (-O2):
define void @mem_destroy() {
ret void
}
void back_extdom_evict_group(struct nss_ops_ctx *nss_context,
                             const char *name) {}


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

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

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

LLVM IR (-O2):
%struct.nss_ops_ctx = type opaque
define void @back_extdom_evict_group(%struct.nss_ops_ctx* nocapture %0, i8* nocapture %1) {
ret void
}
void foo054(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo054(i32 %0) {
ret void
}
__attribute__((always_)) int task_handoff_unregister(struct notifier_block *n) {
  return -38;
}


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

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

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

LLVM IR (-O2):
%struct.notifier_block = type opaque
define i32 @task_handoff_unregister(%struct.notifier_block* nocapture readnone %0) {
ret i32 -38
}
void sched_autogroup_detach(struct task_struct *p) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @func8() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_vertical(int num) {
  if (num < 10)
    printf("%d\n", num);
  else {
    print_vertical(num / 10);
    printf("%d\n", num % 10);
  }
}


x86 assembly (clang, -O0):
<print_vertical>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1149 <print_vertical+0x29>
mov    -0x4(%rbp),%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
jmp    1174 <print_vertical+0x54>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <print_vertical@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_vertical>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
cmp    $0x9,%edi
jle    1147 <print_vertical+0x27>
mov    %ebp,%eax
mov    $0xcccccccd,%ebx
imul   %rax,%rbx
shr    $0x23,%rbx
mov    %ebx,%edi
call   1040 <print_vertical@plt>
add    %ebx,%ebx
lea    (%rbx,%rbx,4),%eax
sub    %eax,%ebp
lea    0xeb2(%rip),%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @print_vertical(i32 %0) {
%2 = icmp slt i32 %0, 10
br i1 %2, label %3, label %6
3: ; preds = %1, %6
%4 = phi i32 [ %8, %6 ], [ %0, %1 ]
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
6: ; preds = %1
%7 = udiv i32 %0, 10
tail call void @print_vertical(i32 %7)
%8 = urem i32 %0, 10
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ mymalloc(scalar_t__);
char *strcpy(int /*<<< orphan*/, char const *);
scalar_t__ strlen(char const *);
char *mystrdup(const char *str) {
  return (strcpy(mymalloc(strlen(str) + 1), str));
}


x86 assembly (clang, -O0):
<mystrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <mymalloc@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrdup>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <mymalloc@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @mystrdup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strlen(i8* %3)
%5 = add nsw i64 %4, 1
%6 = call i32 @mymalloc(i64 %5)
%7 = load i8*, i8** %2
%8 = call i8* @strcpy(i32 %6, i8* %7)
ret i8* %8
}

LLVM IR (-O2):
define i8* @mystrdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i32 @mymalloc(i64 %3)
%5 = tail call i8* @strcpy(i32 %4, i8* %0)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int warterm_refresh() {
  puts("R\01");
  return 0;
}


x86 assembly (clang, -O0):
<warterm_refresh>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"R\01\00"
define i32 @warterm_refresh() {
%1 = call i32 @puts(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"R\01\00"
define i32 @warterm_refresh() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gmx_mindist(int, char **);
int main(int argc, char *argv[]) {
  gmx_mindist(argc, argv);
  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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <gmx_mindist@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <gmx_mindist@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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @gmx_mindist(i32 %6, i8** %7)
ret i32 0
}

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

/* Variables and functions */
int main() {
  uint8_t ui8 = 255;
  int16_t i8 = -255;
  char *s = "abcdefg";
  char c = s[2];
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xff,-0x8(%rbp)
movl   $0xffffff01,-0xc(%rbp)
lea    0xee0(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x2(%rax),%al
mov    %al,-0x19(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
struct afp_volume {
  int dummy;
};
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int EPERM;
int extra_translate(struct afp_volume *, char const *, char **);
int /*<<< orphan*/ free(char *);
int appledouble_chmod(struct afp_volume *volume, const char *path,
                      mode_t mode) {
  int resource;
  char *newpath;
  resource = extra_translate(volume, path, &newpath);
  free(newpath);
  if (resource == 0)
    return 0;
  return -EPERM;
}


x86 assembly (clang, -O0):
<appledouble_chmod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x28(%rbp),%rdx
call   1040 <extra_translate@plt>
mov    %eax,-0x20(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
cmpl   $0x0,-0x20(%rbp)
jne    1166 <appledouble_chmod+0x46>
movl   $0x0,-0x4(%rbp)
jmp    1174 <appledouble_chmod+0x54>
xor    %eax,%eax
mov    0x2e69(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<appledouble_chmod>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rdx
call   1040 <extra_translate@plt>
mov    %eax,%ebx
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    0x2e96(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
test   %ebx,%ebx
cmove  %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.afp_volume = type { i32 }
@EPERM = global i32 0
define i32 @appledouble_chmod(%struct.afp_volume* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.afp_volume*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
store %struct.afp_volume* %0, %struct.afp_volume** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%10 = load %struct.afp_volume*, %struct.afp_volume** %5
%11 = load i8*, i8** %6
%12 = call i32 @extra_translate(%struct.afp_volume* %10, i8* %11, i8** %9)
store i32 %12, i32* %8
%13 = load i8*, i8** %9
%14 = call i32 @free(i8* %13)
%15 = load i32, i32* %8
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %3
store i32 0, i32* %4
br label %21
18: ; preds = %3
%19 = load i32, i32* @EPERM
%20 = sub nsw i32 0, %19
store i32 %20, i32* %4
br label %21
21: ; preds = %18, %17
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
%struct.afp_volume = type { i32 }
@EPERM = global i32 0
define i32 @appledouble_chmod(%struct.afp_volume* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = bitcast i8** %4 to i8*
%6 = call i32 @extra_translate(%struct.afp_volume* %0, i8* %1, i8** %4)
%7 = load i8*, i8** %4
%8 = call i32 @free(i8* %7)
%9 = icmp eq i32 %6, 0
%10 = load i32, i32* @EPERM
%11 = sub nsw i32 0, %10
%12 = select i1 %9, i32 0, i32 %11
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *initialize(char *ptr) {
  if (ptr != NULL) {
    free(ptr);
    ptr = NULL;
  }
  return ptr;
}


x86 assembly (clang, -O0):
<initialize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <initialize+0x28>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize>:
test   %rdi,%rdi
je     111f <initialize+0xf>
push   %rax
call   1030 <free@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define noalias i8* @initialize(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret i8* null
}
void kunmap(struct page *page) {}


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

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

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

LLVM IR (-O2):
%struct.page = type opaque
define void @kunmap(%struct.page* nocapture %0) {
ret void
}
/* Type definitions */
struct timespec {
  int dummy;
};
struct aiocb {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ abort();
int aio_suspend(struct aiocb const *const *, int, struct timespec const *);
int /*<<< orphan*/ perror(char *);
int ps_test_aio_suspend(const struct aiocb *const list[], int nent,
                        const struct timespec *timeout) {
  int rv;
  if ((rv = aio_suspend(list, nent, timeout)) == 0) {
    perror("aio_suspend failed");
    abort();
  }
  return rv;
}


x86 assembly (clang, -O0):
<ps_test_aio_suspend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1040 <aio_suspend@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
jne    1172 <ps_test_aio_suspend+0x42>
lea    0xe9a(%rip),%rdi
call   1050 <perror@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ps_test_aio_suspend>:
push   %rax
call   1040 <aio_suspend@plt>
test   %eax,%eax
je     113c <ps_test_aio_suspend+0xc>
pop    %rcx
ret
lea    0xebd(%rip),%rdi
call   1050 <perror@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct.aiocb = type { i32 }
%struct.timespec = type { i32 }
@.str = [19 x i8] c"aio_suspend failed\00"
define i32 @ps_test_aio_suspend(%struct.aiocb** %0, i32 %1, %struct.timespec* %2) {
%4 = alloca %struct.aiocb**
%5 = alloca i32
%6 = alloca %struct.timespec*
%7 = alloca i32
store %struct.aiocb** %0, %struct.aiocb*** %4
store i32 %1, i32* %5
store %struct.timespec* %2, %struct.timespec** %6
%8 = load %struct.aiocb**, %struct.aiocb*** %4
%9 = load i32, i32* %5
%10 = load %struct.timespec*, %struct.timespec** %6
%11 = call i32 @aio_suspend(%struct.aiocb** %8, i32 %9, %struct.timespec* %10)
store i32 %11, i32* %7
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %3
%14 = call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%15 = call i32 (...) @abort()
unreachable
16: ; preds = %3
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
%struct.aiocb = type { i32 }
%struct.timespec = type { i32 }
@.str = [19 x i8] c"aio_suspend failed\00"
define i32 @ps_test_aio_suspend(%struct.aiocb** %0, i32 %1, %struct.timespec* %2) {
%4 = tail call i32 @aio_suspend(%struct.aiocb** %0, i32 %1, %struct.timespec* %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %3
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ key_t;

/* Variables and functions */
void *malloc(size_t);
int shmget(key_t key, size_t size, int shmflg) {
  void *res = malloc(size);
  if (!res)
    return -1;
  return (long)res;
}


x86 assembly (clang, -O0):
<shmget>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1146 <shmget+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    114d <shmget+0x3d>
mov    -0x20(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shmget>:
push   %rax
mov    %rsi,%rdi
call   1030 <malloc@plt>
cmp    $0x1,%rax
sbb    %ecx,%ecx
or     %eax,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @shmget(i32 %0, i64 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i64
%7 = alloca i32
%8 = alloca i8*
store i32 %0, i32* %5
store i64 %1, i64* %6
store i32 %2, i32* %7
%9 = load i64, i64* %6
%10 = call i8* @malloc(i64 %9)
store i8* %10, i8** %8
%11 = load i8*, i8** %8
%12 = icmp ne i8* %11, null
br i1 %12, label %14, label %13
13: ; preds = %3
store i32 -1, i32* %4
br label %18
14: ; preds = %3
%15 = load i8*, i8** %8
%16 = ptrtoint i8* %15 to i64
%17 = trunc i64 %16 to i32
store i32 %17, i32* %4
br label %18
18: ; preds = %14, %13
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
define i32 @shmget(i32 %0, i64 %1, i32 %2) {
%4 = tail call i8* @malloc(i64 %1)
%5 = icmp eq i8* %4, null
%6 = ptrtoint i8* %4 to i64
%7 = trunc i64 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int32_t;

/* Variables and functions */
void accept_prune(u_int32_t src, u_int32_t dst, char *p, int datalen) {}


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

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

LLVM IR (-O0):
define void @accept_prune(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @accept_prune(i32 %0, i32 %1, i8* nocapture %2, i32 %3) {
ret void
}
int countLetters(char a[]) {
  int i = 0;
  int count = 0;
  while (a[i] != '\0') {
    if (a[i] >= 65 && a[i] <= 122)
      count++;
    i++;
  }
  return count;
}


x86 assembly (clang, -O0):
<countLetters>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     116c <countLetters+0x6c>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x41,%eax
jl     115e <countLetters+0x5e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x7a,%eax
jg     115e <countLetters+0x5e>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <countLetters+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countLetters>:
mov    (%rdi),%cl
test   %cl,%cl
je     1125 <countLetters+0x25>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
add    $0xbf,%cl
cmp    $0x3a,%cl
adc    $0x0,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <countLetters+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @countLetters(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %32, %1
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %35
13: ; preds = %5
%14 = load i8*, i8** %2
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp sge i32 %19, 65
br i1 %20, label %21, label %32
21: ; preds = %13
%22 = load i8*, i8** %2
%23 = load i32, i32* %3
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp sle i32 %27, 122
br i1 %28, label %29, label %32
29: ; preds = %21
%30 = load i32, i32* %4
%31 = add nsw i32 %30, 1
store i32 %31, i32* %4
br label %32
32: ; preds = %29, %21, %13
%33 = load i32, i32* %3
%34 = add nsw i32 %33, 1
store i32 %34, i32* %3
br label %5
35: ; preds = %5
%36 = load i32, i32* %4
ret i32 %36
}

LLVM IR (-O2):
define i32 @countLetters(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %12, %4 ], [ 0, %1 ]
%6 = phi i8 [ %14, %4 ], [ %2, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = add i8 %6, -65
%9 = icmp ult i8 %8, 58
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %7, %10
%12 = add nuw nsw i64 %5, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %4, %1
%17 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %17
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ htons(int /*<<< orphan*/);
void minipack_pack_bin16(void *ptr, uint16_t length, size_t *sz) {
  *sz = 3;
  *((uint8_t *)ptr) = 0xC5;
  *((uint16_t *)(ptr + 1)) = htons(length);
}


x86 assembly (clang, -O0):
<minipack_pack_bin16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movq   $0x3,(%rax)
mov    -0x8(%rbp),%rax
movl   $0xc5,(%rax)
mov    -0xc(%rbp),%edi
call   1030 <htons@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x1(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<minipack_pack_bin16>:
push   %rbx
mov    %rdi,%rbx
movq   $0x3,(%rdx)
movl   $0xc5,(%rdi)
mov    %esi,%edi
call   1030 <htons@plt>
mov    %eax,0x1(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @minipack_pack_bin16(i8* %0, i32 %1, i64* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i64* %2, i64** %6
%7 = load i64*, i64** %6
store i64 3, i64* %7
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
store i32 197, i32* %9
%10 = load i32, i32* %5
%11 = call i32 @htons(i32 %10)
%12 = load i8*, i8** %4
%13 = getelementptr i8, i8* %12, i64 1
%14 = bitcast i8* %13 to i32*
store i32 %11, i32* %14
ret void
}

LLVM IR (-O2):
define void @minipack_pack_bin16(i8* nocapture writeonly %0, i32 %1, i64* nocapture writeonly %2) {
store i64 3, i64* %2
%4 = bitcast i8* %0 to i32*
store i32 197, i32* %4
%5 = tail call i32 @htons(i32 %1)
%6 = getelementptr i8, i8* %0, i64 1
%7 = bitcast i8* %6 to i32*
store i32 %5, i32* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/);
int init() { srand(time(0)); }


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @init() {
%1 = tail call i32 @time(i32 0)
%2 = tail call i32 @srand(i32 %1)
ret i32 undef
}
/* Type definitions */
typedef int fexcept_t;

/* Variables and functions */
int FE_ALL_EXCEPT;
int /*<<< orphan*/ _FPU_GETCW(int);
int /*<<< orphan*/ _FPU_SETCW(int);
int feraiseexcept(int excepts) {
  fexcept_t temp;
  _FPU_GETCW(temp);
  temp |= (excepts & FE_ALL_EXCEPT);
  temp |= (excepts & FE_ALL_EXCEPT) << 5;
  _FPU_SETCW(temp);
  return 0;
}


x86 assembly (clang, -O0):
<feraiseexcept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <_FPU_GETCW@plt>
mov    -0x4(%rbp),%eax
mov    0x2ea3(%rip),%rcx
and    (%rcx),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2e91(%rip),%rcx
and    (%rcx),%eax
shl    $0x5,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <_FPU_SETCW@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<feraiseexcept>:
push   %rax
call   1030 <_FPU_GETCW@plt>
mov    $0xffffffff,%edi
call   1040 <_FPU_SETCW@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@FE_ALL_EXCEPT = global i32 0
define i32 @feraiseexcept(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %3
%5 = call i32 @_FPU_GETCW(i32 %4)
%6 = load i32, i32* %2
%7 = load i32, i32* @FE_ALL_EXCEPT
%8 = and i32 %6, %7
%9 = load i32, i32* %3
%10 = or i32 %9, %8
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = load i32, i32* @FE_ALL_EXCEPT
%13 = and i32 %11, %12
%14 = shl i32 %13, 5
%15 = load i32, i32* %3
%16 = or i32 %15, %14
store i32 %16, i32* %3
%17 = load i32, i32* %3
%18 = call i32 @_FPU_SETCW(i32 %17)
ret i32 0
}

LLVM IR (-O2):
@FE_ALL_EXCEPT = global i32 0
define i32 @feraiseexcept(i32 %0) {
%2 = tail call i32 @_FPU_GETCW(i32 undef)
%3 = tail call i32 @_FPU_SETCW(i32 -1)
ret i32 0
}
/* Variables and functions */
int f();
int g();
int /*<<< orphan*/ printf(char *, int);
main() {
  printf("%d\n", f());
  printf("%d\n", g());
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <f@plt>
mov    %eax,%esi
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <g@plt>
mov    %eax,%esi
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <f@plt>
lea    0xec1(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <g@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @f()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @g()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
void R_gc() {}


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

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

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

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

/* Variables and functions */
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ X509_PUBKEY_it;
int i2d_X509_PUBKEY(X509_PUBKEY *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_PUBKEY_it);
}


x86 assembly (clang, -O0):
<i2d_X509_PUBKEY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2eb1(%rip),%rdx
call   1030 <ASN1_item_i2d@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2d_X509_PUBKEY>:
mov    0x2ec9(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

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

LLVM IR (-O2):
@X509_PUBKEY_it = global i32 0
define i32 @i2d_X509_PUBKEY(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @X509_PUBKEY_it)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Base64Encode(char *, char *, int);
int /*<<< orphan*/ gen_random_str(char **, int);
scalar_t__ xmalloc(int, int);
char *new_session_key(void) {
  char *result;
  result = (char *)xmalloc(48 + 1, sizeof(char));
  gen_random_str(&result, 48);
  Base64Encode(result, result, 48);
  return (result);
}


x86 assembly (clang, -O0):
<new_session_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x31,%edi
mov    $0x1,%esi
call   1050 <xmalloc@plt>
mov    %rax,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
mov    $0x30,%esi
call   1030 <gen_random_str@plt>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x30,%edx
call   1040 <Base64Encode@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_session_key>:
push   %rax
mov    $0x31,%edi
mov    $0x1,%esi
call   1050 <xmalloc@plt>
mov    %rax,(%rsp)
mov    %rsp,%rdi
mov    $0x30,%esi
call   1030 <gen_random_str@plt>
mov    (%rsp),%rdi
mov    %rdi,%rsi
mov    $0x30,%edx
call   1040 <Base64Encode@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @new_session_key() {
%1 = alloca i8*
%2 = call i64 @xmalloc(i32 49, i32 1)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = call i32 @gen_random_str(i8** %1, i32 48)
%5 = load i8*, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 @Base64Encode(i8* %5, i8* %6, i32 48)
%8 = load i8*, i8** %1
ret i8* %8
}

LLVM IR (-O2):
define i8* @new_session_key() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
%3 = tail call i64 @xmalloc(i32 49, i32 1)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %1
%5 = call i32 @gen_random_str(i8** %1, i32 48)
%6 = load i8*, i8** %1
%7 = call i32 @Base64Encode(i8* %6, i8* %6, i32 48)
%8 = load i8*, i8** %1
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char **argv) {
  fprintf(stderr, "Usage: %s file.mbtiles ...\n", argv[0]);
  exit(EXIT_FAILURE);
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%eax
mov    (%rdi),%rdx
lea    0xecc(%rip),%rsi
mov    %eax,%edi
call   1030 <fprintf@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"Usage: %s file.mbtiles ...\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i32, i32* @stderr
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i64 0
%6 = load i8*, i8** %5
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"Usage: %s file.mbtiles ...\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8** nocapture %0) {
%2 = load i32, i32* @stderr
%3 = load i8*, i8** %0
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *,
                           int /*<<< orphan*/ const *const);
void ustringPrint(FILE *fp, const wchar_t *const *data, int indent) {
  fprintf(fp, "\"%ls\"", *data);
}


x86 assembly (clang, -O0):
<ustringPrint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xecb(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ustringPrint>:
mov    (%rsi),%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"\22%ls\22\00"
define void @ustringPrint(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** %8
%10 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %9)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\22%ls\22\00"
define void @ustringPrint(i32* nocapture %0, i32** nocapture %1, i32 %2) {
%4 = load i32*, i32** %1
%5 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %4)
ret void
}