xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ process_args(int *, char ***);
void init(int *argc, char ***argv) { process_args(argc, argv); }


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

x86 assembly (clang, -O2):
<init>:
jmp    1030 <process_args@plt>

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

LLVM IR (-O2):
define void @init(i32* %0, i8*** %1) {
%3 = tail call i32 @process_args(i32* %0, i8*** %1)
ret void
}
/* Variables and functions */
scalar_t__ errno;
int /*<<< orphan*/ fopen(char *, char *);
int main(int argc, char const *argv[]) {
  errno = 0;
  fopen("doesn't matter", "invalid mode");
  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    0x2eb3(%rip),%rax
movq   $0x0,(%rax)
lea    0xec5(%rip),%rdi
lea    0xecd(%rip),%rsi
call   1030 <fopen@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
movq   $0x0,(%rax)
lea    0xeda(%rip),%rdi
lea    0xee2(%rip),%rsi
call   1030 <fopen@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i64 0
@.str = [15 x i8] c"doesn't matter\00"
@.str.1 = [13 x i8] c"invalid mode\00"
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
store i64 0, i64* @errno
%6 = call i32 @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@errno = global i64 0
@.str = [15 x i8] c"doesn't matter\00"
@.str.1 = [13 x i8] c"invalid mode\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
store i64 0, i64* @errno
%3 = tail call i32 @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int valid_user_group_name_full(char const *, int);
bool valid_user_group_name_compat(const char *u) {
  return valid_user_group_name_full(u, false);
}


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

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

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

LLVM IR (-O2):
define i32 @valid_user_group_name_compat(i8* %0) {
%2 = tail call i32 @valid_user_group_name_full(i8* %0, i32 0)
ret i32 %2
}
void lidt(struct pseudodesc *pd) { asm volatile("lidt (%0)" ::"r"(pd)); }


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

x86 assembly (clang, -O2):
<lidt>:
lidt   (%rdi)
ret

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

LLVM IR (-O2):
%struct.pseudodesc = type opaque
define void @lidt(%struct.pseudodesc* %0) {
tail call void asm sideeffect "lidt ($0)", "r,~{dirflag},~{fpsr},~{flags}"(%struct.pseudodesc* %0)
ret void
}
/* Variables and functions */
int foo();
int main() {
  int a = foo();
  if (a == 1) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <foo@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    113f <main+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1146 <main+0x36>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <foo@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @foo()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 0, i32* %1
br label %8
7: ; preds = %0
store i32 1, i32* %1
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = icmp ne i32 %1, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
scalar_t__ tool_search_string(int, char **, char *);
int options_check_help(int argc, char **argv) {
  if (tool_search_string(argc, argv, "-h")) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<options_check_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xed3(%rip),%rdx
call   1030 <tool_search_string@plt>
cmp    $0x0,%rax
je     1148 <options_check_help+0x38>
movl   $0x1,-0x4(%rbp)
jmp    114f <options_check_help+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<options_check_help>:
push   %rax
lea    0xee8(%rip),%rdx
call   1030 <tool_search_string@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"-h\00"
define i32 @options_check_help(i32 %0, i8** %1) {
%3 = tail call i64 @tool_search_string(i32 %0, i8** %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int iseos(int a) { return (a == 33 || a == 46 || a == 63) ? 1 : 0; }


x86 assembly (clang, -O0):
<iseos>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x21,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     112f <iseos+0x2f>
mov    $0x1,%al
cmpl   $0x2e,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     112f <iseos+0x2f>
cmpl   $0x3f,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iseos>:
mov    $0x1,%eax
cmp    $0x21,%edi
je     110f <iseos+0xf>
cmp    $0x2e,%edi
jne    1110 <iseos+0x10>
ret
xor    %eax,%eax
cmp    $0x3f,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @iseos(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 33
br i1 %4, label %11, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 46
br i1 %7, label %11, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 63
br label %11
11: ; preds = %8, %5, %1
%12 = phi i1 [ true, %5 ], [ true, %1 ], [ %10, %8 ]
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 1, i32 0
ret i32 %14
}

LLVM IR (-O2):
define i32 @iseos(i32 %0) {
switch i32 %0, label %2 [
i32 46, label %5
i32 33, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 63
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
ret i32 %6
}
int libtasTestFunc2() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @libtasTestFunc2() {
ret i32 1
}
unsigned long xocontrols(void) {
  unsigned long controls = 0;
  return controls;
}


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

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

LLVM IR (-O0):
define i64 @xocontrols() {
%1 = alloca i64
store i64 0, i64* %1
%2 = load i64, i64* %1
ret i64 %2
}

LLVM IR (-O2):
define i64 @xocontrols() {
ret i64 0
}
void gtk_tree_path_new_from_indices() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ nanosleep(struct timespec const *, struct timespec *);
void thrd_sleep(const struct timespec *time_point, struct timespec *remaining) {
  assert(time_point != NULL);
  nanosleep(time_point, remaining);
}


x86 assembly (clang, -O0):
<thrd_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <nanosleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thrd_sleep>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <nanosleep@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
define void @thrd_sleep(%struct.timespec* %0, %struct.timespec* %1) {
%3 = alloca %struct.timespec*
%4 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load %struct.timespec*, %struct.timespec** %3
%6 = icmp ne %struct.timespec* %5, null
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load %struct.timespec*, %struct.timespec** %3
%10 = load %struct.timespec*, %struct.timespec** %4
%11 = call i32 @nanosleep(%struct.timespec* %9, %struct.timespec* %10)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define void @thrd_sleep(%struct.timespec* %0, %struct.timespec* %1) {
%3 = icmp ne %struct.timespec* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @nanosleep(%struct.timespec* %0, %struct.timespec* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void die_msg(char *msg) {
  fprintf(stderr, "Error: %s.\n", msg);
  exit(1);
}


x86 assembly (clang, -O0):
<die_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die_msg>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"Error: %s.\0A\00"
define void @die_msg(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"Error: %s.\0A\00"
define void @die_msg(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
int test_imm_2Aint8_mem(signed char *val) {
  return ((*val) & (-0x2A << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_2Aint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -42
%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_2Aint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -42
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ errno;
int fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
char *strerror(int /*<<< orphan*/);
int file_close(FILE *stream) {
  int close = fclose(stream);
  if (close) {
    printf("%s\n", strerror(errno));
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<file_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     117b <file_close+0x4b>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %rax,%rsi
lea    0xe96(%rip),%rdi
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1182 <file_close+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_close>:
push   %rax
call   1030 <fclose@plt>
test   %eax,%eax
je     115e <file_close+0x2e>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeb1(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@errno = global i32 0
define i32 @file_close(i32* nocapture %0) {
%2 = tail call i32 @fclose(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = load i32, i32* @errno
%6 = tail call i8* @strerror(i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ -1, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ sla_nut(double *, double *);
void csla_nut(double date, double rmatn[3][3]) {
  sla_nut(&date, &(rmatn[0][0]));
}


x86 assembly (clang, -O0):
<csla_nut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x8(%rbp),%rdi
call   1030 <sla_nut@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<csla_nut>:
push   %rax
mov    %rdi,%rsi
movsd  %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <sla_nut@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @csla_nut(double %0, [3 x double]* %1) {
%3 = alloca double
%4 = alloca [3 x double]*
store double %0, double* %3
store [3 x double]* %1, [3 x double]** %4
%5 = load [3 x double]*, [3 x double]** %4
%6 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0
%7 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 0
%8 = call i32 @sla_nut(double* %3, double* %7)
ret void
}

LLVM IR (-O2):
define void @csla_nut(double %0, [3 x double]* %1) {
%3 = alloca double
store double %0, double* %3
%4 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 0
%5 = call i32 @sla_nut(double* %3, double* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ g(int);
int f(long long d) {
  long long c = d & 0xffffffffff;
  int i = (int)c;
  g(i);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movabs $0xffffffffff,%rax
and    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
call   1030 <g@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
jmp    1030 <g@plt>

LLVM IR (-O0):
define i32 @f(i64 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
store i64 %0, i64* %3
%6 = load i64, i64* %3
%7 = and i64 %6, 1099511627775
store i64 %7, i64* %4
%8 = load i64, i64* %4
%9 = trunc i64 %8 to i32
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = call i32 @g(i32 %10)
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @f(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i32 @g(i32 %2)
ret i32 undef
}
/* Variables and functions */
int open(char const *, int, int);
int outside_open(const char *pathname, int flags, int mode) {
  return open(pathname, flags, mode);
}


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

x86 assembly (clang, -O2):
<outside_open>:
jmp    1030 <open@plt>

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

LLVM IR (-O2):
define i32 @outside_open(i8* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 @open(i8* %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
char *fmt_f32(float);
char *fmt_flags();
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *, char *, int, int);
void print_result(float r, int j, int k) {
  char *r_fmt, *flag_fmt;
  r_fmt = fmt_f32(r);
  flag_fmt = fmt_flags();
  printf("res: %s flags=%s (%d/%d)\n", r_fmt, flag_fmt, j, k);
  free(r_fmt);
  free(flag_fmt);
}


x86 assembly (clang, -O0):
<print_result>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
call   1050 <fmt_f32@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1060 <fmt_flags@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%r8d
lea    0xe7e(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_result>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %edi,%r15d
call   1050 <fmt_f32@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <fmt_flags@plt>
mov    %rax,%rbp
lea    0xe9a(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
mov    %r15d,%ecx
mov    %r14d,%r8d
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"res: %s flags=%s (%d/%d)\0A\00"
define void @print_result(float %0, i32 %1, i32 %2) {
%4 = alloca float
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store float %0, float* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load float, float* %4
%10 = call i8* @fmt_f32(float %9)
store i8* %10, i8** %7
%11 = call i8* (...) @fmt_flags()
store i8* %11, i8** %8
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %13, i32 %14, i32 %15)
%17 = load i8*, i8** %7
%18 = call i32 @free(i8* %17)
%19 = load i8*, i8** %8
%20 = call i32 @free(i8* %19)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"res: %s flags=%s (%d/%d)\0A\00"
define void @print_result(float %0, i32 %1, i32 %2) {
%4 = tail call i8* @fmt_f32(float %0)
%5 = tail call i8* (...) @fmt_flags()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %5, i32 %1, i32 %2)
%7 = tail call i32 @free(i8* %4)
%8 = tail call i32 @free(i8* %5)
ret void
}
/* Variables and functions */
int EINVAL;
long strtol(char const *, char **, int);
int atol_only_cooler(const char *str, long *out_val) {
  long val;
  char *bad_charp;
  val = strtol(str, &bad_charp, 10);
  if (*bad_charp == '\0') {
    *out_val = val;
    return 0;
  } else {
    return EINVAL;
  }
}


x86 assembly (clang, -O0):
<atol_only_cooler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x28(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    115d <atol_only_cooler+0x4d>
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1169 <atol_only_cooler+0x59>
mov    0x2e7c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atol_only_cooler>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0x8(%rsp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    0x8(%rsp),%rcx
cmpb   $0x0,(%rcx)
je     113c <atol_only_cooler+0x2c>
mov    0x2ea8(%rip),%rax
mov    (%rax),%eax
jmp    1141 <atol_only_cooler+0x31>
mov    %rax,(%rbx)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @atol_only_cooler(i8* %0, i64* nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i64 @strtol(i8* %0, i8** %3, i32 10)
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
store i64 %5, i64* %1
br label %12
10: ; preds = %2
%11 = load i32, i32* @EINVAL
br label %12
12: ; preds = %10, %9
%13 = phi i32 [ 0, %9 ], [ %11, %10 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void scr_delr(void) { printf("\033[%s", "M"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[%s\00"
@.str.1 = [2 x i8] c"M\00"
define void @scr_delr() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[%s\00"
@.str.1 = [2 x i8] c"M\00"
define void @scr_delr() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_sinf();
scalar_t__ sinf(float);
void test_sinf(float f) {
  if (sinf(f) != sinf(f))
    link_failure_sinf();
}


x86 assembly (clang, -O0):
<test_sinf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sinf@plt>
mov    %rax,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sinf@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_sinf+0x3c>
mov    $0x0,%al
call   1040 <link_failure_sinf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_sinf>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
call   1030 <sinf@plt>
mov    %rax,%rbx
movss  0xc(%rsp),%xmm0
call   1030 <sinf@plt>
cmp    %rax,%rbx
jne    1149 <test_sinf+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <link_failure_sinf@plt>

LLVM IR (-O0):
define void @test_sinf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @sinf(float %3)
%5 = load float, float* %2
%6 = call i64 @sinf(float %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_sinf()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_sinf(float %0) {
%2 = tail call i64 @sinf(float %0)
%3 = tail call i64 @sinf(float %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_sinf()
br label %7
7: ; preds = %5, %1
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int lfs2_scmp(uint32_t a, uint32_t b) { return (int)(unsigned)(a - b); }


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

x86 assembly (clang, -O2):
<lfs2_scmp>:
mov    %rdi,%rax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @lfs2_scmp(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = sub nsw i64 %5, %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @lfs2_scmp(i64 %0, i64 %1) {
%3 = sub nsw i64 %0, %1
%4 = trunc i64 %3 to i32
ret i32 %4
}
void s390_pv_prep_reset(void) {}


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

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

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

LLVM IR (-O2):
define void @s390_pv_prep_reset() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ write(int, char *, int);
void *handler1(void *arg) {
  int *p = (int *)arg;
  int fd = *p;
  write(fd, "ok", 2);
  printf("send a message:ok!\n");
}


x86 assembly (clang, -O0):
<handler1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
lea    0xeb9(%rip),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler1>:
push   %rax
mov    (%rdi),%edi
lea    0xed6(%rip),%rsi
mov    $0x2,%edx
call   1040 <write@plt>
lea    0xec8(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"ok\00"
@.str.1 = [20 x i8] c"send a message:ok!\0A\00"
define i8* @handler1(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %4
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = call i32 @write(i32 %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%12 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
@.str = [3 x i8] c"ok\00"
@str = [19 x i8] c"send a message:ok!\00"
define noalias i8* @handler1(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @write(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret i8* undef
}
int main(__attribute__((__unused__)) int argc,
         __attribute__((__unused__)) char **argv) {
  return 1;
}


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

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%eax
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
ret i32 1
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ kernel_reschedule();
int /*<<< orphan*/ kernel_thread_exit();
int /*<<< orphan*/ network_receive_frame();
void network_receive(void *param __attribute__((__unused__))) {
  while (1) {
    network_receive_frame();
    kernel_reschedule();
  }
  kernel_thread_exit();
}


x86 assembly (clang, -O0):
<network_receive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <network_receive_frame@plt>
mov    $0x0,%al
call   1040 <kernel_reschedule@plt>
jmp    112c <network_receive+0xc>

x86 assembly (clang, -O2):
<network_receive>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <network_receive_frame@plt>
xor    %eax,%eax
call   1040 <kernel_reschedule@plt>
jmp    1130 <network_receive+0x10>

LLVM IR (-O0):
define void @network_receive(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = call i32 (...) @network_receive_frame()
%5 = call i32 (...) @kernel_reschedule()
br label %3
}

LLVM IR (-O2):
define void @network_receive(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 (...) @network_receive_frame()
%4 = tail call i32 (...) @kernel_reschedule()
br label %2
}
int test_imm_0Auint16_reg(unsigned short val) {
  return ((val) & (0x0A << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_0Auint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 10
%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_0Auint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 10
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ PBE2PARAM;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ PBE2PARAM_it;
int i2d_PBE2PARAM(PBE2PARAM *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &PBE2PARAM_it);
}


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

x86 assembly (clang, -O2):
<i2d_PBE2PARAM>:
mov    0x2ec9(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

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

LLVM IR (-O2):
@PBE2PARAM_it = global i32 0
define i32 @i2d_PBE2PARAM(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @PBE2PARAM_it)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("--- --- --- below is test interger--- --- --- \n");
  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)
lea    0xed3(%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 = [48 x i8] c"--- --- --- below is test interger--- --- --- \0A\00"
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 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [47 x i8] c"--- --- --- below is test interger--- --- --- \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t lfs2_min(uint32_t a, uint32_t b) { return (a < b) ? a : b; }


x86 assembly (clang, -O0):
<lfs2_min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1127 <lfs2_min+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <lfs2_min+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lfs2_min>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @lfs2_min(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ swap(int *, int *);
int main() {
  int a = 10;
  int b = 20;
  printf("before swap a: [%i] b: [%i] \n", a, b);
  swap(&a, &b);
  printf("after swap a: [%i] b: [%i] \n", a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <swap@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0xa,0x4(%rsp)
movl   $0x14,(%rsp)
lea    0xec9(%rip),%rdi
mov    $0xa,%esi
mov    $0x14,%edx
call   1030 <printf@plt>
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <swap@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"before swap a: [%i] b: [%i] \0A\00"
@.str.1 = [29 x i8] c"after swap a: [%i] b: [%i] \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 20, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
%7 = call i32 @swap(i32* %2, i32* %3)
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"before swap a: [%i] b: [%i] \0A\00"
@.str.1 = [29 x i8] c"after swap a: [%i] b: [%i] \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 10, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 20, i32* %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 10, i32 20)
%6 = call i32 @swap(i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void write_padding(int ifd, int pad_len, char pad_val) {
  int i;
  for (i = 0; i < pad_len; i++) {
    write(ifd, &pad_val, 1);
  }
}


x86 assembly (clang, -O0):
<write_padding>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1155 <write_padding+0x45>
mov    -0x4(%rbp),%edi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112a <write_padding+0x1a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_padding>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %dl,0xf(%rsp)
test   %esi,%esi
jle    1144 <write_padding+0x34>
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xf(%rsp),%r14
nopl   0x0(%rax)
mov    %ebp,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0xffffffff,%ebx
jne    1130 <write_padding+0x20>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @write_padding(i32 %0, i32 %1, i8 signext %2) {
%4 = alloca i8
store i8 %2, i8* %4
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %11
6: ; preds = %3, %6
%7 = phi i32 [ %9, %6 ], [ 0, %3 ]
%8 = call i32 @write(i32 %0, i8* %4, i32 1)
%9 = add nuw nsw i32 %7, 1
%10 = icmp eq i32 %9, %1
br i1 %10, label %11, label %6
11: ; preds = %6, %3
ret void
}
int f() {
  for (struct { int j; } i; 0; 0)
    0;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
test   $0x1,%al
jne    1113 <f+0x13>
jmp    111d <f+0x1d>
jmp    1118 <f+0x18>
jmp    1104 <f+0x4>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.anon = type { i32 }
define i32 @f() {
%1 = alloca i32
%2 = alloca %struct.anon
br label %3
3: ; preds = %5, %0
br i1 false, label %4, label %6
4: ; preds = %3
br label %5
5: ; preds = %4
br label %3
6: ; preds = %3
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @f() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ rt_term();
__attribute__((__destructor__)) void dterm(void) { rt_term(); }


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

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

LLVM IR (-O0):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @dterm, i8* null }]
define void @dterm() {
%1 = call i32 (...) @rt_term()
ret void
}

LLVM IR (-O2):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @dterm, i8* null }]
define void @dterm() {
%1 = tail call i32 (...) @rt_term()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pclog(char *);
void iso_load(void) { pclog("iso_load stub\n"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"iso_load stub\0A\00"
define void @iso_load() {
%1 = call i32 @pclog(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"iso_load stub\0A\00"
define void @iso_load() {
%1 = tail call i32 @pclog(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void show_usage(int argc, char *argv[]) {
  printf("Usage : %s -no -n number\n", argv[0]);
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"Usage : %s -no -n number\0A\00"
define void @show_usage(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 0
%7 = load i8*, i8** %6
%8 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Usage : %s -no -n number\0A\00"
define void @show_usage(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int int16_t;

/* Variables and functions */
__attribute__((always_)) void BEPackInt16(uint8_t container[2], int16_t data) {
  container[0] = (uint8_t)(data >> 8);
  container[1] = (uint8_t)data;
}


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

x86 assembly (clang, -O2):
<BEPackInt16>:
movslq %esi,%rax
sar    $0x8,%esi
movslq %esi,%rcx
mov    %rcx,(%rdi)
mov    %rax,0x8(%rdi)
ret

LLVM IR (-O0):
define void @BEPackInt16(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 8
%7 = sext i32 %6 to i64
%8 = load i64*, i64** %3
%9 = getelementptr inbounds i64, i64* %8, i64 0
store i64 %7, i64* %9
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = load i64*, i64** %3
%13 = getelementptr inbounds i64, i64* %12, i64 1
store i64 %11, i64* %13
ret void
}

LLVM IR (-O2):
define void @BEPackInt16(i64* nocapture writeonly %0, i32 %1) {
%3 = ashr i32 %1, 8
%4 = sext i32 %3 to i64
store i64 %4, i64* %0
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i64, i64* %0, i64 1
store i64 %5, i64* %6
ret void
}
int compare_ints(void *data1, void *data2) {
  int d1 = *(int *)data1;
  int d2 = *(int *)data2;
  return d1 == d2;
}


x86 assembly (clang, -O0):
<compare_ints>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_ints>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @compare_ints(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = icmp eq i32 %13, %14
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @compare_ints(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp eq i32 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}