xunge/DecIR huggingface dataset:
/* Type definitions */
struct statvfs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fstatvfs(int, struct statvfs *);
int open_rdonly(char *);
int execute_fstatvfs() {
  struct statvfs fileStat;
  int fd = open_rdonly("syscalls.txt");
  fstatvfs(fd, &fileStat);
  return 0;
}


x86 assembly (clang, -O0):
<execute_fstatvfs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <open_rdonly@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1040 <fstatvfs@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execute_fstatvfs>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <open_rdonly@plt>
mov    %rsp,%rsi
mov    %eax,%edi
call   1040 <fstatvfs@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.statvfs = type { i32 }
@.str = [13 x i8] c"syscalls.txt\00"
define i32 @execute_fstatvfs() {
%1 = alloca %struct.statvfs
%2 = alloca i32
%3 = call i32 @open_rdonly(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @fstatvfs(i32 %4, %struct.statvfs* %1)
ret i32 0
}

LLVM IR (-O2):
%struct.statvfs = type { i32 }
@.str = [13 x i8] c"syscalls.txt\00"
define i32 @execute_fstatvfs() {
%1 = alloca %struct.statvfs
%2 = bitcast %struct.statvfs* %1 to i8*
%3 = tail call i32 @open_rdonly(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @fstatvfs(i32 %3, %struct.statvfs* %1)
ret i32 0
}
int f2(const char *my_string) { return my_string == "foo"; }


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0xef1(%rip),%rax
cmp    %rax,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
lea    0xef9(%rip),%rcx
xor    %eax,%eax
cmp    %rcx,%rdi
sete   %al
ret

LLVM IR (-O0):
@.str = [4 x i8] c"foo\00"
define i32 @f2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
@.str = [4 x i8] c"foo\00"
define i32 @f2(i8* readnone %0) {
%2 = icmp eq i8* %0, getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
%3 = zext i1 %2 to i32
ret i32 %3
}
int my_g(int x, ...) {
  int result;
  __builtin_va_list list;
  __builtin_va_start(list, x);
  result = my_h(list);
  __builtin_va_end(list);
  return result;
}


x86 assembly (clang, -O0):
<my_g>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
test   %al,%al
je     1149 <my_g+0x39>
movaps %xmm0,-0xa0(%rbp)
movaps %xmm1,-0x90(%rbp)
movaps %xmm2,-0x80(%rbp)
movaps %xmm3,-0x70(%rbp)
movaps %xmm4,-0x60(%rbp)
movaps %xmm5,-0x50(%rbp)
movaps %xmm6,-0x40(%rbp)
movaps %xmm7,-0x30(%rbp)
mov    %r9,-0xa8(%rbp)
mov    %r8,-0xb0(%rbp)
mov    %rcx,-0xb8(%rbp)
mov    %rdx,-0xc0(%rbp)
mov    %rsi,-0xc8(%rbp)
mov    %edi,-0x4(%rbp)
lea    -0xd0(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x30,-0x1c(%rbp)
movl   $0x8,-0x20(%rbp)
xor    %eax,%eax
lea    -0x20(%rbp),%rdi
call   1030 <my_h@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_g>:
sub    $0xd8,%rsp
mov    %rsi,0x28(%rsp)
mov    %rdx,0x30(%rsp)
mov    %rcx,0x38(%rsp)
mov    %r8,0x40(%rsp)
mov    %r9,0x48(%rsp)
test   %al,%al
je     116b <my_g+0x5b>
movaps %xmm0,0x50(%rsp)
movaps %xmm1,0x60(%rsp)
movaps %xmm2,0x70(%rsp)
movaps %xmm3,0x80(%rsp)
movaps %xmm4,0x90(%rsp)
movaps %xmm5,0xa0(%rsp)
movaps %xmm6,0xb0(%rsp)
movaps %xmm7,0xc0(%rsp)
lea    0x20(%rsp),%rax
mov    %rax,0x10(%rsp)
lea    0xe0(%rsp),%rax
mov    %rax,0x8(%rsp)
movabs $0x3000000008,%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
xor    %eax,%eax
call   1030 <my_h@plt>
add    $0xd8,%rsp
ret

LLVM IR (-O0):
%struct.__va_list_tag = type { i32, i32, i8*, i8* }
define i32 @my_g(i32 %0, ...) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [1 x %struct.__va_list_tag]
store i32 %0, i32* %2
%5 = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %4, i64 0, i64 0
%6 = bitcast %struct.__va_list_tag* %5 to i8*
%7 = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %4, i64 0, i64 0
%8 = call i32 (%struct.__va_list_tag*, ...) bitcast (i32 (...)* @my_h to i32 (%struct.__va_list_tag*, ...)*)(%struct.__va_list_tag* %7)
store i32 %8, i32* %3
%9 = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %4, i64 0, i64 0
%10 = bitcast %struct.__va_list_tag* %9 to i8*
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
%struct.__va_list_tag = type { i32, i32, i8*, i8* }
define i32 @my_g(i32 %0, ...) {
%2 = alloca [1 x %struct.__va_list_tag]
%3 = bitcast [1 x %struct.__va_list_tag]* %2 to i8*
%4 = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %2, i64 0, i64 0
%5 = call i32 (%struct.__va_list_tag*, ...) bitcast (i32 (...)* @my_h to i32 (%struct.__va_list_tag*, ...)*)(%struct.__va_list_tag* %4)
ret i32 %5
}
f3(a) long a;
{
  int i;
  for (i = 0; i < 10; i++) {
    if (--a == 0)
      return i;
  }
  return -1;
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    114d <f3+0x4d>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    113a <f3+0x3a>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1154 <f3+0x54>
jmp    113f <f3+0x3f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <f3+0xf>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
lea    -0x1(%rdi),%rax
cmp    $0x9,%rax
mov    $0x9,%ecx
cmovb  %rax,%rcx
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @f3(i64 %0) {
%2 = add i64 %0, -1
%3 = call i64 @llvm.umin.i64(i64 %2, i64 9)
%4 = trunc i64 %3 to i32
%5 = add i64 %0, -1
%6 = icmp ult i64 %5, 10
%7 = select i1 %6, i32 %4, i32 -1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ luhn_valid(char *);
int /*<<< orphan*/ printf(char *, char *);
void expectValid(char *a) {
  if (!luhn_valid(a)) {
    printf("`%s` expected to be valid\n\n", a);
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<expectValid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <luhn_valid@plt>
cmp    $0x0,%eax
jne    116c <expectValid+0x3c>
mov    -0x8(%rbp),%rsi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expectValid>:
push   %rbx
mov    %rdi,%rbx
call   1050 <luhn_valid@plt>
test   %eax,%eax
je     113f <expectValid+0xf>
pop    %rbx
ret
lea    0xeba(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"`%s` expected to be valid\0A\0A\00"
@EXIT_FAILURE = global i32 0
define void @expectValid(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @luhn_valid(i8* %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"`%s` expected to be valid\0A\0A\00"
@EXIT_FAILURE = global i32 0
define void @expectValid(i8* %0) {
%2 = tail call i32 @luhn_valid(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret void
}
void ASN1_object_size(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_object_size() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int f1(int *val1) {
  printf("\nin f1:\n");
  printf("* val1 = %d;\n", *val1);
  printf("address of val1 = %p;\n", val1);
  return *val1;
}


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

x86 assembly (clang, -O2):
<f1>:
push   %rbx
mov    %rdi,%rbx
lea    0xefa(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%esi
lea    0xec7(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec7(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"\0Ain f1:\0A\00"
@.str.1 = [14 x i8] c"* val1 = %d;\0A\00"
@.str.2 = [23 x i8] c"address of val1 = %p;\0A\00"
define i32 @f1(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i32*, i32** %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32* %7)
%9 = load i32*, i32** %2
%10 = load i32, i32* %9
ret i32 %10
}

LLVM IR (-O2):
@.str.1 = [14 x i8] c"* val1 = %d;\0A\00"
@.str.2 = [23 x i8] c"address of val1 = %p;\0A\00"
@str = [8 x i8] c"\0Ain f1:\00"
define i32 @f1(i32* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* %0
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32* %0)
%6 = load i32, i32* %0
ret i32 %6
}
/* Variables and functions */
void *shmat(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ throw(char *);
void *attach_segment(int segment_id) {
  void *shared_memory;
  if ((shared_memory = shmat(segment_id, NULL, 0)) == (void *)-1) {
    throw("Error attaching shared memory segment to address space");
  }
  return shared_memory;
}


x86 assembly (clang, -O0):
<attach_segment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1040 <shmat@plt>
mov    %rax,-0x10(%rbp)
mov    $0xffffffffffffffff,%rcx
cmp    %rcx,%rax
jne    1159 <attach_segment+0x39>
lea    0xeac(%rip),%rdi
call   1030 <throw@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<attach_segment>:
push   %rbx
xor    %esi,%esi
xor    %edx,%edx
call   1040 <shmat@plt>
mov    %rax,%rbx
cmp    $0xffffffffffffffff,%rax
jne    113f <attach_segment+0x1f>
lea    0xec6(%rip),%rdi
call   1030 <throw@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [55 x i8] c"Error attaching shared memory segment to address space\00"
define i8* @attach_segment(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @shmat(i32 %4, i32* null, i32 0)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, inttoptr (i64 -1 to i8*)
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @throw(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
@.str = [55 x i8] c"Error attaching shared memory segment to address space\00"
define i8* @attach_segment(i32 %0) {
%2 = tail call i8* @shmat(i32 %0, i32* null, i32 0)
%3 = icmp eq i8* %2, inttoptr (i64 -1 to i8*)
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @throw(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
int /*<<< orphan*/ rte_snprintf(char *, int, char *, unsigned int);
const char *get_rx_queue_name(unsigned id) {
  static char buffer[sizeof("MProc_Client_%u_RX") + 2];
  rte_snprintf(buffer, sizeof(buffer) - 1, "MProc_Client_%u_RX", id);
  return buffer;
}


x86 assembly (clang, -O0):
<get_rx_queue_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
lea    0x2f1b(%rip),%rdi
mov    $0x14,%esi
lea    0xecf(%rip),%rdx
call   1030 <rte_snprintf@plt>
lea    0x2f03(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_rx_queue_name>:
push   %rbx
mov    %edi,%ecx
lea    0x2f26(%rip),%rbx
lea    0xedf(%rip),%rdx
mov    %rbx,%rdi
mov    $0x14,%esi
call   1030 <rte_snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@get_rx_queue_name.buffer = internal global [21 x i8] zeroinitializer
@.str = [19 x i8] c"MProc_Client_%u_RX\00"
define i8* @get_rx_queue_name(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @rte_snprintf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @get_rx_queue_name.buffer, i64 0, i64 0), i32 20, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* getelementptr inbounds ([21 x i8], [21 x i8]* @get_rx_queue_name.buffer, i64 0, i64 0)
}

LLVM IR (-O2):
@get_rx_queue_name.buffer = internal global [21 x i8] zeroinitializer
@.str = [19 x i8] c"MProc_Client_%u_RX\00"
define i8* @get_rx_queue_name(i32 %0) {
%2 = tail call i32 @rte_snprintf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @get_rx_queue_name.buffer, i64 0, i64 0), i32 20, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* getelementptr inbounds ([21 x i8], [21 x i8]* @get_rx_queue_name.buffer, i64 0, i64 0)
}
float fahrenheit(float celsius) { return ((9.0 / 5.0) * celsius) + 32.0; }


x86 assembly (clang, -O0):
<fahrenheit>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee2(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @fahrenheit(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call double @llvm.fmuladd.f64(double 1.800000e+00, double %4, double 3.200000e+01)
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @fahrenheit(float %0) {
%2 = fpext float %0 to double
%3 = tail call double @llvm.fmuladd.f64(double %2, double 1.800000e+00, double 3.200000e+01)
%4 = fptrunc double %3 to float
ret float %4
}
int prime(int n) {
  int i;
  for (i = 2; i <= n / 2; ++i) {
    if (n % i == 0)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jg     115b <prime+0x5b>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1148 <prime+0x48>
movl   $0x0,-0x4(%rbp)
jmp    1162 <prime+0x62>
jmp    114d <prime+0x4d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <prime+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prime>:
mov    $0x1,%r8d
cmp    $0x4,%edi
jl     1137 <prime+0x37>
mov    %edi,%esi
shr    %esi
neg    %esi
mov    $0x2,%ecx
cs nopw 0x0(%rax,%rax,1)
mov    %edi,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     113b <prime+0x3b>
lea    (%rsi,%rcx,1),%eax
add    $0x1,%eax
add    $0x1,%ecx
cmp    $0x1,%eax
jne    1120 <prime+0x20>
mov    %r8d,%eax
ret
xor    %r8d,%r8d
mov    %r8d,%eax
ret

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

LLVM IR (-O2):
define i32 @prime(i32 %0) {
%2 = icmp slt i32 %0, 4
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = lshr i32 %0, 1
br label %8
5: ; preds = %8
%6 = add nuw nsw i32 %9, 1
%7 = icmp eq i32 %9, %4
br i1 %7, label %12, label %8
8: ; preds = %3, %5
%9 = phi i32 [ %6, %5 ], [ 2, %3 ]
%10 = srem i32 %0, %9
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %8, %5, %1
%13 = phi i32 [ 1, %1 ], [ 1, %5 ], [ 0, %8 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned short);
int main(void) {
  short int x = 65535;
  unsigned short int y = 65535;
  printf("signed short: %d\n", x);
  printf("unsigned short: %u\n", y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movw   $0xffff,-0x6(%rbp)
movw   $0xffff,-0x8(%rbp)
lea    0xece(%rip),%rdi
movzwl -0x6(%rbp),%esi
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
movzwl -0x8(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [18 x i8] c"signed short: %d\0A\00"
@.str.1 = [20 x i8] c"unsigned short: %u\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
%3 = alloca i16
store i32 0, i32* %1
store i16 -1, i16* %2
store i16 -1, i16* %3
%4 = load i16, i16* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i16 zeroext %4)
%6 = load i16, i16* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i16 zeroext %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"signed short: %d\0A\00"
@.str.1 = [20 x i8] c"unsigned short: %u\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i16 zeroext -1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i16 zeroext -1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("hello,\nworld\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"hello,\0Aworld\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void foo568(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo568(i32 %0) {
ret void
}
/* Variables and functions */
int partition(int *, int, int);
void qsort(int *a, int p, int r) {
  int q;
  if (p < r) {
    q = partition(a, p, r);
    qsort(a, p, q - 1);
    qsort(a, q + 1, r);
  }
}


x86 assembly (clang, -O0):
<qsort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <qsort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <qsort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <qsort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <qsort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <qsort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <qsort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @qsort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @qsort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
int add(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() { printf("2 + 2 = %d\n", add(2, 2)); }


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"2 + 2 = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @add(i32 2, i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int c_wait_job_recv();
int /*<<< orphan*/ c_wait_job_send();
int c_wait_job() {
  c_wait_job_send();
  return c_wait_job_recv();
}


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

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

LLVM IR (-O0):
define i32 @c_wait_job() {
%1 = call i32 (...) @c_wait_job_send()
%2 = call i32 (...) @c_wait_job_recv()
ret i32 %2
}

LLVM IR (-O2):
define i32 @c_wait_job() {
%1 = tail call i32 (...) @c_wait_job_send()
%2 = tail call i32 (...) @c_wait_job_recv()
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _reboot_usage(void) {
  fputs("Usage: "
        "reboot"
        "\n",
        stderr);
  return 1;
}


x86 assembly (clang, -O0):
<_reboot_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_reboot_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Usage: reboot\0A\00"
@stderr = global i32 0
define i32 @_reboot_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [15 x i8] c"Usage: reboot\0A\00"
@stderr = global i32 0
define i32 @_reboot_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
void create_descriptor(uint32_t base, uint32_t limit, uint16_t flag) {
  uint64_t descriptor;
  descriptor = limit & 0x000F0000;
  descriptor |= (flag << 8) & 0x00F0FF00;
  descriptor |= (base >> 16) & 0x000000FF;
  descriptor |= base & 0xFF000000;
  descriptor <<= 32;
  descriptor |= base << 16;
  descriptor |= limit & 0x0000FFFF;
}


x86 assembly (clang, -O0):
<create_descriptor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0xf0000,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
and    $0xf0ff00,%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff000000,%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffff,%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @create_descriptor(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = and i32 %8, 983040
store i32 %9, i32* %7
%10 = load i32, i32* %6
%11 = shl i32 %10, 8
%12 = and i32 %11, 15793920
%13 = load i32, i32* %7
%14 = or i32 %13, %12
store i32 %14, i32* %7
%15 = load i32, i32* %4
%16 = ashr i32 %15, 16
%17 = and i32 %16, 255
%18 = load i32, i32* %7
%19 = or i32 %18, %17
store i32 %19, i32* %7
%20 = load i32, i32* %4
%21 = and i32 %20, -16777216
%22 = load i32, i32* %7
%23 = or i32 %22, %21
store i32 %23, i32* %7
%24 = load i32, i32* %7
%25 = shl i32 %24, 32
store i32 %25, i32* %7
%26 = load i32, i32* %4
%27 = shl i32 %26, 16
%28 = load i32, i32* %7
%29 = or i32 %28, %27
store i32 %29, i32* %7
%30 = load i32, i32* %5
%31 = and i32 %30, 65535
%32 = load i32, i32* %7
%33 = or i32 %32, %31
store i32 %33, i32* %7
ret void
}

LLVM IR (-O2):
define void @create_descriptor(i32 %0, i32 %1, i32 %2) {
ret void
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int main() {
  int fd, r;
  struct sockaddr_in sa;
  fd = socket(AF_INET, SOCK_STREAM, 0);
  if (fd < 0) {
    printf("socket failed\n");
    return -1;
  }
  sleep(60);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    0x2e89(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1050 <socket@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    117d <main+0x4d>
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    118e <main+0x5e>
mov    $0x3c,%edi
call   1040 <sleep@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    0x2e97(%rip),%rax
mov    (%rax),%esi
xor    %ebx,%ebx
xor    %edx,%edx
call   1050 <socket@plt>
test   %eax,%eax
js     115c <main+0x2c>
mov    $0x3c,%edi
call   1040 <sleep@plt>
jmp    116d <main+0x3d>
lea    0xe9d(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [15 x i8] c"socket failed\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.sockaddr_in
store i32 0, i32* %1
%5 = load i32, i32* @AF_INET
%6 = load i32, i32* @SOCK_STREAM
%7 = call i32 @socket(i32 %5, i32 %6, i32 0)
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %1
br label %14
12: ; preds = %0
%13 = call i32 @sleep(i32 60)
store i32 0, i32* %1
br label %14
14: ; preds = %12, %10
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@str = [14 x i8] c"socket failed\00"
define i32 @main() {
%1 = load i32, i32* @AF_INET
%2 = load i32, i32* @SOCK_STREAM
%3 = tail call i32 @socket(i32 %1, i32 %2, i32 0)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
br label %9
7: ; preds = %0
%8 = tail call i32 @sleep(i32 60)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ -1, %5 ], [ 0, %7 ]
ret i32 %10
}
/* Type definitions */
struct file {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fist_print_generic_file3(char const *, char *,
                                            struct file const *);
void fist_print_generic_file(const char *str, const struct file *file) {
  fist_print_generic_file3(str, "", file);
}


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

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

LLVM IR (-O0):
%struct.file = type { i32 }
@.str = [1 x i8] zeroinitializer
define void @fist_print_generic_file(i8* %0, %struct.file* %1) {
%3 = alloca i8*
%4 = alloca %struct.file*
store i8* %0, i8** %3
store %struct.file* %1, %struct.file** %4
%5 = load i8*, i8** %3
%6 = load %struct.file*, %struct.file** %4
%7 = call i32 @fist_print_generic_file3(i8* %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %struct.file* %6)
ret void
}

LLVM IR (-O2):
%struct.file = type { i32 }
@.str = [1 x i8] zeroinitializer
define void @fist_print_generic_file(i8* %0, %struct.file* %1) {
%3 = tail call i32 @fist_print_generic_file3(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %struct.file* %1)
ret void
}
int gca_cmp2_ptr(const void *aa, const void *bb, void *p) {
  (void)p;
  const void *const a = *(const void *const *)aa;
  const void *const b = *(const void *const *)bb;
  return (((a) > (b)) - ((b) > (a)));
}


x86 assembly (clang, -O0):
<gca_cmp2_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x28(%rbp),%rcx
cmp    -0x20(%rbp),%rcx
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gca_cmp2_ptr>:
mov    (%rdi),%rcx
xor    %eax,%eax
cmp    (%rsi),%rcx
seta   %al
sbb    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @gca_cmp2_ptr(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%9 = load i8*, i8** %6
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i8**
%12 = load i8*, i8** %11
store i8* %12, i8** %7
%13 = load i8*, i8** %5
%14 = bitcast i8* %13 to i8**
%15 = load i8*, i8** %14
store i8* %15, i8** %8
%16 = load i8*, i8** %7
%17 = load i8*, i8** %8
%18 = icmp ugt i8* %16, %17
%19 = zext i1 %18 to i32
%20 = load i8*, i8** %8
%21 = load i8*, i8** %7
%22 = icmp ugt i8* %20, %21
%23 = zext i1 %22 to i32
%24 = sub nsw i32 %19, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @gca_cmp2_ptr(i8* nocapture %0, i8* nocapture %1, i8* nocapture readnone %2) {
%4 = bitcast i8* %0 to i8**
%5 = load i8*, i8** %4
%6 = bitcast i8* %1 to i8**
%7 = load i8*, i8** %6
%8 = icmp ugt i8* %5, %7
%9 = zext i1 %8 to i32
%10 = icmp ugt i8* %7, %5
%11 = sext i1 %10 to i32
%12 = add nsw i32 %11, %9
ret i32 %12
}
void dtlbmiss_except() {}


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

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

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

LLVM IR (-O2):
define void @dtlbmiss_except() {
ret void
}
/* Variables and functions */
float __avr32_f32_mul_fast(float, float);
float float_mul(float a, float b) { return __avr32_f32_mul_fast(a, b); }


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

x86 assembly (clang, -O2):
<float_mul>:
jmp    1030 <__avr32_f32_mul_fast@plt>

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

LLVM IR (-O2):
define float @float_mul(float %0, float %1) {
%3 = tail call float @__avr32_f32_mul_fast(float %0, float %1)
ret float %3
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
void ext_closedir(DIR *d) {
  printf("closing directory ...\n");
  closedir(d);
}


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

x86 assembly (clang, -O2):
<ext_closedir>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <closedir@plt>

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

LLVM IR (-O2):
@str = [22 x i8] c"closing directory ...\00"
define void @ext_closedir(i32* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @closedir(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ t1();
int /*<<< orphan*/ t2();
int /*<<< orphan*/ t3();
int /*<<< orphan*/ t4();
int main() {
  t1();
  t2();
  t3();
  t4();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <t1@plt>
mov    $0x0,%al
call   1050 <t2@plt>
mov    $0x0,%al
call   1040 <t3@plt>
mov    $0x0,%al
call   1060 <t4@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <t1@plt>
xor    %eax,%eax
call   1050 <t2@plt>
xor    %eax,%eax
call   1040 <t3@plt>
xor    %eax,%eax
call   1060 <t4@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @t1()
%3 = call i32 (...) @t2()
%4 = call i32 (...) @t3()
%5 = call i32 (...) @t4()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @t1()
%2 = tail call i32 (...) @t2()
%3 = tail call i32 (...) @t3()
%4 = tail call i32 (...) @t4()
ret i32 0
}
int test_imm_20int16_reg(short val) {
  return ((val) & (0x20 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_20int16_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, 32
%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_20int16_reg(i16 signext %0) {
%2 = and i16 %0, 32
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void disconnect_from(int fd) { close(fd); }


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

x86 assembly (clang, -O2):
<disconnect_from>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @disconnect_from(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char, float);
int main(void) {
  int VarInt;
  char VarChar;
  float VarFloat;
  VarInt = 2012;
  VarChar = 'r';
  VarFloat = 3.1415;
  printf("The year is %d . The radius is denoted as %c while PI is equal to %f",
         VarInt, VarChar, VarFloat);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7dc,-0x8(%rbp)
movb   $0x72,-0x9(%rbp)
movss  0xece(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x9(%rbp),%al
movss  -0x10(%rbp),%xmm0
lea    0xebb(%rip),%rdi
movsbl %al,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeec(%rip),%rdi
movss  0xee0(%rip),%xmm0
mov    $0x7dc,%esi
mov    $0x72,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [69 x i8] c"The year is %d . The radius is denoted as %c while PI is equal to %f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
%4 = alloca float
store i32 0, i32* %1
store i32 2012, i32* %2
store i8 114, i8* %3
store float 0x400921CAC0000000, float* %4
%5 = load i32, i32* %2
%6 = load i8, i8* %3
%7 = load float, float* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0), i32 %5, i8 signext %6, float %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [69 x i8] c"The year is %d . The radius is denoted as %c while PI is equal to %f\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0), i32 2012, i8 signext 114, float 0x400921CAC0000000)
ret i32 0
}
/* Type definitions */
struct tokenizer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ lineFileOpen(char *, int);
struct tokenizer *tokenizerOnLineFile(int /*<<< orphan*/);
struct tokenizer *tokenizerNew(char *fileName) {
  return tokenizerOnLineFile(lineFileOpen(fileName, 1));
}


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

x86 assembly (clang, -O2):
<tokenizerNew>:
push   %rax
mov    $0x1,%esi
call   1040 <lineFileOpen@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <tokenizerOnLineFile@plt>

LLVM IR (-O0):
%struct.tokenizer = type { i32 }
define %struct.tokenizer* @tokenizerNew(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @lineFileOpen(i8* %3, i32 1)
%5 = call %struct.tokenizer* @tokenizerOnLineFile(i32 %4)
ret %struct.tokenizer* %5
}

LLVM IR (-O2):
%struct.tokenizer = type { i32 }
define %struct.tokenizer* @tokenizerNew(i8* %0) {
%2 = tail call i32 @lineFileOpen(i8* %0, i32 1)
%3 = tail call %struct.tokenizer* @tokenizerOnLineFile(i32 %2)
ret %struct.tokenizer* %3
}
/* Variables and functions */
int /*<<< orphan*/ snrm2sub(int const *, float const *, int const *, float *);
float c_snrm2(const int N, const float *X, const int stride) {
  float nrm2;
  snrm2sub(&N, X, &stride, &nrm2);
  return nrm2;
}


x86 assembly (clang, -O0):
<c_snrm2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x4(%rbp),%rdi
lea    -0x14(%rbp),%rdx
lea    -0x18(%rbp),%rcx
call   1030 <snrm2sub@plt>
movss  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_snrm2>:
sub    $0x18,%rsp
mov    %edi,0x14(%rsp)
mov    %edx,0x10(%rsp)
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1030 <snrm2sub@plt>
movss  0xc(%rsp),%xmm0
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define float @c_snrm2(i32 %0, float* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
store i32 %0, i32* %4
store i32 %2, i32* %5
%7 = bitcast float* %6 to i8*
%8 = call i32 @snrm2sub(i32* %4, float* %1, i32* %5, float* %6)
%9 = load float, float* %6
ret float %9
}
void do_help(void) {}


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

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

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

LLVM IR (-O2):
define void @do_help() {
ret void
}
int len2(char *arrname) { return sizeof(arrname) / sizeof(char); }


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

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

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

LLVM IR (-O2):
define i32 @len2(i8* nocapture readnone %0) {
ret i32 8
}
/* Variables and functions */
int /*<<< orphan*/ FH_DU();
int /*<<< orphan*/ init();
int /*<<< orphan*/ interface();
int main(void) {
  unsigned int i;
  for (i = 0; i < 818; i++) {
    init();
    interface();
    FH_DU();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x332,-0x8(%rbp)
jae    1176 <main+0x46>
mov    $0x0,%al
call   1040 <init@plt>
mov    $0x0,%al
call   1030 <interface@plt>
mov    $0x0,%al
call   1050 <FH_DU@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x332,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <init@plt>
xor    %eax,%eax
call   1030 <interface@plt>
xor    %eax,%eax
call   1050 <FH_DU@plt>
add    $0xffffffff,%ebx
jne    1140 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = tail call i32 (...) @init()
%4 = tail call i32 (...) @interface()
%5 = tail call i32 (...) @FH_DU()
%6 = add nuw nsw i32 %2, 1
%7 = icmp eq i32 %6, 818
br i1 %7, label %8, label %1
8: ; preds = %1
ret i32 0
}
void _glapi_init_multithread(void) {}


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

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

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

LLVM IR (-O2):
define void @_glapi_init_multithread() {
ret void
}
int test_imm_CBuint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xCB << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_CBuint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 203
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void av_format_get_opaque() {}


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

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

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

LLVM IR (-O2):
define void @av_format_get_opaque() {
ret void
}