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

/* Variables and functions */
int /*<<< orphan*/ commandList(int /*<<< orphan*/ const *);
int /*<<< orphan*/ delay_ms(int);
int /*<<< orphan*/ lcd_cs0();
int /*<<< orphan*/ lcd_rst0();
int /*<<< orphan*/ lcd_rst1();
void commonInit(const uint8_t *cmdList) {
  lcd_cs0();
  lcd_rst1();
  delay_ms(500);
  lcd_rst0();
  delay_ms(500);
  lcd_rst1();
  delay_ms(500);
  if (cmdList)
    commandList(cmdList);
}


x86 assembly (clang, -O0):
<commonInit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <lcd_cs0@plt>
mov    $0x0,%al
call   1060 <lcd_rst1@plt>
mov    $0x1f4,%edi
call   1070 <delay_ms@plt>
mov    $0x0,%al
call   1040 <lcd_rst0@plt>
mov    $0x1f4,%edi
call   1070 <delay_ms@plt>
mov    $0x0,%al
call   1060 <lcd_rst1@plt>
mov    $0x1f4,%edi
call   1070 <delay_ms@plt>
cmpq   $0x0,-0x8(%rbp)
je     11aa <commonInit+0x5a>
mov    -0x8(%rbp),%rdi
call   1030 <commandList@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<commonInit>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <lcd_cs0@plt>
xor    %eax,%eax
call   1060 <lcd_rst1@plt>
mov    $0x1f4,%edi
call   1070 <delay_ms@plt>
xor    %eax,%eax
call   1040 <lcd_rst0@plt>
mov    $0x1f4,%edi
call   1070 <delay_ms@plt>
xor    %eax,%eax
call   1060 <lcd_rst1@plt>
mov    $0x1f4,%edi
call   1070 <delay_ms@plt>
test   %rbx,%rbx
je     119c <commonInit+0x4c>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <commandList@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @commonInit(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 (...) @lcd_cs0()
%4 = call i32 (...) @lcd_rst1()
%5 = call i32 @delay_ms(i32 500)
%6 = call i32 (...) @lcd_rst0()
%7 = call i32 @delay_ms(i32 500)
%8 = call i32 (...) @lcd_rst1()
%9 = call i32 @delay_ms(i32 500)
%10 = load i32*, i32** %2
%11 = icmp ne i32* %10, null
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = load i32*, i32** %2
%14 = call i32 @commandList(i32* %13)
br label %15
15: ; preds = %12, %1
ret void
}

LLVM IR (-O2):
define void @commonInit(i32* %0) {
%2 = tail call i32 (...) @lcd_cs0()
%3 = tail call i32 (...) @lcd_rst1()
%4 = tail call i32 @delay_ms(i32 500)
%5 = tail call i32 (...) @lcd_rst0()
%6 = tail call i32 @delay_ms(i32 500)
%7 = tail call i32 (...) @lcd_rst1()
%8 = tail call i32 @delay_ms(i32 500)
%9 = icmp eq i32* %0, null
br i1 %9, label %12, label %10
10: ; preds = %1
%11 = tail call i32 @commandList(i32* %0)
br label %12
12: ; preds = %10, %1
ret void
}
int compaq_nvram_load(void *rom_start, struct controller *ctrl) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.controller = type opaque
define i32 @compaq_nvram_load(i8* nocapture readnone %0, %struct.controller* nocapture readnone %1) {
ret i32 0
}
float af(float x) { return x * (1.0f - x); }


x86 assembly (clang, -O0):
<af>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
subss  -0x4(%rbp),%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<af>:
movss  0xef8(%rip),%xmm1
subss  %xmm0,%xmm1
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @af(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fsub float 1.000000e+00, %4
%6 = fmul float %3, %5
ret float %6
}

LLVM IR (-O2):
define float @af(float %0) {
%2 = fsub float 1.000000e+00, %0
%3 = fmul float %2, %0
ret float %3
}
void lf1(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int isFileExisted(char *file) {
  FILE *fp = fopen(file, "r");
  if (fp) {
    fclose(fp);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isFileExisted>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1160 <isFileExisted+0x40>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
jmp    1167 <isFileExisted+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isFileExisted>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1141 <isFileExisted+0x21>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i32 @isFileExisted(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = icmp ne i32* %7, null
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32*, i32** %4
%11 = call i32 @fclose(i32* %10)
store i32 1, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %9
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @isFileExisted(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int age = 10;
  int height = 0;
  printf("I am %d years old.\n", age);
  printf("I am %d inches tall.\n", height);
  return 0;
}


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

LLVM IR (-O0):
@.str = [20 x i8] c"I am %d years old.\0A\00"
@.str.1 = [22 x i8] c"I am %d inches tall.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"I am %d years old.\0A\00"
@.str.1 = [22 x i8] c"I am %d inches tall.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __bitmap_or(unsigned long *, unsigned long const *,
                               unsigned long const *, int);
__attribute__((always_)) void bitmap_or(unsigned long *dst,
                                        const unsigned long *src1,
                                        const unsigned long *src2, int nbits) {
  if (nbits <= 32)
    *dst = *src1 | *src2;
  else
    __bitmap_or(dst, src1, src2, nbits);
}


x86 assembly (clang, -O0):
<bitmap_or>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpl   $0x20,-0x1c(%rbp)
jg     114b <bitmap_or+0x3b>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
or     (%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
jmp    115f <bitmap_or+0x4f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <__bitmap_or@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_or>:
cmp    $0x20,%ecx
jg     111f <bitmap_or+0xf>
mov    (%rdx),%rax
or     (%rsi),%rax
mov    %rax,(%rdi)
ret
jmp    1030 <__bitmap_or@plt>

LLVM IR (-O0):
define void @bitmap_or(i64* %0, i64* %1, i64* %2, i32 %3) {
%5 = alloca i64*
%6 = alloca i64*
%7 = alloca i64*
%8 = alloca i32
store i64* %0, i64** %5
store i64* %1, i64** %6
store i64* %2, i64** %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = icmp sle i32 %9, 32
br i1 %10, label %11, label %18
11: ; preds = %4
%12 = load i64*, i64** %6
%13 = load i64, i64* %12
%14 = load i64*, i64** %7
%15 = load i64, i64* %14
%16 = or i64 %13, %15
%17 = load i64*, i64** %5
store i64 %16, i64* %17
br label %24
18: ; preds = %4
%19 = load i64*, i64** %5
%20 = load i64*, i64** %6
%21 = load i64*, i64** %7
%22 = load i32, i32* %8
%23 = call i32 @__bitmap_or(i64* %19, i64* %20, i64* %21, i32 %22)
br label %24
24: ; preds = %18, %11
ret void
}

LLVM IR (-O2):
define void @bitmap_or(i64* %0, i64* %1, i64* %2, i32 %3) {
%5 = icmp slt i32 %3, 33
br i1 %5, label %6, label %10
6: ; preds = %4
%7 = load i64, i64* %1
%8 = load i64, i64* %2
%9 = or i64 %8, %7
store i64 %9, i64* %0
br label %12
10: ; preds = %4
%11 = tail call i32 @__bitmap_or(i64* %0, i64* %1, i64* %2, i32 %3)
br label %12
12: ; preds = %10, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  if ('Z' < 'z')
    printf("summa\n");
  else
    printf("not here\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
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 = [7 x i8] c"summa\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [6 x i8] c"summa\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 0
}
double dd_quick_two_sum(double a, double b, double *err) {
  double s = a + b;
  *err = b - (s - a);
  return s;
}


x86 assembly (clang, -O0):
<dd_quick_two_sum>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
subsd  -0x8(%rbp),%xmm1
subsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dd_quick_two_sum>:
movapd %xmm0,%xmm2
addsd  %xmm1,%xmm2
movapd %xmm2,%xmm3
subsd  %xmm0,%xmm3
subsd  %xmm3,%xmm1
movsd  %xmm1,(%rdi)
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @dd_quick_two_sum(double %0, double %1, double* %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double*
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double* %2, double** %6
%8 = load double, double* %4
%9 = load double, double* %5
%10 = fadd double %8, %9
store double %10, double* %7
%11 = load double, double* %5
%12 = load double, double* %7
%13 = load double, double* %4
%14 = fsub double %12, %13
%15 = fsub double %11, %14
%16 = load double*, double** %6
store double %15, double* %16
%17 = load double, double* %7
ret double %17
}

LLVM IR (-O2):
define double @dd_quick_two_sum(double %0, double %1, double* nocapture writeonly %2) {
%4 = fadd double %0, %1
%5 = fsub double %4, %0
%6 = fsub double %1, %5
store double %6, double* %2
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ ASRT_Mark(char *, int, char *);
scalar_t__ ASRT_True(int);
int test_FalseOk() {
  do {
    ASRT_Mark("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/cohadar/c-learning/refs/heads/master/"
              "src/asrt_tests.c",
              57, "0");
    if (ASRT_True(!(0))) {
      return 1;
    };
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<test_FalseOk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x39,%esi
lea    0xf55(%rip),%rdx
call   1040 <ASRT_Mark@plt>
mov    $0x1,%edi
call   1030 <ASRT_True@plt>
cmp    $0x0,%rax
je     1160 <test_FalseOk+0x40>
movl   $0x1,-0x4(%rbp)
jmp    116c <test_FalseOk+0x4c>
jmp    1165 <test_FalseOk+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_FalseOk>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xf61(%rip),%rdx
mov    $0x39,%esi
call   1040 <ASRT_Mark@plt>
mov    $0x1,%edi
call   1030 <ASRT_True@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/cohadar/c-learning/refs/heads/master/src/asrt_tests.c\00"
@.str.1 = [2 x i8] c"0\00"
define i32 @test_FalseOk() {
%1 = alloca i32
br label %2
2: ; preds = %0
%3 = call i32 @ASRT_Mark(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 57, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = call i64 @ASRT_True(i32 1)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %2
store i32 1, i32* %1
br label %9
7: ; preds = %2
br label %8
8: ; preds = %7
store i32 0, i32* %1
br label %9
9: ; preds = %8, %6
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/cohadar/c-learning/refs/heads/master/src/asrt_tests.c\00"
@.str.1 = [2 x i8] c"0\00"
define i32 @test_FalseOk() {
%1 = tail call i32 @ASRT_Mark(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 57, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i64 @ASRT_True(i32 1)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ new_op(int);
void parse_ASM() { new_op(7); }


x86 assembly (clang, -O0):
<parse_ASM>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7,%edi
call   1030 <new_op@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_ASM>:
mov    $0x7,%edi
jmp    1030 <new_op@plt>

LLVM IR (-O0):
define void @parse_ASM() {
%1 = call i32 @new_op(i32 7)
ret void
}

LLVM IR (-O2):
define void @parse_ASM() {
%1 = tail call i32 @new_op(i32 7)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int pthread_join(int /*<<< orphan*/, void **);
int interleave_pthread_join(pthread_t thread, void **retval) {
  return pthread_join(thread, retval);
}


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

x86 assembly (clang, -O2):
<interleave_pthread_join>:
jmp    1030 <pthread_join@plt>

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

LLVM IR (-O2):
define i32 @interleave_pthread_join(i32 %0, i8** %1) {
%3 = tail call i32 @pthread_join(i32 %0, i8** %1)
ret i32 %3
}
const char *TransportList(void) {
  return "    foot       = Foot\n"
         "    bicycle    = Bicycle\n"
         "    wheelchair = Wheelchair\n"
         "    horse      = Horse\n"
         "    moped      = Moped     (Small motorbike, limited speed)\n"
         "    motorbike  = Motorbike\n"
         "    motorcar   = Motorcar\n"
         "    goods      = Goods     (Small lorry, van)\n"
         "    hgv        = HGV       (Heavy Goods Vehicle - large lorry)\n"
         "    psv        = PSV       (Public Service Vehicle - bus, coach)\n";
}


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

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

LLVM IR (-O0):
@.str = [386 x i8] c" foot = Foot\0A bicycle = Bicycle\0A wheelchair = Wheelchair\0A horse = Horse\0A moped = Moped (Small motorbike, limited speed)\0A motorbike = Motorbike\0A motorcar = Motorcar\0A goods = Goods (Small lorry, van)\0A hgv = HGV (Heavy Goods Vehicle - large lorry)\0A psv = PSV (Public Service Vehicle - bus, coach)\0A\00"
define i8* @TransportList() {
ret i8* getelementptr inbounds ([386 x i8], [386 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [386 x i8] c" foot = Foot\0A bicycle = Bicycle\0A wheelchair = Wheelchair\0A horse = Horse\0A moped = Moped (Small motorbike, limited speed)\0A motorbike = Motorbike\0A motorcar = Motorcar\0A goods = Goods (Small lorry, van)\0A hgv = HGV (Heavy Goods Vehicle - large lorry)\0A psv = PSV (Public Service Vehicle - bus, coach)\0A\00"
define i8* @TransportList() {
ret i8* getelementptr inbounds ([386 x i8], [386 x i8]* @.str, i64 0, i64 0)
}
void Rename_ENT_SET_OBJ(bb, ss, vv) int *bb, ss, vv;
{
  int r, b;
  Rename_SRC_HIH_EQL_SET_OBJ(&b, &r, ss, vv);
  if (b == 0) {
    Rename_PSH_SET_OBJ(bb, ss, vv);
  } else {
    *bb = 1;
  }
}


x86 assembly (clang, -O0):
<Rename_ENT_SET_OBJ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    -0x18(%rbp),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1040 <Rename_SRC_HIH_EQL_SET_OBJ@plt>
cmpl   $0x0,-0x18(%rbp)
jne    1167 <Rename_ENT_SET_OBJ+0x47>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    $0x0,%al
call   1030 <Rename_PSH_SET_OBJ@plt>
jmp    1171 <Rename_ENT_SET_OBJ+0x51>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Rename_ENT_SET_OBJ>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%ebx
mov    %esi,%ebp
mov    %rdi,%r14
lea    0x8(%rsp),%rdi
lea    0xc(%rsp),%rsi
mov    %ebp,%edx
mov    %ebx,%ecx
xor    %eax,%eax
call   1040 <Rename_SRC_HIH_EQL_SET_OBJ@plt>
cmpl   $0x0,0x8(%rsp)
je     1154 <Rename_ENT_SET_OBJ+0x34>
movl   $0x1,(%r14)
jmp    1162 <Rename_ENT_SET_OBJ+0x42>
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <Rename_PSH_SET_OBJ@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @Rename_ENT_SET_OBJ(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 (i32*, i32*, i32, i32, ...) bitcast (i32 (...)* @Rename_SRC_HIH_EQL_SET_OBJ to i32 (i32*, i32*, i32, i32, ...)*)(i32* %8, i32* %7, i32 %9, i32 %10)
%12 = load i32, i32* %8
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %3
%15 = load i32*, i32** %4
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @Rename_PSH_SET_OBJ to i32 (i32*, i32, i32, ...)*)(i32* %15, i32 %16, i32 %17)
br label %21
19: ; preds = %3
%20 = load i32*, i32** %4
store i32 1, i32* %20
br label %21
21: ; preds = %19, %14
ret void
}

LLVM IR (-O2):
define void @Rename_ENT_SET_OBJ(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %4 to i8*
%7 = bitcast i32* %5 to i8*
%8 = call i32 (i32*, i32*, i32, i32, ...) bitcast (i32 (...)* @Rename_SRC_HIH_EQL_SET_OBJ to i32 (i32*, i32*, i32, i32, ...)*)(i32* %5, i32* %4, i32 %1, i32 %2)
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @Rename_PSH_SET_OBJ to i32 (i32*, i32, i32, ...)*)(i32* %0, i32 %1, i32 %2)
br label %14
13: ; preds = %3
store i32 1, i32* %0
br label %14
14: ; preds = %13, %11
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t _get_u8(const uint8_t *p) { return (uint32_t)p[0]; }


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

x86 assembly (clang, -O2):
<_get_u8>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @_get_u8(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @_get_u8(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
int test_imm_54int64_lowword_reg(long long val) {
  return ((val) & (0x54 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_54int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 84
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ pthread_self();
int rathread_get_tid() { return (intptr_t)pthread_self(); }


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

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

LLVM IR (-O0):
define i32 @rathread_get_tid() {
%1 = call i32 (...) @pthread_self()
%2 = sext i32 %1 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @rathread_get_tid() {
%1 = tail call i32 (...) @pthread_self()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ getline(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ unescape(char *, char *);
int main(void) {
  char s[1000], t[1000];
  getline(t, 1000);
  unescape(s, t);
  printf("%s", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7e0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x7e0(%rbp),%rdi
mov    $0x3e8,%esi
call   1050 <getline@plt>
lea    -0x3f0(%rbp),%rdi
lea    -0x7e0(%rbp),%rsi
call   1040 <unescape@plt>
lea    -0x3f0(%rbp),%rsi
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x7e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x7d8,%rsp
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x3e8,%esi
call   1050 <getline@plt>
lea    0x3f0(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <unescape@plt>
lea    0xe9c(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x7d8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = alloca [1000 x i8]
%3 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%5 = call i32 @getline(i8* %4, i32 1000)
%6 = call i32 @unescape(i8* %3, i8* %4)
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Variables and functions */
size_t region_input_size(void) { return 1024; }


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

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

LLVM IR (-O0):
define i64 @region_input_size() {
ret i64 1024
}

LLVM IR (-O2):
define i64 @region_input_size() {
ret i64 1024
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_sizeof_grpc_event() {
  fprintf(stderr, "Should never reach here");
  abort();
}


x86 assembly (clang, -O0):
<grpcsharp_sizeof_grpc_event>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<grpcsharp_sizeof_grpc_event>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_sizeof_grpc_event() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_sizeof_grpc_event() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
int main(void) {
  int ***three;
  int **two;
  int **mem_3;
  int *mem_4;
  int *mem_5;
  {
    mem_3 = *three;
    mem_4 = *mem_3;
    mem_5 = *two;
    *mem_4 = *mem_5;
    return (0);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    (%rax),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32***
%3 = alloca i32**
%4 = alloca i32**
%5 = alloca i32*
%6 = alloca i32*
store i32 0, i32* %1
%7 = load i32***, i32**** %2
%8 = load i32**, i32*** %7
store i32** %8, i32*** %4
%9 = load i32**, i32*** %4
%10 = load i32*, i32** %9
store i32* %10, i32** %5
%11 = load i32**, i32*** %3
%12 = load i32*, i32** %11
store i32* %12, i32** %6
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = load i32*, i32** %5
store i32 %14, i32* %15
ret i32 0
}

LLVM IR (-O2):
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ addToDate(int /*<<< orphan*/, char, int);
time_t addToDateM(time_t ts) { return addToDate(ts, 'm', 1); }


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

x86 assembly (clang, -O2):
<addToDateM>:
mov    $0x6d,%esi
mov    $0x1,%edx
jmp    1030 <addToDate@plt>

LLVM IR (-O0):
define i32 @addToDateM(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @addToDate(i32 %3, i8 signext 109, i32 1)
ret i32 %4
}

LLVM IR (-O2):
define i32 @addToDateM(i32 %0) {
%2 = tail call i32 @addToDate(i32 %0, i8 signext 109, i32 1)
ret i32 %2
}
length(num) int num;
{ printf("You made %d moves.\n", num); }


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"You made %d moves.\0A\00"
define i32 @length(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
@.str = [20 x i8] c"You made %d moves.\0A\00"
define i32 @length(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("A new process has spawned.\n");
  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)
lea    0xed3(%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 = [28 x i8] c"A new process has spawned.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [27 x i8] c"A new process has spawned.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ random_uint32();
int32_t random_int32(void) { return (int32_t)random_uint32(); }


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

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

LLVM IR (-O0):
define i32 @random_int32() {
%1 = call i32 (...) @random_uint32()
ret i32 %1
}

LLVM IR (-O2):
define i32 @random_int32() {
%1 = tail call i32 (...) @random_uint32()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ set_page_tables();
void main() {
  char *video_memory = (char *)0xb8000;
  *video_memory = 'X';
  set_page_tables();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xb8000,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x58,(%rax)
mov    $0x0,%al
call   1030 <set_page_tables@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movb   $0x58,0xb8000
58
xor    %eax,%eax
jmp    1030 <set_page_tables@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i8*
store i8* inttoptr (i64 753664 to i8*), i8** %1
%2 = load i8*, i8** %1
store i8 88, i8* %2
%3 = call i32 (...) @set_page_tables()
ret void
}

LLVM IR (-O2):
define void @main() {
store i8 88, i8* inttoptr (i64 753664 to i8*)
%1 = tail call i32 (...) @set_page_tables()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ scanf(char *, int *);
int input(const char *info) {
  int r;
  printf("%s:", info);
  scanf("%d", &r);
  return r;
}


x86 assembly (clang, -O0):
<input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<input>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s:\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @input(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long);
void *childGreetings(void *id) {
  unsigned long childID = (unsigned long)id;
  printf("Greetings from child #%lu\n", childID);
  return NULL;
}


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"Greetings from child #%lu\0A\00"
define i8* @childGreetings(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i64 %6)
ret i8* null
}

LLVM IR (-O2):
@.str = [27 x i8] c"Greetings from child #%lu\0A\00"
define noalias i8* @childGreetings(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i64 %2)
ret i8* null
}
/* Type definitions */
typedef size_t uint32_t;

/* Variables and functions */
void reduceLen32(char *name, uint32_t *len) {
  uint32_t i, l = *len;
  for (i = 0; i < l; ++i) {
    if (name[i] == 0) {
      *len = i;
      break;
    }
  }
}


x86 assembly (clang, -O0):
<reduceLen32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    1168 <reduceLen32+0x68>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1152 <reduceLen32+0x52>
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
jmp    1168 <reduceLen32+0x68>
jmp    1157 <reduceLen32+0x57>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111f <reduceLen32+0x1f>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reduceLen32>:
mov    (%rsi),%rax
test   %rax,%rax
je     111f <reduceLen32+0x1f>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,(%rdi,%rcx,1)
je     1120 <reduceLen32+0x20>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <reduceLen32+0x10>
ret
mov    %rcx,(%rsi)
ret

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

LLVM IR (-O2):
define void @reduceLen32(i8* nocapture %0, i64* nocapture %1) {
%3 = load i64, i64* %1
%4 = icmp eq i64 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %11
%6 = phi i64 [ %12, %11 ], [ 0, %2 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %5
store i64 %6, i64* %1
br label %14
11: ; preds = %5
%12 = add nuw i64 %6, 1
%13 = icmp eq i64 %12, %3
br i1 %13, label %14, label %5
14: ; preds = %11, %2, %10
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bzero(void *, int);
void *trie_alloc_uninitialized(int);
void *trie_alloc(int size) {
  void *res = trie_alloc_uninitialized(size);
  bzero(res, size);
  return res;
}


x86 assembly (clang, -O0):
<trie_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <trie_alloc_uninitialized@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1030 <bzero@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trie_alloc>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1040 <trie_alloc_uninitialized@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %ebp,%esi
call   1030 <bzero@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @trie_alloc(i32 %0) {
%2 = tail call i8* @trie_alloc_uninitialized(i32 %0)
%3 = tail call i32 @bzero(i8* %2, i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, int /*<<< orphan*/ *);
void init_doc() { write("json-task.json", "{\n", NULL); }


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

x86 assembly (clang, -O2):
<init_doc>:
lea    0xee9(%rip),%rdi
lea    0xef1(%rip),%rsi
xor    %edx,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"json-task.json\00"
@.str.1 = [3 x i8] c"{\0A\00"
define void @init_doc() {
%1 = call i32 @write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"json-task.json\00"
@.str.1 = [3 x i8] c"{\0A\00"
define void @init_doc() {
%1 = tail call i32 @write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_sub_epi16(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_xor_si128(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i invert_sign_sse2(__m128i a, __m128i sign) {
  a = _mm_xor_si128(a, sign);
  return _mm_sub_epi16(a, sign);
}


x86 assembly (clang, -O0):
<invert_sign_sse2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <_mm_xor_si128@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <_mm_sub_epi16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<invert_sign_sse2>:
push   %rbx
mov    %esi,%ebx
call   1040 <_mm_xor_si128@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <_mm_sub_epi16@plt>

LLVM IR (-O0):
define i32 @invert_sign_sse2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @_mm_xor_si128(i32 %5, i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @_mm_sub_epi16(i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @invert_sign_sse2(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_xor_si128(i32 %0, i32 %1)
%4 = tail call i32 @_mm_sub_epi16(i32 %3, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ dcac_mask_ops(int, int);
void dcac_lockdown(void) { dcac_mask_ops(47, -1); }


x86 assembly (clang, -O0):
<dcac_lockdown>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2f,%edi
mov    $0xffffffff,%esi
call   1030 <dcac_mask_ops@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcac_lockdown>:
mov    $0x2f,%edi
mov    $0xffffffff,%esi
jmp    1030 <dcac_mask_ops@plt>

LLVM IR (-O0):
define void @dcac_lockdown() {
%1 = call i32 @dcac_mask_ops(i32 47, i32 -1)
ret void
}

LLVM IR (-O2):
define void @dcac_lockdown() {
%1 = tail call i32 @dcac_mask_ops(i32 47, i32 -1)
ret void
}
/* Variables and functions */
char *libc_stristr(char *, char *);
int libc_stripos(char *haystack, char *needle) {
  char *p = libc_stristr(haystack, needle);
  if (p) {
    return p - haystack;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<libc_stripos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <libc_stristr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     114f <libc_stripos+0x3f>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x4(%rbp)
jmp    1156 <libc_stripos+0x46>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libc_stripos>:
push   %rbx
mov    %rdi,%rbx
call   1030 <libc_stristr@plt>
mov    %eax,%ecx
sub    %ebx,%ecx
cmp    $0x1,%rax
sbb    %eax,%eax
or     %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @libc_stripos(i8* %0, i8* %1) {
%3 = tail call i8* @libc_stristr(i8* %0, i8* %1)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i32
%9 = select i1 %4, i32 -1, i32 %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char **);
int main(void) {
  char *name;
  printf("Please enter your name: ");
  scanf(" %m[^\n]", &name);
  printf("Hello %s!\n", name);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
mov    (%rsp),%rsi
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Please enter your name: \00"
@.str.1 = [8 x i8] c" %m[^\0A]\00"
@.str.2 = [11 x i8] c"Hello %s!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %2)
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"Please enter your name: \00"
@.str.1 = [8 x i8] c" %m[^\0A]\00"
@.str.2 = [11 x i8] c"Hello %s!\0A\00"
define i32 @main() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %1)
%5 = load i8*, i8** %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ value;

/* Variables and functions */
int getxattr(char *, char *, char *, int);
int main(void) {
  char value[] = "valuestring";
  return getxattr("/path/to/somewhere", "name", value, sizeof(value));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x10(%rbp),%rdx
lea    0xece(%rip),%rdi
lea    0xeda(%rip),%rsi
mov    $0xc,%ecx
call   1030 <getxattr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x72747365756c6176,%rax
73 74 72
mov    %rax,0x8(%rsp)
movl   $0x676e69,0x10(%rsp)
lea    0xeda(%rip),%rdi
lea    0xee6(%rip),%rsi
lea    0x8(%rsp),%rdx
mov    $0xc,%ecx
call   1030 <getxattr@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.value = [12 x i8] c"valuestring\00"
@.str = [19 x i8] c"/path/to/somewhere\00"
@.str.1 = [5 x i8] c"name\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [12 x i8]
store i32 0, i32* %1
%3 = bitcast [12 x i8]* %2 to i8*
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%5 = call i32 @getxattr(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %4, i32 12)
ret i32 %5
}

LLVM IR (-O2):
@__const.main.value = [12 x i8] c"valuestring\00"
@.str = [19 x i8] c"/path/to/somewhere\00"
@.str.1 = [5 x i8] c"name\00"
define i32 @main() {
%1 = alloca [12 x i8]
%2 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%3 = call i32 @getxattr(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %2, i32 12)
ret i32 %3
}