xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
float my_fabsf(float x) {
  union {
    float f;
    uint32_t i;
  } u = {x};
  u.i &= 0x7fffffff;
  return u.f;
}


x86 assembly (clang, -O0):
<my_fabsf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x7fffffff,%eax
mov    %eax,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_fabsf>:
andps  0xef9(%rip),%xmm0
ret

LLVM IR (-O0):
%union.anon = type { float }
define float @my_fabsf(float %0) {
%2 = alloca float
%3 = alloca %union.anon
store float %0, float* %2
%4 = bitcast %union.anon* %3 to float*
%5 = load float, float* %2
store float %5, float* %4
%6 = bitcast %union.anon* %3 to i32*
%7 = load i32, i32* %6
%8 = and i32 %7, 2147483647
store i32 %8, i32* %6
%9 = bitcast %union.anon* %3 to float*
%10 = load float, float* %9
ret float %10
}

LLVM IR (-O2):
define float @my_fabsf(float %0) {
%2 = bitcast float %0 to i32
%3 = and i32 %2, 2147483647
%4 = bitcast i32 %3 to float
ret float %4
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void store24bit(void *data, int pos, uint32_t expanded_value) {
  ((uint8_t *)data)[3 * pos] = expanded_value >> 8;
  ((uint8_t *)data)[3 * pos + 1] = expanded_value >> 16;
  ((uint8_t *)data)[3 * pos + 2] = expanded_value >> 24;
}


x86 assembly (clang, -O0):
<store24bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%edx
sar    $0x8,%edx
mov    -0x8(%rbp),%rax
imul   $0x3,-0xc(%rbp),%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%edx
sar    $0x10,%edx
mov    -0x8(%rbp),%rax
imul   $0x3,-0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%edx
sar    $0x18,%edx
mov    -0x8(%rbp),%rax
imul   $0x3,-0xc(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<store24bit>:
mov    %edx,%eax
sar    $0x8,%eax
lea    (%rsi,%rsi,2),%ecx
movslq %ecx,%rcx
mov    %eax,(%rdi,%rcx,4)
mov    %edx,%eax
sar    $0x10,%eax
mov    %eax,0x4(%rdi,%rcx,4)
sar    $0x18,%edx
mov    %edx,0x8(%rdi,%rcx,4)
ret

LLVM IR (-O0):
define void @store24bit(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = ashr i32 %7, 8
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %5
%12 = mul nsw i32 3, %11
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %10, i64 %13
store i32 %8, i32* %14
%15 = load i32, i32* %6
%16 = ashr i32 %15, 16
%17 = load i8*, i8** %4
%18 = bitcast i8* %17 to i32*
%19 = load i32, i32* %5
%20 = mul nsw i32 3, %19
%21 = add nsw i32 %20, 1
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %18, i64 %22
store i32 %16, i32* %23
%24 = load i32, i32* %6
%25 = ashr i32 %24, 24
%26 = load i8*, i8** %4
%27 = bitcast i8* %26 to i32*
%28 = load i32, i32* %5
%29 = mul nsw i32 3, %28
%30 = add nsw i32 %29, 2
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i32, i32* %27, i64 %31
store i32 %25, i32* %32
ret void
}

LLVM IR (-O2):
define void @store24bit(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = ashr i32 %2, 8
%5 = bitcast i8* %0 to i32*
%6 = mul nsw i32 %1, 3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
store i32 %4, i32* %8
%9 = ashr i32 %2, 16
%10 = add nsw i32 %6, 1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %5, i64 %11
store i32 %9, i32* %12
%13 = ashr i32 %2, 24
%14 = add nsw i32 %6, 2
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %5, i64 %15
store i32 %13, i32* %16
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int, int);
void testTortureExecute(void) {
  foo(1, 2);
  return;
}


x86 assembly (clang, -O0):
<testTortureExecute>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <foo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testTortureExecute>:
mov    $0x1,%edi
mov    $0x2,%esi
jmp    1030 <foo@plt>

LLVM IR (-O0):
define void @testTortureExecute() {
%1 = call i32 @foo(i32 1, i32 2)
ret void
}

LLVM IR (-O2):
define void @testTortureExecute() {
%1 = tail call i32 @foo(i32 1, i32 2)
ret void
}
int foo(int a[const 1][2]) {
  int bar(int b[restrict volatile static 2]);
  return bar(a[0]);
}


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

x86 assembly (clang, -O2):
<foo>:
jmp    1030 <bar@plt>

LLVM IR (-O0):
define i32 @foo([2 x i32]* %0) {
%2 = alloca [2 x i32]*
store [2 x i32]* %0, [2 x i32]** %2
%3 = load [2 x i32]*, [2 x i32]** %2
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%6 = call i32 @bar(i32* %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @foo([2 x i32]* %0) {
%2 = getelementptr inbounds [2 x i32], [2 x i32]* %0, i64 0, i64 0
%3 = tail call i32 @bar(i32* %2)
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
bool CANRetryGet(uint32_t ui32Base) {
  ;
  if ((*((volatile unsigned long *)(ui32Base + 0x00000000))) & 0x00000020) {
    return (0);
  }
  return (1);
}


x86 assembly (clang, -O0):
<CANRetryGet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
and    $0x20,%rax
cmp    $0x0,%rax
je     1129 <CANRetryGet+0x29>
movl   $0x0,-0x4(%rbp)
jmp    1130 <CANRetryGet+0x30>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CANRetryGet>:
mov    (%rdi),%rcx
xor    %eax,%eax
test   $0x20,%cl
sete   %al
ret

LLVM IR (-O0):
define i32 @CANRetryGet(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = add nsw i64 %4, 0
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
%8 = and i64 %7, 32
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 0, i32* %2
br label %12
11: ; preds = %1
store i32 1, i32* %2
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @CANRetryGet(i64 %0) {
%2 = inttoptr i64 %0 to i64*
%3 = load volatile i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = lshr i32 %4, 5
%6 = and i32 %5, 1
%7 = xor i32 %6, 1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ build_path();
int /*<<< orphan*/ print_queue_set();
int main(int argc, const char *argv[]) {
  build_path();
  print_queue_set();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <build_path@plt>
mov    $0x0,%al
call   1040 <print_queue_set@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <build_path@plt>
xor    %eax,%eax
call   1040 <print_queue_set@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
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 (...) @build_path()
%6 = call i32 (...) @print_queue_set()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @build_path()
%4 = tail call i32 (...) @print_queue_set()
ret i32 0
}
int a(void) { return sizeof(_Bool); }


x86 assembly (clang, -O0):
<a>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @a() {
ret i32 1
}

LLVM IR (-O2):
define i32 @a() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int *pnum = NULL;
  printf("alamat memory pnum %p \n", pnum);
  printf("nilai pnum %d \n", *pnum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [24 x i8] c"alamat memory pnum %p \0A\00"
@.str.1 = [16 x i8] c"nilai pnum %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
store i32* null, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"alamat memory pnum %p \0A\00"
@.str.1 = [16 x i8] c"nilai pnum %d \0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32* null)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 undef)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ crypto_onetimeauth(unsigned char *, unsigned char const *,
                                      unsigned long long,
                                      unsigned char const *);
int crypto_verify_16(unsigned char const *, unsigned char *);
int crypto_onetimeauth_verify(const unsigned char *h, const unsigned char *in,
                              unsigned long long inlen,
                              const unsigned char *k) {
  unsigned char correct[16];
  crypto_onetimeauth(correct, in, inlen, k);
  return crypto_verify_16(h, correct);
}


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

x86 assembly (clang, -O2):
<crypto_onetimeauth_verify>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <crypto_onetimeauth@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <crypto_verify_16@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @crypto_onetimeauth_verify(i8* %0, i8* %1, i64 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
%9 = alloca [16 x i8]
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i8* %3, i8** %8
%10 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 0
%11 = load i8*, i8** %6
%12 = load i64, i64* %7
%13 = load i8*, i8** %8
%14 = call i32 @crypto_onetimeauth(i8* %10, i8* %11, i64 %12, i8* %13)
%15 = load i8*, i8** %5
%16 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 0
%17 = call i32 @crypto_verify_16(i8* %15, i8* %16)
ret i32 %17
}

LLVM IR (-O2):
define i32 @crypto_onetimeauth_verify(i8* %0, i8* %1, i64 %2, i8* %3) {
%5 = alloca [16 x i8]
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%7 = call i32 @crypto_onetimeauth(i8* %6, i8* %1, i64 %2, i8* %3)
%8 = call i32 @crypto_verify_16(i8* %0, i8* %6)
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
FILE *InitDiffSpecOutput(char *filename) {
  FILE *f = fopen(filename, "w");
  if (!f) {
    printf("File %s cannot be opened!\n", filename);
  } else {
    return f;
  }
}


x86 assembly (clang, -O0):
<InitDiffSpecOutput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1160 <InitDiffSpecOutput+0x40>
mov    -0x10(%rbp),%rsi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
jmp    1168 <InitDiffSpecOutput+0x48>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<InitDiffSpecOutput>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xed2(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114a <InitDiffSpecOutput+0x2a>
lea    0xec0(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
@.str.1 = [27 x i8] c"File %s cannot be opened!\0A\00"
define i32* @InitDiffSpecOutput(i8* %0) {
%2 = alloca i32*
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = icmp ne i32* %7, null
br i1 %8, label %12, label %9
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* %10)
br label %14
12: ; preds = %1
%13 = load i32*, i32** %4
store i32* %13, i32** %2
br label %14
14: ; preds = %12, %9
%15 = load i32*, i32** %2
ret i32* %15
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
@.str.1 = [27 x i8] c"File %s cannot be opened!\0A\00"
define noalias i32* @InitDiffSpecOutput(i8* %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %1, %4
ret i32* %2
}
delmode(f, n) int f, n;
{ return (adjustmode(0, 0)); }


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

x86 assembly (clang, -O2):
<delmode>:
xor    %edi,%edi
xor    %esi,%esi
xor    %eax,%eax
jmp    1030 <adjustmode@plt>

LLVM IR (-O0):
define i32 @delmode(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (i32, i32, ...) bitcast (i32 (...)* @adjustmode to i32 (i32, i32, ...)*)(i32 0, i32 0)
ret i32 %5
}

LLVM IR (-O2):
define i32 @delmode(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @adjustmode to i32 (i32, i32, ...)*)(i32 0, i32 0)
ret i32 %3
}
unsigned int f58(unsigned int x, unsigned long int y) {
  return (x << (8 * sizeof(unsigned int) - y)) ^ (x >> y);
}


x86 assembly (clang, -O0):
<f58>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sub    -0x10(%rbp),%rcx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
shr    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f58>:
mov    %esi,%ecx
neg    %cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f58(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = load i64, i64* %4
%7 = sub i64 32, %6
%8 = trunc i64 %7 to i32
%9 = shl i32 %5, %8
%10 = load i32, i32* %3
%11 = load i64, i64* %4
%12 = trunc i64 %11 to i32
%13 = lshr i32 %10, %12
%14 = xor i32 %9, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @f58(i32 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = sub i32 32, %3
%5 = shl i32 %0, %4
%6 = lshr i32 %0, %3
%7 = xor i32 %5, %6
ret i32 %7
}
unsigned char inb(unsigned short port) {
  unsigned char data;
  asm volatile("inb %1, %0" : "=a"(data) : "Nd"(port));
  return data;
}


x86 assembly (clang, -O0):
<inb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm sideeffect "inb $1, $0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb $1, $0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ freeze(int);
void lib_freeze(int motor) { freeze(motor); }


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

x86 assembly (clang, -O2):
<lib_freeze>:
jmp    1030 <freeze@plt>

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

LLVM IR (-O2):
define void @lib_freeze(i32 %0) {
%2 = tail call i32 @freeze(i32 %0)
ret void
}
void omp_set_num_threads(int num_threads) { return; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fread(unsigned char *, int, int, int /*<<< orphan*/ *);
int fileheight(char *filename) {
  FILE *f = fopen(filename, "rb");
  unsigned char info[54];
  fread(info, sizeof(unsigned char), 54, f);
  int height = *(int *)&info[22];
  fclose(f);
  return height;
}


x86 assembly (clang, -O0):
<fileheight>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
mov    $0x36,%edx
call   1030 <fread@plt>
mov    -0x3a(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x54(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileheight>:
push   %rbp
push   %rbx
sub    $0x38,%rsp
lea    0xec3(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    %rsp,%rdi
mov    $0x1,%esi
mov    $0x36,%edx
mov    %rax,%rcx
call   1030 <fread@plt>
mov    0x16(%rsp),%ebp
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    %ebp,%eax
add    $0x38,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"rb\00"
define i32 @fileheight(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca [54 x i8]
%5 = alloca i32
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** %3
%8 = getelementptr inbounds [54 x i8], [54 x i8]* %4, i64 0, i64 0
%9 = load i32*, i32** %3
%10 = call i32 @fread(i8* %8, i32 1, i32 54, i32* %9)
%11 = getelementptr inbounds [54 x i8], [54 x i8]* %4, i64 0, i64 22
%12 = bitcast i8* %11 to i32*
%13 = load i32, i32* %12
store i32 %13, i32* %5
%14 = load i32*, i32** %3
%15 = call i32 @fclose(i32* %14)
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
define i32 @fileheight(i8* nocapture %0) {
%2 = alloca [54 x i8]
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [54 x i8], [54 x i8]* %2, i64 0, i64 0
%5 = call i32 @fread(i8* %4, i32 1, i32 54, i32* %3)
%6 = getelementptr inbounds [54 x i8], [54 x i8]* %2, i64 0, i64 22
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = tail call i32 @fclose(i32* %3)
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
int /*<<< orphan*/ snprintf(char *, int, char *);
int strlen(char *);
int main(int argc, char **argv) {
  char buffer[64];
  int x = 1;
  snprintf(buffer, sizeof(buffer), argv[1]);
  buffer[sizeof(buffer) - 1] = 0;
  int howmuch = strlen(buffer);
  printf("Buffer:(%d) \nData:%s\n", howmuch, buffer);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x54(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
mov    $0x40,%esi
call   1050 <snprintf@plt>
movb   $0x0,-0x11(%rbp)
lea    -0x50(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x58(%rbp)
mov    -0x58(%rbp),%esi
lea    -0x50(%rbp),%rdx
lea    0xe7f(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
mov    0x8(%rsi),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x40,%esi
call   1050 <snprintf@plt>
movb   $0x0,0x3f(%rsp)
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xea3(%rip),%rdi
mov    %eax,%esi
mov    %rbx,%rdx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Buffer:(%d) \0AData:%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [64 x i8]
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %7
%9 = getelementptr inbounds [64 x i8], [64 x i8]* %6, i64 0, i64 0
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @snprintf(i8* %9, i32 64, i8* %12)
%14 = getelementptr inbounds [64 x i8], [64 x i8]* %6, i64 0, i64 63
store i8 0, i8* %14
%15 = getelementptr inbounds [64 x i8], [64 x i8]* %6, i64 0, i64 0
%16 = call i32 @strlen(i8* %15)
store i32 %16, i32* %8
%17 = load i32, i32* %8
%18 = getelementptr inbounds [64 x i8], [64 x i8]* %6, i64 0, i64 0
%19 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %17, i8* %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"Buffer:(%d) \0AData:%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [64 x i8]
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = call i32 @snprintf(i8* %4, i32 64, i8* %6)
%8 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 63
store i8 0, i8* %8
%9 = call i32 @strlen(i8* %4)
%10 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %4)
ret i32 0
}
double dot(double v1[3], double v2[3]) {
  return v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2];
}


x86 assembly (clang, -O0):
<dot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dot>:
movsd  0x8(%rdi),%xmm0
mulsd  0x8(%rsi),%xmm0
movsd  (%rdi),%xmm1
mulsd  (%rsi),%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  0x10(%rsi),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dot(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 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = load double*, double** %3
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = fmul double %13, %16
%18 = call double @llvm.fmuladd.f64(double %7, double %10, double %17)
%19 = load double*, double** %3
%20 = getelementptr inbounds double, double* %19, i64 2
%21 = load double, double* %20
%22 = load double*, double** %4
%23 = getelementptr inbounds double, double* %22, i64 2
%24 = load double, double* %23
%25 = call double @llvm.fmuladd.f64(double %21, double %24, double %18)
ret double %25
}

LLVM IR (-O2):
define double @dot(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = getelementptr inbounds double, double* %0, i64 1
%6 = load double, double* %5
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = load double, double* %7
%9 = fmul double %6, %8
%10 = tail call double @llvm.fmuladd.f64(double %3, double %4, double %9)
%11 = getelementptr inbounds double, double* %0, i64 2
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %1, i64 2
%14 = load double, double* %13
%15 = tail call double @llvm.fmuladd.f64(double %12, double %14, double %10)
ret double %15
}
/* Type definitions */
struct iommu_group {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENODEV;
struct iommu_group *ERR_PTR(int /*<<< orphan*/);
struct iommu_group *iommu_group_alloc(void) {
  return ERR_PTR(-ENODEV);
}


x86 assembly (clang, -O0):
<iommu_group_alloc>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    0x2ec3(%rip),%rax
sub    (%rax),%edi
call   1030 <ERR_PTR@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<iommu_group_alloc>:
mov    0x2ec9(%rip),%rax
xor    %edi,%edi
sub    (%rax),%edi
jmp    1030 <ERR_PTR@plt>

LLVM IR (-O0):
%struct.iommu_group = type { i32 }
@ENODEV = global i32 0
define %struct.iommu_group* @iommu_group_alloc() {
%1 = load i32, i32* @ENODEV
%2 = sub nsw i32 0, %1
%3 = call %struct.iommu_group* @ERR_PTR(i32 %2)
ret %struct.iommu_group* %3
}

LLVM IR (-O2):
%struct.iommu_group = type { i32 }
@ENODEV = global i32 0
define %struct.iommu_group* @iommu_group_alloc() {
%1 = load i32, i32* @ENODEV
%2 = sub nsw i32 0, %1
%3 = tail call %struct.iommu_group* @ERR_PTR(i32 %2)
ret %struct.iommu_group* %3
}
int execle(const char *file, const char *arg, ...) {}


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

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

LLVM IR (-O0):
define i32 @execle(i8* %0, i8* %1, ...) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @execle(i8* nocapture readnone %0, i8* nocapture readnone %1, ...) {
ret i32 undef
}
void pcie_aspm_init_link_state(struct pci_dev *pdev) {}


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

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

LLVM IR (-O0):
%struct.pci_dev = type opaque
define void @pcie_aspm_init_link_state(%struct.pci_dev* %0) {
%2 = alloca %struct.pci_dev*
store %struct.pci_dev* %0, %struct.pci_dev** %2
ret void
}

LLVM IR (-O2):
%struct.pci_dev = type opaque
define void @pcie_aspm_init_link_state(%struct.pci_dev* nocapture %0) {
ret void
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMR95_get(void) { return U_WMRCORENONE_get("U_WMR95"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR95\00"
define i32 @U_WMR95_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR95\00"
define i32 @U_WMR95_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
int priority(int op) {
  switch (op) {
  case 14:
    return (2);
  case 24:
  case 19:
    return (1);
  case 34:
  case 29:
    return (0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<priority>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xfffffff2,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x14,%eax
ja     1154 <priority+0x54>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x2,-0x4(%rbp)
jmp    115b <priority+0x5b>
movl   $0x1,-0x4(%rbp)
jmp    115b <priority+0x5b>
movl   $0x0,-0x4(%rbp)
jmp    115b <priority+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<priority>:
add    $0xfffffff2,%edi
cmp    $0x14,%edi
ja     111d <priority+0x1d>
mov    $0x2,%eax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @priority(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 14, label %5
i32 24, label %6
i32 19, label %6
i32 34, label %7
i32 29, label %7
]
5: ; preds = %1
store i32 2, i32* %2
br label %9
6: ; preds = %1, %1
store i32 1, i32* %2
br label %9
7: ; preds = %1, %1
store i32 0, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @priority(i32 %0) {
switch i32 %0, label %4 [
i32 14, label %5
i32 24, label %2
i32 19, label %2
i32 34, label %3
i32 29, label %3
]
2: ; preds = %1, %1
br label %5
3: ; preds = %1, %1
br label %5
4: ; preds = %1
br label %5
5: ; preds = %1, %4, %3, %2
%6 = phi i32 [ 0, %4 ], [ 0, %3 ], [ 1, %2 ], [ 2, %1 ]
ret i32 %6
}
unsigned long long f3(long long diff) {
  return ((unsigned long long)(diff < 0 ? -diff : diff));
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1122 <f3+0x22>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112a <f3+0x2a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @f3(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64, i64* %2
%7 = sub nsw i64 0, %6
br label %10
8: ; preds = %1
%9 = load i64, i64* %2
br label %10
10: ; preds = %8, %5
%11 = phi i64 [ %7, %5 ], [ %9, %8 ]
ret i64 %11
}

LLVM IR (-O2):
define i64 @f3(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
void XtCvtIntToBool() {}


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

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

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

LLVM IR (-O2):
define void @XtCvtIntToBool() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void *hilo1(void *arg) { printf("hola"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"hola\00"
define noalias i8* @hilo1(i8* nocapture readnone %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ putch(int /*<<< orphan*/);
void putstr(const char *s) {
  while (*s)
    putch(*s++);
}


x86 assembly (clang, -O0):
<putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <putstr+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <putch@plt>
jmp    111c <putstr+0xc>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @putstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @putch(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
void w_quick_sort_int_save(void *data, int i, void *key) {
  int *ints = (int *)data;
  *(int *)key = ints[i];
}


x86 assembly (clang, -O0):
<w_quick_sort_int_save>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<w_quick_sort_int_save>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%eax
mov    %eax,(%rdx)
ret

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

LLVM IR (-O2):
define void @w_quick_sort_int_save(i8* nocapture %0, i32 %1, i8* nocapture writeonly %2) {
%4 = bitcast i8* %0 to i32*
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i32, i32* %4, i64 %5
%7 = load i32, i32* %6
%8 = bitcast i8* %2 to i32*
store i32 %7, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_sample_format_valid() {
  printf("NOT IMPLEMENTED:"
         "pa_sample_format_valid"
         "\n");
}


x86 assembly (clang, -O0):
<pa_sample_format_valid>:
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_sample_format_valid>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [39 x i8] c"NOT IMPLEMENTED:pa_sample_format_valid\00"
define i32 @pa_sample_format_valid() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int test_imm_DBint16_reg(short val) {
  return ((val) & (0xDB << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_DBint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xdb,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_DBint16_reg(i16 signext %0) {
%2 = and i16 %0, 219
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void rct_set_vin_lvds_pad(int mode) {}


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

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

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

LLVM IR (-O2):
define void @rct_set_vin_lvds_pad(i32 %0) {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint8_t uint32_big_encode(uint32_t value, uint8_t *p_encoded_data) {
  return sizeof(uint32_t);
}


x86 assembly (clang, -O0):
<uint32_big_encode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x4,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @uint32_big_encode(i32 %0, i32* nocapture readnone %1) {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned int, unsigned int);
void aeh_signature_toString(unsigned long crc, char *buf) {
  sprintf(buf, "%04X-%04X", (unsigned)((crc >> 16) & 0xffff),
          (unsigned)(crc & 0xffff));
}


x86 assembly (clang, -O0):
<aeh_signature_toString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
shr    $0x10,%rax
and    $0xffff,%rax
mov    %eax,%edx
mov    -0x8(%rbp),%rax
and    $0xffff,%rax
mov    %eax,%ecx
lea    0xeb9(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aeh_signature_toString>:
mov    %rsi,%rax
movzwl %di,%ecx
mov    %edi,%edx
shr    $0x10,%edx
lea    0xede(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"%04X-%04X\00"
define void @aeh_signature_toString(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i64, i64* %3
%7 = lshr i64 %6, 16
%8 = and i64 %7, 65535
%9 = trunc i64 %8 to i32
%10 = load i64, i64* %3
%11 = and i64 %10, 65535
%12 = trunc i64 %11 to i32
%13 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%04X-%04X\00"
define void @aeh_signature_toString(i64 %0, i8* nocapture writeonly %1) {
%3 = trunc i64 %0 to i32
%4 = lshr i32 %3, 16
%5 = and i32 %3, 65535
%6 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ execvp(char *, char **);
void exec_arg(char **arg) { execvp(arg[0], &(arg[0])); }


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

x86 assembly (clang, -O2):
<exec_arg>:
mov    %rdi,%rsi
mov    (%rdi),%rdi
jmp    1030 <execvp@plt>

LLVM IR (-O0):
define void @exec_arg(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = load i8**, i8*** %2
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = call i32 @execvp(i8* %5, i8** %7)
ret void
}

LLVM IR (-O2):
define void @exec_arg(i8** %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @execvp(i8* %2, i8** %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ printf(char *, int);
int __gcc_personality_v0(int v, ...) {
  printf("You are in a very strange, bad place. (GCC personality %d)\n", v);
  abort();
}


x86 assembly (clang, -O0):
<__gcc_personality_v0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<__gcc_personality_v0>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [60 x i8] c"You are in a very strange, bad place. (GCC personality %d)\0A\00"
define i32 @__gcc_personality_v0(i32 %0, ...) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@.str = [60 x i8] c"You are in a very strange, bad place. (GCC personality %d)\0A\00"
define i32 @__gcc_personality_v0(i32 %0, ...) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syscon_write_multprec_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(441, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_write_multprec_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1b9,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_write_multprec_system>:
mov    $0x1b9,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @syscon_write_multprec_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 441, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @syscon_write_multprec_system() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 441, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
char *XtMalloc(int);
char *xmalloc(int n) { return XtMalloc(n); }


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

x86 assembly (clang, -O2):
<xmalloc>:
jmp    1030 <XtMalloc@plt>

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

LLVM IR (-O2):
define i8* @xmalloc(i32 %0) {
%2 = tail call i8* @XtMalloc(i32 %0)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ in_addr_t;

/* Variables and functions */
int /*<<< orphan*/ inet_addr(char const *);
int /*<<< orphan*/ ntohl(int /*<<< orphan*/);
in_addr_t inet_network(const char *p) { return ntohl(inet_addr(p)); }


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

x86 assembly (clang, -O2):
<inet_network>:
push   %rax
call   1030 <inet_addr@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <ntohl@plt>

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

LLVM IR (-O2):
define i32 @inet_network(i8* %0) {
%2 = tail call i32 @inet_addr(i8* %0)
%3 = tail call i32 @ntohl(i32 %2)
ret i32 %3
}
int comp_double_asc(const void *p_d1, const void *p_d2) {
  double d1 = *(double *)p_d1;
  double d2 = *(double *)p_d2;
  if (d1 < d2) {
    return -1;
  }
  if (d1 > d2) {
    return +1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<comp_double_asc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1146 <comp_double_asc+0x46>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <comp_double_asc+0x69>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    1162 <comp_double_asc+0x62>
movl   $0x1,-0x4(%rbp)
jmp    1169 <comp_double_asc+0x69>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp_double_asc>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @comp_double_asc(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp olt double %4, %6
%8 = fcmp ogt double %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}