xunge/DecIR huggingface dataset:
/* Variables and functions */
int __ctype_isgraph(int);
int isgraph(int c) { return __ctype_isgraph(c); }


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

x86 assembly (clang, -O2):
<isgraph>:
jmp    1030 <__ctype_isgraph@plt>

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

LLVM IR (-O2):
define i32 @isgraph(i32 %0) {
%2 = tail call i32 @__ctype_isgraph(i32 %0)
ret i32 %2
}
int isspec(char c) {
  return (((c >= '!') && (c <= '/')) || (c >= ':' && c <= '@') ||
          ((c >= '[') && (c <= '`')) || ((c >= '{') && (c <= 'DEL')));
}


x86 assembly (clang, -O0):
<isspec>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x21,%eax
jl     1129 <isspec+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2f,%ecx
mov    %al,-0x2(%rbp)
jle    118e <isspec+0x8e>
movsbl -0x1(%rbp),%eax
cmp    $0x3a,%eax
jl     1148 <isspec+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x40,%ecx
mov    %al,-0x2(%rbp)
jle    118e <isspec+0x8e>
movsbl -0x1(%rbp),%eax
cmp    $0x5b,%eax
jl     1167 <isspec+0x67>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x60,%ecx
mov    %al,-0x2(%rbp)
jle    118e <isspec+0x8e>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x7b,%ecx
mov    %al,-0x3(%rbp)
jl     1188 <isspec+0x88>
movsbl -0x1(%rbp),%eax
cmp    $0x44454c,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspec>:
lea    -0x21(%rdi),%eax
cmp    $0xf,%al
setb   %al
lea    -0x3a(%rdi),%ecx
cmp    $0x7,%cl
setb   %cl
or     %al,%cl
lea    -0x5b(%rdi),%eax
cmp    $0x6,%al
setb   %al
cmp    $0x7b,%dil
setge  %dl
or     %al,%dl
or     %cl,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @isspec(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 33
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 47
br i1 %9, label %36, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 58
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 64
br i1 %17, label %36, label %18
18: ; preds = %14, %10
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp sge i32 %20, 91
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp sle i32 %24, 96
br i1 %25, label %36, label %26
26: ; preds = %22, %18
%27 = load i8, i8* %2
%28 = sext i8 %27 to i32
%29 = icmp sge i32 %28, 123
br i1 %29, label %30, label %34
30: ; preds = %26
%31 = load i8, i8* %2
%32 = sext i8 %31 to i32
%33 = icmp sle i32 %32, 4474188
br label %34
34: ; preds = %30, %26
%35 = phi i1 [ false, %26 ], [ %33, %30 ]
br label %36
36: ; preds = %34, %22, %14, %6
%37 = phi i1 [ true, %22 ], [ true, %14 ], [ true, %6 ], [ %35, %34 ]
%38 = zext i1 %37 to i32
ret i32 %38
}

LLVM IR (-O2):
define i32 @isspec(i8 signext %0) {
%2 = add i8 %0, -33
%3 = icmp ult i8 %2, 15
%4 = add i8 %0, -58
%5 = icmp ult i8 %4, 7
%6 = or i1 %3, %5
%7 = add i8 %0, -91
%8 = icmp ult i8 %7, 6
%9 = or i1 %8, %6
%10 = icmp sgt i8 %0, 122
%11 = or i1 %10, %9
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Type definitions */
struct ccnl_prefix_s {
  int dummy;
};

/* Variables and functions */
int ccnl_cistlv_prependChunkInterestWithHdr(struct ccnl_prefix_s *, int *,
                                            unsigned char *);
int ccnl_cistlv_prependInterestWithHdr(struct ccnl_prefix_s *name, int *offset,
                                       unsigned char *buf) {
  return ccnl_cistlv_prependChunkInterestWithHdr(name, offset, buf);
}


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

x86 assembly (clang, -O2):
<ccnl_cistlv_prependInterestWithHdr>:
jmp    1030 <ccnl_cistlv_prependChunkInterestWithHdr@plt>

LLVM IR (-O0):
%struct.ccnl_prefix_s = type { i32 }
define i32 @ccnl_cistlv_prependInterestWithHdr(%struct.ccnl_prefix_s* %0, i32* %1, i8* %2) {
%4 = alloca %struct.ccnl_prefix_s*
%5 = alloca i32*
%6 = alloca i8*
store %struct.ccnl_prefix_s* %0, %struct.ccnl_prefix_s** %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%7 = load %struct.ccnl_prefix_s*, %struct.ccnl_prefix_s** %4
%8 = load i32*, i32** %5
%9 = load i8*, i8** %6
%10 = call i32 @ccnl_cistlv_prependChunkInterestWithHdr(%struct.ccnl_prefix_s* %7, i32* %8, i8* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.ccnl_prefix_s = type { i32 }
define i32 @ccnl_cistlv_prependInterestWithHdr(%struct.ccnl_prefix_s* %0, i32* %1, i8* %2) {
%4 = tail call i32 @ccnl_cistlv_prependChunkInterestWithHdr(%struct.ccnl_prefix_s* %0, i32* %1, i8* %2)
ret i32 %4
}
/* Variables and functions */
long long tan(long long);
long long internal_tan_l(long long value) { return tan(value); }


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

x86 assembly (clang, -O2):
<internal_tan_l>:
jmp    1030 <tan@plt>

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

LLVM IR (-O2):
define i64 @internal_tan_l(i64 %0) {
%2 = tail call i64 @tan(i64 %0)
ret i64 %2
}
void repspaces(str) char *str;
{
  while (*str) {
    if (*str == ' ')
      *str = '0';
    ++str;
  }
}


x86 assembly (clang, -O0):
<repspaces>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113d <repspaces+0x3d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    112c <repspaces+0x2c>
mov    -0x8(%rbp),%rax
movb   $0x30,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <repspaces+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<repspaces>:
jmp    1117 <repspaces+0x17>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x30,(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0x20,%al
je     1110 <repspaces+0x10>
test   %al,%al
jne    1113 <repspaces+0x13>
ret

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

LLVM IR (-O2):
define void @repspaces(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
switch i8 %4, label %6 [
i8 0, label %8
i8 32, label %5
]
5: ; preds = %2
store i8 48, i8* %3
br label %6
6: ; preds = %2, %5
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
8: ; preds = %2
ret void
}
void foo507(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo507(i32 %0) {
ret void
}
int *getScalingArray(int number, int endsite, int mxtips, int *scalingArray) {
  return &(scalingArray[endsite * (number - mxtips - 1)]);
}


x86 assembly (clang, -O0):
<getScalingArray>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%edx
sub    -0xc(%rbp),%edx
sub    $0x1,%edx
imul   %edx,%ecx
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getScalingArray>:
not    %edx
add    %edi,%edx
imul   %esi,%edx
movslq %edx,%rax
lea    (%rcx,%rax,4),%rax
ret

LLVM IR (-O0):
define i32* @getScalingArray(i32 %0, i32 %1, i32 %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%9 = load i32*, i32** %8
%10 = load i32, i32* %6
%11 = load i32, i32* %5
%12 = load i32, i32* %7
%13 = sub nsw i32 %11, %12
%14 = sub nsw i32 %13, 1
%15 = mul nsw i32 %10, %14
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %9, i64 %16
ret i32* %17
}

LLVM IR (-O2):
define i32* @getScalingArray(i32 %0, i32 %1, i32 %2, i32* readnone %3) {
%5 = xor i32 %2, -1
%6 = add i32 %5, %0
%7 = mul nsw i32 %6, %1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %3, i64 %8
ret i32* %9
}
int fnFibonacci(int n) {
  if (0 == n || 1 == n)
    return n;
  else {
    return fnFibonacci(n - 1) + fnFibonacci(n - 2);
  }
}


x86 assembly (clang, -O0):
<fnFibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
je     1134 <fnFibonacci+0x24>
mov    $0x1,%eax
cmp    -0x8(%rbp),%eax
jne    113f <fnFibonacci+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1162 <fnFibonacci+0x52>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fnFibonacci@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fnFibonacci@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnFibonacci>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jb     1132 <fnFibonacci+0x22>
xor    %ebp,%ebp
xchg   %ax,%ax
lea    -0x1(%rbx),%edi
call   1030 <fnFibonacci@plt>
add    $0xfffffffe,%ebx
add    %eax,%ebp
cmp    $0x1,%ebx
ja     1120 <fnFibonacci+0x10>
add    %ebx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fnFibonacci(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fnFibonacci(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %8, 2
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %9, %3 ]
%13 = phi i32 [ %0, %1 ], [ %8, %3 ]
%14 = add nsw i32 %13, %12
ret i32 %14
}
float fahrenheit2celsius(float fahrenheit) { return (fahrenheit - 32) / 1.8; }


x86 assembly (clang, -O0):
<fahrenheit2celsius>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xef2(%rip),%xmm1
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeda(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fahrenheit2celsius>:
addss  0xef8(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
divsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @fahrenheit2celsius(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fsub float %3, 3.200000e+01
%5 = fpext float %4 to double
%6 = fdiv double %5, 1.800000e+00
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @fahrenheit2celsius(float %0) {
%2 = fadd float %0, -3.200000e+01
%3 = fpext float %2 to double
%4 = fdiv double %3, 1.800000e+00
%5 = fptrunc double %4 to float
ret float %5
}
/* Type definitions */
struct SN_env {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SN_close_env(struct SN_env *);
extern void porter_ISO_8859_1_close_env(struct SN_env *z) { SN_close_env(z); }


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

x86 assembly (clang, -O2):
<porter_ISO_8859_1_close_env>:
jmp    1030 <SN_close_env@plt>

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

LLVM IR (-O2):
%struct.SN_env = type { i32 }
define void @porter_ISO_8859_1_close_env(%struct.SN_env* %0) {
%2 = tail call i32 @SN_close_env(%struct.SN_env* %0)
ret void
}
/* Variables and functions */
float __infer_nondet_float();
float sinf(float x) { return __infer_nondet_float(); }


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

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

LLVM IR (-O0):
define float @sinf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = call float (...) @__infer_nondet_float()
ret float %3
}

LLVM IR (-O2):
define float @sinf(float %0) {
%2 = tail call float (...) @__infer_nondet_float()
ret float %2
}
long call_with_4_arg(int (*func)(), int argc, char **argv) {
  long ret;
  __asm__ __volatile__("movq %5,%%rcx\n\t"
                       "movq %4,%%rdx\n\t"
                       "movq %3,%%rsi\n\t"
                       "movq %2,%%rdi\n\t"
                       "xor %%rax,%%rax\n\t"
                       "call *%1\n\t"
                       "movq %%rax, %0"
                       : "=r"(ret)
                       : "r"(func), "m"(argv[3]), "m"(argv[4]), "m"(argv[5]),
                         "m"(argv[6])
                       : "rax", "rcx", "rdx", "rsi", "rdi");
  return ret;
}


x86 assembly (clang, -O0):
<call_with_4_arg>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%r8
mov    -0x20(%rbp),%r9
add    $0x18,%r9
mov    -0x20(%rbp),%r10
add    $0x20,%r10
mov    -0x20(%rbp),%r11
add    $0x28,%r11
mov    -0x20(%rbp),%rbx
add    $0x30,%rbx
mov    (%rbx),%rcx
mov    (%r11),%rdx
mov    (%r10),%rsi
mov    (%r9),%rdi
xor    %rax,%rax
call   *%r8
mov    %rax,%r8
mov    %r8,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_with_4_arg>:
mov    %rdx,%r8
mov    %rdi,%r9
mov    0x30(%r8),%rcx
mov    0x28(%r8),%rdx
mov    0x20(%r8),%rsi
mov    0x18(%r8),%rdi
xor    %rax,%rax
call   *%r9
mov    %rax,%r8
mov    %r8,%rax
ret

LLVM IR (-O0):
define i64 @call_with_4_arg(i32 (...)* %0, i32 %1, i8** %2) {
%4 = alloca i32 (...)*
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i64
store i32 (...)* %0, i32 (...)** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%8 = load i32 (...)*, i32 (...)** %4
%9 = load i8**, i8*** %6
%10 = getelementptr inbounds i8*, i8** %9, i64 3
%11 = load i8**, i8*** %6
%12 = getelementptr inbounds i8*, i8** %11, i64 4
%13 = load i8**, i8*** %6
%14 = getelementptr inbounds i8*, i8** %13, i64 5
%15 = load i8**, i8*** %6
%16 = getelementptr inbounds i8*, i8** %15, i64 6
%17 = call i64 asm sideeffect "movq $5,%rcx\0A\09movq $4,%rdx\0A\09movq $3,%rsi\0A\09movq $2,%rdi\0A\09xor %rax,%rax\0A\09call *$1\0A\09movq %rax, $0", "=r,r,*m,*m,*m,*m,~{rax},~{rcx},~{rdx},~{rsi},~{rdi},~{dirflag},~{fpsr},~{flags}"(i32 (...)* %8, i8** elementtype(i8*) %10, i8** elementtype(i8*) %12, i8** elementtype(i8*) %14, i8** elementtype(i8*) %16)
store i64 %17, i64* %7
%18 = load i64, i64* %7
ret i64 %18
}

LLVM IR (-O2):
define i64 @call_with_4_arg(i32 (...)* %0, i32 %1, i8** %2) {
%4 = getelementptr inbounds i8*, i8** %2, i64 3
%5 = getelementptr inbounds i8*, i8** %2, i64 4
%6 = getelementptr inbounds i8*, i8** %2, i64 5
%7 = getelementptr inbounds i8*, i8** %2, i64 6
%8 = tail call i64 asm sideeffect "movq $5,%rcx\0A\09movq $4,%rdx\0A\09movq $3,%rsi\0A\09movq $2,%rdi\0A\09xor %rax,%rax\0A\09call *$1\0A\09movq %rax, $0", "=r,r,*m,*m,*m,*m,~{rax},~{rcx},~{rdx},~{rsi},~{rdi},~{dirflag},~{fpsr},~{flags}"(i32 (...)* %0, i8** elementtype(i8*) %4, i8** elementtype(i8*) %5, i8** elementtype(i8*) %6, i8** elementtype(i8*) %7)
ret i64 %8
}
imm0adr1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if (22 <= (*((double *)11111111)))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<imm0adr1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    $0xa98ac7,%eax
movsd  (%rax),%xmm0
movsd  0xed3(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1143 <imm0adr1+0x43>
movl   $0x1,-0x4(%rbp)
jmp    114a <imm0adr1+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imm0adr1>:
movsd  0xa98ac7,%xmm0
xor    %eax,%eax
ucomisd 0xeed(%rip),%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @imm0adr1(double %0, double %1, i32 %2, i32 %3, double* %4, double* %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
store double %0, double* %8
store double %1, double* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store double* %4, double** %12
store double* %5, double** %13
%14 = load double, double* inttoptr (i64 11111111 to double*)
%15 = fcmp ole double 2.200000e+01, %14
br i1 %15, label %16, label %17
16: ; preds = %6
store i32 1, i32* %7
br label %18
17: ; preds = %6
store i32 0, i32* %7
br label %18
18: ; preds = %17, %16
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
define i32 @imm0adr1(double %0, double %1, i32 %2, i32 %3, double* nocapture readnone %4, double* nocapture readnone %5) {
%7 = load double, double* inttoptr (i64 11111111 to double*)
%8 = fcmp oge double %7, 2.200000e+01
%9 = zext i1 %8 to i32
ret i32 %9
}
float fahr_to_celsius(int temp) { return (5.0 / 9.0) * (temp - 32.0); }


x86 assembly (clang, -O0):
<fahr_to_celsius>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xef4(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xee0(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fahr_to_celsius>:
cvtsi2sd %edi,%xmm0
addsd  0xef4(%rip),%xmm0
mulsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @fahr_to_celsius(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fsub double %4, 3.200000e+01
%6 = fmul double 0x3FE1C71C71C71C72, %5
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @fahr_to_celsius(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fadd double %2, -3.200000e+01
%4 = fmul double %3, 0x3FE1C71C71C71C72
%5 = fptrunc double %4 to float
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ l1_cache_operate_on_line_range(int /*<<< orphan*/,
                                                  unsigned int, unsigned int);
__attribute__((always_)) void l1_cache_invalidate_range(unsigned addr,
                                                        unsigned size) {
  l1_cache_operate_on_line_range((0), addr, size);
}


x86 assembly (clang, -O0):
<l1_cache_invalidate_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
xor    %edi,%edi
call   1030 <l1_cache_operate_on_line_range@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<l1_cache_invalidate_range>:
mov    %esi,%edx
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <l1_cache_operate_on_line_range@plt>

LLVM IR (-O0):
define void @l1_cache_invalidate_range(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @l1_cache_operate_on_line_range(i32 0, i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @l1_cache_invalidate_range(i32 %0, i32 %1) {
%3 = tail call i32 @l1_cache_operate_on_line_range(i32 0, i32 %0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ parse_string(char const *, char const **);
ssize_t parse_dqstring(const char *buffer,
                       __attribute__((unused)) const char **error) {
  if (*buffer != '"')
    return 0;
  return parse_string(buffer, error);
}


x86 assembly (clang, -O0):
<parse_dqstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
je     113c <parse_dqstring+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    114c <parse_dqstring+0x3c>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <parse_string@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_dqstring>:
cmpb   $0x22,(%rdi)
jne    111a <parse_dqstring+0xa>
jmp    1030 <parse_string@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @parse_dqstring(i8* %0, i8** %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 34
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @parse_string(i8* %0, i8** %1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ 0, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ AUDIO_SET_AV_SYNC;
int ioctl(int, int /*<<< orphan*/, int);
int /*<<< orphan*/ perror(char *);
int audioSetAVSync(int fd, int state) {
  int ans;
  if ((ans = ioctl(fd, AUDIO_SET_AV_SYNC, state)) < 0) {
    perror("AUDIO SET AV SYNC: ");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<audioSetAVSync>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
call   1030 <ioctl@plt>
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
jge    1166 <audioSetAVSync+0x46>
lea    0xeab(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    116d <audioSetAVSync+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<audioSetAVSync>:
push   %rax
mov    %esi,%edx
mov    0x2ebe(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
js     113b <audioSetAVSync+0x1b>
pop    %rcx
ret
lea    0xebe(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@AUDIO_SET_AV_SYNC = global i32 0
@.str = [20 x i8] c"AUDIO SET AV SYNC: \00"
define i32 @audioSetAVSync(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = load i32, i32* @AUDIO_SET_AV_SYNC
%9 = load i32, i32* %5
%10 = call i32 @ioctl(i32 %7, i32 %8, i32 %9)
store i32 %10, i32* %6
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %15
14: ; preds = %2
store i32 0, i32* %3
br label %15
15: ; preds = %14, %12
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@AUDIO_SET_AV_SYNC = global i32 0
@.str = [20 x i8] c"AUDIO SET AV SYNC: \00"
define i32 @audioSetAVSync(i32 %0, i32 %1) {
%3 = load i32, i32* @AUDIO_SET_AV_SYNC
%4 = tail call i32 @ioctl(i32 %0, i32 %3, i32 %1)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ -1, %6 ], [ 0, %2 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ inet_addr(char const *);
const uint32_t getip(const char *ipstr) {
  return (const uint32_t)inet_addr(ipstr);
}


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

x86 assembly (clang, -O2):
<getip>:
jmp    1030 <inet_addr@plt>

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

LLVM IR (-O2):
define i32 @getip(i8* %0) {
%2 = tail call i32 @inet_addr(i8* %0)
ret i32 %2
}
int main(int argc, const char *argv[]) {
  int i = 1;
  while (i) {
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1128 <main+0x28>
jmp    1119 <main+0x19>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
br label %3
}
char *_Tokenizer(char *args, const char Keyword) {
  int i = 0;
  while (args[i] != Keyword && args[i] != '\0')
    i++;
  return &args[i];
}


x86 assembly (clang, -O0):
<_Tokenizer>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
movsbl -0x9(%rbp),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x11(%rbp)
je     1147 <_Tokenizer+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1157 <_Tokenizer+0x57>
jmp    1165 <_Tokenizer+0x65>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1115 <_Tokenizer+0x15>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Tokenizer>:
mov    %rdi,%rax
mov    $0xffffffffffffffff,%rcx
nopw   0x0(%rax,%rax,1)
movzbl 0x1(%rax,%rcx,1),%edx
add    $0x1,%rcx
cmp    %sil,%dl
je     1122 <_Tokenizer+0x22>
test   %dl,%dl
jne    1110 <_Tokenizer+0x10>
mov    %ecx,%ecx
add    %rcx,%rax
ret

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

LLVM IR (-O2):
define i8* @_Tokenizer(i8* %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %10, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, %1
%8 = icmp eq i8 %6, 0
%9 = or i1 %7, %8
%10 = add nuw i64 %4, 1
br i1 %9, label %11, label %3
11: ; preds = %3
%12 = and i64 %4, 4294967295
%13 = getelementptr inbounds i8, i8* %0, i64 %12
ret i8* %13
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ prg8setBank2(int);
void m40setParamsE000(uint16_t addr, uint8_t val) {
  (void)addr;
  prg8setBank2(val << 13);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
shl    $0xd,%edi
call   1030 <prg8setBank2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    %esi,%edi
shl    $0xd,%edi
jmp    1030 <prg8setBank2@plt>

LLVM IR (-O0):
define void @m40setParamsE000(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 %6, 13
%8 = call i32 @prg8setBank2(i32 %7)
ret void
}

LLVM IR (-O2):
define void @m40setParamsE000(i32 %0, i32 %1) {
%3 = shl i32 %1, 13
%4 = tail call i32 @prg8setBank2(i32 %3)
ret void
}
/* Variables and functions */
void *malloc(unsigned long);
void *di(unsigned long q) {
  void *dh = malloc(q);
  return dh;
}


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

x86 assembly (clang, -O2):
<di>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @di(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
ret i8* %6
}

LLVM IR (-O2):
define noalias i8* @di(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
int main() {
  int x;
  int y;
  x = 3;
  y = ++x + 2;
  return x + y;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
store i32 %5, i32* %2
%6 = add nsw i32 %5, 2
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = add nsw i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
ret i32 10
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
scalar_t__ handle_stray_noerror();
void handle_stray(void) {
  if (handle_stray_noerror())
    error("stray '\\' in program");
}


x86 assembly (clang, -O0):
<handle_stray>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <handle_stray_noerror@plt>
cmp    $0x0,%rax
je     1141 <handle_stray+0x21>
lea    0xec4(%rip),%rdi
call   1040 <error@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_stray>:
push   %rax
xor    %eax,%eax
call   1030 <handle_stray_noerror@plt>
test   %rax,%rax
je     113a <handle_stray+0x1a>
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <error@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [21 x i8] c"stray '\\' in program\00"
define void @handle_stray() {
%1 = call i64 (...) @handle_stray_noerror()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @error(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"stray '\\' in program\00"
define void @handle_stray() {
%1 = tail call i64 (...) @handle_stray_noerror()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @error(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret void
}
unsigned short _2bytesToUShort(const unsigned char *_2bytes) {
  return (_2bytes[1] * 0x100 + _2bytes[0]);
}


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

x86 assembly (clang, -O2):
<_2bytesToUShort>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
define zeroext i16 @_2bytesToUShort(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = mul nsw i32 %6, 256
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = add nsw i32 %7, %11
%13 = trunc i32 %12 to i16
ret i16 %13
}

LLVM IR (-O2):
define zeroext i16 @_2bytesToUShort(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = zext i8 %3 to i16
%5 = shl nuw i16 %4, 8
%6 = load i8, i8* %0
%7 = zext i8 %6 to i16
%8 = or i16 %5, %7
ret i16 %8
}
/* Variables and functions */
int rand();
int rand_num(void) { return rand() % 100 + 1; }


x86 assembly (clang, -O0):
<rand_num>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_num>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rand_num() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 100
%3 = add nsw i32 %2, 1
ret i32 %3
}

LLVM IR (-O2):
define i32 @rand_num() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 100
%3 = add nsw i32 %2, 1
ret i32 %3
}
/* Type definitions */
typedef int u_int32_t;

/* Variables and functions */
int htons(int);
u_int32_t wrapsum(u_int32_t sum) {
  sum = ~sum & 0xFFFF;
  return (htons(sum));
}


x86 assembly (clang, -O0):
<wrapsum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
and    $0xffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <htons@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrapsum>:
not    %edi
movzwl %di,%edi
jmp    1030 <htons@plt>

LLVM IR (-O0):
define i32 @wrapsum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = xor i32 %3, -1
%5 = and i32 %4, 65535
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @htons(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @wrapsum(i32 %0) {
%2 = and i32 %0, 65535
%3 = xor i32 %2, 65535
%4 = tail call i32 @htons(i32 %3)
ret i32 %4
}
/* Variables and functions */
char bdos(int, int);
int /*<<< orphan*/ flush();
int /*<<< orphan*/ printf(char *);
int waitakey() {
  char c;
  printf("\n Any key to continue: ");
  flush();
  while (!(c = bdos(6, 0xff)))
    ;
  return c;
}


x86 assembly (clang, -O0):
<waitakey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <flush@plt>
mov    $0x6,%edi
mov    $0xff,%esi
call   1050 <bdos@plt>
mov    %al,-0x1(%rbp)
cmp    $0x0,%al
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1171 <waitakey+0x41>
jmp    1176 <waitakey+0x46>
jmp    114b <waitakey+0x1b>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitakey>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <flush@plt>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x6,%edi
mov    $0xff,%esi
call   1050 <bdos@plt>
test   %al,%al
je     1150 <waitakey+0x20>
movsbl %al,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"\0A Any key to continue: \00"
define i32 @waitakey() {
%1 = alloca i8
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @flush()
br label %4
4: ; preds = %8, %0
%5 = call signext i8 @bdos(i32 6, i32 255)
store i8 %5, i8* %1
%6 = icmp ne i8 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %9
8: ; preds = %4
br label %4
9: ; preds = %4
%10 = load i8, i8* %1
%11 = sext i8 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
@.str = [24 x i8] c"\0A Any key to continue: \00"
define i32 @waitakey() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @flush()
br label %3
3: ; preds = %3, %0
%4 = tail call signext i8 @bdos(i32 6, i32 255)
%5 = icmp eq i8 %4, 0
br i1 %5, label %3, label %6
6: ; preds = %3
%7 = sext i8 %4 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ shit(int, int);
int main(int argc, char *argv[]) {
  printf("THINGS\n");
  shit(argc, 7);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
mov    $0x7,%esi
call   1040 <shit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
mov    $0x7,%esi
call   1040 <shit@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@str = [7 x i8] c"THINGS\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @shit(i32 %0, i32 7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free_token(char *);
void pevent_free_token(char *token) { free_token(token); }


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

x86 assembly (clang, -O2):
<pevent_free_token>:
jmp    1030 <free_token@plt>

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

LLVM IR (-O2):
define void @pevent_free_token(i8* %0) {
%2 = tail call i32 @free_token(i8* %0)
ret void
}
/* Type definitions */
struct args_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ out_str(char *);
char doGet(struct args_t *args) {
  out_str("somebody knocked: ");
  return 1;
}


x86 assembly (clang, -O0):
<doGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <out_str@plt>
mov    $0x1,%al
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doGet>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <out_str@plt>
mov    $0x1,%al
pop    %rcx
ret

LLVM IR (-O0):
%struct.args_t = type { i32 }
@.str = [19 x i8] c"somebody knocked: \00"
define signext i8 @doGet(%struct.args_t* %0) {
%2 = alloca %struct.args_t*
store %struct.args_t* %0, %struct.args_t** %2
%3 = call i32 @out_str(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i8 1
}

LLVM IR (-O2):
%struct.args_t = type { i32 }
@.str = [19 x i8] c"somebody knocked: \00"
define signext i8 @doGet(%struct.args_t* nocapture readnone %0) {
%2 = tail call i32 @out_str(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i8 1
}
double triangle(double a, double b, double c) {
  return (0x1p-2 *
          sqrt((a + (b + c)) * (a + (b - c)) * (c + (a - b)) * (c - (a - b))));
}


x86 assembly (clang, -O0):
<triangle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
addsd  -0x18(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
subsd  -0x18(%rbp),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
subsd  -0x10(%rbp),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
subsd  -0x10(%rbp),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xe71(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<triangle>:
push   %rax
movapd %xmm1,%xmm3
addsd  %xmm2,%xmm3
addsd  %xmm0,%xmm3
movapd %xmm1,%xmm4
subsd  %xmm2,%xmm4
addsd  %xmm0,%xmm4
mulsd  %xmm3,%xmm4
subsd  %xmm1,%xmm0
movapd %xmm0,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm4,%xmm1
subsd  %xmm0,%xmm2
mulsd  %xmm1,%xmm2
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm2
jb     1158 <triangle+0x48>
xorps  %xmm0,%xmm0
sqrtsd %xmm2,%xmm0
jmp    1161 <triangle+0x51>
movapd %xmm2,%xmm0
call   1030 <sqrt@plt>
mulsd  0xe97(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @triangle(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* %5
%9 = load double, double* %6
%10 = fadd double %8, %9
%11 = fadd double %7, %10
%12 = load double, double* %4
%13 = load double, double* %5
%14 = load double, double* %6
%15 = fsub double %13, %14
%16 = fadd double %12, %15
%17 = fmul double %11, %16
%18 = load double, double* %6
%19 = load double, double* %4
%20 = load double, double* %5
%21 = fsub double %19, %20
%22 = fadd double %18, %21
%23 = fmul double %17, %22
%24 = load double, double* %6
%25 = load double, double* %4
%26 = load double, double* %5
%27 = fsub double %25, %26
%28 = fsub double %24, %27
%29 = fmul double %23, %28
%30 = call double @sqrt(double %29)
%31 = fmul double 2.500000e-01, %30
ret double %31
}

LLVM IR (-O2):
define double @triangle(double %0, double %1, double %2) {
%4 = fadd double %1, %2
%5 = fadd double %4, %0
%6 = fsub double %1, %2
%7 = fadd double %6, %0
%8 = fmul double %5, %7
%9 = fsub double %0, %1
%10 = fadd double %9, %2
%11 = fmul double %10, %8
%12 = fsub double %2, %9
%13 = fmul double %12, %11
%14 = tail call double @sqrt(double %13)
%15 = fmul double %14, 2.500000e-01
ret double %15
}
const char *SDL_GetPlatform() { return "Linux"; }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"Linux\00"
define i8* @SDL_GetPlatform() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long, long);
int main() {
  long n3 = 2000000000;
  long n4 = 1234567890;
  printf("%ld, %ld\n", n3, n4);
  printf("%lld, %lld\n", n3, n4);
  printf("%Ld, %Ld\n", n3, n4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x77359400,-0x10(%rbp)
77
movq   $0x499602d2,-0x18(%rbp)
49
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x77359400,%esi
mov    $0x499602d2,%edx
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
mov    $0x77359400,%esi
mov    $0x499602d2,%edx
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
mov    $0x77359400,%esi
mov    $0x499602d2,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%ld, %ld\0A\00"
@.str.1 = [12 x i8] c"%lld, %lld\0A\00"
@.str.2 = [10 x i8] c"%Ld, %Ld\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 2000000000, i64 1234567890)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i64 2000000000, i64 1234567890)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i64 2000000000, i64 1234567890)
ret i32 0
}
__attribute__((noreturn)) void hp1(void) { __builtin_unreachable(); }


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

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @hp1() {
unreachable
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void lsmash_freep(void *ptrptr) {
  if (!ptrptr)
    return;
  void **ptr = (void **)ptrptr;
  free(*ptr);
  *ptr = NULL;
}


x86 assembly (clang, -O0):
<lsmash_freep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <lsmash_freep+0x1c>
jmp    114b <lsmash_freep+0x3b>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lsmash_freep>:
test   %rdi,%rdi
je     1129 <lsmash_freep+0x19>
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @lsmash_freep(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = bitcast i8* %0 to i8**
%5 = load i8*, i8** %4
%6 = tail call i32 @free(i8* %5)
store i8* null, i8** %4
br label %7
7: ; preds = %1, %3
ret void
}