xunge/DecIR huggingface dataset:
__attribute__((always_)) int mpol_parse_str(char *str, struct mempolicy **mpol,
                                            int no_context) {
  return 1;
}


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

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

LLVM IR (-O0):
%struct.mempolicy = type opaque
define i32 @mpol_parse_str(i8* %0, %struct.mempolicy** %1, i32 %2) {
%4 = alloca i8*
%5 = alloca %struct.mempolicy**
%6 = alloca i32
store i8* %0, i8** %4
store %struct.mempolicy** %1, %struct.mempolicy*** %5
store i32 %2, i32* %6
ret i32 1
}

LLVM IR (-O2):
%struct.mempolicy = type opaque
define i32 @mpol_parse_str(i8* nocapture readnone %0, %struct.mempolicy** nocapture readnone %1, i32 %2) {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ _SC_PAGESIZE;
int sysconf(int /*<<< orphan*/);
off_t get_sig_offset(int orig) {
  int pagesize = sysconf(_SC_PAGESIZE);
  return (off_t)((sizeof(char) * pagesize) - (orig ? 20 : 10));
}


x86 assembly (clang, -O0):
<get_sig_offset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
mov    %eax,-0x8(%rbp)
movslq -0x8(%rbp),%rax
shl    $0x0,%rax
mov    -0x4(%rbp),%esi
mov    $0xa,%ecx
mov    $0x14,%edx
cmp    $0x0,%esi
cmovne %edx,%ecx
movslq %ecx,%rcx
sub    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_sig_offset>:
push   %rbx
mov    %edi,%ebx
mov    0x2ece(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
lea    -0x14(%rax),%ecx
add    $0xfffffff6,%eax
test   %ebx,%ebx
cmovne %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@_SC_PAGESIZE = global i32 0
define i32 @get_sig_offset(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* @_SC_PAGESIZE
%5 = call i32 @sysconf(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = mul i64 1, %7
%9 = load i32, i32* %2
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 20, i32 10
%13 = sext i32 %12 to i64
%14 = sub i64 %8, %13
%15 = trunc i64 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
@_SC_PAGESIZE = global i32 0
define i32 @get_sig_offset(i32 %0) {
%2 = load i32, i32* @_SC_PAGESIZE
%3 = tail call i32 @sysconf(i32 %2)
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i32 -10, i32 -20
%6 = add i32 %3, %5
ret i32 %6
}
int main() {
  int a;
  int b;
  if (a < b) {
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    111c <main+0x1c>
jmp    111c <main+0x1c>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void bound(double *value, double min, double max) {
  if (*value < min) {
    *value = min;
  } else if (*value > max) {
    *value = max;
  }
}


x86 assembly (clang, -O0):
<bound>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    113b <bound+0x3b>
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1160 <bound+0x60>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    115b <bound+0x5b>
movsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1160 <bound+0x60>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bound>:
movsd  (%rdi),%xmm2
ucomisd %xmm2,%xmm0
ja     1114 <bound+0x14>
ucomisd %xmm1,%xmm2
movapd %xmm1,%xmm0
jbe    1118 <bound+0x18>
movsd  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @bound(double* %0, double %1, double %2) {
%4 = alloca double*
%5 = alloca double
%6 = alloca double
store double* %0, double** %4
store double %1, double* %5
store double %2, double* %6
%7 = load double*, double** %4
%8 = load double, double* %7
%9 = load double, double* %5
%10 = fcmp olt double %8, %9
br i1 %10, label %11, label %14
11: ; preds = %3
%12 = load double, double* %5
%13 = load double*, double** %4
store double %12, double* %13
br label %23
14: ; preds = %3
%15 = load double*, double** %4
%16 = load double, double* %15
%17 = load double, double* %6
%18 = fcmp ogt double %16, %17
br i1 %18, label %19, label %22
19: ; preds = %14
%20 = load double, double* %6
%21 = load double*, double** %4
store double %20, double* %21
br label %22
22: ; preds = %19, %14
br label %23
23: ; preds = %22, %11
ret void
}

LLVM IR (-O2):
define void @bound(double* nocapture %0, double %1, double %2) {
%4 = load double, double* %0
%5 = fcmp olt double %4, %1
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = fcmp ogt double %4, %2
br i1 %7, label %8, label %10
8: ; preds = %6, %3
%9 = phi double [ %1, %3 ], [ %2, %6 ]
store double %9, double* %0
br label %10
10: ; preds = %8, %6
ret void
}
void g_hook_insert_sorted() {}


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

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

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

LLVM IR (-O2):
define void @g_hook_insert_sorted() {
ret void
}
int isaddop(int c) { return (c == '+' || c == '-'); }


x86 assembly (clang, -O0):
<isaddop>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x2b,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <isaddop+0x20>
cmpl   $0x2d,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isaddop>:
add    $0xffffffd5,%edi
xor    %eax,%eax
test   $0xfffffffd,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isaddop(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 43
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 45
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isaddop(i32 %0) {
%2 = icmp eq i32 %0, 43
%3 = icmp eq i32 %0, 45
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
void __aeabi_unwind_cpp_pr0(void) { (void)0; }


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

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

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

LLVM IR (-O2):
define void @__aeabi_unwind_cpp_pr0() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *malloc(size_t);
void *avifAlloc(size_t size) {
  void *out = malloc(size);
  if (out == NULL) {
    abort();
  }
  return out;
}


x86 assembly (clang, -O0):
<avifAlloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <avifAlloc+0x2b>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<avifAlloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     112d <avifAlloc+0xd>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @avifAlloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @avifAlloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret i8* %2
}
long __ocl_convert_long_char(char src) { return (long)src; }


x86 assembly (clang, -O0):
<__ocl_convert_long_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbq -0x1(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ocl_convert_long_char>:
movslq %edi,%rax
ret

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

LLVM IR (-O2):
define i64 @__ocl_convert_long_char(i8 signext %0) {
%2 = sext i8 %0 to i64
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ TCODE_LOCK_COMPARE_SWAP;
int /*<<< orphan*/ do_lock_request(int /*<<< orphan*/);
void do_compare_swap(void) { do_lock_request(TCODE_LOCK_COMPARE_SWAP); }


x86 assembly (clang, -O0):
<do_compare_swap>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <do_lock_request@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_compare_swap>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <do_lock_request@plt>

LLVM IR (-O0):
@TCODE_LOCK_COMPARE_SWAP = global i32 0
define void @do_compare_swap() {
%1 = load i32, i32* @TCODE_LOCK_COMPARE_SWAP
%2 = call i32 @do_lock_request(i32 %1)
ret void
}

LLVM IR (-O2):
@TCODE_LOCK_COMPARE_SWAP = global i32 0
define void @do_compare_swap() {
%1 = load i32, i32* @TCODE_LOCK_COMPARE_SWAP
%2 = tail call i32 @do_lock_request(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ set_port(int /*<<< orphan*/, int /*<<< orphan*/,
                            int /*<<< orphan*/, int, int);
void invert_port(uint8_t address, uint8_t port, uint8_t polarity) {
  set_port(address, port, polarity, 0x02, 0x03);
}


x86 assembly (clang, -O0):
<invert_port>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    $0x2,%ecx
mov    $0x3,%r8d
call   1030 <set_port@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<invert_port>:
mov    $0x2,%ecx
mov    $0x3,%r8d
jmp    1030 <set_port@plt>

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

LLVM IR (-O2):
define void @invert_port(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @set_port(i32 %0, i32 %1, i32 %2, i32 2, i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int foo(int);
int main(void) {
  if (foo(0xabcd0000L) != 0 || foo(0) != 1)
    _exit(-1);
  _exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xabcd0000,%edi
call   1040 <foo@plt>
cmp    $0x0,%eax
jne    1152 <main+0x32>
xor    %edi,%edi
call   1040 <foo@plt>
cmp    $0x1,%eax
je     115c <main+0x3c>
mov    $0xffffffff,%edi
call   1030 <_exit@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xabcd0000,%edi
call   1040 <foo@plt>
test   %eax,%eax
jne    1142 <main+0x22>
xor    %edi,%edi
call   1040 <foo@plt>
cmp    $0x1,%eax
jne    1142 <main+0x22>
xor    %edi,%edi
call   1030 <_exit@plt>
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 -1412628480)
%3 = icmp ne i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = call i32 @foo(i32 0)
%6 = icmp ne i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %4, %0
%8 = call i32 @_exit(i32 -1)
unreachable
9: ; preds = %4
%10 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 -1412628480)
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 @foo(i32 0)
%5 = icmp eq i32 %4, 1
br i1 %5, label %8, label %6
6: ; preds = %3, %0
%7 = tail call i32 @_exit(i32 -1)
unreachable
8: ; preds = %3
%9 = tail call i32 @_exit(i32 0)
unreachable
}
/* Type definitions */
struct types_cnets_osblinnikov_github_com {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ types_cnets_osblinnikov_github_com_onCreate(
    struct types_cnets_osblinnikov_github_com *);
void types_cnets_osblinnikov_github_com_init(
    struct types_cnets_osblinnikov_github_com *that) {
  types_cnets_osblinnikov_github_com_onCreate(that);
}


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

x86 assembly (clang, -O2):
<types_cnets_osblinnikov_github_com_init>:
jmp    1030 <types_cnets_osblinnikov_github_com_onCreate@plt>

LLVM IR (-O0):
%struct.types_cnets_osblinnikov_github_com = type { i32 }
define void @types_cnets_osblinnikov_github_com_init(%struct.types_cnets_osblinnikov_github_com* %0) {
%2 = alloca %struct.types_cnets_osblinnikov_github_com*
store %struct.types_cnets_osblinnikov_github_com* %0, %struct.types_cnets_osblinnikov_github_com** %2
%3 = load %struct.types_cnets_osblinnikov_github_com*, %struct.types_cnets_osblinnikov_github_com** %2
%4 = call i32 @types_cnets_osblinnikov_github_com_onCreate(%struct.types_cnets_osblinnikov_github_com* %3)
ret void
}

LLVM IR (-O2):
%struct.types_cnets_osblinnikov_github_com = type { i32 }
define void @types_cnets_osblinnikov_github_com_init(%struct.types_cnets_osblinnikov_github_com* %0) {
%2 = tail call i32 @types_cnets_osblinnikov_github_com_onCreate(%struct.types_cnets_osblinnikov_github_com* %0)
ret void
}
void PSG_write(unsigned char data) {
  volatile unsigned char *pb;
  pb = (unsigned char *)0xC00011;
  *pb = data;
}


x86 assembly (clang, -O0):
<PSG_write>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0xc00011,%eax
mov    %rax,-0x10(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PSG_write>:
mov    %dil,0xc00011
ret

LLVM IR (-O0):
define void @PSG_write(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8*
store i8 %0, i8* %2
store i8* inttoptr (i64 12582929 to i8*), i8** %3
%4 = load i8, i8* %2
%5 = load i8*, i8** %3
store volatile i8 %4, i8* %5
ret void
}

LLVM IR (-O2):
define void @PSG_write(i8 zeroext %0) {
store volatile i8 %0, i8* inttoptr (i64 12582929 to i8*)
ret void
}
/* Variables and functions */
double mirroring_math(double input, double previous, double *original,
                      bool mirrored) {
  if (mirrored) {
    previous -= input - *original;
    *original = input;
  } else
    previous = input;
  return previous;
}


x86 assembly (clang, -O0):
<mirroring_math>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %esi,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     114c <mirroring_math+0x4c>
movsd  -0x8(%rbp),%xmm1
mov    -0x18(%rbp),%rax
subsd  (%rax),%xmm1
movsd  -0x10(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1156 <mirroring_math+0x56>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mirroring_math>:
test   %esi,%esi
je     1118 <mirroring_math+0x18>
movapd %xmm0,%xmm2
subsd  (%rdi),%xmm2
subsd  %xmm2,%xmm1
movsd  %xmm0,(%rdi)
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @mirroring_math(double %0, double %1, double* %2, i32 %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double*
%8 = alloca i32
store double %0, double* %5
store double %1, double* %6
store double* %2, double** %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %20
11: ; preds = %4
%12 = load double, double* %5
%13 = load double*, double** %7
%14 = load double, double* %13
%15 = fsub double %12, %14
%16 = load double, double* %6
%17 = fsub double %16, %15
store double %17, double* %6
%18 = load double, double* %5
%19 = load double*, double** %7
store double %18, double* %19
br label %22
20: ; preds = %4
%21 = load double, double* %5
store double %21, double* %6
br label %22
22: ; preds = %20, %11
%23 = load double, double* %6
ret double %23
}

LLVM IR (-O2):
define double @mirroring_math(double %0, double %1, double* nocapture %2, i32 %3) {
%5 = icmp eq i32 %3, 0
br i1 %5, label %10, label %6
6: ; preds = %4
%7 = load double, double* %2
%8 = fsub double %0, %7
%9 = fsub double %1, %8
store double %0, double* %2
br label %10
10: ; preds = %4, %6
%11 = phi double [ %9, %6 ], [ %0, %4 ]
ret double %11
}
void test4(int i) {}


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

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

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

LLVM IR (-O2):
define void @test4(i32 %0) {
ret void
}
char strip_comments(char *l, char c) {
  while (*l != '\0') {
    if (*l == c) {
      *l = '\0';
      return 0;
    }
    l++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<strip_comments>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1152 <strip_comments+0x52>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    1141 <strip_comments+0x41>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
movb   $0x0,-0x1(%rbp)
jmp    1156 <strip_comments+0x56>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110e <strip_comments+0xe>
movb   $0x1,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strip_comments>:
mov    (%rdi),%cl
mov    $0x1,%al
test   %cl,%cl
je     1120 <strip_comments+0x20>
add    $0x1,%rdi
nopl   0x0(%rax)
cmp    %sil,%cl
je     1121 <strip_comments+0x21>
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <strip_comments+0x10>
ret
movb   $0x0,-0x1(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define signext i8 @strip_comments(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %10
%6 = phi i8 [ %12, %10 ], [ %3, %2 ]
%7 = phi i8* [ %11, %10 ], [ %0, %2 ]
%8 = icmp eq i8 %6, %1
br i1 %8, label %9, label %10
9: ; preds = %5
store i8 0, i8* %7
br label %14
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %10, %2, %9
%15 = phi i8 [ 0, %9 ], [ 1, %2 ], [ 1, %10 ]
ret i8 %15
}
/* Type definitions */
struct genlist_link {
  int dummy;
};
struct fileinfo_list_link {
  int dummy;
};

/* Variables and functions */
scalar_t__ genlist_link_next(struct genlist_link const *);
struct fileinfo_list_link *
fileinfo_list_link_next(const struct fileinfo_list_link *plink) {
  return ((struct fileinfo_list_link *)genlist_link_next(
      (const struct genlist_link *)plink));
}


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

x86 assembly (clang, -O2):
<fileinfo_list_link_next>:
jmp    1030 <genlist_link_next@plt>

LLVM IR (-O0):
%struct.fileinfo_list_link = type { i32 }
%struct.genlist_link = type { i32 }
define %struct.fileinfo_list_link* @fileinfo_list_link_next(%struct.fileinfo_list_link* %0) {
%2 = alloca %struct.fileinfo_list_link*
store %struct.fileinfo_list_link* %0, %struct.fileinfo_list_link** %2
%3 = load %struct.fileinfo_list_link*, %struct.fileinfo_list_link** %2
%4 = bitcast %struct.fileinfo_list_link* %3 to %struct.genlist_link*
%5 = call i64 @genlist_link_next(%struct.genlist_link* %4)
%6 = inttoptr i64 %5 to %struct.fileinfo_list_link*
ret %struct.fileinfo_list_link* %6
}

LLVM IR (-O2):
%struct.fileinfo_list_link = type { i32 }
%struct.genlist_link = type { i32 }
define %struct.fileinfo_list_link* @fileinfo_list_link_next(%struct.fileinfo_list_link* %0) {
%2 = bitcast %struct.fileinfo_list_link* %0 to %struct.genlist_link*
%3 = tail call i64 @genlist_link_next(%struct.genlist_link* %2)
%4 = inttoptr i64 %3 to %struct.fileinfo_list_link*
ret %struct.fileinfo_list_link* %4
}
void fa152(void) {
P0A:
  goto P0A;
  ({
    P01A:
      goto P01A;
      ({
        P012A:
          goto P012A;
          0;
      });
    P01B:
      goto P01B;
      ({
        P013A:
          goto P013A;
          0;
      });
    P01C:
      goto P01C;
      0;
  });
P0B:
  goto P0B;
  ({
    P02A:
      goto P02A;
      ({
        P024A:
          goto P024A;
          0;
      });
    P02B:
      goto P02B;
      ({
        p025A:
          goto p025A;
          goto a;
        P025A:
          goto P025A;
          0;
      });
    P02C:
      goto P02C;
      0;
  });
a:
  0;
P0D:
  goto P0D;
}


x86 assembly (clang, -O0):
<fa152>:
push   %rbp
mov    %rsp,%rbp
jmp    1104 <fa152+0x4>

x86 assembly (clang, -O2):
<fa152>:
jmp    1100 <fa152>

LLVM IR (-O0):
define void @fa152() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
br label %7
7: ; preds = %7, %0
br label %7
8: ; No predecessors!
br label %9
9: ; preds = %9, %8
br label %9
10: ; No predecessors!
br label %11
11: ; preds = %11, %10
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
br label %14
14: ; preds = %14, %13
br label %14
15: ; preds = %15
br label %15
16: ; preds = %16
br label %16
17: ; No predecessors!
br label %18
18: ; preds = %18, %17
br label %18
19: ; No predecessors!
br label %20
20: ; preds = %20, %19
br label %20
21: ; preds = %21
br label %21
22: ; No predecessors!
br label %23
23: ; preds = %23, %22
br label %23
24: ; preds = %24
br label %24
25: ; preds = %25
br label %25
26: ; No predecessors!
br label %27
27: ; preds = %27, %26
br label %27
}

LLVM IR (-O2):
define void @fa152() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int strlen(char *);
int mask_query(char *s) {
  int i;
  for (i = 0; i < strlen(s); i++)
    s[i] ^= 3;
  return 0;
}


x86 assembly (clang, -O0):
<mask_query>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    115f <mask_query+0x4f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edx
xor    $0x3,%edx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <mask_query+0x13>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mask_query>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %eax,%eax
jle    1148 <mask_query+0x38>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xorb   $0x3,(%r14,%rbx,1)
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1130 <mask_query+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @mask_query(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = xor i8 %7, 3
store i8 %8, i8* %6
%9 = add nuw nsw i64 %5, 1
%10 = tail call i32 @strlen(i8* %0)
%11 = sext i32 %10 to i64
%12 = icmp slt i64 %9, %11
br i1 %12, label %4, label %13
13: ; preds = %4, %1
ret i32 0
}
double pow3o4(double x) { return __builtin_sqrt(x * __builtin_sqrt(x)); }


x86 assembly (clang, -O0):
<pow3o4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow3o4>:
movapd %xmm0,%xmm1
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jb     1127 <pow3o4+0x17>
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
jmp    1143 <pow3o4+0x33>
push   %rax
movapd %xmm1,%xmm0
movsd  %xmm1,(%rsp)
call   1030 <sqrt@plt>
xorpd  %xmm2,%xmm2
movsd  (%rsp),%xmm1
add    $0x8,%rsp
mulsd  %xmm1,%xmm0
ucomisd %xmm2,%xmm0
jb     1152 <pow3o4+0x42>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @pow3o4(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = call double @sqrt(double %4)
%6 = fmul double %3, %5
%7 = call double @sqrt(double %6)
ret double %7
}

LLVM IR (-O2):
define double @pow3o4(double %0) {
%2 = tail call double @sqrt(double %0)
%3 = fmul double %2, %0
%4 = tail call double @sqrt(double %3)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ func_1();
int /*<<< orphan*/ func_2();
int getpid();
int main(int argc, char *argv[]) {
  if (getpid() & 0x1) {
    func_1();
  } else {
    func_2();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
and    $0x1,%eax
cmp    $0x0,%eax
je     1165 <main+0x35>
mov    $0x0,%al
call   1050 <func_1@plt>
jmp    116c <main+0x3c>
mov    $0x0,%al
call   1040 <func_2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
test   $0x1,%al
jne    1145 <main+0x15>
xor    %eax,%eax
call   1040 <func_2@plt>
jmp    114c <main+0x1c>
xor    %eax,%eax
call   1050 <func_1@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @getpid()
%7 = and i32 %6, 1
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (...) @func_1()
br label %13
11: ; preds = %2
%12 = call i32 (...) @func_2()
br label %13
13: ; preds = %11, %9
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getpid()
%4 = and i32 %3, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @func_1()
br label %10
8: ; preds = %2
%9 = tail call i32 (...) @func_2()
br label %10
10: ; preds = %8, %6
ret i32 0
}
/* Variables and functions */
void swap(char *arr, size_t i, size_t j) {
  char tmp = arr[i];
  arr[i] = arr[j];
  arr[j] = tmp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x19(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x19(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi,%rsi,1),%al
mov    (%rdi,%rdx,1),%cl
mov    %cl,(%rdi,%rsi,1)
mov    %al,(%rdi,%rdx,1)
ret

LLVM IR (-O0):
define void @swap(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i8
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = load i64, i64* %5
%10 = getelementptr inbounds i8, i8* %8, i64 %9
%11 = load i8, i8* %10
store i8 %11, i8* %7
%12 = load i8*, i8** %4
%13 = load i64, i64* %6
%14 = getelementptr inbounds i8, i8* %12, i64 %13
%15 = load i8, i8* %14
%16 = load i8*, i8** %4
%17 = load i64, i64* %5
%18 = getelementptr inbounds i8, i8* %16, i64 %17
store i8 %15, i8* %18
%19 = load i8, i8* %7
%20 = load i8*, i8** %4
%21 = load i64, i64* %6
%22 = getelementptr inbounds i8, i8* %20, i64 %21
store i8 %19, i8* %22
ret void
}

LLVM IR (-O2):
define void @swap(i8* nocapture %0, i64 %1, i64 %2) {
%4 = getelementptr inbounds i8, i8* %0, i64 %1
%5 = load i8, i8* %4
%6 = getelementptr inbounds i8, i8* %0, i64 %2
%7 = load i8, i8* %6
store i8 %7, i8* %4
store i8 %5, i8* %6
ret void
}
/* Type definitions */
struct generator {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ w(struct generator *, char *);
void write_block_end(struct generator *g) { w(g, "~-~M}~N"); }


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

x86 assembly (clang, -O2):
<write_block_end>:
lea    0xee9(%rip),%rsi
jmp    1030 <w@plt>

LLVM IR (-O0):
%struct.generator = type { i32 }
@.str = [8 x i8] c"~-~M}~N\00"
define void @write_block_end(%struct.generator* %0) {
%2 = alloca %struct.generator*
store %struct.generator* %0, %struct.generator** %2
%3 = load %struct.generator*, %struct.generator** %2
%4 = call i32 @w(%struct.generator* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.generator = type { i32 }
@.str = [8 x i8] c"~-~M}~N\00"
define void @write_block_end(%struct.generator* %0) {
%2 = tail call i32 @w(%struct.generator* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
h(void (*pv)(int hello)) {}


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @h(void (i32)* nocapture readnone %0) {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ strtoll(char const *, int /*<<< orphan*/ *, int);
int64_t atoi64(const char *psz) { return strtoll(psz, NULL, 10); }


x86 assembly (clang, -O0):
<atoi64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1030 <strtoll@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoi64>:
xor    %esi,%esi
mov    $0xa,%edx
jmp    1030 <strtoll@plt>

LLVM IR (-O0):
define i32 @atoi64(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strtoll(i8* %3, i32* null, i32 10)
ret i32 %4
}

LLVM IR (-O2):
define i32 @atoi64(i8* nocapture %0) {
%2 = tail call i32 @strtoll(i8* nocapture %0, i32* null, i32 10)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("usage: surfgrid [-f]\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"usage: surfgrid [-f]\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@str = [21 x i8] c"usage: surfgrid [-f]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ draw_quadrilateral(int, int, int, int);
void draw_parallelepiped() {
  int x1 = 200, y1 = 100, x2 = 300, y2 = 200;
  int i;
  for (i = 0; i < 40; i += 2)
    draw_quadrilateral(x1 + i, y1 + i, x2 + i, y2 + i);
}


x86 assembly (clang, -O0):
<draw_parallelepiped>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0xc8,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
movl   $0x12c,-0xc(%rbp)
movl   $0xc8,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x28,-0x14(%rbp)
jge    1170 <draw_parallelepiped+0x60>
mov    -0x4(%rbp),%edi
add    -0x14(%rbp),%edi
mov    -0x8(%rbp),%esi
add    -0x14(%rbp),%esi
mov    -0xc(%rbp),%edx
add    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
add    -0x14(%rbp),%ecx
call   1030 <draw_quadrilateral@plt>
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
jmp    113b <draw_parallelepiped+0x2b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_parallelepiped>:
push   %rbx
mov    $0xfffffffe,%ebx
cs nopw 0x0(%rax,%rax,1)
lea    0xca(%rbx),%ecx
lea    0x66(%rbx),%esi
lea    0x12e(%rbx),%edx
mov    %ecx,%edi
call   1030 <draw_quadrilateral@plt>
add    $0x2,%ebx
cmp    $0x26,%ebx
jb     1120 <draw_parallelepiped+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @draw_parallelepiped() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %7, %1 ]
%3 = add nuw nsw i32 %2, 200
%4 = add nuw nsw i32 %2, 100
%5 = add nuw nsw i32 %2, 300
%6 = tail call i32 @draw_quadrilateral(i32 %3, i32 %4, i32 %5, i32 %3)
%7 = add nuw nsw i32 %2, 2
%8 = icmp ult i32 %2, 38
br i1 %8, label %1, label %9
9: ; preds = %1
ret void
}
char *RCSid() {
  return RCSid("$Id: util3d.c,v 1.44.2.1 2012/01/11 23:42:23 sfeam Exp $");
}


x86 assembly (clang, -O0):
<RCSid>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <RCSid@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<RCSid>:
jmp    1100 <RCSid>

LLVM IR (-O0):
@.str = [57 x i8] c"$Id: util3d.c,v 1.44.2.1 2012/01/11 23:42:23 sfeam Exp $\00"
define i8* @RCSid() {
%1 = call i8* (i8*, ...) bitcast (i8* ()* @RCSid to i8* (i8*, ...)*)(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @RCSid() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int checker_read_double(int, char const *, int, double *);
int checker_read_team_double(const char *name, int eof_error_flag,
                             double *p_val) {
  return checker_read_double(1, name, eof_error_flag, p_val);
}


x86 assembly (clang, -O0):
<checker_read_team_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x1,%edi
call   1030 <checker_read_double@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checker_read_team_double>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <checker_read_double@plt>

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

LLVM IR (-O2):
define i32 @checker_read_team_double(i8* %0, i32 %1, double* %2) {
%4 = tail call i32 @checker_read_double(i32 1, i8* %0, i32 %1, double* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ simplificar(int, int);
int /*<<< orphan*/ stdout;
void sub(int n1, int d1, int n2, int d2) {
  int n = n1 * d2 - n2 * d1;
  int d = d1 * d2;
  printf("%d/%d = ", n, d);
  fflush(stdout);
  simplificar(n, d);
}


x86 assembly (clang, -O0):
<sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0x8(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xe92(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1030 <simplificar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
imul   %ecx,%ebp
imul   %esi,%edx
sub    %edx,%ebp
imul   %ecx,%ebx
lea    0xeb7(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1040 <printf@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <simplificar@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"%d/%d = \00"
@stdout = global i32 0
define void @sub(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %5
%12 = load i32, i32* %8
%13 = mul nsw i32 %11, %12
%14 = load i32, i32* %7
%15 = load i32, i32* %6
%16 = mul nsw i32 %14, %15
%17 = sub nsw i32 %13, %16
store i32 %17, i32* %9
%18 = load i32, i32* %6
%19 = load i32, i32* %8
%20 = mul nsw i32 %18, %19
store i32 %20, i32* %10
%21 = load i32, i32* %9
%22 = load i32, i32* %10
%23 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %21, i32 %22)
%24 = load i32, i32* @stdout
%25 = call i32 @fflush(i32 %24)
%26 = load i32, i32* %9
%27 = load i32, i32* %10
%28 = call i32 @simplificar(i32 %26, i32 %27)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d/%d = \00"
@stdout = global i32 0
define void @sub(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = mul nsw i32 %3, %0
%6 = mul nsw i32 %2, %1
%7 = sub nsw i32 %5, %6
%8 = mul nsw i32 %3, %1
%9 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
%10 = load i32, i32* @stdout
%11 = tail call i32 @fflush(i32 %10)
%12 = tail call i32 @simplificar(i32 %7, i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGPIPE;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
void ignore_sigpipe(void) { (void)signal(SIGPIPE, SIG_IGN); }


x86 assembly (clang, -O0):
<ignore_sigpipe>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    0x2ec4(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ignore_sigpipe>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
jmp    1030 <signal@plt>

LLVM IR (-O0):
@SIGPIPE = global i32 0
@SIG_IGN = global i32 0
define void @ignore_sigpipe() {
%1 = load i32, i32* @SIGPIPE
%2 = load i32, i32* @SIG_IGN
%3 = call i32 @signal(i32 %1, i32 %2)
ret void
}

LLVM IR (-O2):
@SIGPIPE = global i32 0
@SIG_IGN = global i32 0
define void @ignore_sigpipe() {
%1 = load i32, i32* @SIGPIPE
%2 = load i32, i32* @SIG_IGN
%3 = tail call i32 @signal(i32 %1, i32 %2)
ret void
}
void EVP_get_digestbyname(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_get_digestbyname() {
ret void
}
int main(int argc, char const *argv[]) { return !(argc == 2); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
sete   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
cmp    $0x2,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 2
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp ne i32 %0, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
void rtos_enable_rt_warning() {}


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

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

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

LLVM IR (-O2):
define void @rtos_enable_rt_warning() {
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ FD_SET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
int select(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *, struct timeval *);
int timeout(int fd) {
  fd_set rfds;
  struct timeval tv;
  FD_ZERO(&rfds);
  FD_SET(fd, &rfds);
  tv.tv_sec = 300;
  tv.tv_usec = 0;
  int retval = select(fd + 1, &rfds, NULL, NULL, &tv);
  return retval;
}


x86 assembly (clang, -O0):
<timeout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <FD_ZERO@plt>
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1050 <FD_SET@plt>
movl   $0x12c,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1,%edi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x18(%rbp),%r8
mov    %rcx,%rdx
call   1040 <select@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timeout>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ebx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1030 <FD_ZERO@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1050 <FD_SET@plt>
movl   $0x12c,0x8(%rsp)
movq   $0x0,0x10(%rsp)
add    $0x1,%ebx
lea    0x8(%rsp),%r8
mov    %ebx,%edi
mov    %r14,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
call   1040 <select@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i32 @timeout(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.timeval
%5 = alloca i32
store i32 %0, i32* %2
%6 = call i32 @FD_ZERO(i32* %3)
%7 = load i32, i32* %2
%8 = call i32 @FD_SET(i32 %7, i32* %3)
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
store i32 300, i32* %9
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 1
store i64 0, i64* %10
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
%13 = call i32 @select(i32 %12, i32* %3, i32* null, i32* null, %struct.timeval* %4)
store i32 %13, i32* %5
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i32 @timeout(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timeval
%4 = bitcast i32* %2 to i8*
%5 = bitcast %struct.timeval* %3 to i8*
%6 = call i32 @FD_ZERO(i32* %2)
%7 = call i32 @FD_SET(i32 %0, i32* %2)
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 0
store i32 300, i32* %8
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 1
store i64 0, i64* %9
%10 = add nsw i32 %0, 1
%11 = call i32 @select(i32 %10, i32* %2, i32* null, i32* null, %struct.timeval* %3)
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void print_conv(int itermax, double *dx) {
  for (int j = 0; j < itermax; ++j)
    printf("%12.5e\n", dx[j]);
}


x86 assembly (clang, -O0):
<print_conv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1159 <print_conv+0x49>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <print_conv+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_conv>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1147 <print_conv+0x37>
mov    %rsi,%r15
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsd  (%r15,%rbx,8),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print_conv+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%12.5e\0A\00"
define void @print_conv(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i32
store i32 %0, i32* %3
store double* %1, double** %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %3
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load double*, double** %4
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds double, double* %11, i64 %13
%15 = load double, double* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %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):
@.str = [8 x i8] c"%12.5e\0A\00"
define void @print_conv(i32 %0, double* nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds double, double* %1, i64 %8
%10 = load double, double* %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}