xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ summary();
void test_failure() {
  fprintf(stderr, "** Test failed - exiting **\n");
  summary();
  exit(1);
}


x86 assembly (clang, -O0):
<test_failure>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <summary@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<test_failure>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
lea    0xebf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
call   1040 <summary@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"** Test failed - exiting **\0A\00"
define void @test_failure() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @summary()
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"** Test failed - exiting **\0A\00"
define void @test_failure() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @summary()
%4 = tail call i32 @exit(i32 1)
unreachable
}
void X509V3_EXT_add(void) {}


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

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

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

LLVM IR (-O2):
define void @X509V3_EXT_add() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pin_Direction(int);
int /*<<< orphan*/ pin_Value(int, int);
void brake_left(int tl) {
  pin_Direction(46);
  pin_Value(46, tl);
}


x86 assembly (clang, -O0):
<brake_left>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x2e,%edi
call   1030 <pin_Direction@plt>
mov    -0x4(%rbp),%esi
mov    $0x2e,%edi
call   1040 <pin_Value@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<brake_left>:
push   %rbx
mov    %edi,%ebx
mov    $0x2e,%edi
call   1030 <pin_Direction@plt>
mov    $0x2e,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <pin_Value@plt>

LLVM IR (-O0):
define void @brake_left(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @pin_Direction(i32 46)
%4 = load i32, i32* %2
%5 = call i32 @pin_Value(i32 46, i32 %4)
ret void
}

LLVM IR (-O2):
define void @brake_left(i32 %0) {
%2 = tail call i32 @pin_Direction(i32 46)
%3 = tail call i32 @pin_Value(i32 46, i32 %0)
ret void
}
/* Variables and functions */
char *calloc(int, int);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
char in() {
  char *str = calloc(3, sizeof(char));
  char c;
  printf("(i)nsert, (d)elete, or (g)et? ");
  fgets(str, 3, stdin);
  c = *str;
  free(str);
  return c;
}


x86 assembly (clang, -O0):
<in>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3,%edi
mov    $0x1,%esi
call   1060 <calloc@plt>
mov    %rax,-0x8(%rbp)
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e76(%rip),%rax
mov    (%rax),%edx
mov    $0x3,%esi
call   1050 <fgets@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movsbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<in>:
push   %rbp
push   %rbx
push   %rax
mov    $0x3,%edi
mov    $0x1,%esi
call   1060 <calloc@plt>
mov    %rax,%rbx
lea    0xea4(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    $0x3,%esi
call   1050 <fgets@plt>
mov    (%rbx),%bpl
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [31 x i8] c"(i)nsert, (d)elete, or (g)et? \00"
@stdin = global i32 0
define signext i8 @in() {
%1 = alloca i8*
%2 = alloca i8
%3 = call i8* @calloc(i32 3, i32 1)
store i8* %3, i8** %1
%4 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %1
%6 = load i32, i32* @stdin
%7 = call i32 @fgets(i8* %5, i32 3, i32 %6)
%8 = load i8*, i8** %1
%9 = load i8, i8* %8
store i8 %9, i8* %2
%10 = load i8*, i8** %1
%11 = call i32 @free(i8* %10)
%12 = load i8, i8* %2
ret i8 %12
}

LLVM IR (-O2):
@.str = [31 x i8] c"(i)nsert, (d)elete, or (g)et? \00"
@stdin = global i32 0
define signext i8 @in() {
%1 = tail call dereferenceable_or_null(3) i8* @calloc(i32 3, i32 1)
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdin
%4 = tail call i32 @fgets(i8* %1, i32 3, i32 %3)
%5 = load i8, i8* %1
%6 = tail call i32 @free(i8* %1)
ret i8 %5
}
long double add_pi(long double x) {
  return x + 3.1415926535897932385128089594061862044L;
}


x86 assembly (clang, -O0):
<add_pi>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fldt   0xeed(%rip)
faddp  %st,%st(1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_pi>:
fldt   0x8(%rsp)
fldt   0xef6(%rip)
faddp  %st,%st(1)
ret

LLVM IR (-O0):
define x86_fp80 @add_pi(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fadd x86_fp80 %3, 0xK4000C90FDAA22168C235
ret x86_fp80 %4
}

LLVM IR (-O2):
define x86_fp80 @add_pi(x86_fp80 %0) {
%2 = fadd x86_fp80 %0, 0xK4000C90FDAA22168C235
ret x86_fp80 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void clear_buffer(char *buffer) {
  if (buffer != NULL) {
    free(buffer);
    buffer = NULL;
  }
}


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

x86 assembly (clang, -O2):
<clear_buffer>:
test   %rdi,%rdi
je     111a <clear_buffer+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @clear_buffer(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
unsigned short read2FromEco(unsigned char *p) {
  return (unsigned short)p[0] << 8 | (unsigned short)p[1] << 0;
}


x86 assembly (clang, -O0):
<read2FromEco>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzwl %ax,%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
movzwl %cx,%ecx
shl    $0x0,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read2FromEco>:
movzwl (%rdi),%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @read2FromEco(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i16
%7 = zext i16 %6 to i32
%8 = shl i32 %7, 8
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i16
%13 = zext i16 %12 to i32
%14 = shl i32 %13, 0
%15 = or i32 %8, %14
%16 = trunc i32 %15 to i16
ret i16 %16
}

LLVM IR (-O2):
define zeroext i16 @read2FromEco(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i16
%4 = shl nuw i16 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i16
%8 = or i16 %4, %7
ret i16 %8
}
double f10(double arg) { return arg; }


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

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

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

LLVM IR (-O2):
define double @f10(double returned %0) {
ret double %0
}
char load_char(unsigned char **bufferp) {
  unsigned char *buffer = *bufferp;
  char c = (char)*buffer;
  *bufferp += 1;
  return c;
}


x86 assembly (clang, -O0):
<load_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
movsbl -0x11(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_char>:
mov    (%rdi),%rcx
mov    (%rcx),%al
add    $0x1,%rcx
mov    %rcx,(%rdi)
ret

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

LLVM IR (-O2):
define signext i8 @load_char(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = getelementptr inbounds i8, i8* %2, i64 1
store i8* %4, i8** %0
ret i8 %3
}
void rop3_237_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D ^ T;
  stk2 = ~stk2;
  stk1 = S | stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_237_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_237_1_0>:
mov    (%rdi),%al
xor    %al,%dl
or     %sil,%dl
not    %dl
and    %sil,%al
or     %dl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_237_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = xor i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %8
%17 = zext i8 %16 to i32
%18 = xor i32 %17, -1
%19 = trunc i32 %18 to i8
store i8 %19, i8* %8
%20 = load i8, i8* %5
%21 = zext i8 %20 to i32
%22 = load i8, i8* %8
%23 = zext i8 %22 to i32
%24 = or i32 %21, %23
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = load i8, i8* %5
%29 = zext i8 %28 to i32
%30 = xor i32 %29, -1
%31 = and i32 %27, %30
%32 = load i8*, i8** %4
%33 = load i8, i8* %32
%34 = zext i8 %33 to i32
%35 = load i8, i8* %5
%36 = zext i8 %35 to i32
%37 = and i32 %34, %36
%38 = or i32 %31, %37
%39 = trunc i32 %38 to i8
%40 = load i8*, i8** %4
store i8 %39, i8* %40
ret void
}

LLVM IR (-O2):
define void @rop3_237_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %2
%6 = or i8 %5, %1
%7 = xor i8 %6, -1
%8 = and i8 %4, %1
%9 = or i8 %8, %7
store i8 %9, i8* %0
ret void
}
void recurse_mesh(struct pmm_model *m, int *p, int plane, int n_p) {}


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

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

LLVM IR (-O0):
%struct.pmm_model = type opaque
define void @recurse_mesh(%struct.pmm_model* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca %struct.pmm_model*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store %struct.pmm_model* %0, %struct.pmm_model** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
%struct.pmm_model = type opaque
define void @recurse_mesh(%struct.pmm_model* nocapture %0, i32* nocapture %1, i32 %2, i32 %3) {
ret void
}
void pit_handler(void) {}


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

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

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

LLVM IR (-O2):
define void @pit_handler() {
ret void
}
int test_imm_3Fint8_reg(signed char val) {
  return ((val) & (0x3F << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_3Fint8_reg(i8 signext %0) {
%2 = and i8 %0, 63
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ do_qsort(void *const, size_t, size_t,
                            int (*)(void const *, void const *));
void sortValues(void *const pbase, size_t total_elems, size_t size,
                int (*cmp)(const void *, const void *)) {
  do_qsort(pbase, total_elems, size, cmp);
}


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

x86 assembly (clang, -O2):
<sortValues>:
jmp    1030 <do_qsort@plt>

LLVM IR (-O0):
define void @sortValues(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*)* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32 (i8*, i8*)*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32 (i8*, i8*)* %3, i32 (i8*, i8*)** %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = load i32 (i8*, i8*)*, i32 (i8*, i8*)** %8
%13 = call i32 @do_qsort(i8* %9, i64 %10, i64 %11, i32 (i8*, i8*)* %12)
ret void
}

LLVM IR (-O2):
define void @sortValues(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*)* %3) {
%5 = tail call i32 @do_qsort(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*)* %3)
ret void
}
unsigned sat_add(unsigned i) {
  unsigned ret = i + 1;
  if (ret < i)
    ret = i;
  return ret;
}


x86 assembly (clang, -O0):
<sat_add>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    1122 <sat_add+0x22>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sat_add>:
inc    %edi
mov    $0xffffffff,%eax
cmovne %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @sat_add(i32 %0) {
%2 = add i32 %0, 1
%3 = icmp eq i32 %0, -1
%4 = select i1 %3, i32 -1, i32 %2
ret i32 %4
}
/* Variables and functions */
int atoi(char const *);
int getInt(const char *n) {
  int num;
  num = atoi(n);
  return num;
}


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

x86 assembly (clang, -O2):
<getInt>:
jmp    1030 <atoi@plt>

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

LLVM IR (-O2):
define i32 @getInt(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *);
int /*<<< orphan*/ execlp(char *, char *, int /*<<< orphan*/ *);
void getroot(void) {
  execlp("su", "su", NULL);
  err(1, "failed to execute \"su\"");
}


x86 assembly (clang, -O0):
<getroot>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
mov    %rsi,%rdi
call   1040 <execlp@plt>
mov    $0x1,%edi
lea    0xec0(%rip),%rsi
call   1030 <err@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getroot>:
push   %rax
lea    0xed8(%rip),%rdi
mov    %rdi,%rsi
xor    %edx,%edx
call   1040 <execlp@plt>
lea    0xeca(%rip),%rsi
mov    $0x1,%edi
pop    %rax
jmp    1030 <err@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"su\00"
@.str.1 = [23 x i8] c"failed to execute \22su\22\00"
define void @getroot() {
%1 = call i32 @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* null)
%2 = call i32 @err(i32 1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"su\00"
@.str.1 = [23 x i8] c"failed to execute \22su\22\00"
define void @getroot() {
%1 = tail call i32 @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* null)
%2 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
void escreveVETOR(int vector[], int n) {
  int i;
  for (i = 0; i < n; ++i)
    putchar(vector[i]);
}


x86 assembly (clang, -O0):
<escreveVETOR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1150 <escreveVETOR+0x40>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <putchar@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <escreveVETOR+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<escreveVETOR>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1142 <escreveVETOR+0x32>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <escreveVETOR+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @escreveVETOR(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @putchar(i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int system(char *);
int main(int argc, char *argv[]) {
  int x = 0;
  char *cmd = "/usr/bin/passwd";
  x = system(cmd);
  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)
lea    0xecc(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <system@plt>
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"/usr/bin/passwd\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8** %7
%8 = load i8*, i8** %7
%9 = call i32 @system(i8* %8)
store i32 %9, i32* %6
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"/usr/bin/passwd\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @system(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
double eval_sin(int, int, double);
double eval_cos(int hilo, int j, double x) {
  return (eval_sin(hilo, (j + 1) % 4, x));
}


x86 assembly (clang, -O0):
<eval_cos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
movsd  -0x10(%rbp),%xmm0
call   1030 <eval_sin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval_cos>:
lea    0x1(%rsi),%eax
lea    0x4(%rsi),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffffffc,%ecx
neg    %ecx
add    %ecx,%esi
add    $0x1,%esi
jmp    1030 <eval_sin@plt>

LLVM IR (-O0):
define double @eval_cos(i32 %0, i32 %1, double %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
store i32 %0, i32* %4
store i32 %1, i32* %5
store double %2, double* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = add nsw i32 %8, 1
%10 = srem i32 %9, 4
%11 = load double, double* %6
%12 = call double @eval_sin(i32 %7, i32 %10, double %11)
ret double %12
}

LLVM IR (-O2):
define double @eval_cos(i32 %0, i32 %1, double %2) {
%4 = add nsw i32 %1, 1
%5 = srem i32 %4, 4
%6 = tail call double @eval_sin(i32 %0, i32 %5, double %2)
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ GP_break50();
int /*<<< orphan*/ MP_motor(int, int);
int /*<<< orphan*/ MP_sleep(long);
void MP_prozess5(void) {
  long PV_time = 1L;
  while (1) {
    GP_break50();
    MP_motor(3, 1);
    MP_sleep(PV_time);
    MP_motor(3, 0);
    MP_sleep(PV_time);
  };
}


x86 assembly (clang, -O0):
<MP_prozess5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x1,-0x8(%rbp)
mov    $0x0,%al
call   1050 <GP_break50@plt>
mov    $0x3,%edi
mov    $0x1,%esi
call   1030 <MP_motor@plt>
mov    -0x8(%rbp),%rdi
call   1040 <MP_sleep@plt>
mov    $0x3,%edi
xor    %esi,%esi
call   1030 <MP_motor@plt>
mov    -0x8(%rbp),%rdi
call   1040 <MP_sleep@plt>
jmp    1140 <MP_prozess5+0x10>

x86 assembly (clang, -O2):
<MP_prozess5>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <GP_break50@plt>
mov    $0x3,%edi
mov    $0x1,%esi
call   1030 <MP_motor@plt>
mov    $0x1,%edi
call   1040 <MP_sleep@plt>
mov    $0x3,%edi
xor    %esi,%esi
call   1030 <MP_motor@plt>
mov    $0x1,%edi
call   1040 <MP_sleep@plt>
jmp    1140 <MP_prozess5+0x10>

LLVM IR (-O0):
define void @MP_prozess5() {
%1 = alloca i64
store i64 1, i64* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 (...) @GP_break50()
%4 = call i32 @MP_motor(i32 3, i32 1)
%5 = load i64, i64* %1
%6 = call i32 @MP_sleep(i64 %5)
%7 = call i32 @MP_motor(i32 3, i32 0)
%8 = load i64, i64* %1
%9 = call i32 @MP_sleep(i64 %8)
br label %2
}

LLVM IR (-O2):
define void @MP_prozess5() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @GP_break50()
%3 = tail call i32 @MP_motor(i32 3, i32 1)
%4 = tail call i32 @MP_sleep(i64 1)
%5 = tail call i32 @MP_motor(i32 3, i32 0)
%6 = tail call i32 @MP_sleep(i64 1)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void sfyyfree(void *ptr) { free((char *)ptr); }


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

x86 assembly (clang, -O2):
<sfyyfree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @sfyyfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
double celsius(double fahrenheit) { return (fahrenheit - 32.0) * (5.0 / 9.0); }


x86 assembly (clang, -O0):
<celsius>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xef2(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xede(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<celsius>:
addsd  0xef8(%rip),%xmm0
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @celsius(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 3.200000e+01
%5 = fmul double %4, 0x3FE1C71C71C71C72
ret double %5
}

LLVM IR (-O2):
define double @celsius(double %0) {
%2 = fadd double %0, -3.200000e+01
%3 = fmul double %2, 0x3FE1C71C71C71C72
ret double %3
}
const char *ufmcontrol_prompt(void) { return ("ufmcontrol> "); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"ufmcontrol> \00"
define i8* @ufmcontrol_prompt() {
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [13 x i8] c"ufmcontrol> \00"
define i8* @ufmcontrol_prompt() {
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ ptr;
};
typedef TYPE_1__ UDF_INIT;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/);
void udf_renewal_date_deinit(UDF_INIT *initid) { free(initid->ptr); }


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

x86 assembly (clang, -O2):
<udf_renewal_date_deinit>:
mov    (%rdi),%edi
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
define void @udf_renewal_date_deinit(%struct.TYPE_3__* %0) {
%2 = alloca %struct.TYPE_3__*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %2
%3 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i32 @free(i32 %5)
ret void
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
define void @udf_renewal_date_deinit(%struct.TYPE_3__* nocapture %0) {
%2 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i32 @free(i32 %3)
ret void
}
int seg_dist(int x, int x1, int x2) {
  if (x <= x1)
    return x1 - x;
  else if (x >= x2)
    return x - x2 + 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<seg_dist>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1127 <seg_dist+0x27>
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114b <seg_dist+0x4b>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1144 <seg_dist+0x44>
mov    -0x8(%rbp),%eax
sub    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    114b <seg_dist+0x4b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<seg_dist>:
mov    %esi,%eax
sub    %edi,%eax
jge    1111 <seg_dist+0x11>
xor    %eax,%eax
sub    %edx,%edi
jl     1111 <seg_dist+0x11>
add    $0x1,%edi
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @seg_dist(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %15
11: ; preds = %3
%12 = load i32, i32* %6
%13 = load i32, i32* %5
%14 = sub nsw i32 %12, %13
store i32 %14, i32* %4
br label %25
15: ; preds = %3
%16 = load i32, i32* %5
%17 = load i32, i32* %7
%18 = icmp sge i32 %16, %17
br i1 %18, label %19, label %24
19: ; preds = %15
%20 = load i32, i32* %5
%21 = load i32, i32* %7
%22 = sub nsw i32 %20, %21
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %25
24: ; preds = %15
store i32 0, i32* %4
br label %25
25: ; preds = %24, %19, %11
%26 = load i32, i32* %4
ret i32 %26
}

LLVM IR (-O2):
define i32 @seg_dist(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = sub nsw i32 %1, %0
br label %12
7: ; preds = %3
%8 = icmp slt i32 %0, %2
br i1 %8, label %12, label %9
9: ; preds = %7
%10 = add i32 %0, 1
%11 = sub i32 %10, %2
br label %12
12: ; preds = %7, %9, %5
%13 = phi i32 [ %6, %5 ], [ %11, %9 ], [ 0, %7 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ count_frequency(int *, int *);
int /*<<< orphan*/ create_random(int *);
int /*<<< orphan*/ draw_histogram(int *);
int main() {
  int tab[20];
  int freq[20];
  create_random(tab);
  count_frequency(tab, freq);
  draw_histogram(freq);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
call   1030 <create_random@plt>
lea    -0x60(%rbp),%rdi
lea    -0xb0(%rbp),%rsi
call   1040 <count_frequency@plt>
lea    -0xb0(%rbp),%rdi
call   1050 <draw_histogram@plt>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0xa8,%rsp
lea    0x50(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <create_random@plt>
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <count_frequency@plt>
mov    %r14,%rdi
call   1050 <draw_histogram@plt>
xor    %eax,%eax
add    $0xa8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i32]
%3 = alloca [20 x i32]
store i32 0, i32* %1
%4 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%5 = call i32 @create_random(i32* %4)
%6 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%7 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 0
%8 = call i32 @count_frequency(i32* %6, i32* %7)
%9 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 0
%10 = call i32 @draw_histogram(i32* %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [20 x i32]
%2 = alloca [20 x i32]
%3 = bitcast [20 x i32]* %1 to i8*
%4 = bitcast [20 x i32]* %2 to i8*
%5 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 0
%6 = call i32 @create_random(i32* %5)
%7 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%8 = call i32 @count_frequency(i32* %5, i32* %7)
%9 = call i32 @draw_histogram(i32* %7)
ret i32 0
}
void __jit_debug_register_code() {}


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

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

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

LLVM IR (-O2):
define void @__jit_debug_register_code() {
ret void
}
/* Variables and functions */
int cpfork();
int /*<<< orphan*/ printf(char *);
int main(void) {
  int i;
  i = cpfork();
  if (i == -1)
    printf("error\n");
  else if (i == 0)
    printf("this is child\n");
  else
    printf("this is father\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <cpfork@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1154 <main+0x34>
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
jmp    1180 <main+0x60>
cmpl   $0x0,-0x8(%rbp)
jne    116f <main+0x4f>
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
jmp    117b <main+0x5b>
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
jmp    1180 <main+0x60>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <cpfork@plt>
test   %eax,%eax
lea    0xede(%rip),%rcx
lea    0xec8(%rip),%rdx
cmove  %rcx,%rdx
cmp    $0xffffffff,%eax
lea    0xed7(%rip),%rdi
cmovne %rdx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"error\0A\00"
@.str.1 = [15 x i8] c"this is child\0A\00"
@.str.2 = [16 x i8] c"this is father\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @cpfork()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %16
8: ; preds = %0
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %15
13: ; preds = %8
%14 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
br label %15
15: ; preds = %13, %11
br label %16
16: ; preds = %15, %6
ret i32 0
}

LLVM IR (-O2):
@str = [15 x i8] c"this is father\00"
@str.3 = [14 x i8] c"this is child\00"
@str.4 = [6 x i8] c"error\00"
define i32 @main() {
%1 = tail call i32 (...) @cpfork()
%2 = icmp eq i32 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0)
%4 = icmp eq i32 %1, -1
%5 = select i1 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.4, i64 0, i64 0), i8* %3
%6 = tail call i32 @puts(i8* dereferenceable(1) %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ AnalyzeImage();
int /*<<< orphan*/ Reset();
void Init() {
  AnalyzeImage();
  Reset();
}


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

x86 assembly (clang, -O2):
<Init>:
push   %rax
xor    %eax,%eax
call   1030 <AnalyzeImage@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <Reset@plt>

LLVM IR (-O0):
define void @Init() {
%1 = call i32 (...) @AnalyzeImage()
%2 = call i32 (...) @Reset()
ret void
}

LLVM IR (-O2):
define void @Init() {
%1 = tail call i32 (...) @AnalyzeImage()
%2 = tail call i32 (...) @Reset()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ v;
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          int);
__attribute__((__unused__)) __attribute__((__nonnull__)) uint64_t
gdnsd_get_una64(const uint8_t *p) {
  uint64_t v;
  memcpy(&v, p, sizeof(v));
  return v;
}


x86 assembly (clang, -O0):
<gdnsd_get_una64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdnsd_get_una64>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @gdnsd_get_una64(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i32* %0, i32 4)
%5 = load i32, i32* %2
ret i32 %5
}
void gtk_entry_completion_set_model() {}


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

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

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

LLVM IR (-O2):
define void @gtk_entry_completion_set_model() {
ret void
}
/* Variables and functions */
unsigned char MDrv_PNL_Control_Out_Swing(unsigned short);
unsigned char MApi_PNL_Control_Out_Swing(unsigned short u16Swing_Level) {
  return MDrv_PNL_Control_Out_Swing(u16Swing_Level);
}


x86 assembly (clang, -O0):
<MApi_PNL_Control_Out_Swing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <MDrv_PNL_Control_Out_Swing@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MApi_PNL_Control_Out_Swing>:
jmp    1030 <MDrv_PNL_Control_Out_Swing@plt>

LLVM IR (-O0):
define zeroext i8 @MApi_PNL_Control_Out_Swing(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call zeroext i8 @MDrv_PNL_Control_Out_Swing(i16 zeroext %3)
ret i8 %4
}

LLVM IR (-O2):
define zeroext i8 @MApi_PNL_Control_Out_Swing(i16 zeroext %0) {
%2 = tail call zeroext i8 @MDrv_PNL_Control_Out_Swing(i16 zeroext %0)
ret i8 %2
}
void Batch_free_final() {}


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

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

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

LLVM IR (-O2):
define void @Batch_free_final() {
ret void
}
int llz_hamming_cof_num(double ftrans) { return (int)(6.2 / ftrans); }


x86 assembly (clang, -O0):
<llz_hamming_cof_num>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<llz_hamming_cof_num>:
movsd  0xef8(%rip),%xmm1
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
ret

LLVM IR (-O0):
define i32 @llz_hamming_cof_num(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double 6.200000e+00, %3
%5 = fptosi double %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @llz_hamming_cof_num(double %0) {
%2 = fdiv double 6.200000e+00, %0
%3 = fptosi double %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ enableRepeatAndCursor();
int /*<<< orphan*/ resetConsole();
int /*<<< orphan*/ resetInputMode();
void resetEnvironment() {
  resetInputMode();
  enableRepeatAndCursor();
  resetConsole();
}


x86 assembly (clang, -O0):
<resetEnvironment>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <resetInputMode@plt>
mov    $0x0,%al
call   1030 <enableRepeatAndCursor@plt>
mov    $0x0,%al
call   1040 <resetConsole@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<resetEnvironment>:
push   %rax
xor    %eax,%eax
call   1050 <resetInputMode@plt>
xor    %eax,%eax
call   1030 <enableRepeatAndCursor@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <resetConsole@plt>

LLVM IR (-O0):
define void @resetEnvironment() {
%1 = call i32 (...) @resetInputMode()
%2 = call i32 (...) @enableRepeatAndCursor()
%3 = call i32 (...) @resetConsole()
ret void
}

LLVM IR (-O2):
define void @resetEnvironment() {
%1 = tail call i32 (...) @resetInputMode()
%2 = tail call i32 (...) @enableRepeatAndCursor()
%3 = tail call i32 (...) @resetConsole()
ret void
}
int tcsendbreak(fd, len)
int fd, len;
{ return (0); }


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

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

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

LLVM IR (-O2):
define i32 @tcsendbreak(i32 %0, i32 %1) {
ret i32 0
}
float biggest(float a, float b, float c) {
  if (a > b && a > c) {
    return a;
  }
  if (b > a && b > c) {
    return b;
  }
  return c;
}


x86 assembly (clang, -O0):
<biggest>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1140 <biggest+0x40>
movss  -0x8(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    1140 <biggest+0x40>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1177 <biggest+0x77>
movss  -0xc(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    116d <biggest+0x6d>
movss  -0xc(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    116d <biggest+0x6d>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1177 <biggest+0x77>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<biggest>:
movaps %xmm1,%xmm3
maxss  %xmm2,%xmm3
movaps %xmm0,%xmm4
cmpltss %xmm1,%xmm4
andps  %xmm4,%xmm3
andnps %xmm2,%xmm4
orps   %xmm3,%xmm4
cmpltss %xmm0,%xmm1
cmpltss %xmm0,%xmm2
andps  %xmm2,%xmm0
andnps %xmm4,%xmm2
orps   %xmm2,%xmm0
andps  %xmm1,%xmm0
andnps %xmm4,%xmm1
orps   %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @biggest(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
%8 = load float, float* %5
%9 = load float, float* %6
%10 = fcmp ogt float %8, %9
br i1 %10, label %11, label %17
11: ; preds = %3
%12 = load float, float* %5
%13 = load float, float* %7
%14 = fcmp ogt float %12, %13
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = load float, float* %5
store float %16, float* %4
br label %29
17: ; preds = %11, %3
%18 = load float, float* %6
%19 = load float, float* %5
%20 = fcmp ogt float %18, %19
br i1 %20, label %21, label %27
21: ; preds = %17
%22 = load float, float* %6
%23 = load float, float* %7
%24 = fcmp ogt float %22, %23
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = load float, float* %6
store float %26, float* %4
br label %29
27: ; preds = %21, %17
%28 = load float, float* %7
store float %28, float* %4
br label %29
29: ; preds = %27, %25, %15
%30 = load float, float* %4
ret float %30
}

LLVM IR (-O2):
define float @biggest(float %0, float %1, float %2) {
%4 = fcmp ogt float %0, %1
%5 = fcmp ogt float %0, %2
%6 = and i1 %4, %5
%7 = fcmp ogt float %1, %0
%8 = fcmp ogt float %1, %2
%9 = and i1 %7, %8
%10 = select i1 %9, float %1, float %2
%11 = select i1 %6, float %0, float %10
ret float %11
}
int test_imm_2Duint8_reg(unsigned char val) {
  return ((val) & (0x2D << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_2Duint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 45
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ctranspose(double *, int, int, double *);
int /*<<< orphan*/ dtranspose(double *, int, int, double *);
void mtranspose(double *sig, int rows, int cols, double *col) {
  if (rows >= 512 && cols >= 512) {
    ctranspose(sig, rows, cols, col);
  } else {
    dtranspose(sig, rows, cols, col);
  }
}


x86 assembly (clang, -O0):
<mtranspose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
cmpl   $0x200,-0xc(%rbp)
jl     1168 <mtranspose+0x48>
cmpl   $0x200,-0x10(%rbp)
jl     1168 <mtranspose+0x48>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1030 <ctranspose@plt>
jmp    117b <mtranspose+0x5b>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1040 <dtranspose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mtranspose>:
cmp    $0x200,%esi
jl     1135 <mtranspose+0x15>
cmp    $0x200,%edx
jl     1135 <mtranspose+0x15>
jmp    1030 <ctranspose@plt>
jmp    1040 <dtranspose@plt>

LLVM IR (-O0):
define void @mtranspose(double* %0, i32 %1, i32 %2, double* %3) {
%5 = alloca double*
%6 = alloca i32
%7 = alloca i32
%8 = alloca double*
store double* %0, double** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store double* %3, double** %8
%9 = load i32, i32* %6
%10 = icmp sge i32 %9, 512
br i1 %10, label %11, label %20
11: ; preds = %4
%12 = load i32, i32* %7
%13 = icmp sge i32 %12, 512
br i1 %13, label %14, label %20
14: ; preds = %11
%15 = load double*, double** %5
%16 = load i32, i32* %6
%17 = load i32, i32* %7
%18 = load double*, double** %8
%19 = call i32 @ctranspose(double* %15, i32 %16, i32 %17, double* %18)
br label %26
20: ; preds = %11, %4
%21 = load double*, double** %5
%22 = load i32, i32* %6
%23 = load i32, i32* %7
%24 = load double*, double** %8
%25 = call i32 @dtranspose(double* %21, i32 %22, i32 %23, double* %24)
br label %26
26: ; preds = %20, %14
ret void
}

LLVM IR (-O2):
define void @mtranspose(double* %0, i32 %1, i32 %2, double* %3) {
%5 = icmp sgt i32 %1, 511
%6 = icmp sgt i32 %2, 511
%7 = and i1 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = tail call i32 @ctranspose(double* %0, i32 %1, i32 %2, double* %3)
br label %12
10: ; preds = %4
%11 = tail call i32 @dtranspose(double* %0, i32 %1, i32 %2, double* %3)
br label %12
12: ; preds = %10, %8
ret void
}
double ceil(double num) { return (double)(int)(num + 0.9); }


x86 assembly (clang, -O0):
<ceil>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceil>:
addsd  0xef8(%rip),%xmm0
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @ceil(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 9.000000e-01
%5 = fptosi double %4 to i32
%6 = sitofp i32 %5 to double
ret double %6
}

LLVM IR (-O2):
define double @ceil(double %0) {
%2 = fadd double %0, 9.000000e-01
%3 = fptosi double %2 to i32
%4 = sitofp i32 %3 to double
ret double %4
}