xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ pem_password_cb;
typedef int /*<<< orphan*/ EVP_PKEY;
typedef int /*<<< orphan*/ EVP_CIPHER;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int do_pk8pkey(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int, int,
               int /*<<< orphan*/ const *, char *, int, int /*<<< orphan*/ *,
               void *);
int i2d_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY *x, const EVP_CIPHER *enc,
                            char *kstr, int klen, pem_password_cb *cb,
                            void *u) {
  return do_pk8pkey(bp, x, 1, -1, enc, kstr, klen, cb, u);
}


x86 assembly (clang, -O0):
<i2d_PKCS8PrivateKey_bio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
mov    -0x24(%rbp),%r11d
mov    -0x30(%rbp),%r10
mov    0x10(%rbp),%rax
mov    $0x1,%edx
mov    $0xffffffff,%ecx
mov    %r11d,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1030 <do_pk8pkey@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2d_PKCS8PrivateKey_bio>:
push   %rax
mov    %r9,%rax
mov    %r8d,%r10d
mov    %rcx,%r9
mov    %rdx,%r8
sub    $0x8,%rsp
mov    $0x1,%edx
mov    $0xffffffff,%ecx
push   0x18(%rsp)
push   %rax
push   %r10
call   1030 <do_pk8pkey@plt>
add    $0x20,%rsp
pop    %rcx
ret

LLVM IR (-O0):
define i32 @i2d_PKCS8PrivateKey_bio(i32* %0, i32* %1, i32* %2, i8* %3, i32 %4, i32* %5, i8* %6) {
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32*
%14 = alloca i8*
store i32* %0, i32** %8
store i32* %1, i32** %9
store i32* %2, i32** %10
store i8* %3, i8** %11
store i32 %4, i32* %12
store i32* %5, i32** %13
store i8* %6, i8** %14
%15 = load i32*, i32** %8
%16 = load i32*, i32** %9
%17 = load i32*, i32** %10
%18 = load i8*, i8** %11
%19 = load i32, i32* %12
%20 = load i32*, i32** %13
%21 = load i8*, i8** %14
%22 = call i32 @do_pk8pkey(i32* %15, i32* %16, i32 1, i32 -1, i32* %17, i8* %18, i32 %19, i32* %20, i8* %21)
ret i32 %22
}

LLVM IR (-O2):
define i32 @i2d_PKCS8PrivateKey_bio(i32* %0, i32* %1, i32* %2, i8* %3, i32 %4, i32* %5, i8* %6) {
%8 = tail call i32 @do_pk8pkey(i32* %0, i32* %1, i32 1, i32 -1, i32* %2, i8* %3, i32 %4, i32* %5, i8* %6)
ret i32 %8
}
int main(void) { 1 << 5; }


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

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

LLVM IR (-O0):
define i32 @main() {
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int DigitSum(int n) {
  if (n == 0) {
    return 0;
  } else {
    return (DigitSum(n / 10) + n % 10);
  }
}


x86 assembly (clang, -O0):
<DigitSum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <DigitSum+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1159 <DigitSum+0x49>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <DigitSum@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DigitSum>:
xor    %eax,%eax
test   %edi,%edi
je     113b <DigitSum+0x3b>
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
add    %esi,%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <DigitSum+0x10>
ret

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

LLVM IR (-O2):
define i32 @DigitSum(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = phi i32 [ %8, %3 ], [ 0, %1 ]
%6 = sdiv i32 %4, 10
%7 = srem i32 %4, 10
%8 = add nsw i32 %7, %5
%9 = add i32 %4, 9
%10 = icmp ult i32 %9, 19
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_MD_CTX;

/* Variables and functions */
int /*<<< orphan*/ NID_sha224;
int jksengine_digests_final(int /*<<< orphan*/ *, unsigned char *,
                            int /*<<< orphan*/);
int jksengine_sha224_final(EVP_MD_CTX *ctx, unsigned char *md) {
  ;
  return (jksengine_digests_final(ctx, md, NID_sha224));
}


x86 assembly (clang, -O0):
<jksengine_sha224_final>:
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
call   1030 <jksengine_digests_final@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jksengine_sha224_final>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edx
jmp    1030 <jksengine_digests_final@plt>

LLVM IR (-O0):
@NID_sha224 = global i32 0
define i32 @jksengine_sha224_final(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i8*, i8** %4
%7 = load i32, i32* @NID_sha224
%8 = call i32 @jksengine_digests_final(i32* %5, i8* %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@NID_sha224 = global i32 0
define i32 @jksengine_sha224_final(i32* %0, i8* %1) {
%3 = load i32, i32* @NID_sha224
%4 = tail call i32 @jksengine_digests_final(i32* %0, i8* %1, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ setLiftMotors(int /*<<< orphan*/);
void stopLift() { setLiftMotors(0); }


x86 assembly (clang, -O0):
<stopLift>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <setLiftMotors@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<stopLift>:
xor    %edi,%edi
jmp    1030 <setLiftMotors@plt>

LLVM IR (-O0):
define void @stopLift() {
%1 = call i32 @setLiftMotors(i32 0)
ret void
}

LLVM IR (-O2):
define void @stopLift() {
%1 = tail call i32 @setLiftMotors(i32 0)
ret void
}
int test_imm_63uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x63 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_63uint64_lowword_mem>:
testb  $0x63,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_63uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 99
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ sfmt_lrand32();
int32_t sfmt_mrand32() { return (int32_t)sfmt_lrand32(); }


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

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

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

LLVM IR (-O2):
define i32 @sfmt_mrand32() {
%1 = tail call i32 (...) @sfmt_lrand32()
ret i32 %1
}
/* Variables and functions */
int afabs(int);
int /*<<< orphan*/ printf(char *, int);
int main() { printf("%d\n", afabs(-538)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffffde6,%edi
call   1030 <afabs@plt>
mov    %eax,%esi
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xfffffde6,%edi
call   1030 <afabs@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = call i32 @afabs(i32 -538)
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @afabs(i32 -538)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int EquationParse__ConvertBinaryDigitToNumber(char ch) { return ch - '0'; }


x86 assembly (clang, -O0):
<EquationParse__ConvertBinaryDigitToNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<EquationParse__ConvertBinaryDigitToNumber>:
lea    -0x30(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @EquationParse__ConvertBinaryDigitToNumber(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 48
ret i32 %5
}

LLVM IR (-O2):
define i32 @EquationParse__ConvertBinaryDigitToNumber(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -48
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ uart_getc();
unsigned char uart_putc(int /*<<< orphan*/);
unsigned char UartGetc(void) { return uart_putc(uart_getc()); }


x86 assembly (clang, -O0):
<UartGetc>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <uart_getc@plt>
mov    %eax,%edi
call   1030 <uart_putc@plt>
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UartGetc>:
push   %rax
xor    %eax,%eax
call   1040 <uart_getc@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <uart_putc@plt>

LLVM IR (-O0):
define zeroext i8 @UartGetc() {
%1 = call i32 (...) @uart_getc()
%2 = call zeroext i8 @uart_putc(i32 %1)
ret i8 %2
}

LLVM IR (-O2):
define zeroext i8 @UartGetc() {
%1 = tail call i32 (...) @uart_getc()
%2 = tail call zeroext i8 @uart_putc(i32 %1)
ret i8 %2
}
int gregorian_non_leap(int year) {
  return (year & 3) || ((year % 100) == 0 && ((year / 100 & 3)));
}


x86 assembly (clang, -O0):
<gregorian_non_leap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x3,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    1151 <gregorian_non_leap+0x51>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    $0x0,%edx
mov    %al,-0x6(%rbp)
jne    114b <gregorian_non_leap+0x4b>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
and    $0x3,%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gregorian_non_leap>:
mov    $0x1,%eax
test   $0x3,%dil
je     110c <gregorian_non_leap+0xc>
ret
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
ror    $0x2,%ecx
xor    %eax,%eax
cmp    $0x28f5c28,%ecx
ja     110b <gregorian_non_leap+0xb>
movslq %edi,%rax
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rax
shr    $0x3f,%rax
sar    $0x25,%rcx
add    %eax,%ecx
xor    %eax,%eax
test   $0x3,%cl
setne  %al
ret

LLVM IR (-O0):
define i32 @gregorian_non_leap(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 3
%5 = icmp ne i32 %4, 0
br i1 %5, label %17, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = srem i32 %7, 100
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i32, i32* %2
%12 = sdiv i32 %11, 100
%13 = and i32 %12, 3
%14 = icmp ne i32 %13, 0
br label %15
15: ; preds = %10, %6
%16 = phi i1 [ false, %6 ], [ %14, %10 ]
br label %17
17: ; preds = %15, %1
%18 = phi i1 [ true, %1 ], [ %16, %15 ]
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @gregorian_non_leap(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %12
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = sdiv i32 %0, 100
%7 = icmp eq i32 %5, 0
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = and i32 %6, 3
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %4, %8, %1
%13 = phi i32 [ 1, %1 ], [ 0, %4 ], [ %11, %8 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ eprintf(char *, char *, char *);
int /*<<< orphan*/ *fopen(char *, char *);
FILE *efopen(char *fname, char *mode) {
  FILE *fp;
  if ((fp = fopen(fname, mode)) == NULL)
    eprintf("efopen(%s, %s) failed:", fname, mode);
  return fp;
}


x86 assembly (clang, -O0):
<efopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    115f <efopen+0x3f>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xea6(%rip),%rdi
call   1030 <eprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<efopen>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114a <efopen+0x2a>
lea    0xec1(%rip),%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <eprintf@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [23 x i8] c"efopen(%s, %s) failed:\00"
define noalias i32* @efopen(i8* %0, i8* %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @eprintf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
br label %7
7: ; preds = %5, %2
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ bubbleSort(int *, int);
void test_bubbleSort() {
  int array[5] = {4, 2, 8, 7, 1};
  bubbleSort(array, 5);
}


x86 assembly (clang, -O0):
<test_bubbleSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1030 <bubbleSort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_bubbleSort>:
sub    $0x18,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
call   1030 <bubbleSort@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.test_bubbleSort.array = [5 x i32] [i32 4, i32 2, i32 8, i32 7, i32 1]
define void @test_bubbleSort() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @bubbleSort(i32* %3, i32 5)
ret void
}

LLVM IR (-O2):
@__const.test_bubbleSort.array = [5 x i32] [i32 4, i32 2, i32 8, i32 7, i32 1]
define void @test_bubbleSort() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @bubbleSort(i32* %3, i32 5)
ret void
}
const char *dln_strerror(void) {}


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

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

LLVM IR (-O0):
define i8* @dln_strerror() {
%1 = alloca i8*
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
define noalias i8* @dln_strerror() {
ret i8* undef
}
int sum(int x) {
  if (x == 0)
    return 0;
  return x + sum(x - 1);
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <sum+0x21>
movl   $0x0,-0x4(%rbp)
jmp    114c <sum+0x3c>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <sum@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):
<sum>:
test   %edi,%edi
je     1119 <sum+0x19>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
imul   %eax,%eax
shr    %rcx
add    %edi,%eax
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @sum(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = mul i32 %4, %4
%6 = zext i32 %4 to i33
%7 = add i32 %0, -2
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %5, %0
%13 = sub i32 %12, %11
br label %14
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %13, %3 ]
ret i32 %15
}
void reg_dummy_read(void) {
  int a = *(unsigned int *)(((0x08000000)));
  a++;
}


x86 assembly (clang, -O0):
<reg_dummy_read>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8000000,%eax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @reg_dummy_read() {
%1 = alloca i32
%2 = load i32, i32* inttoptr (i64 134217728 to i32*)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
ret void
}

LLVM IR (-O2):
define void @reg_dummy_read() {
ret void
}
void cmdshell_start(void) { ; }


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

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

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

LLVM IR (-O2):
define void @cmdshell_start() {
ret void
}
/* Variables and functions */
scalar_t__ Pmember();
scalar_t__ PnameRef();
PportNameRef() {
  int b = -1;
  ;
  b = PnameRef() || Pmember();
  return (b);
}


x86 assembly (clang, -O0):
<PportNameRef>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffffff,-0x4(%rbp)
mov    $0x0,%al
call   1040 <PnameRef@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1159 <PportNameRef+0x39>
mov    $0x0,%al
call   1030 <Pmember@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PportNameRef>:
push   %rax
xor    %eax,%eax
call   1040 <PnameRef@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <PportNameRef+0x17>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <Pmember@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @PportNameRef() {
%1 = alloca i32
store i32 -1, i32* %1
%2 = call i64 (...) @PnameRef()
%3 = icmp ne i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = call i64 (...) @Pmember()
%6 = icmp ne i64 %5, 0
br label %7
7: ; preds = %4, %0
%8 = phi i1 [ true, %0 ], [ %6, %4 ]
%9 = zext i1 %8 to i32
store i32 %9, i32* %1
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @PportNameRef() {
%1 = tail call i64 (...) @PnameRef()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i64 (...) @Pmember()
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 1, %0 ], [ %6, %3 ]
ret i32 %8
}
void fpu_init_native_accrued_exceptions(void) {}


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

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

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

LLVM IR (-O2):
define void @fpu_init_native_accrued_exceptions() {
ret void
}
/* Variables and functions */
char fgetc(int /*<<< orphan*/);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/, char *, int *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
int get_vm_id(void) {
  int num;
  printf("Enter vm_id: ");
  fscanf(stdin, "%d", &num);
  while (fgetc(stdin) != '\n')
    ;
  return num;
}


x86 assembly (clang, -O0):
<get_vm_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
lea    0xeba(%rip),%rsi
lea    -0x4(%rbp),%rdx
call   1040 <fscanf@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1050 <fgetc@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     117c <get_vm_id+0x4c>
jmp    115d <get_vm_id+0x2d>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_vm_id>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea0(%rip),%rbx
mov    (%rbx),%edi
lea    0xebd(%rip),%rsi
lea    0xc(%rsp),%rdx
call   1040 <fscanf@plt>
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%edi
call   1050 <fgetc@plt>
cmp    $0xa,%al
jne    1160 <get_vm_id+0x30>
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Enter vm_id: \00"
@stdin = global i32 0
@.str.1 = [3 x i8] c"%d\00"
define i32 @get_vm_id() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdin
%4 = call i32 @fscanf(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
br label %5
5: ; preds = %10, %0
%6 = load i32, i32* @stdin
%7 = call signext i8 @fgetc(i32 %6)
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 10
br i1 %9, label %10, label %11
10: ; preds = %5
br label %5
11: ; preds = %5
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [14 x i8] c"Enter vm_id: \00"
@stdin = global i32 0
@.str.1 = [3 x i8] c"%d\00"
define i32 @get_vm_id() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdin
%5 = call i32 @fscanf(i32 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
br label %6
6: ; preds = %6, %0
%7 = load i32, i32* @stdin
%8 = call signext i8 @fgetc(i32 %7)
%9 = icmp eq i8 %8, 10
br i1 %9, label %10, label %6
10: ; preds = %6
%11 = load i32, i32* %1
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ m68ki_exception_illegal();
void m68k_op_illegal(void) { m68ki_exception_illegal(); }


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

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

LLVM IR (-O0):
define void @m68k_op_illegal() {
%1 = call i32 (...) @m68ki_exception_illegal()
ret void
}

LLVM IR (-O2):
define void @m68k_op_illegal() {
%1 = tail call i32 (...) @m68ki_exception_illegal()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_pstream_set_revoke_callback() {
  printf("NOT IMPLEMENTED:"
         "pa_pstream_set_revoke_callback"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [48 x i8] c"NOT IMPLEMENTED:pa_pstream_set_revoke_callback\0A\00"
define i32 @pa_pstream_set_revoke_callback() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [47 x i8] c"NOT IMPLEMENTED:pa_pstream_set_revoke_callback\00"
define i32 @pa_pstream_set_revoke_callback() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int pthread_attr_getguardsize(int /*<<< orphan*/ *, size_t *);
int my_pthread_attr_getguardsize(pthread_attr_t const *__attr,
                                 size_t *guard_size) {
  pthread_attr_t *realattr = (pthread_attr_t *)*(int *)__attr;
  return pthread_attr_getguardsize(realattr, guard_size);
}


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

x86 assembly (clang, -O2):
<my_pthread_attr_getguardsize>:
movslq (%rdi),%rdi
jmp    1030 <pthread_attr_getguardsize@plt>

LLVM IR (-O0):
define i32 @my_pthread_attr_getguardsize(i32* %0, i64* %1) {
%3 = alloca i32*
%4 = alloca i64*
%5 = alloca i32*
store i32* %0, i32** %3
store i64* %1, i64** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store i32* %9, i32** %5
%10 = load i32*, i32** %5
%11 = load i64*, i64** %4
%12 = call i32 @pthread_attr_getguardsize(i32* %10, i64* %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @my_pthread_attr_getguardsize(i32* nocapture %0, i64* %1) {
%3 = load i32, i32* %0
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = tail call i32 @pthread_attr_getguardsize(i32* %5, i64* %1)
ret i32 %6
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SOCK_STREAM;
int init_sock(int /*<<< orphan*/);
int /*<<< orphan*/ set_sock_nonblock(int);
int /*<<< orphan*/ svr_bind(int, unsigned short);
int /*<<< orphan*/ svr_listen(int);
int svr_init(unsigned short port) {
  int fd, sc;
  struct sockaddr_in client_addr;
  fd = init_sock(SOCK_STREAM);
  set_sock_nonblock(fd);
  svr_bind(fd, port);
  svr_listen(fd);
  return fd;
}


x86 assembly (clang, -O0):
<svr_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
call   1030 <init_sock@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1060 <set_sock_nonblock@plt>
mov    -0x8(%rbp),%edi
movzwl -0x2(%rbp),%esi
call   1050 <svr_bind@plt>
mov    -0x8(%rbp),%edi
call   1040 <svr_listen@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<svr_init>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1030 <init_sock@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1060 <set_sock_nonblock@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1050 <svr_bind@plt>
mov    %ebp,%edi
call   1040 <svr_listen@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
@SOCK_STREAM = global i32 0
define i32 @svr_init(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.sockaddr_in
store i16 %0, i16* %2
%6 = load i32, i32* @SOCK_STREAM
%7 = call i32 @init_sock(i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i32 @set_sock_nonblock(i32 %8)
%10 = load i32, i32* %3
%11 = load i16, i16* %2
%12 = call i32 @svr_bind(i32 %10, i16 zeroext %11)
%13 = load i32, i32* %3
%14 = call i32 @svr_listen(i32 %13)
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@SOCK_STREAM = global i32 0
define i32 @svr_init(i16 zeroext %0) {
%2 = load i32, i32* @SOCK_STREAM
%3 = tail call i32 @init_sock(i32 %2)
%4 = tail call i32 @set_sock_nonblock(i32 %3)
%5 = tail call i32 @svr_bind(i32 %3, i16 zeroext %0)
%6 = tail call i32 @svr_listen(i32 %3)
ret i32 %3
}
/* Variables and functions */
int errno;
int getgid();
int __sulong_posix_getgid(void) {
  {
    int native_errno = errno;
    int result = getgid();
    if (result == (int)-1) {
      result = (int)(long)-errno;
    }
    errno = native_errno;
    return result;
  };
}


x86 assembly (clang, -O0):
<__sulong_posix_getgid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getgid@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1148 <__sulong_posix_getgid+0x38>
xor    %eax,%eax
mov    0x2e9f(%rip),%rcx
sub    (%rcx),%eax
cltq
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
mov    0x2e8e(%rip),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sulong_posix_getgid>:
push   %rbp
push   %r14
push   %rbx
mov    0x2ec5(%rip),%r14
mov    (%r14),%ebp
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <getgid@plt>
sub    (%r14),%ebx
cmp    $0xffffffff,%eax
cmove  %ebx,%eax
mov    %ebp,(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @__sulong_posix_getgid() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @errno
store i32 %3, i32* %1
%4 = call i32 (...) @getgid()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %12
7: ; preds = %0
%8 = load i32, i32* @errno
%9 = sub nsw i32 0, %8
%10 = sext i32 %9 to i64
%11 = trunc i64 %10 to i32
store i32 %11, i32* %2
br label %12
12: ; preds = %7, %0
%13 = load i32, i32* %1
store i32 %13, i32* @errno
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @__sulong_posix_getgid() {
%1 = load i32, i32* @errno
%2 = tail call i32 (...) @getgid()
%3 = icmp eq i32 %2, -1
%4 = load i32, i32* @errno
%5 = sub nsw i32 0, %4
%6 = select i1 %3, i32 %5, i32 %2
store i32 %1, i32* @errno
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ point(double, double, double, double, double, double, double,
                         double, double);
int main(void) {
  point(0.0, 0.0, 0.65, -1.0, 1.0, 0.0, 1.0, 1.0, 0.0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm8,%xmm8
movsd  0xed5(%rip),%xmm2
movsd  0xed5(%rip),%xmm3
movsd  0xed5(%rip),%xmm7
movaps %xmm8,%xmm0
movaps %xmm8,%xmm1
movaps %xmm7,%xmm4
movaps %xmm8,%xmm5
movaps %xmm7,%xmm6
movsd  %xmm8,(%rsp)
call   1030 <point@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movq   $0x0,(%rsp)
movsd  0xedf(%rip),%xmm2
movsd  0xedf(%rip),%xmm3
movsd  0xedf(%rip),%xmm4
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm5,%xmm5
movaps %xmm4,%xmm6
movaps %xmm4,%xmm7
call   1030 <point@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @point(double 0.000000e+00, double 0.000000e+00, double 6.500000e-01, double -1.000000e+00, double 1.000000e+00, double 0.000000e+00, double 1.000000e+00, double 1.000000e+00, double 0.000000e+00)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @point(double 0.000000e+00, double 0.000000e+00, double 6.500000e-01, double -1.000000e+00, double 1.000000e+00, double 0.000000e+00, double 1.000000e+00, double 1.000000e+00, double 0.000000e+00)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ readByte(int *, int);
size_t readLen(size_t lenWidthInBytes) {
  size_t ret = 0, i;
  uint8_t b;
  for (i = 0; i < lenWidthInBytes; i++) {
    readByte(&b, (1));
    ret += (b << (8 * i));
  }
  return ret;
}


x86 assembly (clang, -O0):
<readLen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1170 <readLen+0x60>
lea    -0x1c(%rbp),%rdi
mov    $0x1,%esi
call   1030 <readByte@plt>
mov    -0x1c(%rbp),%eax
mov    -0x18(%rbp),%rcx
shl    $0x3,%rcx
shl    %cl,%eax
cltq
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    112c <readLen+0x1c>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readLen>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
xor    %ebx,%ebx
test   %rdi,%rdi
je     1155 <readLen+0x45>
mov    %rdi,%r14
lea    0x4(%rsp),%r15
xor    %r12d,%r12d
nopw   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    $0x1,%esi
call   1030 <readByte@plt>
mov    0x4(%rsp),%eax
mov    %ebx,%ecx
shl    %cl,%eax
cltq
add    %rax,%r12
add    $0x8,%ebx
add    $0xffffffffffffffff,%r14
jne    1130 <readLen+0x20>
jmp    1158 <readLen+0x48>
xor    %r12d,%r12d
mov    %r12,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @readLen(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
store i64 %0, i64* %2
store i64 0, i64* %3
store i64 0, i64* %4
br label %6
6: ; preds = %20, %1
%7 = load i64, i64* %4
%8 = load i64, i64* %2
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %23
10: ; preds = %6
%11 = call i32 @readByte(i32* %5, i32 1)
%12 = load i32, i32* %5
%13 = load i64, i64* %4
%14 = mul i64 8, %13
%15 = trunc i64 %14 to i32
%16 = shl i32 %12, %15
%17 = sext i32 %16 to i64
%18 = load i64, i64* %3
%19 = add i64 %18, %17
store i64 %19, i64* %3
br label %20
20: ; preds = %10
%21 = load i64, i64* %4
%22 = add i64 %21, 1
store i64 %22, i64* %4
br label %6
23: ; preds = %6
%24 = load i64, i64* %3
ret i64 %24
}

LLVM IR (-O2):
define i64 @readLen(i64 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = icmp eq i64 %0, 0
br i1 %4, label %17, label %5
5: ; preds = %1, %5
%6 = phi i64 [ %15, %5 ], [ 0, %1 ]
%7 = phi i64 [ %14, %5 ], [ 0, %1 ]
%8 = call i32 @readByte(i32* %2, i32 1)
%9 = load i32, i32* %2
%10 = trunc i64 %6 to i32
%11 = shl i32 %10, 3
%12 = shl i32 %9, %11
%13 = sext i32 %12 to i64
%14 = add i64 %7, %13
%15 = add nuw i64 %6, 1
%16 = icmp eq i64 %15, %0
br i1 %16, label %17, label %5
17: ; preds = %5, %1
%18 = phi i64 [ 0, %1 ], [ %14, %5 ]
ret i64 %18
}
int __attribute__((target("sse4.2"))) redecl3(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @redecl3() {
ret i32 0
}

LLVM IR (-O2):
define i32 @redecl3() {
ret i32 0
}
long double test_volatile_assign(volatile _Atomic long double *addr) {
  *addr = 115;
  return *addr;
}


x86 assembly (clang, -O0):
<test_volatile_assign>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
xorps  %xmm0,%xmm0
movaps %xmm0,-0x20(%rbp)
flds   0xec3(%rip)
fstpt  -0x20(%rbp)
mov    $0x10,%edi
mov    %rdi,-0x40(%rbp)
lea    -0x20(%rbp),%rdx
mov    $0x5,%ecx
mov    %ecx,-0x34(%rbp)
call   1040 <__atomic_store@plt>
mov    -0x40(%rbp),%rdi
mov    -0x34(%rbp),%ecx
mov    -0x8(%rbp),%rsi
lea    -0x30(%rbp),%rdx
call   1030 <__atomic_load@plt>
fldt   -0x30(%rbp)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_volatile_assign>:
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rbx
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
flds   0xecb(%rip)
fstpt  (%rsp)
mov    %rsp,%rdx
mov    $0x10,%edi
mov    %rbx,%rsi
mov    $0x5,%ecx
call   1040 <__atomic_store@plt>
lea    0x10(%rsp),%rdx
mov    $0x10,%edi
mov    %rbx,%rsi
mov    $0x5,%ecx
call   1030 <__atomic_load@plt>
fldt   0x10(%rsp)
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define x86_fp80 @test_volatile_assign(x86_fp80* %0) {
%2 = alloca x86_fp80*
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80* %0, x86_fp80** %2
%5 = load x86_fp80*, x86_fp80** %2
%6 = bitcast x86_fp80* %3 to i8*
store x86_fp80 0xK4005E600000000000000, x86_fp80* %3
%7 = bitcast x86_fp80* %5 to i8*
%8 = bitcast x86_fp80* %3 to i8*
%9 = load x86_fp80*, x86_fp80** %2
%10 = bitcast x86_fp80* %9 to i8*
%11 = bitcast x86_fp80* %4 to i8*
%12 = load x86_fp80, x86_fp80* %4
ret x86_fp80 %12
}

LLVM IR (-O2):
define x86_fp80 @test_volatile_assign(x86_fp80* %0) {
%2 = alloca x86_fp80
%3 = alloca x86_fp80
%4 = bitcast x86_fp80* %2 to i8*
store x86_fp80 0xK4005E600000000000000, x86_fp80* %2
%5 = bitcast x86_fp80* %0 to i8*
%6 = bitcast x86_fp80* %3 to i8*
%7 = load x86_fp80, x86_fp80* %3
ret x86_fp80 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void test1(void *dead) {
  sleep(100000);
  printf("test1\n");
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x186a0,%edi
call   1040 <sleep@plt>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
push   %rax
mov    $0x186a0,%edi
call   1040 <sleep@plt>
lea    0xece(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [6 x i8] c"test1\00"
define void @test1(i8* nocapture readnone %0) {
%2 = tail call i32 @sleep(i32 100000)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int read(int, unsigned char *, int);
int kiss_platform_serial_read(int handle, unsigned char *data, int count) {
  return read(handle, data, count);
}


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

x86 assembly (clang, -O2):
<kiss_platform_serial_read>:
jmp    1030 <read@plt>

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

LLVM IR (-O2):
define i32 @kiss_platform_serial_read(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Type definitions */
struct cec_msg {
  int len;
  int /*<<< orphan*/ *msg;
};

/* Variables and functions */
int /*<<< orphan*/ CEC_MSG_RECORD_ON;
int /*<<< orphan*/ CEC_OP_RECORD_SRC_OWN;
void cec_msg_record_on_own(struct cec_msg *msg) {
  msg->len = 3;
  msg->msg[1] = CEC_MSG_RECORD_ON;
  msg->msg[2] = CEC_OP_RECORD_SRC_OWN;
}


x86 assembly (clang, -O0):
<cec_msg_record_on_own>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x3,(%rax)
mov    0x2ec7(%rip),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %ecx,0x4(%rax)
mov    0x2eab(%rip),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %ecx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cec_msg_record_on_own>:
movl   $0x3,(%rdi)
mov    0x2ed3(%rip),%rax
mov    (%rax),%eax
mov    0x8(%rdi),%rcx
mov    %eax,0x4(%rcx)
mov    0x2ebb(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x8(%rcx)
ret

LLVM IR (-O0):
%struct.cec_msg = type { i32, i32* }
@CEC_MSG_RECORD_ON = global i32 0
@CEC_OP_RECORD_SRC_OWN = global i32 0
define void @cec_msg_record_on_own(%struct.cec_msg* %0) {
%2 = alloca %struct.cec_msg*
store %struct.cec_msg* %0, %struct.cec_msg** %2
%3 = load %struct.cec_msg*, %struct.cec_msg** %2
%4 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %3, i32 0, i32 0
store i32 3, i32* %4
%5 = load i32, i32* @CEC_MSG_RECORD_ON
%6 = load %struct.cec_msg*, %struct.cec_msg** %2
%7 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %6, i32 0, i32 1
%8 = load i32*, i32** %7
%9 = getelementptr inbounds i32, i32* %8, i64 1
store i32 %5, i32* %9
%10 = load i32, i32* @CEC_OP_RECORD_SRC_OWN
%11 = load %struct.cec_msg*, %struct.cec_msg** %2
%12 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %11, i32 0, i32 1
%13 = load i32*, i32** %12
%14 = getelementptr inbounds i32, i32* %13, i64 2
store i32 %10, i32* %14
ret void
}

LLVM IR (-O2):
%struct.cec_msg = type { i32, i32* }
@CEC_MSG_RECORD_ON = global i32 0
@CEC_OP_RECORD_SRC_OWN = global i32 0
define void @cec_msg_record_on_own(%struct.cec_msg* nocapture %0) {
%2 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %0, i64 0, i32 0
store i32 3, i32* %2
%3 = load i32, i32* @CEC_MSG_RECORD_ON
%4 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %0, i64 0, i32 1
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 1
store i32 %3, i32* %6
%7 = load i32, i32* @CEC_OP_RECORD_SRC_OWN
%8 = getelementptr inbounds i32, i32* %5, i64 2
store i32 %7, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __gmp_get_memory_functions(void *(*)(size_t),
                                              int /*<<< orphan*/ *,
                                              int /*<<< orphan*/ *);
void *stub1(size_t);
char *mpc_alloc_str(size_t len) {
  void *(*allocfunc)(size_t);
  __gmp_get_memory_functions(&allocfunc, NULL, NULL);
  return (char *)((*allocfunc)(len));
}


x86 assembly (clang, -O0):
<mpc_alloc_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   1030 <__gmp_get_memory_functions@plt>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpc_alloc_str>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <__gmp_get_memory_functions@plt>
mov    %rbx,%rdi
call   *0x8(%rsp)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @mpc_alloc_str(i64 %0) {
%2 = alloca i64
%3 = alloca i8* (i64)*
store i64 %0, i64* %2
%4 = bitcast i8* (i64)** %3 to i8* (i64)*
%5 = call i32 @__gmp_get_memory_functions(i8* (i64)* %4, i32* null, i32* null)
%6 = load i8* (i64)*, i8* (i64)** %3
%7 = load i64, i64* %2
%8 = call i8* %6(i64 %7)
ret i8* %8
}

LLVM IR (-O2):
define i8* @mpc_alloc_str(i64 %0) {
%2 = alloca i8* (i64)*
%3 = bitcast i8* (i64)** %2 to i8*
%4 = bitcast i8* (i64)** %2 to i8* (i64)*
%5 = call i32 @__gmp_get_memory_functions(i8* (i64)* %4, i32* null, i32* null)
%6 = load i8* (i64)*, i8* (i64)** %2
%7 = call i8* %6(i64 %0)
ret i8* %7
}
void begin_pso() {}


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

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

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

LLVM IR (-O2):
define void @begin_pso() {
ret void
}
/* Type definitions */
struct hostent {
  int dummy;
};

/* Variables and functions */
struct hostent *gethostbyname(char const *);
struct hostent *resolveHostInfo(const char *hostName) {
  struct hostent *hostInfo = gethostbyname(hostName);
  return hostInfo;
}


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

x86 assembly (clang, -O2):
<resolveHostInfo>:
jmp    1030 <gethostbyname@plt>

LLVM IR (-O0):
%struct.hostent = type { i32 }
define %struct.hostent* @resolveHostInfo(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.hostent*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call %struct.hostent* @gethostbyname(i8* %4)
store %struct.hostent* %5, %struct.hostent** %3
%6 = load %struct.hostent*, %struct.hostent** %3
ret %struct.hostent* %6
}

LLVM IR (-O2):
%struct.hostent = type { i32 }
define %struct.hostent* @resolveHostInfo(i8* %0) {
%2 = tail call %struct.hostent* @gethostbyname(i8* %0)
ret %struct.hostent* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int32_t;

/* Variables and functions */
int /*<<< orphan*/ Interpolate_2(int /*<<< orphan*/, int, int /*<<< orphan*/,
                                 int, int);
u_int32_t Interp5(u_int32_t c1, u_int32_t c2) {
  return Interpolate_2(c1, 1, c2, 1, 1);
}


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

x86 assembly (clang, -O2):
<Interp5>:
mov    %esi,%edx
mov    $0x1,%esi
mov    $0x1,%ecx
mov    $0x1,%r8d
jmp    1030 <Interpolate_2@plt>

LLVM IR (-O0):
define i32 @Interp5(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 @Interpolate_2(i32 %5, i32 1, i32 %6, i32 1, i32 1)
ret i32 %7
}

LLVM IR (-O2):
define i32 @Interp5(i32 %0, i32 %1) {
%3 = tail call i32 @Interpolate_2(i32 %0, i32 1, i32 %1, i32 1, i32 1)
ret i32 %3
}
void highvideo(void) {}


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

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

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

LLVM IR (-O2):
define void @highvideo() {
ret void
}
/* Variables and functions */
int atoi(char *);
char *strstr(char *, char *);
int ph_parseCallProgressNewCid(char *data) {
  char *tag = strstr(data, "CIDN=");
  if (!tag)
    return 0;
  return atoi(tag + 5);
}


x86 assembly (clang, -O0):
<ph_parseCallProgressNewCid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strstr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1157 <ph_parseCallProgressNewCid+0x37>
movl   $0x0,-0x4(%rbp)
jmp    1167 <ph_parseCallProgressNewCid+0x47>
mov    -0x18(%rbp),%rdi
add    $0x5,%rdi
call   1030 <atoi@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ph_parseCallProgressNewCid>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <strstr@plt>
test   %rax,%rax
je     113f <ph_parseCallProgressNewCid+0x1f>
add    $0x5,%rax
mov    %rax,%rdi
pop    %rax
jmp    1030 <atoi@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"CIDN=\00"
define i32 @ph_parseCallProgressNewCid(i8* %0) {
%2 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %2, i64 5
%6 = tail call i32 @atoi(i8* %5)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ 0, %1 ]
ret i32 %8
}