xunge/DecIR huggingface dataset:
/* Type definitions */
struct aiocb {
  int aio_fildes;
  int aio_nbytes;
  char *aio_buf;
  int /*<<< orphan*/ aio_offset;
};
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
void populate_aiocb(struct aiocb *aio, int fd, off_t offset, int bytes,
                    char *buf) {
  aio->aio_fildes = fd;
  aio->aio_offset = offset;
  aio->aio_nbytes = bytes;
  aio->aio_buf = buf;
}


x86 assembly (clang, -O0):
<populate_aiocb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x10(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<populate_aiocb>:
mov    %esi,(%rdi)
mov    %edx,0x10(%rdi)
mov    %ecx,0x4(%rdi)
mov    %r8,0x8(%rdi)
ret

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

LLVM IR (-O2):
%struct.aiocb = type { i32, i32, i8*, i32 }
define void @populate_aiocb(%struct.aiocb* nocapture writeonly %0, i32 %1, i32 %2, i32 %3, i8* %4) {
%6 = getelementptr inbounds %struct.aiocb, %struct.aiocb* %0, i64 0, i32 0
store i32 %1, i32* %6
%7 = getelementptr inbounds %struct.aiocb, %struct.aiocb* %0, i64 0, i32 3
store i32 %2, i32* %7
%8 = getelementptr inbounds %struct.aiocb, %struct.aiocb* %0, i64 0, i32 1
store i32 %3, i32* %8
%9 = getelementptr inbounds %struct.aiocb, %struct.aiocb* %0, i64 0, i32 2
store i8* %4, i8** %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ split(int *, size_t, int *);
void mergeSort(int *array, size_t size, int *trackers) {
  split(array, size, trackers);
}


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

x86 assembly (clang, -O2):
<mergeSort>:
jmp    1030 <split@plt>

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

LLVM IR (-O2):
define void @mergeSort(i32* %0, i64 %1, i32* %2) {
%4 = tail call i32 @split(i32* %0, i64 %1, i32* %2)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int verify_cksum(uint8_t *pkt) {
  int sum = 0;
  int i;
  for (i = 0; i < 11; i++)
    sum += pkt[i];
  sum &= 0xff;
  return (sum == pkt[9]);
}


x86 assembly (clang, -O0):
<verify_cksum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0xb,-0x10(%rbp)
jge    113f <verify_cksum+0x3f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <verify_cksum+0x16>
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    0x24(%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<verify_cksum>:
movdqu 0x4(%rdi),%xmm0
movdqu 0x14(%rdi),%xmm1
paddd  %xmm0,%xmm1
pshufd $0xee,%xmm1,%xmm0
paddd  %xmm1,%xmm0
pshufd $0x55,%xmm0,%xmm1
paddd  %xmm0,%xmm1
movd   %xmm1,%eax
add    (%rdi),%eax
mov    0x24(%rdi),%ecx
add    %ecx,%eax
add    0x28(%rdi),%eax
movzbl %al,%edx
xor    %eax,%eax
cmp    %ecx,%edx
sete   %al
ret

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

LLVM IR (-O2):
define i32 @verify_cksum(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = bitcast i32* %3 to <8 x i32>*
%5 = load <8 x i32>, <8 x i32>* %4
%6 = getelementptr inbounds i32, i32* %0, i64 9
%7 = load i32, i32* %6
%8 = call i32 @llvm.vector.reduce.add.v8i32(<8 x i32> %5)
%9 = add nsw i32 %8, %2
%10 = add nsw i32 %9, %7
%11 = getelementptr inbounds i32, i32* %0, i64 10
%12 = load i32, i32* %11
%13 = add nsw i32 %12, %10
%14 = and i32 %13, 255
%15 = icmp eq i32 %14, %7
%16 = zext i1 %15 to i32
ret i32 %16
}
int getopt(argc, argv, optstring)
int argc;
char *const *argv;
const char *optstring;
{
  return _getopt_internal(argc, argv, optstring, (const struct option *)0,
                          (int *)0, 0);
}


x86 assembly (clang, -O0):
<getopt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%r8d
xor    %r9d,%r9d
mov    %r8,%rcx
mov    $0x0,%al
call   1030 <_getopt_internal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getopt>:
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
xor    %eax,%eax
jmp    1030 <_getopt_internal@plt>

LLVM IR (-O0):
%struct.option = type opaque
define i32 @getopt(i32 %0, i8** %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = load i8*, i8** %6
%10 = call i32 (i32, i8**, i8*, %struct.option*, i32*, i32, ...) bitcast (i32 (...)* @_getopt_internal to i32 (i32, i8**, i8*, %struct.option*, i32*, i32, ...)*)(i32 %7, i8** %8, i8* %9, %struct.option* null, i32* null, i32 0)
ret i32 %10
}

LLVM IR (-O2):
%struct.option = type opaque
define i32 @getopt(i32 %0, i8** %1, i8* %2) {
%4 = tail call i32 (i32, i8**, i8*, %struct.option*, i32*, i32, ...) bitcast (i32 (...)* @_getopt_internal to i32 (i32, i8**, i8*, %struct.option*, i32*, i32, ...)*)(i32 %0, i8** %1, i8* %2, %struct.option* null, i32* null, i32 0)
ret i32 %4
}
int __crow_mod(int a, int b) { return a % b; }


x86 assembly (clang, -O0):
<__crow_mod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__crow_mod>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @__crow_mod(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 = srem i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @__crow_mod(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
ret i32 %3
}
int tok_add(char *buf, unsigned *cur, unsigned max, char ch) {
  if (*cur < max) {
    buf[*cur] = ch;
    (*cur)++;
    return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<tok_add>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %al,-0x1d(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
cmp    -0x1c(%rbp),%eax
jae    114a <tok_add+0x4a>
mov    -0x1d(%rbp),%dl
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1151 <tok_add+0x51>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tok_add>:
mov    (%rsi),%r8d
mov    $0xffffffff,%eax
cmp    %edx,%r8d
jae    1116 <tok_add+0x16>
mov    %cl,(%rdi,%r8,1)
addl   $0x1,(%rsi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @tok_add(i8* nocapture writeonly %0, i32* nocapture %1, i32 %2, i8 signext %3) {
%5 = load i32, i32* %1
%6 = icmp ult i32 %5, %2
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = zext i32 %5 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
store i8 %3, i8* %9
%10 = load i32, i32* %1
%11 = add i32 %10, 1
store i32 %11, i32* %1
br label %12
12: ; preds = %4, %7
%13 = phi i32 [ 0, %7 ], [ -1, %4 ]
ret i32 %13
}
int test_imm_68int16_mem(short *val) {
  return ((*val) & (-0x68 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_68int16_mem>:
movzwl (%rdi),%eax
test   $0xff98,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_68int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -104
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ suffix(char *);
int main() {
  char text[1000];
  printf("Text: ");
  scanf("%s", text);
  suffix(text);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
lea    -0x3f0(%rbp),%rsi
lea    0xeab(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x3f0(%rbp),%rdi
call   1040 <suffix@plt>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x3f0,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1040 <suffix@plt>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"Text: \00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1000 x i8]
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%7 = call i32 @suffix(i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"Text: \00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 @suffix(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ disp_str(char *);
void keyboard_handler(int irq) { disp_str("*"); }


x86 assembly (clang, -O0):
<keyboard_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <disp_str@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"*\00"
define void @keyboard_handler(i32 %0) {
%2 = tail call i32 @disp_str(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
OP(ed, ea) { illegal_2(); }


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_2()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ output(char *);
void printLoadAvg1Info(const char *cmd) {
  (void)cmd;
  output("Load average 1 min\t0\t0\t\n");
}


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"Load average 1 min\090\090\09\0A\00"
define void @printLoadAvg1Info(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @output(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Load average 1 min\090\090\09\0A\00"
define void @printLoadAvg1Info(i8* nocapture readnone %0) {
%2 = tail call i32 @output(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_7Cuint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x7C << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_7Cuint64_highword_reg>:
movabs $0x7c00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_7Cuint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 124
%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_7Cuint64_highword_reg(i64 %0) {
%2 = and i64 %0, 532575944704
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ C67_asm(char *, int /*<<< orphan*/, int, int);
void C67_SPTRUNC(int r, int v) { C67_asm("SPTRUNC.L", 0, r, v); }


x86 assembly (clang, -O0):
<C67_SPTRUNC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xed5(%rip),%rdi
xor    %esi,%esi
call   1030 <C67_asm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C67_SPTRUNC>:
mov    %esi,%ecx
mov    %edi,%edx
lea    0xee5(%rip),%rdi
xor    %esi,%esi
jmp    1030 <C67_asm@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"SPTRUNC.L\00"
define void @C67_SPTRUNC(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 @C67_asm(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0, i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"SPTRUNC.L\00"
define void @C67_SPTRUNC(i32 %0, i32 %1) {
%3 = tail call i32 @C67_asm(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0, i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HwFreedomHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void HwFreedomUpdated() { UAVObjUpdated(HwFreedomHandle()); }


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

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

LLVM IR (-O0):
define void @HwFreedomUpdated() {
%1 = call i32 (...) @HwFreedomHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @HwFreedomUpdated() {
%1 = tail call i32 (...) @HwFreedomHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ printf(char *);
int tcsetattr(int fd __attribute__((unused)),
              int optional_actions __attribute__((unused)),
              const struct termios *termios_p __attribute__((unused))) {
  printf("tcsetattr\n");
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<tcsetattr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%ecx
mov    0x2e9a(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcsetattr>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ec4(%rip),%rax
mov    (%rax),%eax
mov    0x2eab(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.termios = type { i32 }
@.str = [11 x i8] c"tcsetattr\0A\00"
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @tcsetattr(i32 %0, i32 %1, %struct.termios* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.termios*
store i32 %0, i32* %4
store i32 %1, i32* %5
store %struct.termios* %2, %struct.termios** %6
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @ENOSYS
store i32 %8, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
@str = [10 x i8] c"tcsetattr\00"
define i32 @tcsetattr(i32 %0, i32 %1, %struct.termios* nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ memcpy(char *, char *, int);
char *subString(char *input, int start, int end) {
  char *result = malloc(end - start + 1);
  memcpy(result, &input[start], end - start);
  result[end - start] = '\0';
  return result;
}


x86 assembly (clang, -O0):
<subString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%edi
sub    -0xc(%rbp),%edi
add    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
mov    -0x10(%rbp),%edx
sub    -0xc(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%ecx
sub    -0xc(%rbp),%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<subString>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%r15d
mov    %rdi,%r14
sub    %esi,%ebx
lea    0x1(%rbx),%edi
call   1040 <malloc@plt>
mov    %rax,%rbp
movslq %r15d,%rsi
add    %r14,%rsi
mov    %rax,%rdi
mov    %ebx,%edx
call   1030 <memcpy@plt>
movslq %ebx,%rax
movb   $0x0,0x0(%rbp,%rax,1)
mov    %rbp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @subString(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = sub nsw i32 %8, %9
%11 = add nsw i32 %10, 1
%12 = call i8* @malloc(i32 %11)
store i8* %12, i8** %7
%13 = load i8*, i8** %7
%14 = load i8*, i8** %4
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i32, i32* %6
%19 = load i32, i32* %5
%20 = sub nsw i32 %18, %19
%21 = call i32 @memcpy(i8* %13, i8* %17, i32 %20)
%22 = load i8*, i8** %7
%23 = load i32, i32* %6
%24 = load i32, i32* %5
%25 = sub nsw i32 %23, %24
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8, i8* %22, i64 %26
store i8 0, i8* %27
%28 = load i8*, i8** %7
ret i8* %28
}

LLVM IR (-O2):
define i8* @subString(i8* %0, i32 %1, i32 %2) {
%4 = sub nsw i32 %2, %1
%5 = add nsw i32 %4, 1
%6 = tail call i8* @malloc(i32 %5)
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = tail call i32 @memcpy(i8* %6, i8* %8, i32 %4)
%10 = sext i32 %4 to i64
%11 = getelementptr inbounds i8, i8* %6, i64 %10
store i8 0, i8* %11
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int /*<<< orphan*/ myfoo(int *);
void mallocFreeUse_params() {
  int *p = malloc(12);
  free(p);
  myfoo(p);
}


x86 assembly (clang, -O0):
<mallocFreeUse_params>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xc,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
call   1040 <myfoo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mallocFreeUse_params>:
push   %rbx
mov    $0xc,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <myfoo@plt>

LLVM IR (-O0):
define void @mallocFreeUse_params() {
%1 = alloca i32*
%2 = call i32* @malloc(i32 12)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @free(i32* %3)
%5 = load i32*, i32** %1
%6 = call i32 @myfoo(i32* %5)
ret void
}

LLVM IR (-O2):
define void @mallocFreeUse_params() {
%1 = tail call i32* @malloc(i32 12)
%2 = tail call i32 @free(i32* %1)
%3 = tail call i32 @myfoo(i32* %1)
ret void
}
double GetTFahrenheitFromTRankine(double T_R) { return T_R - 459.67; }


x86 assembly (clang, -O0):
<GetTFahrenheitFromTRankine>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetTFahrenheitFromTRankine>:
addsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @GetTFahrenheitFromTRankine(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 4.596700e+02
ret double %4
}

LLVM IR (-O2):
define double @GetTFahrenheitFromTRankine(double %0) {
%2 = fadd double %0, -4.596700e+02
ret double %2
}
/* Variables and functions */
int roadmap_shape_count();
int /*<<< orphan*/ roadmap_square_set_current(int);
int roadmap_square_has_shapes(int square) {
  roadmap_square_set_current(square);
  return roadmap_shape_count();
}


x86 assembly (clang, -O0):
<roadmap_square_has_shapes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <roadmap_square_set_current@plt>
mov    $0x0,%al
call   1030 <roadmap_shape_count@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roadmap_square_has_shapes>:
push   %rax
call   1040 <roadmap_square_set_current@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <roadmap_shape_count@plt>

LLVM IR (-O0):
define i32 @roadmap_square_has_shapes(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @roadmap_square_set_current(i32 %3)
%5 = call i32 (...) @roadmap_shape_count()
ret i32 %5
}

LLVM IR (-O2):
define i32 @roadmap_square_has_shapes(i32 %0) {
%2 = tail call i32 @roadmap_square_set_current(i32 %0)
%3 = tail call i32 (...) @roadmap_shape_count()
ret i32 %3
}
/* Variables and functions */
int launch(char **);
int execute(char **args) { return args[0] ? launch(args) : 0; }


x86 assembly (clang, -O0):
<execute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     113b <execute+0x2b>
mov    -0x8(%rbp),%rdi
call   1030 <launch@plt>
mov    %eax,-0xc(%rbp)
jmp    1145 <execute+0x35>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1145 <execute+0x35>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execute>:
cmpq   $0x0,(%rdi)
je     111b <execute+0xb>
jmp    1030 <launch@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @execute(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 = icmp ne i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8**, i8*** %2
%9 = call i32 @launch(i8** %8)
br label %11
10: ; preds = %1
br label %11
11: ; preds = %10, %7
%12 = phi i32 [ %9, %7 ], [ 0, %10 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @execute(i8** %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @launch(i8** %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void failwhale(int index, int key) {
  printf("Incorrect value in final hash table at index %d: %d\n", index, key);
  printf("\nfail whale :(\n");
  exit(1);
}


x86 assembly (clang, -O0):
<failwhale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<failwhale>:
push   %rax
mov    %esi,%edx
mov    %edi,%esi
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeeb(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"Incorrect value in final hash table at index %d: %d\0A\00"
@.str.1 = [16 x i8] c"\0Afail whale :(\0A\00"
define void @failwhale(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 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [53 x i8] c"Incorrect value in final hash table at index %d: %d\0A\00"
@str = [15 x i8] c"\0Afail whale :(\00"
define void @failwhale(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Fortran2cstring(char *, char *, int, int);
int PAPI_query_named_event(char *);
void papif_query_named_event__(char *EventName, int *check, int Event_len) {
  char tmp[128];
  Fortran2cstring(tmp, EventName, 128, Event_len);
  *check = PAPI_query_named_event(tmp);
}


x86 assembly (clang, -O0):
<papif_query_named_event__>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%ecx
mov    $0x80,%edx
call   1040 <Fortran2cstring@plt>
lea    -0xa0(%rbp),%rdi
call   1030 <PAPI_query_named_event@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_query_named_event__>:
push   %r14
push   %rbx
sub    $0x88,%rsp
mov    %edx,%ecx
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x80,%edx
call   1040 <Fortran2cstring@plt>
mov    %r14,%rdi
call   1030 <PAPI_query_named_event@plt>
mov    %eax,(%rbx)
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @papif_query_named_event__(i8* %0, i32* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca [128 x i8]
store i8* %0, i8** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%9 = load i8*, i8** %4
%10 = load i32, i32* %6
%11 = call i32 @Fortran2cstring(i8* %8, i8* %9, i32 128, i32 %10)
%12 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%13 = call i32 @PAPI_query_named_event(i8* %12)
%14 = load i32*, i32** %5
store i32 %13, i32* %14
ret void
}

LLVM IR (-O2):
define void @papif_query_named_event__(i8* %0, i32* nocapture writeonly %1, i32 %2) {
%4 = alloca [128 x i8]
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%6 = call i32 @Fortran2cstring(i8* %5, i8* %0, i32 128, i32 %2)
%7 = call i32 @PAPI_query_named_event(i8* %5)
store i32 %7, i32* %1
ret void
}
/* Variables and functions */
float cosf(float);
float sine_ease_in_out(float p) {
  return 0.5f * (1.0f - cosf(p * 3.1415926536f));
}


x86 assembly (clang, -O0):
<sine_ease_in_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xee3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
call   1030 <cosf@plt>
movss  0xecd(%rip),%xmm1
subss  %xmm0,%xmm1
movss  0xebd(%rip),%xmm0
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sine_ease_in_out>:
push   %rax
mulss  0xee7(%rip),%xmm0
call   1030 <cosf@plt>
movss  0xede(%rip),%xmm1
subss  %xmm0,%xmm1
mulss  0xed6(%rip),%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @sine_ease_in_out(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 0x400921FB60000000
%5 = call float @cosf(float %4)
%6 = fsub float 1.000000e+00, %5
%7 = fmul float 5.000000e-01, %6
ret float %7
}

LLVM IR (-O2):
define float @sine_ease_in_out(float %0) {
%2 = fmul float %0, 0x400921FB60000000
%3 = tail call float @cosf(float %2)
%4 = fsub float 1.000000e+00, %3
%5 = fmul float %4, 5.000000e-01
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char const *, char *, int *);
void funcChar2Int(const char *pcI, int *piI) { sscanf(pcI, "%d", piI); }


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

x86 assembly (clang, -O2):
<funcChar2Int>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <sscanf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @funcChar2Int(i8* nocapture %0, i32* %1) {
%3 = tail call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void func3() {
  int i = 11, j = 999;
  printf("\t\t\t[in func3] i = %d, j = %d\n", i, j);
}


x86 assembly (clang, -O0):
<func3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xb,-0x4(%rbp)
movl   $0x3e7,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func3>:
lea    0xee9(%rip),%rdi
mov    $0xb,%esi
mov    $0x3e7,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"\09\09\09[in func3] i = %d, j = %d\0A\00"
define void @func3() {
%1 = alloca i32
%2 = alloca i32
store i32 11, i32* %1
store i32 999, i32* %2
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"\09\09\09[in func3] i = %d, j = %d\0A\00"
define void @func3() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 11, i32 999)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  printf("%s\n", "Hello World");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char *lp_mailer();
int use_mailer(void) {
  char *m = lp_mailer();
  if (m && *m)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<use_mailer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <lp_mailer@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <use_mailer+0x3a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114a <use_mailer+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1151 <use_mailer+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<use_mailer>:
push   %rax
xor    %eax,%eax
call   1030 <lp_mailer@plt>
test   %rax,%rax
je     112c <use_mailer+0x1c>
mov    %rax,%rcx
mov    $0x1,%eax
cmpb   $0x0,(%rcx)
je     112c <use_mailer+0x1c>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @use_mailer() {
%1 = tail call i8* (...) @lp_mailer()
%2 = icmp eq i8* %1, null
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %3, %0
br label %7
7: ; preds = %3, %6
%8 = phi i32 [ 0, %6 ], [ 1, %3 ]
ret i32 %8
}
/* Variables and functions */
size_t st_sizhash(const void *k, int type) {
  return (size_t)(*(const size_t *)k ^ (size_t)type);
}


x86 assembly (clang, -O0):
<st_sizhash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movslq -0xc(%rbp),%rcx
xor    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<st_sizhash>:
movslq %esi,%rax
xor    (%rdi),%rax
ret

LLVM IR (-O0):
define i64 @st_sizhash(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = xor i64 %7, %9
ret i64 %10
}

LLVM IR (-O2):
define i64 @st_sizhash(i8* nocapture %0, i32 %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = sext i32 %1 to i64
%6 = xor i64 %4, %5
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void mov_preg64preg64_reg8(int reg1, int reg2, int reg8) {
  put8(0x88);
  put8(0x04 | (reg8 << 3));
  put8((reg1 << 3) | reg2);
}


x86 assembly (clang, -O0):
<mov_preg64preg64_reg8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x88,%edi
call   1030 <put8@plt>
mov    -0xc(%rbp),%edi
shl    $0x3,%edi
or     $0x4,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     -0x8(%rbp),%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mov_preg64preg64_reg8>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%r14d
mov    %edi,%ebp
mov    $0x88,%edi
call   1030 <put8@plt>
lea    0x4(,%rbx,8),%edi
call   1030 <put8@plt>
shl    $0x3,%ebp
or     %r14d,%ebp
mov    %ebp,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @mov_preg64preg64_reg8(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 @put8(i32 136)
%8 = load i32, i32* %6
%9 = shl i32 %8, 3
%10 = or i32 4, %9
%11 = call i32 @put8(i32 %10)
%12 = load i32, i32* %4
%13 = shl i32 %12, 3
%14 = load i32, i32* %5
%15 = or i32 %13, %14
%16 = call i32 @put8(i32 %15)
ret void
}

LLVM IR (-O2):
define void @mov_preg64preg64_reg8(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @put8(i32 136)
%5 = shl i32 %2, 3
%6 = or i32 %5, 4
%7 = tail call i32 @put8(i32 %6)
%8 = shl i32 %0, 3
%9 = or i32 %8, %1
%10 = tail call i32 @put8(i32 %9)
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

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

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


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

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

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

LLVM IR (-O2):
define i64 @get_XEvent_xcrossing_window(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
double scale_h3(double, double, double);
double scale_dLz(double x, double y, double z, double dx, double dy,
                 double dz) {
  return scale_h3(x, y, z) * dz;
}


x86 assembly (clang, -O0):
<scale_dLz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1030 <scale_h3@plt>
mulsd  -0x30(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scale_dLz>:
push   %rax
movsd  %xmm5,(%rsp)
call   1030 <scale_h3@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @scale_dLz(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%13 = load double, double* %7
%14 = load double, double* %8
%15 = load double, double* %9
%16 = call double @scale_h3(double %13, double %14, double %15)
%17 = load double, double* %12
%18 = fmul double %16, %17
ret double %18
}

LLVM IR (-O2):
define double @scale_dLz(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = tail call double @scale_h3(double %0, double %1, double %2)
%8 = fmul double %7, %5
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ do_test();
int /*<<< orphan*/ ll_init();
int /*<<< orphan*/ ll_stop();
int main(int argc, char **argv) {
  (void)argc;
  (void)argv;
  ll_init();
  do_test();
  do_test();
  ll_stop();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 (...) @ll_init()
%9 = call i32 (...) @do_test()
%10 = call i32 (...) @do_test()
%11 = call i32 (...) @ll_stop()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @ll_init()
%4 = tail call i32 (...) @do_test()
%5 = tail call i32 (...) @do_test()
%6 = tail call i32 (...) @ll_stop()
ret i32 0
}
double ceil(double x) {
  int intnum = (int)x;
  if (x == (double)intnum) {
    return x;
  }
  return x < 0 ? (double)intnum : (double)(intnum + 1);
}


x86 assembly (clang, -O0):
<ceil>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jne    113a <ceil+0x3a>
jp     113a <ceil+0x3a>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1170 <ceil+0x70>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1157 <ceil+0x57>
cvtsi2sdl -0x14(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1166 <ceil+0x66>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceil>:
cvttsd2si %xmm0,%eax
cvttpd2dq %xmm0,%xmm1
cvtdq2pd %xmm1,%xmm1
add    $0x1,%eax
cvtsi2sd %eax,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm4
cmpltsd %xmm3,%xmm4
movapd %xmm4,%xmm3
andpd  %xmm1,%xmm3
andnpd %xmm2,%xmm4
orpd   %xmm3,%xmm4
cmpeqsd %xmm0,%xmm1
andpd  %xmm1,%xmm0
andnpd %xmm4,%xmm1
orpd   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @ceil(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
%5 = load double, double* %3
%6 = fptosi double %5 to i32
store i32 %6, i32* %4
%7 = load double, double* %3
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to double
%10 = fcmp oeq double %7, %9
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = load double, double* %3
store double %12, double* %2
br label %25
13: ; preds = %1
%14 = load double, double* %3
%15 = fcmp olt double %14, 0.000000e+00
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = load i32, i32* %4
%18 = sitofp i32 %17 to double
br label %23
19: ; preds = %13
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
%22 = sitofp i32 %21 to double
br label %23
23: ; preds = %19, %16
%24 = phi double [ %18, %16 ], [ %22, %19 ]
store double %24, double* %2
br label %25
25: ; preds = %23, %11
%26 = load double, double* %2
ret double %26
}

LLVM IR (-O2):
define double @ceil(double %0) {
%2 = fptosi double %0 to i32
%3 = sitofp i32 %2 to double
%4 = fcmp oeq double %3, %0
%5 = fcmp olt double %0, 0.000000e+00
%6 = add nsw i32 %2, 1
%7 = sitofp i32 %6 to double
%8 = select i1 %5, double %3, double %7
%9 = select i1 %4, double %0, double %8
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ pinza(int);
void pinzaOpen() { pinza(32); }


x86 assembly (clang, -O0):
<pinzaOpen>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
call   1030 <pinza@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pinzaOpen>:
mov    $0x20,%edi
jmp    1030 <pinza@plt>

LLVM IR (-O0):
define void @pinzaOpen() {
%1 = call i32 @pinza(i32 32)
ret void
}

LLVM IR (-O2):
define void @pinzaOpen() {
%1 = tail call i32 @pinza(i32 32)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ init();
int /*<<< orphan*/ play();
int main(int argc, char *argv[]) {
  init();
  play();
  endwin();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <init@plt>
mov    $0x0,%al
call   1030 <play@plt>
mov    $0x0,%al
call   1050 <endwin@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <init@plt>
xor    %eax,%eax
call   1030 <play@plt>
xor    %eax,%eax
call   1050 <endwin@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @init()
%7 = call i32 (...) @play()
%8 = call i32 (...) @endwin()
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @init()
%4 = tail call i32 (...) @play()
%5 = tail call i32 (...) @endwin()
%6 = tail call i32 @exit(i32 0)
unreachable
}