xunge/DecIR huggingface dataset:
short byteswap_short(short number) {
  unsigned char leftmost = 255, rightmost = 255;
  leftmost &= number;
  rightmost &= (number >> 8);
  return (leftmost << 8) + rightmost;
}


x86 assembly (clang, -O0):
<byteswap_short>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movb   $0xff,-0x3(%rbp)
movb   $0xff,-0x4(%rbp)
movswl -0x2(%rbp),%ecx
movzbl -0x3(%rbp),%eax
and    %ecx,%eax
mov    %al,-0x3(%rbp)
movswl -0x2(%rbp),%ecx
sar    $0x8,%ecx
movzbl -0x4(%rbp),%eax
and    %ecx,%eax
mov    %al,-0x4(%rbp)
movzbl -0x3(%rbp),%eax
shl    $0x8,%eax
movzbl -0x4(%rbp),%ecx
add    %ecx,%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<byteswap_short>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define signext i16 @byteswap_short(i16 signext %0) {
%2 = alloca i16
%3 = alloca i8
%4 = alloca i8
store i16 %0, i16* %2
store i8 -1, i8* %3
store i8 -1, i8* %4
%5 = load i16, i16* %2
%6 = sext i16 %5 to i32
%7 = load i8, i8* %3
%8 = zext i8 %7 to i32
%9 = and i32 %8, %6
%10 = trunc i32 %9 to i8
store i8 %10, i8* %3
%11 = load i16, i16* %2
%12 = sext i16 %11 to i32
%13 = ashr i32 %12, 8
%14 = load i8, i8* %4
%15 = zext i8 %14 to i32
%16 = and i32 %15, %13
%17 = trunc i32 %16 to i8
store i8 %17, i8* %4
%18 = load i8, i8* %3
%19 = zext i8 %18 to i32
%20 = shl i32 %19, 8
%21 = load i8, i8* %4
%22 = zext i8 %21 to i32
%23 = add nsw i32 %20, %22
%24 = trunc i32 %23 to i16
ret i16 %24
}

LLVM IR (-O2):
define signext i16 @byteswap_short(i16 signext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
unsigned digits(unsigned n) { return n ? 1 + digits(n / 10) : n; }


x86 assembly (clang, -O0):
<digits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1143 <digits+0x33>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%edi
call   1030 <digits@plt>
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1149 <digits+0x39>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<digits>:
xor    %eax,%eax
test   %edi,%edi
je     1124 <digits+0x24>
mov    $0xcccccccd,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
add    $0x1,%eax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <digits+0x10>
ret

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

LLVM IR (-O2):
define i32 @digits(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = phi i32 [ %7, %3 ], [ 0, %1 ]
%6 = udiv i32 %4, 10
%7 = add i32 %5, 1
%8 = icmp ult i32 %4, 10
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
void test55_PrintImpl_printReal__E(float f) { printf("%f", (float)f); }


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

x86 assembly (clang, -O2):
<test55_PrintImpl_printReal__E>:
lea    0xee9(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define void @test55_PrintImpl_printReal__E(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %3)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define void @test55_PrintImpl_printReal__E(float %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %0)
ret void
}
reg0adr1_set(r0, r1, x0, x1, p0, p1) float r0, r1;
float *p0, *p1;
{ r0 = (*((float *)(11111111 & ~(__alignof__(float) - 1)))); }


x86 assembly (clang, -O0):
<reg0adr1_set>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm1,-0x30(%rbp)
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    $0xa98ac4,%eax
movss  (%rax),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @reg0adr1_set(double %0, double %1, i32 %2, i32 %3, float* %4, float* %5) {
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca i32
%11 = alloca i32
%12 = alloca float*
%13 = alloca float*
%14 = fptrunc double %0 to float
%15 = fptrunc double %1 to float
store float %14, float* %8
store float %15, float* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store float* %4, float** %12
store float* %5, float** %13
%16 = load float, float* inttoptr (i64 11111108 to float*)
store float %16, float* %8
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
define i32 @reg0adr1_set(double %0, double %1, i32 %2, i32 %3, float* nocapture readnone %4, float* nocapture readnone %5) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ uioPrintChar(char const);
void uioPrint(const char *string) {
  for (const char *p = string; *p; p++)
    uioPrintChar(*p);
}


x86 assembly (clang, -O0):
<uioPrint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <uioPrint+0x3e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <uioPrintChar@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <uioPrint+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uioPrint>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <uioPrint+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <uioPrintChar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <uioPrint+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @uioPrint(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %1
ret void
5: ; preds = %1, %5
%6 = phi i8 [ %10, %5 ], [ %2, %1 ]
%7 = phi i8* [ %9, %5 ], [ %0, %1 ]
%8 = tail call i32 @uioPrintChar(i8 signext %6)
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %4, label %5
}
/* Type definitions */
typedef int /*<<< orphan*/ PKCS8_PRIV_KEY_INFO;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int /*<<< orphan*/ *ASN1_item_d2i_bio(int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ **);
int /*<<< orphan*/ PKCS8_PRIV_KEY_INFO_it;
PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_bio(BIO *bp,
                                                 PKCS8_PRIV_KEY_INFO **p8inf) {
  return ASN1_item_d2i_bio(&PKCS8_PRIV_KEY_INFO_it, bp, p8inf);
}


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

x86 assembly (clang, -O2):
<d2i_PKCS8_PRIV_KEY_INFO_bio>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ec3(%rip),%rdi
jmp    1030 <ASN1_item_d2i_bio@plt>

LLVM IR (-O0):
@PKCS8_PRIV_KEY_INFO_it = global i32 0
define i32* @d2i_PKCS8_PRIV_KEY_INFO_bio(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* @ASN1_item_d2i_bio(i32* @PKCS8_PRIV_KEY_INFO_it, i32* %5, i32** %6)
ret i32* %7
}

LLVM IR (-O2):
@PKCS8_PRIV_KEY_INFO_it = global i32 0
define i32* @d2i_PKCS8_PRIV_KEY_INFO_bio(i32* %0, i32** %1) {
%3 = tail call i32* @ASN1_item_d2i_bio(i32* @PKCS8_PRIV_KEY_INFO_it, i32* %0, i32** %1)
ret i32* %3
}
int FindStartCode2(unsigned char *Buf) {
  if (Buf[0] != 0 || Buf[1] != 0 || Buf[2] != 1)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<FindStartCode2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x0,%eax
jne    113a <FindStartCode2+0x3a>
mov    -0x10(%rbp),%rax
movzbl 0x1(%rax),%eax
cmp    $0x0,%eax
jne    113a <FindStartCode2+0x3a>
mov    -0x10(%rbp),%rax
movzbl 0x2(%rax),%eax
cmp    $0x1,%eax
je     1146 <FindStartCode2+0x46>
movl   $0x0,-0x4(%rbp)
jmp    114d <FindStartCode2+0x4d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FindStartCode2>:
xor    %eax,%eax
cmpb   $0x0,(%rdi)
je     1108 <FindStartCode2+0x8>
ret
cmpb   $0x0,0x1(%rdi)
jne    1107 <FindStartCode2+0x7>
xor    %eax,%eax
cmpb   $0x1,0x2(%rdi)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @FindStartCode2(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 1
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %8, %1, %4
%14 = phi i32 [ 0, %4 ], [ 0, %1 ], [ %12, %8 ]
ret i32 %14
}
float test5f(float a, float b) { return __builtin_copysignf(a, b); }


x86 assembly (clang, -O0):
<test5f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movaps 0xee1(%rip),%xmm2
pand   %xmm2,%xmm1
movaps 0xee6(%rip),%xmm2
pand   %xmm2,%xmm0
por    %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<test5f>:
andps  0xef9(%rip),%xmm1
andps  0xf02(%rip),%xmm0
orps   %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @test5f(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @llvm.copysign.f32(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @test5f(float %0, float %1) {
%3 = tail call float @llvm.copysign.f32(float %0, float %1)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ __print_int(int);
int main() {
  int i = 0;
  int a;
  while (i < 5) {
    a = 5;
    i++;
  }
  __print_int(a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1145 <main+0x35>
movl   $0x5,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0xc(%rbp),%edi
call   1030 <__print_int@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1030 <__print_int@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__print_int(i32 5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_python_strings() {
  test_parser_verify_parse(
      test_parser_sourcefile("python", "\"abc#not a 'comment\""), "python",
      "\"abc#not a 'comment\"", "", 0);
}


x86 assembly (clang, -O0):
<test_python_strings>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xec0(%rip),%rdx
lea    0xecd(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_python_strings>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rbx
lea    0xed5(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <test_parser_sourcefile@plt>
lea    0xed7(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %r8d,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"python\00"
@.str.1 = [21 x i8] c"\22abc#not a 'comment\22\00"
@.str.2 = [1 x i8] zeroinitializer
define void @test_python_strings() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"python\00"
@.str.1 = [21 x i8] c"\22abc#not a 'comment\22\00"
@.str.2 = [1 x i8] zeroinitializer
define void @test_python_strings() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i32 0)
ret void
}
void rcu_early_boot_tests(void) {}


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

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

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

LLVM IR (-O2):
define void @rcu_early_boot_tests() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *progname) {
  printf("\nUsage: %s <SIGNAL> <PID>\n\n"
         "  SIGNAL is a valid signal name on your linux system\n"
         "  PID    is a valid process id\n\n"
         "Exit codes:\n"
         "  0) Success\n"
         "  1) Invalid signal name\n"
         "  2) Invalid pid\n"
         "  3) Process not running\n"
         "  4) Failed to send signal\n"
         "  5) Missing Parameter\n\n"
         "See sig.h for supported signals.\n\n",
         progname);
}


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

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

LLVM IR (-O0):
@.str = [290 x i8] c"\0AUsage: %s <SIGNAL> <PID>\0A\0A SIGNAL is a valid signal name on your linux system\0A PID is a valid process id\0A\0AExit codes:\0A 0) Success\0A 1) Invalid signal name\0A 2) Invalid pid\0A 3) Process not running\0A 4) Failed to send signal\0A 5) Missing Parameter\0A\0ASee sig.h for supported signals.\0A\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([290 x i8], [290 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [290 x i8] c"\0AUsage: %s <SIGNAL> <PID>\0A\0A SIGNAL is a valid signal name on your linux system\0A PID is a valid process id\0A\0AExit codes:\0A 0) Success\0A 1) Invalid signal name\0A 2) Invalid pid\0A 3) Process not running\0A 4) Failed to send signal\0A 5) Missing Parameter\0A\0ASee sig.h for supported signals.\0A\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([290 x i8], [290 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct _Locale_name_hint {
  int dummy;
};
struct _Locale_messages {
  int dummy;
};

/* Variables and functions */
struct _Locale_name_hint *
_Locale_get_messages_hint(struct _Locale_messages *messages) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct._Locale_name_hint = type { i32 }
%struct._Locale_messages = type { i32 }
define %struct._Locale_name_hint* @_Locale_get_messages_hint(%struct._Locale_messages* %0) {
%2 = alloca %struct._Locale_messages*
store %struct._Locale_messages* %0, %struct._Locale_messages** %2
ret %struct._Locale_name_hint* null
}

LLVM IR (-O2):
%struct._Locale_name_hint = type { i32 }
%struct._Locale_messages = type { i32 }
define noalias %struct._Locale_name_hint* @_Locale_get_messages_hint(%struct._Locale_messages* nocapture readnone %0) {
ret %struct._Locale_name_hint* null
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void __gnat_raise_program_error(void) { abort(); }


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

x86 assembly (clang, -O2):
<__gnat_raise_program_error>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @__gnat_raise_program_error() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @__gnat_raise_program_error() {
%1 = tail call i32 (...) @abort()
unreachable
}
void badcnt(s) char *s;
{ errx(1, "%s: bad byte count", s); }


x86 assembly (clang, -O0):
<badcnt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x1,%edi
lea    0xed4(%rip),%rsi
mov    $0x0,%al
call   1030 <errx@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<badcnt>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
jmp    1030 <errx@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"%s: bad byte count\00"
define void @badcnt(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @errx to i32 (i32, i8*, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"%s: bad byte count\00"
define void @badcnt(i8* %0) {
%2 = tail call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @errx to i32 (i32, i8*, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
const char *Assign_Definition(void) {
  return "struct Assign {\n"
         "  void (*assign)(var, var);\n"
         "};\n";
}


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

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

LLVM IR (-O0):
@.str = [48 x i8] c"struct Assign {\0A void (*assign)(var, var);\0A};\0A\00"
define i8* @Assign_Definition() {
ret i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [48 x i8] c"struct Assign {\0A void (*assign)(var, var);\0A};\0A\00"
define i8* @Assign_Definition() {
ret i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("This program needs to be replaced.");
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"This program needs to be replaced.\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"This program needs to be replaced.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void XcmsAllocNamedColor() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
int elog(char *msg) {
  FILE *fp = fopen("debug.log", "a+");
  if (NULL != fp) {
    perror("fopen");
    exit(1);
  }
  fputs(msg, fp);
  return 0;
}


x86 assembly (clang, -O0):
<elog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xead(%rip),%rdi
lea    0xeb0(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
je     1185 <elog+0x45>
lea    0xe97(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <fputs@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<elog>:
push   %rbx
mov    %rdi,%rbx
lea    0xeb5(%rip),%rdi
lea    0xeb8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
jne    116a <elog+0x2a>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <fputs@plt>
xor    %eax,%eax
pop    %rbx
ret
lea    0xe9c(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"debug.log\00"
@.str.1 = [3 x i8] c"a+\00"
@.str.2 = [6 x i8] c"fopen\00"
define i32 @elog(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
%8 = tail call i32 @fputs(i8* %0, i32* null)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ window;
};
struct TYPE_4__ {
  TYPE_1__ xselectionclear;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned long get_XEvent_xselectionclear_window(void *_p) {
  return (unsigned long)((XEvent *)_p)->xselectionclear.window;
}


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

x86 assembly (clang, -O2):
<get_XEvent_xselectionclear_window>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i64 @get_XEvent_xselectionclear_window(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @get_XEvent_xselectionclear_window(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
void upvp_to_xy(double up, double vp, double *xc, double *yc) {
  *xc = 9 * up / (6 * up - 16 * vp + 12);
  *yc = 4 * vp / (6 * up - 16 * vp + 12);
}


x86 assembly (clang, -O0):
<upvp_to_xy>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movsd  0xf02(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xee0(%rip),%xmm2
mulsd  -0x10(%rbp),%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
movsd  0xeb4(%rip),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  0xe9c(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xe9c(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xe82(%rip),%xmm2
mulsd  -0x10(%rbp),%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
movsd  0xe56(%rip),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  0xe3e(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<upvp_to_xy>:
movsd  0xef8(%rip),%xmm2
mulsd  %xmm0,%xmm2
movsd  0xef4(%rip),%xmm3
mulsd  %xmm1,%xmm3
mulsd  0xef0(%rip),%xmm0
addsd  %xmm3,%xmm0
addsd  0xeec(%rip),%xmm0
divsd  %xmm0,%xmm2
movsd  %xmm2,(%rdi)
mulsd  0xee4(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rsi)
ret

LLVM IR (-O0):
define void @upvp_to_xy(double %0, double %1, double* %2, double* %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double*
%8 = alloca double*
store double %0, double* %5
store double %1, double* %6
store double* %2, double** %7
store double* %3, double** %8
%9 = load double, double* %5
%10 = fmul double 9.000000e+00, %9
%11 = load double, double* %5
%12 = load double, double* %6
%13 = fmul double 1.600000e+01, %12
%14 = fneg double %13
%15 = call double @llvm.fmuladd.f64(double 6.000000e+00, double %11, double %14)
%16 = fadd double %15, 1.200000e+01
%17 = fdiv double %10, %16
%18 = load double*, double** %7
store double %17, double* %18
%19 = load double, double* %6
%20 = fmul double 4.000000e+00, %19
%21 = load double, double* %5
%22 = load double, double* %6
%23 = fmul double 1.600000e+01, %22
%24 = fneg double %23
%25 = call double @llvm.fmuladd.f64(double 6.000000e+00, double %21, double %24)
%26 = fadd double %25, 1.200000e+01
%27 = fdiv double %20, %26
%28 = load double*, double** %8
store double %27, double* %28
ret void
}

LLVM IR (-O2):
define void @upvp_to_xy(double %0, double %1, double* nocapture writeonly %2, double* nocapture writeonly %3) {
%5 = fmul double %0, 9.000000e+00
%6 = fmul double %1, -1.600000e+01
%7 = tail call double @llvm.fmuladd.f64(double %0, double 6.000000e+00, double %6)
%8 = fadd double %7, 1.200000e+01
%9 = fdiv double %5, %8
store double %9, double* %2
%10 = fmul double %1, 4.000000e+00
%11 = fdiv double %10, %8
store double %11, double* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void displayQuitMessage() { puts("\nThanks for playing The Message."); }


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

x86 assembly (clang, -O2):
<displayQuitMessage>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"\0AThanks for playing The Message.\00"
define void @displayQuitMessage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"\0AThanks for playing The Message.\00"
define void @displayQuitMessage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double arctan26(double, double);
double arctan2(double x, double y) { return arctan26(x, y); }


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

x86 assembly (clang, -O2):
<arctan2>:
jmp    1030 <arctan26@plt>

LLVM IR (-O0):
define double @arctan2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @arctan26(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @arctan2(double %0, double %1) {
%3 = tail call double @arctan26(double %0, double %1)
ret double %3
}
int ls_costN_nm7_work(int *sz_arg, int *sz_res, int *sz_iw, int *sz_w) {
  if (sz_arg)
    *sz_arg = 1;
  if (sz_res)
    *sz_res = 2;
  if (sz_iw)
    *sz_iw = 0;
  if (sz_w)
    *sz_w = 1;
  return 0;
}


x86 assembly (clang, -O0):
<ls_costN_nm7_work>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1129 <ls_costN_nm7_work+0x29>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     113e <ls_costN_nm7_work+0x3e>
mov    -0x10(%rbp),%rax
movl   $0x2,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     1153 <ls_costN_nm7_work+0x53>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     1168 <ls_costN_nm7_work+0x68>
mov    -0x20(%rbp),%rax
movl   $0x1,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_costN_nm7_work>:
test   %rdi,%rdi
je     110b <ls_costN_nm7_work+0xb>
movl   $0x1,(%rdi)
test   %rsi,%rsi
je     1116 <ls_costN_nm7_work+0x16>
movl   $0x2,(%rsi)
test   %rdx,%rdx
je     1121 <ls_costN_nm7_work+0x21>
movl   $0x0,(%rdx)
test   %rcx,%rcx
je     112c <ls_costN_nm7_work+0x2c>
movl   $0x1,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @ls_costN_nm7_work(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** %5
%10 = icmp ne i32* %9, null
br i1 %10, label %11, label %13
11: ; preds = %4
%12 = load i32*, i32** %5
store i32 1, i32* %12
br label %13
13: ; preds = %11, %4
%14 = load i32*, i32** %6
%15 = icmp ne i32* %14, null
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = load i32*, i32** %6
store i32 2, i32* %17
br label %18
18: ; preds = %16, %13
%19 = load i32*, i32** %7
%20 = icmp ne i32* %19, null
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = load i32*, i32** %7
store i32 0, i32* %22
br label %23
23: ; preds = %21, %18
%24 = load i32*, i32** %8
%25 = icmp ne i32* %24, null
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = load i32*, i32** %8
store i32 1, i32* %27
br label %28
28: ; preds = %26, %23
ret i32 0
}

LLVM IR (-O2):
define i32 @ls_costN_nm7_work(i32* writeonly %0, i32* writeonly %1, i32* writeonly %2, i32* writeonly %3) {
%5 = icmp eq i32* %0, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i32 1, i32* %0
br label %7
7: ; preds = %6, %4
%8 = icmp eq i32* %1, null
br i1 %8, label %10, label %9
9: ; preds = %7
store i32 2, i32* %1
br label %10
10: ; preds = %9, %7
%11 = icmp eq i32* %2, null
br i1 %11, label %13, label %12
12: ; preds = %10
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10
%14 = icmp eq i32* %3, null
br i1 %14, label %16, label %15
15: ; preds = %13
store i32 1, i32* %3
br label %16
16: ; preds = %15, %13
ret i32 0
}
/* Type definitions */
struct cx18_stream {
  int dummy;
};
struct cx18_queue {
  int dummy;
};
struct cx18_mdl {
  int dummy;
};

/* Variables and functions */
struct cx18_queue *_cx18_enqueue(struct cx18_stream *, struct cx18_mdl *,
                                 struct cx18_queue *, int);
struct cx18_queue *cx18_push(struct cx18_stream *s, struct cx18_mdl *mdl,
                             struct cx18_queue *q) {
  return _cx18_enqueue(s, mdl, q, 1);
}


x86 assembly (clang, -O0):
<cx18_push>:
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
mov    $0x1,%ecx
call   1030 <_cx18_enqueue@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cx18_push>:
mov    $0x1,%ecx
jmp    1030 <_cx18_enqueue@plt>

LLVM IR (-O0):
%struct.cx18_stream = type { i32 }
%struct.cx18_mdl = type { i32 }
%struct.cx18_queue = type { i32 }
define %struct.cx18_queue* @cx18_push(%struct.cx18_stream* %0, %struct.cx18_mdl* %1, %struct.cx18_queue* %2) {
%4 = alloca %struct.cx18_stream*
%5 = alloca %struct.cx18_mdl*
%6 = alloca %struct.cx18_queue*
store %struct.cx18_stream* %0, %struct.cx18_stream** %4
store %struct.cx18_mdl* %1, %struct.cx18_mdl** %5
store %struct.cx18_queue* %2, %struct.cx18_queue** %6
%7 = load %struct.cx18_stream*, %struct.cx18_stream** %4
%8 = load %struct.cx18_mdl*, %struct.cx18_mdl** %5
%9 = load %struct.cx18_queue*, %struct.cx18_queue** %6
%10 = call %struct.cx18_queue* @_cx18_enqueue(%struct.cx18_stream* %7, %struct.cx18_mdl* %8, %struct.cx18_queue* %9, i32 1)
ret %struct.cx18_queue* %10
}

LLVM IR (-O2):
%struct.cx18_stream = type { i32 }
%struct.cx18_mdl = type { i32 }
%struct.cx18_queue = type { i32 }
define %struct.cx18_queue* @cx18_push(%struct.cx18_stream* %0, %struct.cx18_mdl* %1, %struct.cx18_queue* %2) {
%4 = tail call %struct.cx18_queue* @_cx18_enqueue(%struct.cx18_stream* %0, %struct.cx18_mdl* %1, %struct.cx18_queue* %2, i32 1)
ret %struct.cx18_queue* %4
}
int useit(val)
int val;
{
  static int usedval;
  usedval = val;
  return val + sum_upto(0);
}


x86 assembly (clang, -O0):
<useit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,0x2f08(%rip)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
xor    %edi,%edi
mov    $0x0,%al
call   1030 <sum_upto@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<useit>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
xor    %eax,%eax
call   1030 <sum_upto@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@useit.usedval = internal global i32 0
define i32 @useit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store i32 %3, i32* @useit.usedval
%4 = load i32, i32* %2
%5 = call i32 (i32, ...) bitcast (i32 (...)* @sum_upto to i32 (i32, ...)*)(i32 0)
%6 = add nsw i32 %4, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @useit(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @sum_upto to i32 (i32, ...)*)(i32 0)
%3 = add nsw i32 %2, %0
ret i32 %3
}
/* Type definitions */
struct dm_interface {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ DM_TABLE_CLEAR;
int dev_cmd(struct dm_interface *, char const *, int /*<<< orphan*/,
            int /*<<< orphan*/);
int dm_clear_device(struct dm_interface *dmi, const char *name) {
  return dev_cmd(dmi, name, DM_TABLE_CLEAR, 0);
}


x86 assembly (clang, -O0):
<dm_clear_device>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2eb9(%rip),%rax
mov    (%rax),%edx
xor    %ecx,%ecx
call   1030 <dev_cmd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dm_clear_device>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edx
xor    %ecx,%ecx
jmp    1030 <dev_cmd@plt>

LLVM IR (-O0):
%struct.dm_interface = type { i32 }
@DM_TABLE_CLEAR = global i32 0
define i32 @dm_clear_device(%struct.dm_interface* %0, i8* %1) {
%3 = alloca %struct.dm_interface*
%4 = alloca i8*
store %struct.dm_interface* %0, %struct.dm_interface** %3
store i8* %1, i8** %4
%5 = load %struct.dm_interface*, %struct.dm_interface** %3
%6 = load i8*, i8** %4
%7 = load i32, i32* @DM_TABLE_CLEAR
%8 = call i32 @dev_cmd(%struct.dm_interface* %5, i8* %6, i32 %7, i32 0)
ret i32 %8
}

LLVM IR (-O2):
%struct.dm_interface = type { i32 }
@DM_TABLE_CLEAR = global i32 0
define i32 @dm_clear_device(%struct.dm_interface* %0, i8* %1) {
%3 = load i32, i32* @DM_TABLE_CLEAR
%4 = tail call i32 @dev_cmd(%struct.dm_interface* %0, i8* %1, i32 %3, i32 0)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int XSUM_isConsole(FILE *stream) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @XSUM_isConsole(i32* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  double pi = 3.1415926535898;
  int radius, radiusSq;
  scanf("%d", &radius);
  radiusSq = radius * radius;
  printf("%.7f\n%d\n", pi * radiusSq, radiusSq << 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    0xec5(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
imul   -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%esi
shl    $0x1,%esi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
imul   %esi,%esi
cvtsi2sd %esi,%xmm0
mulsd  0xebb(%rip),%xmm0
add    %esi,%esi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [9 x i8] c"%.7f\0A%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store double 0x400921FB54442D28, double* %2
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
%7 = load i32, i32* %3
%8 = mul nsw i32 %6, %7
store i32 %8, i32* %4
%9 = load double, double* %2
%10 = load i32, i32* %4
%11 = sitofp i32 %10 to double
%12 = fmul double %9, %11
%13 = load i32, i32* %4
%14 = shl i32 %13, 1
%15 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), double %12, i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [9 x i8] c"%.7f\0A%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = sitofp i32 %5 to double
%7 = fmul double %6, 0x400921FB54442D28
%8 = shl nuw i32 %5, 1
%9 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), double %7, i32 %8)
ret i32 0
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
void startProfiling(struct timeval *start) { gettimeofday(start, NULL); }


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

x86 assembly (clang, -O2):
<startProfiling>:
xor    %esi,%esi
jmp    1030 <gettimeofday@plt>

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

LLVM IR (-O2):
%struct.timeval = type { i32 }
define void @startProfiling(%struct.timeval* nocapture %0) {
%2 = tail call i32 @gettimeofday(%struct.timeval* %0, i32* null)
ret void
}
/* Variables and functions */
long double modf(double, double *);
__attribute__((weak)) long double modfl(long double x, long double *y) {
  return modf((double)x, (double *)y);
}


x86 assembly (clang, -O0):
<modfl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    %rdi,-0x18(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
mov    -0x18(%rbp),%rdi
call   1030 <modf@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modfl>:
fldt   0x8(%rsp)
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
jmp    1030 <modf@plt>

LLVM IR (-O0):
define weak x86_fp80 @modfl(x86_fp80 %0, x86_fp80* %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80*
store x86_fp80 %0, x86_fp80* %3
store x86_fp80* %1, x86_fp80** %4
%5 = load x86_fp80, x86_fp80* %3
%6 = fptrunc x86_fp80 %5 to double
%7 = load x86_fp80*, x86_fp80** %4
%8 = bitcast x86_fp80* %7 to double*
%9 = call x86_fp80 @modf(double %6, double* %8)
ret x86_fp80 %9
}

LLVM IR (-O2):
define weak x86_fp80 @modfl(x86_fp80 %0, x86_fp80* %1) {
%3 = fptrunc x86_fp80 %0 to double
%4 = bitcast x86_fp80* %1 to double*
%5 = tail call x86_fp80 @modf(double %3, double* %4)
ret x86_fp80 %5
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void e() { puts("this is e()"); }


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

x86 assembly (clang, -O2):
<e>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"this is e()\00"
define void @e() {
%1 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"this is e()\00"
define void @e() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ showBacktrace();
int MyFunc_A() {
  showBacktrace();
  return 10;
}


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

x86 assembly (clang, -O2):
<MyFunc_A>:
push   %rax
xor    %eax,%eax
call   1030 <showBacktrace@plt>
mov    $0xa,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @MyFunc_A() {
%1 = call i32 (...) @showBacktrace()
ret i32 10
}

LLVM IR (-O2):
define i32 @MyFunc_A() {
%1 = tail call i32 (...) @showBacktrace()
ret i32 10
}
/* Variables and functions */
int /*<<< orphan*/ safe_strncpy(char *, char const *const, size_t const);
size_t strlen(char *const);
void safe_strncat(char *const to, const char *const from, const size_t size) {
  size_t l;
  l = strlen(to);
  safe_strncpy(&to[l], from, size - l);
  return;
}


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

x86 assembly (clang, -O2):
<safe_strncat>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
add    %rax,%rbx
sub    %rax,%r15
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <safe_strncpy@plt>

LLVM IR (-O0):
define void @safe_strncat(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
store i64 %9, i64* %7
%10 = load i8*, i8** %4
%11 = load i64, i64* %7
%12 = getelementptr inbounds i8, i8* %10, i64 %11
%13 = load i8*, i8** %5
%14 = load i64, i64* %6
%15 = load i64, i64* %7
%16 = sub i64 %14, %15
%17 = call i32 @safe_strncpy(i8* %12, i8* %13, i64 %16)
ret void
}

LLVM IR (-O2):
define void @safe_strncat(i8* %0, i8* %1, i64 %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = sub i64 %2, %4
%7 = tail call i32 @safe_strncpy(i8* %5, i8* %1, i64 %6)
ret void
}