xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printPath(int prev[6], int v0, int v) {
  if (v == v0) {
    printf("%d", v0);
    return;
  }
  printPath(prev, v0, prev[v]);
  printf("->%d", v);
}


x86 assembly (clang, -O0):
<printPath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1152 <printPath+0x32>
mov    -0xc(%rbp),%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
jmp    1178 <printPath+0x58>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
call   1040 <printPath@plt>
mov    -0x10(%rbp),%esi
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printPath>:
push   %rbx
mov    %edx,%ebx
cmp    %esi,%edx
jne    1130 <printPath+0x10>
lea    0xed4(%rip),%rdi
jmp    1142 <printPath+0x22>
movslq %ebx,%rax
mov    (%rdi,%rax,4),%edx
call   1040 <printPath@plt>
lea    0xebe(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"->%d\00"
define void @printPath(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32, i32* %5
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = load i32, i32* %5
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %23
13: ; preds = %3
%14 = load i32*, i32** %4
%15 = load i32, i32* %5
%16 = load i32*, i32** %4
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %16, i64 %18
%20 = load i32, i32* %19
%21 = load i32, i32* %6
%22 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %21)
br label %23
23: ; preds = %13, %10
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"->%d\00"
define void @printPath(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, %1
br i1 %4, label %5, label %8
5: ; preds = %3, %8
%6 = phi i8* [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %8 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %3 ]
%7 = tail call i32 @printf(i8* %6, i32 %2)
ret void
8: ; preds = %3
%9 = sext i32 %2 to i64
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
tail call void @printPath(i32* %0, i32 %1, i32 %11)
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ print_bar();
int /*<<< orphan*/ print_center(char const *);
int print_header(const char *header) {
  print_center(header);
  print_bar();
  return 0;
}


x86 assembly (clang, -O0):
<print_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <print_center@plt>
mov    $0x0,%al
call   1040 <print_bar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @print_header(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @print_center(i8* %3)
%5 = call i32 (...) @print_bar()
ret i32 0
}

LLVM IR (-O2):
define i32 @print_header(i8* %0) {
%2 = tail call i32 @print_center(i8* %0)
%3 = tail call i32 (...) @print_bar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sumDigits(int);
int main() {
  printf("%i", sumDigits(1234));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
define i32 @main() {
%1 = tail call i32 @sumDigits(i32 1234)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
FILE *freopen(const char *fname, const char *mode, FILE *stream) {
  fprintf(stderr, "Warning: freopen() unimplemented\n");
  return NULL;
}


x86 assembly (clang, -O0):
<freopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freopen>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"Warning: freopen() unimplemented\0A\00"
define i32* @freopen(i8* %0, i8* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32* null
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"Warning: freopen() unimplemented\0A\00"
define noalias i32* @freopen(i8* nocapture readnone %0, i8* nocapture readnone %1, i32* nocapture readnone %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32* null
}
/* Variables and functions */
scalar_t__ alloca(int);
void *test5a(char *);
void __attribute__((no)) * test5(void) {
  char *save = (char *)alloca(4);
  return test5a(save);
}


x86 assembly (clang, -O0):
<test5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <alloca@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <test5a@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test5>:
push   %rax
mov    $0x4,%edi
call   1040 <alloca@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <test5a@plt>

LLVM IR (-O0):
define i8* @test5() {
%1 = alloca i8*
%2 = call i64 @alloca(i32 4)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i8* @test5a(i8* %4)
ret i8* %5
}

LLVM IR (-O2):
define i8* @test5() {
%1 = tail call i64 @alloca(i32 4)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i8* @test5a(i8* %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(void *);
void end_thread(void *rv) { pthread_exit(rv); }


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

x86 assembly (clang, -O2):
<end_thread>:
jmp    1030 <pthread_exit@plt>

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

LLVM IR (-O2):
define void @end_thread(i8* %0) {
%2 = tail call i32 @pthread_exit(i8* %0)
ret void
}
/* Type definitions */
struct kcn_info {
  int dummy;
};

/* Variables and functions */
int kcn_db_search(struct kcn_info *, char const *);
bool kcn_search(struct kcn_info *ki, const char *keys) {
  return kcn_db_search(ki, keys);
}


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

x86 assembly (clang, -O2):
<kcn_search>:
jmp    1030 <kcn_db_search@plt>

LLVM IR (-O0):
%struct.kcn_info = type { i32 }
define i32 @kcn_search(%struct.kcn_info* %0, i8* %1) {
%3 = alloca %struct.kcn_info*
%4 = alloca i8*
store %struct.kcn_info* %0, %struct.kcn_info** %3
store i8* %1, i8** %4
%5 = load %struct.kcn_info*, %struct.kcn_info** %3
%6 = load i8*, i8** %4
%7 = call i32 @kcn_db_search(%struct.kcn_info* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.kcn_info = type { i32 }
define i32 @kcn_search(%struct.kcn_info* %0, i8* %1) {
%3 = tail call i32 @kcn_db_search(%struct.kcn_info* %0, i8* %1)
ret i32 %3
}
int ishex(c)
char c;
{ return isnum(c) || ((c = toupper(c)) >= 'A' && c <= 'F'); }


x86 assembly (clang, -O0):
<ishex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
mov    $0x0,%al
call   1040 <isnum@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x2(%rbp)
jne    1179 <ishex+0x59>
movsbl -0x1(%rbp),%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbp)
movsbl %al,%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x3(%rbp)
jl     1173 <ishex+0x53>
movsbl -0x1(%rbp),%eax
cmp    $0x46,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ishex>:
push   %rbx
movsbl %dil,%ebx
mov    %ebx,%edi
xor    %eax,%eax
call   1040 <isnum@plt>
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
je     113b <ishex+0x1b>
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <toupper@plt>
mov    %eax,%ecx
shl    $0x18,%ecx
add    $0xbfffffff,%ecx
xor    %eax,%eax
cmp    $0x6ffffff,%ecx
setb   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ishex(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = call i32 (i32, ...) bitcast (i32 (...)* @isnum to i32 (i32, ...)*)(i32 %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %21, label %8
8: ; preds = %1
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = call i32 @toupper(i32 %10)
%12 = trunc i32 %11 to i8
store i8 %12, i8* %2
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 65
br i1 %14, label %15, label %19
15: ; preds = %8
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 70
br label %19
19: ; preds = %15, %8
%20 = phi i1 [ false, %8 ], [ %18, %15 ]
br label %21
21: ; preds = %19, %1
%22 = phi i1 [ true, %1 ], [ %20, %19 ]
%23 = zext i1 %22 to i32
ret i32 %23
}

LLVM IR (-O2):
define i32 @ishex(i32 %0) {
%2 = shl i32 %0, 24
%3 = ashr exact i32 %2, 24
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @isnum to i32 (i32, ...)*)(i32 %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = tail call i32 @toupper(i32 %3)
%8 = shl i32 %7, 24
%9 = add i32 %8, -1073741825
%10 = icmp ult i32 %9, 117440511
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ 1, %1 ], [ %11, %6 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int errno;
int /*<<< orphan*/ fatal_error_with_errno(char *);
int pthread_join(int /*<<< orphan*/, int /*<<< orphan*/ *);
void join_thread(pthread_t t) {
  int result = pthread_join(t, NULL);
  if (result) {
    errno = result;
    fatal_error_with_errno("Failed to join thread");
  }
}


x86 assembly (clang, -O0):
<join_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <pthread_join@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     115c <join_thread+0x3c>
mov    -0x8(%rbp),%ecx
mov    0x2e92(%rip),%rax
mov    %ecx,(%rax)
lea    0xea9(%rip),%rdi
call   1030 <fatal_error_with_errno@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<join_thread>:
push   %rax
xor    %esi,%esi
call   1040 <pthread_join@plt>
test   %eax,%eax
je     1142 <join_thread+0x22>
mov    0x2ead(%rip),%rcx
mov    %eax,(%rcx)
lea    0xec4(%rip),%rdi
pop    %rax
jmp    1030 <fatal_error_with_errno@plt>
pop    %rax
ret

LLVM IR (-O0):
@errno = global i32 0
@.str = [22 x i8] c"Failed to join thread\00"
define void @join_thread(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @pthread_join(i32 %4, i32* null)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* %3
store i32 %9, i32* @errno
%10 = call i32 @fatal_error_with_errno(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@errno = global i32 0
@.str = [22 x i8] c"Failed to join thread\00"
define void @join_thread(i32 %0) {
%2 = tail call i32 @pthread_join(i32 %0, i32* null)
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
store i32 %2, i32* @errno
%5 = tail call i32 @fatal_error_with_errno(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *realloc(void *, size_t const);
int /*<<< orphan*/ stderr;
void *term_realloc(void *ptr, const size_t size) {
  void *re_ptr;
  if ((re_ptr = realloc(ptr, size)) == NULL) {
    fprintf(stderr, "Couldn't reallocate memory - exiting.\n");
    exit(EXIT_FAILURE);
  }
  return re_ptr;
}


x86 assembly (clang, -O0):
<term_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    117e <term_realloc+0x4e>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
lea    0xe95(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_realloc>:
push   %rax
call   1040 <realloc@plt>
test   %rax,%rax
je     113d <term_realloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"Couldn't reallocate memory - exiting.\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @term_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%13 = load i32, i32* @EXIT_FAILURE
%14 = call i32 @exit(i32 %13)
unreachable
15: ; preds = %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"Couldn't reallocate memory - exiting.\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @term_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
int /*<<< orphan*/ issafemul(int, int);
int safemul(int x, int y) {
  if (!issafemul(x, y)) {
    error("safemul");
  }
  return x * y;
}


x86 assembly (clang, -O0):
<safemul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <issafemul@plt>
cmp    $0x0,%eax
jne    114e <safemul+0x2e>
lea    0xeb7(%rip),%rdi
call   1030 <error@plt>
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safemul>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <issafemul@plt>
test   %eax,%eax
jne    113c <safemul+0x1c>
lea    0xec9(%rip),%rdi
call   1030 <error@plt>
imul   %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"safemul\00"
define i32 @safemul(i32 %0, i32 %1) {
%3 = tail call i32 @issafemul(i32 %0, i32 %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @error(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
%8 = mul nsw i32 %1, %0
ret i32 %8
}
/* Type definitions */
struct dirent {
  char *d_name;
};

/* Variables and functions */
int pidFilter(const struct dirent *entry) {
  if ((entry->d_name[0] >= '0') && (entry->d_name[0] <= '9'))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<pidFilter>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jl     113a <pidFilter+0x3a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
jg     113a <pidFilter+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <pidFilter+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pidFilter>:
mov    (%rdi),%rax
mov    (%rax),%cl
add    $0xd0,%cl
xor    %eax,%eax
cmp    $0xa,%cl
setb   %al
ret

LLVM IR (-O0):
%struct.dirent = type { i8* }
define i32 @pidFilter(%struct.dirent* %0) {
%2 = alloca i32
%3 = alloca %struct.dirent*
store %struct.dirent* %0, %struct.dirent** %3
%4 = load %struct.dirent*, %struct.dirent** %3
%5 = getelementptr inbounds %struct.dirent, %struct.dirent* %4, i32 0, i32 0
%6 = load i8*, i8** %5
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp sge i32 %9, 48
br i1 %10, label %11, label %20
11: ; preds = %1
%12 = load %struct.dirent*, %struct.dirent** %3
%13 = getelementptr inbounds %struct.dirent, %struct.dirent* %12, i32 0, i32 0
%14 = load i8*, i8** %13
%15 = getelementptr inbounds i8, i8* %14, i64 0
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 57
br i1 %18, label %19, label %20
19: ; preds = %11
store i32 1, i32* %2
br label %21
20: ; preds = %11, %1
store i32 0, i32* %2
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
%struct.dirent = type { i8* }
define i32 @pidFilter(%struct.dirent* nocapture %0) {
%2 = getelementptr inbounds %struct.dirent, %struct.dirent* %0, i64 0, i32 0
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = add i8 %4, -48
%6 = icmp ult i8 %5, 10
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ COLOR_PAIR(int);
int /*<<< orphan*/ wattroff(int /*<<< orphan*/ *, int /*<<< orphan*/);
void wcoloroff(WINDOW *win, int fg, int bg) {
  wattroff(win, COLOR_PAIR((fg << 4) | (bg << 0)));
}


x86 assembly (clang, -O0):
<wcoloroff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
shl    $0x4,%edi
mov    -0x10(%rbp),%eax
shl    $0x0,%eax
or     %eax,%edi
call   1030 <COLOR_PAIR@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <wattroff@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcoloroff>:
push   %rbx
mov    %rdi,%rbx
shl    $0x4,%esi
or     %edx,%esi
mov    %esi,%edi
call   1030 <COLOR_PAIR@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <wattroff@plt>

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

LLVM IR (-O2):
define void @wcoloroff(i32* %0, i32 %1, i32 %2) {
%4 = shl i32 %1, 4
%5 = or i32 %4, %2
%6 = tail call i32 @COLOR_PAIR(i32 %5)
%7 = tail call i32 @wattroff(i32* %0, i32 %6)
ret void
}
void gtk_widget_set_default_direction() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_set_default_direction() {
ret void
}
/* Variables and functions */
int usb_readLineWait(char *, int, int /*<<< orphan*/);
int usb_readLine(char *s, int len) { return usb_readLineWait(s, len, 0); }


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

x86 assembly (clang, -O2):
<usb_readLine>:
xor    %edx,%edx
jmp    1030 <usb_readLineWait@plt>

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

LLVM IR (-O2):
define i32 @usb_readLine(i8* %0, i32 %1) {
%3 = tail call i32 @usb_readLineWait(i8* %0, i32 %1, i32 0)
ret i32 %3
}
float *mat2_scaling(float *result, float *v) {
  result[0] = v[0];
  result[1] = 0.0f;
  result[2] = 0.0f;
  result[3] = v[1];
  return result;
}


x86 assembly (clang, -O0):
<mat2_scaling>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0xc(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat2_scaling>:
mov    %rdi,%rax
movss  (%rsi),%xmm0
movss  %xmm0,(%rdi)
movq   $0x0,0x4(%rdi)
movss  0x4(%rsi),%xmm0
movss  %xmm0,0xc(%rdi)
ret

LLVM IR (-O0):
define float* @mat2_scaling(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %4
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float*, float** %3
%9 = getelementptr inbounds float, float* %8, i64 0
store float %7, float* %9
%10 = load float*, float** %3
%11 = getelementptr inbounds float, float* %10, i64 1
store float 0.000000e+00, float* %11
%12 = load float*, float** %3
%13 = getelementptr inbounds float, float* %12, i64 2
store float 0.000000e+00, float* %13
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 1
%16 = load float, float* %15
%17 = load float*, float** %3
%18 = getelementptr inbounds float, float* %17, i64 3
store float %16, float* %18
%19 = load float*, float** %3
ret float* %19
}

LLVM IR (-O2):
define float* @mat2_scaling(float* returned writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
store float %3, float* %0
%4 = getelementptr inbounds float, float* %0, i64 1
store float 0.000000e+00, float* %4
%5 = getelementptr inbounds float, float* %0, i64 2
store float 0.000000e+00, float* %5
%6 = getelementptr inbounds float, float* %1, i64 1
%7 = load float, float* %6
%8 = getelementptr inbounds float, float* %0, i64 3
store float %7, float* %8
ret float* %0
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int swapoff(const char *path) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<swapoff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapoff>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @swapoff(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @ENOSYS
%4 = call i32 @__set_errno(i32 %3)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @swapoff(i8* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
%3 = tail call i32 @__set_errno(i32 %2)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int main() {
  int server_fd;
  if ((server_fd = socket(AF_INET, SOCK_STREAM, 0)) == 0) {
    perror("socket failed");
    exit(1);
  }
  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)
cmp    $0x0,%eax
jne    117a <main+0x4a>
lea    0xe95(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    0x2e97(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1050 <socket@plt>
test   %eax,%eax
je     1152 <main+0x22>
xor    %eax,%eax
pop    %rcx
ret
lea    0xea7(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [14 x i8] c"socket failed\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @AF_INET
%4 = load i32, i32* @SOCK_STREAM
%5 = call i32 @socket(i32 %3, i32 %4, i32 0)
store i32 %5, i32* %2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %0
ret i32 0
}

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 eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %0
ret i32 0
}
/* Variables and functions */
void *realloc(void *, size_t);
void *grow_pointer_array(void *array, size_t *allocedp) {
  if (*allocedp == 0)
    *allocedp = 8;
  else
    *allocedp *= 2;
  return realloc(array, *allocedp * sizeof(void *));
}


x86 assembly (clang, -O0):
<grow_pointer_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    113e <grow_pointer_array+0x2e>
mov    -0x10(%rbp),%rax
movq   $0x8,(%rax)
jmp    114c <grow_pointer_array+0x3c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
shl    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
shl    $0x3,%rsi
call   1030 <realloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<grow_pointer_array>:
mov    (%rsi),%rax
lea    (%rax,%rax,1),%rcx
test   %rax,%rax
mov    $0x8,%eax
cmovne %rcx,%rax
mov    %rax,(%rsi)
shl    $0x3,%rax
mov    %rax,%rsi
jmp    1030 <realloc@plt>

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

LLVM IR (-O2):
define noalias i8* @grow_pointer_array(i8* nocapture %0, i64* nocapture %1) {
%3 = load i64, i64* %1
%4 = icmp eq i64 %3, 0
%5 = shl i64 %3, 1
%6 = select i1 %4, i64 8, i64 %5
store i64 %6, i64* %1
%7 = shl i64 %6, 3
%8 = tail call i8* @realloc(i8* %0, i64 %7)
ret i8* %8
}
void gtk_stock_list_ids() {}


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

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

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

LLVM IR (-O2):
define void @gtk_stock_list_ids() {
ret void
}
/* Variables and functions */
bool host_build(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @host_build() {
ret i32 0
}
/* Variables and functions */
int *malloc(int);
int *iptr(int value) {
  int *p = malloc(sizeof(int));
  *p = value;
  return p;
}


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

x86 assembly (clang, -O2):
<iptr>:
push   %rbx
mov    %edi,%ebx
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %ebx,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define i32* @iptr(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = call i32* @malloc(i32 4)
store i32* %4, i32** %3
%5 = load i32, i32* %2
%6 = load i32*, i32** %3
store i32 %5, i32* %6
%7 = load i32*, i32** %3
ret i32* %7
}

LLVM IR (-O2):
define noalias i32* @iptr(i32 %0) {
%2 = tail call i32* @malloc(i32 4)
store i32 %0, i32* %2
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char const);
int puts(const char *s) {
  const char *c;
  for (c = s; *c; c++)
    putchar(*c);
  putchar('\n');
  return c - s + 1;
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <puts+0x3e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <putchar@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <puts+0x14>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
add    $0x1,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
mov    %rdi,%rbx
test   %al,%al
je     1144 <puts+0x34>
mov    %r14,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <puts+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
sub    %r14d,%ebx
add    $0x1,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @puts(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @putchar(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i8* [ %0, %1 ], [ %8, %4 ]
%13 = tail call i32 @putchar(i8 signext 10)
%14 = ptrtoint i8* %12 to i64
%15 = ptrtoint i8* %0 to i64
%16 = sub i64 %14, %15
%17 = trunc i64 %16 to i32
%18 = add i32 %17, 1
ret i32 %18
}
/* Type definitions */
struct plainstring {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cstr_loaddouble(char *, double);
int plainstring_equals(struct plainstring const *, char *);
int plainstring_equals_double(const struct plainstring *this_string, double d) {
  char buffer[0xFF];
  if (!this_string)
    return 0;
  cstr_loaddouble(buffer, d);
  return plainstring_equals(this_string, buffer);
}


x86 assembly (clang, -O0):
<plainstring_equals_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <plainstring_equals_double+0x2b>
movl   $0x0,-0x4(%rbp)
jmp    116f <plainstring_equals_double+0x4f>
lea    -0x120(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
call   1040 <cstr_loaddouble@plt>
mov    -0x10(%rbp),%rdi
lea    -0x120(%rbp),%rsi
call   1030 <plainstring_equals@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plainstring_equals_double>:
test   %rdi,%rdi
je     1153 <plainstring_equals_double+0x33>
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <cstr_loaddouble@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <plainstring_equals@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.plainstring = type { i32 }
define i32 @plainstring_equals_double(%struct.plainstring* %0, double %1) {
%3 = alloca i32
%4 = alloca %struct.plainstring*
%5 = alloca double
%6 = alloca [255 x i8]
store %struct.plainstring* %0, %struct.plainstring** %4
store double %1, double* %5
%7 = load %struct.plainstring*, %struct.plainstring** %4
%8 = icmp ne %struct.plainstring* %7, null
br i1 %8, label %10, label %9
9: ; preds = %2
store i32 0, i32* %3
br label %17
10: ; preds = %2
%11 = getelementptr inbounds [255 x i8], [255 x i8]* %6, i64 0, i64 0
%12 = load double, double* %5
%13 = call i32 @cstr_loaddouble(i8* %11, double %12)
%14 = load %struct.plainstring*, %struct.plainstring** %4
%15 = getelementptr inbounds [255 x i8], [255 x i8]* %6, i64 0, i64 0
%16 = call i32 @plainstring_equals(%struct.plainstring* %14, i8* %15)
store i32 %16, i32* %3
br label %17
17: ; preds = %10, %9
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
%struct.plainstring = type { i32 }
define i32 @plainstring_equals_double(%struct.plainstring* %0, double %1) {
%3 = alloca [255 x i8]
%4 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%5 = icmp eq %struct.plainstring* %0, null
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = call i32 @cstr_loaddouble(i8* %4, double %1)
%8 = call i32 @plainstring_equals(%struct.plainstring* %0, i8* %4)
br label %9
9: ; preds = %2, %6
%10 = phi i32 [ %8, %6 ], [ 0, %2 ]
ret i32 %10
}
void ar9003_hw_rtt_disable(struct ath_hw *ah) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
%struct.ath_hw = type opaque
define void @ar9003_hw_rtt_disable(%struct.ath_hw* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i = 1, j = 0, k;
  k = !i | j;
  k = !k;
  printf("%d", k);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xea4(%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
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 0, i32* %3
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
%9 = load i32, i32* %3
%10 = or i32 %8, %9
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
%14 = zext i1 %13 to i32
store i32 %14, i32* %4
%15 = load i32, i32* %4
%16 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
void omap4_cpu_resume(void) {}


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

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

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

LLVM IR (-O2):
define void @omap4_cpu_resume() {
ret void
}
/* Variables and functions */
char *__strtok_r(char *, char const *, char **, int /*<<< orphan*/);
char *strsep(register char **source_ptr, register const char *delim) {
  return __strtok_r(*source_ptr, delim, source_ptr, 0);
}


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

x86 assembly (clang, -O2):
<strsep>:
mov    %rdi,%rdx
mov    (%rdi),%rdi
xor    %ecx,%ecx
jmp    1030 <__strtok_r@plt>

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

LLVM IR (-O2):
define i8* @strsep(i8** %0, i8* %1) {
%3 = load i8*, i8** %0
%4 = tail call i8* @__strtok_r(i8* %3, i8* %1, i8** %0, i32 0)
ret i8* %4
}
int test_imm_E2int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xE2 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_E2int64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 226
%7 = icmp ne i64 %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_E2int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 14811136
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void CrashLog_LogOSVersion(char *buffer) {
  (void)buffer;
  ;
}


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

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

LLVM IR (-O0):
define void @CrashLog_LogOSVersion(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @CrashLog_LogOSVersion(i8* nocapture %0) {
ret void
}
int f9(float a, float b) { return a < 0.0f && a > b; }


x86 assembly (clang, -O0):
<f9>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
xor    %eax,%eax
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
mov    %al,-0x9(%rbp)
jbe    112f <f9+0x2f>
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
seta   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f9>:
xorps  %xmm2,%xmm2
ucomiss %xmm0,%xmm2
seta   %al
ucomiss %xmm1,%xmm0
seta   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @f9(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 = fcmp olt float %5, 0.000000e+00
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load float, float* %3
%9 = load float, float* %4
%10 = fcmp ogt float %8, %9
br label %11
11: ; preds = %7, %2
%12 = phi i1 [ false, %2 ], [ %10, %7 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @f9(float %0, float %1) {
%3 = fcmp olt float %0, 0.000000e+00
%4 = fcmp ogt float %0, %1
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
const char *socket_simgen_longdesc() {
  return "Connect to a wifi/network OBDII device\n"
         "Seed: <host:port>";
}


x86 assembly (clang, -O0):
<socket_simgen_longdesc>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_simgen_longdesc>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [57 x i8] c"Connect to a wifi/network OBDII device\0ASeed: <host:port>\00"
define i8* @socket_simgen_longdesc() {
ret i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [57 x i8] c"Connect to a wifi/network OBDII device\0ASeed: <host:port>\00"
define i8* @socket_simgen_longdesc() {
ret i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0)
}
void foo(void) {
  int i;
#pragma omp distribute parallel for schedule(static) dist_schedule(static)
  for (i = 0; i < 64; i++)
    ;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x40,-0x4(%rbp)
jge    1128 <foo+0x28>
jmp    111a <foo+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <foo+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @foo() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Enemy_AnimationByStatus();
void Enemy_Predraw() { Enemy_AnimationByStatus(); }


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

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

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

LLVM IR (-O2):
define void @Enemy_Predraw() {
%1 = tail call i32 (...) @Enemy_AnimationByStatus()
ret void
}
void any_free(void *priv) {}


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

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

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

LLVM IR (-O2):
define void @any_free(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BBM_POWER_ON(void *);
void mtv_power_on(void *hDevice) { BBM_POWER_ON(hDevice); }


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

x86 assembly (clang, -O2):
<mtv_power_on>:
jmp    1030 <BBM_POWER_ON@plt>

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

LLVM IR (-O2):
define void @mtv_power_on(i8* %0) {
%2 = tail call i32 @BBM_POWER_ON(i8* %0)
ret void
}
void I2CIntEnable(unsigned long ulBase, unsigned long ulIntType) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000004))) = ulIntType;
}


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

x86 assembly (clang, -O2):
<I2CIntEnable>:
mov    %rsi,0x4(%rdi)
ret

LLVM IR (-O0):
define void @I2CIntEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 4
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @I2CIntEnable(i64 %0, i64 %1) {
%3 = add i64 %0, 4
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ popcnt_words0(int /*<<< orphan*/ *, int);
uint64_t popcnt_words(uint64_t *buf, int64_t off, int64_t n) {
  return popcnt_words0(buf + off, n);
}


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

x86 assembly (clang, -O2):
<popcnt_words>:
movslq %esi,%rax
lea    (%rdi,%rax,4),%rdi
mov    %edx,%esi
jmp    1030 <popcnt_words0@plt>

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

LLVM IR (-O2):
define i32 @popcnt_words(i32* %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = tail call i32 @popcnt_words0(i32* %5, i32 %2)
ret i32 %6
}