xunge/DecIR huggingface dataset:
unsigned char _n_base_val(char chr) {
  if (chr > '9') {
    if ((chr < 'a') && (chr >= 'A'))
      return (chr - 'A' + 10);
    else
      return (chr - 'a' + 10);
  }
  return (chr - '0');
}


x86 assembly (clang, -O0):
<_n_base_val>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x39,%eax
jle    1155 <_n_base_val+0x55>
movsbl -0x2(%rbp),%eax
cmp    $0x61,%eax
jge    1143 <_n_base_val+0x43>
movsbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jl     1143 <_n_base_val+0x43>
movsbl -0x2(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %al,-0x1(%rbp)
jmp    115f <_n_base_val+0x5f>
movsbl -0x2(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %al,-0x1(%rbp)
jmp    115f <_n_base_val+0x5f>
movsbl -0x2(%rbp),%eax
sub    $0x30,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_n_base_val>:
lea    -0x41(%rdi),%eax
cmp    $0x20,%al
setb   %al
shl    $0x5,%al
add    $0xa9,%al
cmp    $0x3a,%dil
movzbl %al,%ecx
mov    $0xd0,%eax
cmovge %ecx,%eax
add    %dil,%al
ret

LLVM IR (-O0):
define zeroext i8 @_n_base_val(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sgt i32 %5, 57
br i1 %6, label %7, label %27
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp slt i32 %9, 97
br i1 %10, label %11, label %21
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 65
br i1 %14, label %15, label %21
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = sub nsw i32 %17, 65
%19 = add nsw i32 %18, 10
%20 = trunc i32 %19 to i8
store i8 %20, i8* %2
br label %32
21: ; preds = %11, %7
%22 = load i8, i8* %3
%23 = sext i8 %22 to i32
%24 = sub nsw i32 %23, 97
%25 = add nsw i32 %24, 10
%26 = trunc i32 %25 to i8
store i8 %26, i8* %2
br label %32
27: ; preds = %1
%28 = load i8, i8* %3
%29 = sext i8 %28 to i32
%30 = sub nsw i32 %29, 48
%31 = trunc i32 %30 to i8
store i8 %31, i8* %2
br label %32
32: ; preds = %27, %21, %15
%33 = load i8, i8* %2
ret i8 %33
}

LLVM IR (-O2):
define zeroext i8 @_n_base_val(i8 signext %0) {
%2 = icmp sgt i8 %0, 57
%3 = add nsw i8 %0, -65
%4 = icmp ult i8 %3, 32
%5 = select i1 %4, i8 -55, i8 -87
%6 = select i1 %2, i8 %5, i8 -48
%7 = add i8 %6, %0
ret i8 %7
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void _show_connection(uint32_t id) {
  printf("connection details for conn id %u...\n", id);
}


x86 assembly (clang, -O0):
<_show_connection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_show_connection>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"connection details for conn id %u...\0A\00"
define void @_show_connection(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"connection details for conn id %u...\0A\00"
define void @_show_connection(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int Q_log2(int val) {
  int answer = 0;
  while ((val >>= 1) != 0) {
    answer++;
  }
  return answer;
}


x86 assembly (clang, -O0):
<Q_log2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     112e <Q_log2+0x2e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <Q_log2+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_log2>:
xor    %eax,%eax
cmp    $0x2,%edi
jb     111c <Q_log2+0x1c>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
sar    %ecx
add    $0x1,%eax
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1110 <Q_log2+0x10>
ret

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

LLVM IR (-O2):
define i32 @Q_log2(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = ashr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 4
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Variables and functions */
scalar_t__ posix_memalign(void **, int, size_t);
__attribute__((always_)) void *align_malloc(size_t size) {
  void *mem;
  return posix_memalign(&mem, 64, size) ? NULL : mem;
}


x86 assembly (clang, -O0):
<align_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    -0x10(%rbp),%rdi
mov    $0x40,%esi
call   1030 <posix_memalign@plt>
cmp    $0x0,%rax
je     1143 <align_malloc+0x33>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    114b <align_malloc+0x3b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<align_malloc>:
push   %rax
mov    %rdi,%rdx
mov    %rsp,%rdi
mov    $0x40,%esi
call   1030 <posix_memalign@plt>
test   %rax,%rax
jne    112c <align_malloc+0x1c>
mov    (%rsp),%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @align_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @posix_memalign(i8** %3, i32 64, i64 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
br label %10
8: ; preds = %1
%9 = load i8*, i8** %3
br label %10
10: ; preds = %8, %7
%11 = phi i8* [ null, %7 ], [ %9, %8 ]
ret i8* %11
}

LLVM IR (-O2):
define i8* @align_malloc(i64 %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i64 @posix_memalign(i8** %2, i32 64, i64 %0)
%5 = icmp eq i64 %4, 0
%6 = load i8*, i8** %2
%7 = select i1 %5, i8* %6, i8* null
ret i8* %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fputs(char const *, int /*<<< orphan*/ *);
int lfputs(const char *s, FILE *stream) { return fputs(s, stream); }


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

x86 assembly (clang, -O2):
<lfputs>:
jmp    1030 <fputs@plt>

LLVM IR (-O0):
define i32 @lfputs(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 @fputs(i8* %5, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @lfputs(i8* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @fputs(i8* %0, i32* %1)
ret i32 %3
}
void fam10h_check_enable_mmcfg(void) {}


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

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

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

LLVM IR (-O2):
define void @fam10h_check_enable_mmcfg() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ snake_end();
void signal_handler(int sig) { snake_end(); }


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

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

LLVM IR (-O0):
define void @signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @snake_end()
ret void
}

LLVM IR (-O2):
define void @signal_handler(i32 %0) {
%2 = tail call i32 (...) @snake_end()
ret void
}
void movi_msl8(int *__restrict a) {
  int i;
  for (i = 0; i < 16; i++)
    a[i] = 0xabff;
}


x86 assembly (clang, -O0):
<movi_msl8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jge    1136 <movi_msl8+0x36>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0xabff,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <movi_msl8+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<movi_msl8>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
movups %xmm0,0x10(%rdi)
movups %xmm0,0x20(%rdi)
movups %xmm0,0x30(%rdi)
ret

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

LLVM IR (-O2):
define void @movi_msl8(i32* noalias nocapture writeonly %0) {
%2 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> <i32 44031, i32 44031, i32 44031, i32 44031>, <4 x i32>* %2
%3 = getelementptr inbounds i32, i32* %0, i64 4
%4 = bitcast i32* %3 to <4 x i32>*
store <4 x i32> <i32 44031, i32 44031, i32 44031, i32 44031>, <4 x i32>* %4
%5 = getelementptr inbounds i32, i32* %0, i64 8
%6 = bitcast i32* %5 to <4 x i32>*
store <4 x i32> <i32 44031, i32 44031, i32 44031, i32 44031>, <4 x i32>* %6
%7 = getelementptr inbounds i32, i32* %0, i64 12
%8 = bitcast i32* %7 to <4 x i32>*
store <4 x i32> <i32 44031, i32 44031, i32 44031, i32 44031>, <4 x i32>* %8
ret void
}
/* Variables and functions */
double ConvertToFahrenheit(float);
int /*<<< orphan*/ printf(char *, float, double);
void ShowFahrenheitConversion(float celsiusTemperature) {
  printf("%.1f degrees Celsius is %.1f degrees Fahrenheit\n",
         celsiusTemperature, ConvertToFahrenheit(celsiusTemperature));
}


x86 assembly (clang, -O0):
<ShowFahrenheitConversion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <ConvertToFahrenheit@plt>
movaps %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShowFahrenheitConversion>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1040 <ConvertToFahrenheit@plt>
movaps %xmm0,%xmm1
lea    0xeca(%rip),%rdi
movss  0x4(%rsp),%xmm0
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [49 x i8] c"%.1f degrees Celsius is %.1f degrees Fahrenheit\0A\00"
define void @ShowFahrenheitConversion(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = call double @ConvertToFahrenheit(float %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), float %3, double %5)
ret void
}

LLVM IR (-O2):
@.str = [49 x i8] c"%.1f degrees Celsius is %.1f degrees Fahrenheit\0A\00"
define void @ShowFahrenheitConversion(float %0) {
%2 = tail call double @ConvertToFahrenheit(float %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), float %0, double %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int main(int argc, char *argv[]) {
  int s = 0;
#pragma omp parallel sections reduction(+ : s)
  {
#pragma omp section
    { s = s + 1; }
#pragma omp section
    { s = s + 1; }
#pragma omp section
    { s = s + 1; }
  }
  if (s != 3)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
je     1159 <main+0x49>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
int nc_180(int top_cell) {
  switch (top_cell) {
  case 1:
    return (7);
  case 3:
    return (3);
  case 5:
    return (5);
  case 7:
    return (1);
  case 0:
    return (6);
  case 2:
    return (8);
  case 6:
    return (0);
  case 8:
    return (2);
  }
}


x86 assembly (clang, -O0):
<nc_180>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x8,%rax
ja     1187 <nc_180+0x87>
mov    -0x10(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x7,-0x4(%rbp)
jmp    1187 <nc_180+0x87>
movl   $0x3,-0x4(%rbp)
jmp    1187 <nc_180+0x87>
movl   $0x5,-0x4(%rbp)
jmp    1187 <nc_180+0x87>
movl   $0x1,-0x4(%rbp)
jmp    1187 <nc_180+0x87>
movl   $0x6,-0x4(%rbp)
jmp    1187 <nc_180+0x87>
movl   $0x8,-0x4(%rbp)
jmp    1187 <nc_180+0x87>
movl   $0x0,-0x4(%rbp)
jmp    1187 <nc_180+0x87>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nc_180>:
mov    $0x7,%eax
cmp    $0x8,%edi
ja     1117 <nc_180+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

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

LLVM IR (-O2):
@switch.table.nc_180 = [9 x i32] [i32 6, i32 7, i32 8, i32 3, i32 7, i32 5, i32 0, i32 1, i32 2]
define i32 @nc_180(i32 %0) {
%2 = icmp ult i32 %0, 9
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [9 x i32], [9 x i32]* @switch.table.nc_180, i64 0, i64 %4
%6 = load i32, i32* %5
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 7, %1 ], [ %6, %3 ]
ret i32 %8
}
void init_fpu(void) { __asm __volatile("finit"); }


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

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

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

LLVM IR (-O2):
define void @init_fpu() {
tail call void asm sideeffect "finit", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int a, b;
  a = 2;
  b = 4;
  if ((a = 2) & (b = 4))
    printf(" TAK\n");
  else
    printf(" NIE\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
xor    %eax,%eax
test   $0x1,%al
jne    114a <main+0x3a>
jmp    115b <main+0x4b>
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
jmp    1167 <main+0x57>
lea    0xea4(%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 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c" TAK\0A\00"
@.str.1 = [6 x i8] c" NIE\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
store i32 4, i32* %3
store i32 2, i32* %2
store i32 4, i32* %3
br i1 false, label %4, label %6
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
ret i32 0
}

LLVM IR (-O2):
@str = [5 x i8] c" NIE\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ f3();
void f2() { f3(); }


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

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

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

LLVM IR (-O2):
define void @f2() {
%1 = tail call i32 (...) @f3()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_heap();
int /*<<< orphan*/ test_isr();
int /*<<< orphan*/ test_page();
int /*<<< orphan*/ test_vfs();
void test_main(void) {
  test_isr();
  test_page();
  test_heap();
  test_vfs();
}


x86 assembly (clang, -O0):
<test_main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <test_isr@plt>
mov    $0x0,%al
call   1040 <test_page@plt>
mov    $0x0,%al
call   1060 <test_heap@plt>
mov    $0x0,%al
call   1030 <test_vfs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_main>:
push   %rax
xor    %eax,%eax
call   1050 <test_isr@plt>
xor    %eax,%eax
call   1040 <test_page@plt>
xor    %eax,%eax
call   1060 <test_heap@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <test_vfs@plt>

LLVM IR (-O0):
define void @test_main() {
%1 = call i32 (...) @test_isr()
%2 = call i32 (...) @test_page()
%3 = call i32 (...) @test_heap()
%4 = call i32 (...) @test_vfs()
ret void
}

LLVM IR (-O2):
define void @test_main() {
%1 = tail call i32 (...) @test_isr()
%2 = tail call i32 (...) @test_page()
%3 = tail call i32 (...) @test_heap()
%4 = tail call i32 (...) @test_vfs()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ erase();
int /*<<< orphan*/ getch();
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ refresh();
void show_email(WINDOW *email_window, char *email) {
  erase();
  printf("%s", email);
  refresh();
  getch();
  erase();
  refresh();
}


x86 assembly (clang, -O0):
<show_email>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <erase@plt>
mov    -0x10(%rbp),%rsi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <refresh@plt>
mov    $0x0,%al
call   1060 <getch@plt>
mov    $0x0,%al
call   1040 <erase@plt>
mov    $0x0,%al
call   1050 <refresh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_email>:
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
call   1040 <erase@plt>
lea    0xeae(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <refresh@plt>
xor    %eax,%eax
call   1060 <getch@plt>
xor    %eax,%eax
call   1040 <erase@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <refresh@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @show_email(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = call i32 (...) @erase()
%6 = load i8*, i8** %4
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = call i32 (...) @refresh()
%9 = call i32 (...) @getch()
%10 = call i32 (...) @erase()
%11 = call i32 (...) @refresh()
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @show_email(i32* nocapture readnone %0, i8* %1) {
%3 = tail call i32 (...) @erase()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%5 = tail call i32 (...) @refresh()
%6 = tail call i32 (...) @getch()
%7 = tail call i32 (...) @erase()
%8 = tail call i32 (...) @refresh()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ VIM_HIF_SetReg16(unsigned long, unsigned long);
void VIM_HIF_SetReg32(unsigned long adr, unsigned long val) {
  VIM_HIF_SetReg16(adr, val);
  VIM_HIF_SetReg16(adr + 0x02, val >> 16);
}


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

x86 assembly (clang, -O2):
<VIM_HIF_SetReg32>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <VIM_HIF_SetReg16@plt>
add    $0x2,%rbx
shr    $0x10,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <VIM_HIF_SetReg16@plt>

LLVM IR (-O0):
define void @VIM_HIF_SetReg32(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 = call i32 @VIM_HIF_SetReg16(i64 %5, i64 %6)
%8 = load i64, i64* %3
%9 = add i64 %8, 2
%10 = load i64, i64* %4
%11 = lshr i64 %10, 16
%12 = call i32 @VIM_HIF_SetReg16(i64 %9, i64 %11)
ret void
}

LLVM IR (-O2):
define void @VIM_HIF_SetReg32(i64 %0, i64 %1) {
%3 = tail call i32 @VIM_HIF_SetReg16(i64 %0, i64 %1)
%4 = add i64 %0, 2
%5 = lshr i64 %1, 16
%6 = tail call i32 @VIM_HIF_SetReg16(i64 %4, i64 %5)
ret void
}
int erdStdLineSeparator(char t) { return ((t == '\n')); }


x86 assembly (clang, -O0):
<erdStdLineSeparator>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<erdStdLineSeparator>:
xor    %eax,%eax
cmp    $0xa,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @erdStdLineSeparator(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 10
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @erdStdLineSeparator(i8 signext %0) {
%2 = icmp eq i8 %0, 10
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int _sendenet(char *, int);
int /*<<< orphan*/ monLock();
int /*<<< orphan*/ monUnlock();
int mon_sendenetpkt(char *pkt, int size) {
  int ret;
  monLock();
  ret = _sendenet(pkt, size);
  monUnlock();
  return (ret);
}


x86 assembly (clang, -O0):
<mon_sendenetpkt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <monLock@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <_sendenet@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <monUnlock@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mon_sendenetpkt>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <monLock@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <_sendenet@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <monUnlock@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mon_sendenetpkt(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = call i32 (...) @monLock()
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @_sendenet(i8* %7, i32 %8)
store i32 %9, i32* %5
%10 = call i32 (...) @monUnlock()
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
define i32 @mon_sendenetpkt(i8* %0, i32 %1) {
%3 = tail call i32 (...) @monLock()
%4 = tail call i32 @_sendenet(i8* %0, i32 %1)
%5 = tail call i32 (...) @monUnlock()
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ft_put_char(char);
void ft_is_negative(int n) {
  if (n < 0) {
    ft_put_char('N');
  } else {
    ft_put_char('P');
  }
}


x86 assembly (clang, -O0):
<ft_is_negative>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1134 <ft_is_negative+0x24>
mov    $0x4e,%edi
call   1030 <ft_put_char@plt>
jmp    113e <ft_is_negative+0x2e>
mov    $0x50,%edi
call   1030 <ft_put_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_is_negative>:
not    %edi
shr    $0x1f,%edi
add    %edi,%edi
add    $0x4e,%edi
jmp    1030 <ft_put_char@plt>

LLVM IR (-O0):
define void @ft_is_negative(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @ft_put_char(i8 signext 78)
br label %9
7: ; preds = %1
%8 = call i32 @ft_put_char(i8 signext 80)
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
define void @ft_is_negative(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = select i1 %2, i8 78, i8 80
%4 = tail call i32 @ft_put_char(i8 signext %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ geoip_reset_entry_stats(int /*<<< orphan*/);
void geoip_entry_stats_term(void) { geoip_reset_entry_stats(0); }


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

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

LLVM IR (-O0):
define void @geoip_entry_stats_term() {
%1 = call i32 @geoip_reset_entry_stats(i32 0)
ret void
}

LLVM IR (-O2):
define void @geoip_entry_stats_term() {
%1 = tail call i32 @geoip_reset_entry_stats(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void lmemcpy(void *trg, const void *src, size_t count) {
  memcpy(trg, src, count);
}


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

x86 assembly (clang, -O2):
<lmemcpy>:
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @lmemcpy(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_REUSEPORT;
int diminuto_ipc_set_socket(int, int /*<<< orphan*/, int /*<<< orphan*/, int);
int diminuto_ipc_set_reuseport(int fd, int enable) {
  return diminuto_ipc_set_socket(fd, SOL_SOCKET, SO_REUSEPORT, !!enable);
}


x86 assembly (clang, -O0):
<diminuto_ipc_set_reuseport>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    0x2eaf(%rip),%rax
mov    (%rax),%edx
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%ecx
call   1030 <diminuto_ipc_set_socket@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<diminuto_ipc_set_reuseport>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec0(%rip),%rcx
mov    (%rcx),%edx
xor    %ecx,%ecx
test   %esi,%esi
setne  %cl
mov    %eax,%esi
jmp    1030 <diminuto_ipc_set_socket@plt>

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_REUSEPORT = global i32 0
define i32 @diminuto_ipc_set_reuseport(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* @SOL_SOCKET
%7 = load i32, i32* @SO_REUSEPORT
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
%13 = call i32 @diminuto_ipc_set_socket(i32 %5, i32 %6, i32 %7, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_REUSEPORT = global i32 0
define i32 @diminuto_ipc_set_reuseport(i32 %0, i32 %1) {
%3 = load i32, i32* @SOL_SOCKET
%4 = load i32, i32* @SO_REUSEPORT
%5 = icmp ne i32 %1, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @diminuto_ipc_set_socket(i32 %0, i32 %3, i32 %4, i32 %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *arg) {
  printf("Usage: %s [ -h ] [ file1 file2 ]\n", arg);
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"Usage: %s [ -h ] [ file1 file2 ]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"Usage: %s [ -h ] [ file1 file2 ]\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t square_sum_rec(uint64_t num) {
  if (num == 0) {
    return 0;
  } else {
    return ((num - 1) << 1) + 1 + square_sum_rec(num - 1);
  }
}


x86 assembly (clang, -O0):
<square_sum_rec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <square_sum_rec+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1155 <square_sum_rec+0x45>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
shl    $0x1,%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <square_sum_rec@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<square_sum_rec>:
test   %edi,%edi
je     111f <square_sum_rec+0x1f>
lea    -0x1(%rdi),%ecx
lea    (%rdi,%rdi,1),%eax
add    $0xfffffffd,%eax
imul   %ecx,%eax
lea    (%rax,%rdi,2),%eax
add    $0xfffffffe,%edi
imul   %ecx,%edi
or     $0x1,%edi
sub    %edi,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @square_sum_rec(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = shl i32 %0, 1
%6 = add i32 %5, -3
%7 = mul i32 %4, %6
%8 = add i32 %7, %5
%9 = add i32 %0, -2
%10 = mul i32 %4, %9
%11 = or i32 %10, 1
%12 = sub i32 %8, %11
br label %13
13: ; preds = %3, %1
%14 = phi i32 [ 0, %1 ], [ %12, %3 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ my_sleep(int);
unsigned int rand();
void do_retry_sleep(unsigned milli_sleep) {
  my_sleep(1000 * (milli_sleep + 5 * (rand() % (milli_sleep / 5))));
}


x86 assembly (clang, -O0):
<do_retry_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
xor    %edx,%edx
div    %ecx
mov    -0x8(%rbp),%eax
imul   $0x5,%edx,%ecx
add    %ecx,%eax
imul   $0x3e8,%eax,%edi
call   1030 <my_sleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_retry_sleep>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <rand@plt>
mov    %ebx,%ecx
mov    $0xcccccccd,%esi
imul   %rcx,%rsi
shr    $0x22,%rsi
xor    %edx,%edx
div    %esi
lea    (%rdx,%rdx,4),%eax
add    %ebx,%eax
imul   $0x3e8,%eax,%edi
pop    %rbx
jmp    1030 <my_sleep@plt>

LLVM IR (-O0):
define void @do_retry_sleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (...) @rand()
%5 = load i32, i32* %2
%6 = udiv i32 %5, 5
%7 = urem i32 %4, %6
%8 = mul i32 5, %7
%9 = add i32 %3, %8
%10 = mul i32 1000, %9
%11 = call i32 @my_sleep(i32 %10)
ret void
}

LLVM IR (-O2):
define void @do_retry_sleep(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = udiv i32 %0, 5
%4 = urem i32 %2, %3
%5 = mul nuw i32 %4, 5
%6 = add i32 %5, %0
%7 = mul i32 %6, 1000
%8 = tail call i32 @my_sleep(i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ getch();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ printw(char *);
int /*<<< orphan*/ refresh();
int main(int argc, char *argv[]) {
  initscr();
  printw("Hello World");
  refresh();
  getch();
  endwin();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <initscr@plt>
lea    0xe8c(%rip),%rdi
call   1040 <printw@plt>
mov    $0x0,%al
call   1050 <refresh@plt>
mov    $0x0,%al
call   1060 <getch@plt>
mov    $0x0,%al
call   1070 <endwin@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <initscr@plt>
lea    0xea1(%rip),%rdi
call   1040 <printw@plt>
xor    %eax,%eax
call   1050 <refresh@plt>
xor    %eax,%eax
call   1060 <getch@plt>
xor    %eax,%eax
call   1070 <endwin@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Hello World\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @initscr()
%7 = call i32 @printw(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (...) @refresh()
%9 = call i32 (...) @getch()
%10 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello World\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @initscr()
%4 = tail call i32 @printw(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (...) @refresh()
%6 = tail call i32 (...) @getch()
%7 = tail call i32 (...) @endwin()
ret i32 0
}
void sortNumbers(int *nums, int len) {}


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

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

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

LLVM IR (-O2):
define void @sortNumbers(i32* nocapture %0, i32 %1) {
ret void
}
float sinf(float x) { return 0.0; }


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

x86 assembly (clang, -O2):
<sinf>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @sinf(float %0) {
%2 = alloca float
store float %0, float* %2
ret float 0.000000e+00
}

LLVM IR (-O2):
define float @sinf(float %0) {
ret float 0.000000e+00
}
/* Type definitions */
typedef int /*<<< orphan*/ Display;
typedef int /*<<< orphan*/ Bool;

/* Variables and functions */
int /*<<< orphan*/ XNVCTRLSetTargetStringAttribute(int /*<<< orphan*/ *,
                                                   int /*<<< orphan*/, int,
                                                   unsigned int, unsigned int,
                                                   char const *);
Bool XNVCTRLSetStringAttribute(Display *dpy, int screen,
                               unsigned int display_mask,
                               unsigned int attribute, const char *ptr) {
  return XNVCTRLSetTargetStringAttribute(dpy, 0, screen, display_mask,
                                         attribute, ptr);
}


x86 assembly (clang, -O0):
<XNVCTRLSetStringAttribute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x20(%rbp),%r9
xor    %esi,%esi
call   1030 <XNVCTRLSetTargetStringAttribute@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XNVCTRLSetStringAttribute>:
mov    %r8,%r9
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <XNVCTRLSetTargetStringAttribute@plt>

LLVM IR (-O0):
define i32 @XNVCTRLSetStringAttribute(i32* %0, i32 %1, i32 %2, i32 %3, i8* %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = load i32*, i32** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i8*, i8** %10
%16 = call i32 @XNVCTRLSetTargetStringAttribute(i32* %11, i32 0, i32 %12, i32 %13, i32 %14, i8* %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @XNVCTRLSetStringAttribute(i32* %0, i32 %1, i32 %2, i32 %3, i8* %4) {
%6 = tail call i32 @XNVCTRLSetTargetStringAttribute(i32* %0, i32 0, i32 %1, i32 %2, i32 %3, i8* %4)
ret i32 %6
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
unsigned int population(int);
unsigned int ntz(uint32_t x) { return 32 - population(x | -x); }


x86 assembly (clang, -O0):
<ntz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %eax,%eax
sub    -0x4(%rbp),%eax
or     %eax,%edi
call   1030 <population@plt>
mov    %eax,%ecx
mov    $0x20,%eax
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntz>:
push   %rax
mov    %edi,%eax
neg    %eax
or     %eax,%edi
call   1030 <population@plt>
mov    $0x20,%ecx
sub    %eax,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ntz(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 0, %4
%6 = or i32 %3, %5
%7 = call i32 @population(i32 %6)
%8 = sub i32 32, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @ntz(i32 %0) {
%2 = sub nsw i32 0, %0
%3 = or i32 %2, %0
%4 = tail call i32 @population(i32 %3)
%5 = sub i32 32, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("MBEDTLS_CIPHER_C and/or MBEDTLS_MD_C and/or MBEDTLS_FS_IO not "
         "defined.\n");
  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 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [72 x i8] c"MBEDTLS_CIPHER_C and/or MBEDTLS_MD_C and/or MBEDTLS_FS_IO not defined.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [71 x i8] c"MBEDTLS_CIPHER_C and/or MBEDTLS_MD_C and/or MBEDTLS_FS_IO not defined.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int l2x0_status() { return (*((volatile unsigned *)(0xC4200000 + 0x100))) & 1; }


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

x86 assembly (clang, -O2):
<l2x0_status>:
mov    $0xc4200100,%eax
mov    (%rax),%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @l2x0_status() {
%1 = load volatile i32, i32* inttoptr (i64 3290431744 to i32*)
%2 = and i32 %1, 1
ret i32 %2
}

LLVM IR (-O2):
define i32 @l2x0_status() {
%1 = load volatile i32, i32* inttoptr (i64 3290431744 to i32*)
%2 = and i32 %1, 1
ret i32 %2
}
/* Variables and functions */
void *encalloc(int, size_t, size_t);
void *ecalloc(size_t nmemb, size_t size) { return encalloc(1, nmemb, size); }


x86 assembly (clang, -O0):
<ecalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x1,%edi
call   1030 <encalloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ecalloc>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <encalloc@plt>

LLVM IR (-O0):
define i8* @ecalloc(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 = call i8* @encalloc(i32 1, i64 %5, i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @ecalloc(i64 %0, i64 %1) {
%3 = tail call i8* @encalloc(i32 1, i64 %0, i64 %1)
ret i8* %3
}
void uwsgi_opt_noop(char *opt, char *foo, void *bar) {}


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

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

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

LLVM IR (-O2):
define void @uwsgi_opt_noop(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
/* Type definitions */
struct dns_hosts {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dns_hosts_release(struct dns_hosts *);
struct dns_hosts *dns_hosts_mortal(struct dns_hosts *hosts) {
  if (hosts)
    dns_hosts_release(hosts);
  return hosts;
}


x86 assembly (clang, -O0):
<dns_hosts_mortal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <dns_hosts_mortal+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <dns_hosts_release@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dns_hosts_mortal>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
je     1121 <dns_hosts_mortal+0x11>
mov    %rbx,%rdi
call   1030 <dns_hosts_release@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.dns_hosts = type { i32 }
define %struct.dns_hosts* @dns_hosts_mortal(%struct.dns_hosts* returned %0) {
%2 = icmp eq %struct.dns_hosts* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @dns_hosts_release(%struct.dns_hosts* %0)
br label %5
5: ; preds = %3, %1
ret %struct.dns_hosts* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i = 42;
  printf("%d\n", i);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2a,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%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    $0x2a,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 42, i32* %2
%3 = load i32, i32* %2
%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 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 42)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SetFontStrikeOut111(unsigned long);
void setfontstrikeout(unsigned long sk) { SetFontStrikeOut111(sk); }


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

x86 assembly (clang, -O2):
<setfontstrikeout>:
jmp    1030 <SetFontStrikeOut111@plt>

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

LLVM IR (-O2):
define void @setfontstrikeout(i64 %0) {
%2 = tail call i32 @SetFontStrikeOut111(i64 %0)
ret void
}
/* Type definitions */
struct upnphttp {
  int dummy;
};
typedef int /*<<< orphan*/ resp;

/* Variables and functions */
int /*<<< orphan*/ BuildSendAndCloseSoapResp(struct upnphttp *, char const *,
                                             int);
void GetConnectionTypeInfo(struct upnphttp *h, const char *action) {
  static const char resp[] =
      "<u:GetConnectionTypeInfoResponse "
      "xmlns:u=\"urn:schemas-upnp-org:service:WANIPConnection:1\">"
      "<NewConnectionType>IP_Routed</NewConnectionType>"
      "<NewPossibleConnectionTypes>IP_Routed</NewPossibleConnectionTypes>"
      "</u:GetConnectionTypeInfoResponse>";
  BuildSendAndCloseSoapResp(h, resp, sizeof(resp) - 1);
}


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

x86 assembly (clang, -O2):
<GetConnectionTypeInfo>:
lea    0xee9(%rip),%rsi
mov    $0xee,%edx
jmp    1030 <BuildSendAndCloseSoapResp@plt>

LLVM IR (-O0):
%struct.upnphttp = type { i32 }
@GetConnectionTypeInfo.resp = internal constant [239 x i8] c"<u:GetConnectionTypeInfoResponse xmlns:u=\22urn:schemas-upnp-org:service:WANIPConnection:1\22><NewConnectionType>IP_Routed</NewConnectionType><NewPossibleConnectionTypes>IP_Routed</NewPossibleConnectionTypes></u:GetConnectionTypeInfoResponse>\00"
define void @GetConnectionTypeInfo(%struct.upnphttp* %0, i8* %1) {
%3 = alloca %struct.upnphttp*
%4 = alloca i8*
store %struct.upnphttp* %0, %struct.upnphttp** %3
store i8* %1, i8** %4
%5 = load %struct.upnphttp*, %struct.upnphttp** %3
%6 = call i32 @BuildSendAndCloseSoapResp(%struct.upnphttp* %5, i8* getelementptr inbounds ([239 x i8], [239 x i8]* @GetConnectionTypeInfo.resp, i64 0, i64 0), i32 238)
ret void
}

LLVM IR (-O2):
%struct.upnphttp = type { i32 }
@GetConnectionTypeInfo.resp = internal constant [239 x i8] c"<u:GetConnectionTypeInfoResponse xmlns:u=\22urn:schemas-upnp-org:service:WANIPConnection:1\22><NewConnectionType>IP_Routed</NewConnectionType><NewPossibleConnectionTypes>IP_Routed</NewPossibleConnectionTypes></u:GetConnectionTypeInfoResponse>\00"
define void @GetConnectionTypeInfo(%struct.upnphttp* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @BuildSendAndCloseSoapResp(%struct.upnphttp* %0, i8* getelementptr inbounds ([239 x i8], [239 x i8]* @GetConnectionTypeInfo.resp, i64 0, i64 0), i32 238)
ret void
}