xunge/DecIR huggingface dataset:
const char *db_list_users_report_sql(void) {
  static const char *query = "SELECT"
                             "  id AS 'User ID',"
                             "  user_name AS 'Username',"
                             "  first_name AS 'First Name',"
                             "  last_name AS 'Last Name',"
                             "  enabled AS 'Enabled?'"
                             "  FROM users"
                             "  ORDER BY id";
  return query;
}


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

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

LLVM IR (-O0):
@db_list_users_report_sql.query = internal global i8* getelementptr inbounds ([155 x i8], [155 x i8]* @.str, i32 0, i32 0)
@.str = [155 x i8] c"SELECT id AS 'User ID', user_name AS 'Username', first_name AS 'First Name', last_name AS 'Last Name', enabled AS 'Enabled?' FROM users ORDER BY id\00"
define i8* @db_list_users_report_sql() {
%1 = load i8*, i8** @db_list_users_report_sql.query
ret i8* %1
}

LLVM IR (-O2):
@.str = [155 x i8] c"SELECT id AS 'User ID', user_name AS 'Username', first_name AS 'First Name', last_name AS 'Last Name', enabled AS 'Enabled?' FROM users ORDER BY id\00"
define i8* @db_list_users_report_sql() {
ret i8* getelementptr inbounds ([155 x i8], [155 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, double *);
double read_seconds(int runner_number) {
  double seconds = 0.0;
  printf("Please enter runner %d's seconds part of time: ", runner_number);
  scanf("%lf", &seconds);
  return seconds;
}


x86 assembly (clang, -O0):
<read_seconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_seconds>:
push   %rax
mov    %edi,%esi
movq   $0x0,(%rsp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
lea    0xef2(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [48 x i8] c"Please enter runner %d's seconds part of time: \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @read_seconds(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
store double 0.000000e+00, double* %3
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %3)
%7 = load double, double* %3
ret double %7
}

LLVM IR (-O2):
@.str = [48 x i8] c"Please enter runner %d's seconds part of time: \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @read_seconds(i32 %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
store double 0.000000e+00, double* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%6 = load double, double* %2
ret double %6
}
void LK_Printf(const char *dataString) {}


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

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

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

LLVM IR (-O2):
define void @LK_Printf(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int errno;
int pthread_sigmask(int, int /*<<< orphan*/ const *, int /*<<< orphan*/ *);
int sigprocmask(int how, const sigset_t *restrict set, sigset_t *restrict old) {
  int r = pthread_sigmask(how, set, old);
  if (!r)
    return r;
  errno = r;
  return -1;
}


x86 assembly (clang, -O0):
<sigprocmask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <pthread_sigmask@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    114b <sigprocmask+0x3b>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115e <sigprocmask+0x4e>
mov    -0x1c(%rbp),%ecx
mov    0x2e8b(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigprocmask>:
push   %rax
call   1030 <pthread_sigmask@plt>
test   %eax,%eax
je     112a <sigprocmask+0x1a>
mov    0x2ebf(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @sigprocmask(i32 %0, i32* noalias %1, i32* noalias %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32* %2, i32** %7
%9 = load i32, i32* %5
%10 = load i32*, i32** %6
%11 = load i32*, i32** %7
%12 = call i32 @pthread_sigmask(i32 %9, i32* %10, i32* %11)
store i32 %12, i32* %8
%13 = load i32, i32* %8
%14 = icmp ne i32 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %3
%16 = load i32, i32* %8
store i32 %16, i32* %4
br label %19
17: ; preds = %3
%18 = load i32, i32* %8
store i32 %18, i32* @errno
store i32 -1, i32* %4
br label %19
19: ; preds = %17, %15
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @sigprocmask(i32 %0, i32* noalias %1, i32* noalias %2) {
%4 = tail call i32 @pthread_sigmask(i32 %0, i32* %1, i32* %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %3
store i32 %4, i32* @errno
br label %7
7: ; preds = %3, %6
%8 = phi i32 [ -1, %6 ], [ 0, %3 ]
ret i32 %8
}
int Media_PushBuffer(int size, int flags, char *buffer) { return 0; }


x86 assembly (clang, -O0):
<Media_PushBuffer>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @Media_PushBuffer(i32 %0, i32 %1, i8* nocapture readnone %2) {
ret i32 0
}
void statmbx_printMaybeBold(char *str) {
  printf("%c%c%c%c%s%c%c%c%c", 033, '[', '1', 'm', str, 033, '[', '0', 'm');
}


x86 assembly (clang, -O0):
<statmbx_printMaybeBold>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%r9
lea    0xed9(%rip),%rdi
mov    $0x1b,%esi
mov    $0x5b,%edx
mov    $0x31,%ecx
mov    $0x6d,%r8d
movl   $0x1b,(%rsp)
movl   $0x5b,0x8(%rsp)
movl   $0x30,0x10(%rsp)
movl   $0x6d,0x18(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<statmbx_printMaybeBold>:
push   %rax
mov    %rdi,%r9
lea    0xee5(%rip),%rdi
mov    $0x1b,%esi
mov    $0x5b,%edx
mov    $0x31,%ecx
mov    $0x6d,%r8d
xor    %eax,%eax
push   $0x6d
push   $0x30
push   $0x5b
push   $0x1b
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rax
ret

LLVM IR (-O0):
@.str = [19 x i8] c"%c%c%c%c%s%c%c%c%c\00"
define void @statmbx_printMaybeBold(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 27, i32 91, i32 49, i32 109, i8* %3, i32 27, i32 91, i32 48, i32 109)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"%c%c%c%c%s%c%c%c%c\00"
define void @statmbx_printMaybeBold(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 27, i32 91, i32 49, i32 109, i8* %0, i32 27, i32 91, i32 48, i32 109)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ execl(char *, char *, char *, int /*<<< orphan*/ *);
void do_exec() { execl("/sbin/agetty", "agetty", "-", NULL); }


x86 assembly (clang, -O0):
<do_exec>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee4(%rip),%rsi
lea    0xee4(%rip),%rdx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <execl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_exec>:
lea    0xee9(%rip),%rdi
lea    0xee8(%rip),%rsi
lea    0xee8(%rip),%rdx
xor    %ecx,%ecx
jmp    1030 <execl@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"/sbin/agetty\00"
@.str.1 = [7 x i8] c"agetty\00"
@.str.2 = [2 x i8] c"-\00"
define void @do_exec() {
%1 = call i32 @execl(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32* null)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"/sbin/agetty\00"
@.str.1 = [7 x i8] c"agetty\00"
@.str.2 = [2 x i8] c"-\00"
define void @do_exec() {
%1 = tail call i32 @execl(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ insert(int, int);
int linearSearch(int);
int /*<<< orphan*/ print();
int /*<<< orphan*/ printf(char *, int);
int main() {
  insert(1, 11);
  insert(2, 13);
  insert(3, 12);
  insert(4, 14);
  insert(5, 6);
  insert(6, 10);
  print();
  printf("Position of the key is : %d\n", linearSearch(6));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0xb,%esi
call   1060 <insert@plt>
mov    $0x2,%edi
mov    $0xd,%esi
call   1060 <insert@plt>
mov    $0x3,%edi
mov    $0xc,%esi
call   1060 <insert@plt>
mov    $0x4,%edi
mov    $0xe,%esi
call   1060 <insert@plt>
mov    $0x5,%edi
mov    $0x6,%esi
call   1060 <insert@plt>
mov    $0x6,%edi
mov    $0xa,%esi
call   1060 <insert@plt>
mov    $0x0,%al
call   1050 <print@plt>
mov    $0x6,%edi
call   1030 <linearSearch@plt>
mov    %eax,%esi
lea    0xe3d(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0xb,%esi
call   1060 <insert@plt>
mov    $0x2,%edi
mov    $0xd,%esi
call   1060 <insert@plt>
mov    $0x3,%edi
mov    $0xc,%esi
call   1060 <insert@plt>
mov    $0x4,%edi
mov    $0xe,%esi
call   1060 <insert@plt>
mov    $0x5,%edi
mov    $0x6,%esi
call   1060 <insert@plt>
mov    $0x6,%edi
mov    $0xa,%esi
call   1060 <insert@plt>
xor    %eax,%eax
call   1050 <print@plt>
mov    $0x6,%edi
call   1030 <linearSearch@plt>
lea    0xe4d(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Position of the key is : %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @insert(i32 1, i32 11)
%3 = call i32 @insert(i32 2, i32 13)
%4 = call i32 @insert(i32 3, i32 12)
%5 = call i32 @insert(i32 4, i32 14)
%6 = call i32 @insert(i32 5, i32 6)
%7 = call i32 @insert(i32 6, i32 10)
%8 = call i32 (...) @print()
%9 = call i32 @linearSearch(i32 6)
%10 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"Position of the key is : %d\0A\00"
define i32 @main() {
%1 = tail call i32 @insert(i32 1, i32 11)
%2 = tail call i32 @insert(i32 2, i32 13)
%3 = tail call i32 @insert(i32 3, i32 12)
%4 = tail call i32 @insert(i32 4, i32 14)
%5 = tail call i32 @insert(i32 5, i32 6)
%6 = tail call i32 @insert(i32 6, i32 10)
%7 = tail call i32 (...) @print()
%8 = tail call i32 @linearSearch(i32 6)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ oom(size_t);
void *xmalloc(size_t size) {
  void *ret = malloc(size);
  if (!ret)
    oom(size);
  return ret;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114d <xmalloc+0x2d>
mov    -0x8(%rbp),%rdi
call   1030 <oom@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113c <xmalloc+0x1c>
mov    %r14,%rdi
call   1030 <oom@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i32 @oom(i64 %9)
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @oom(i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
double strtod(char const *, char **);
double trio_to_double(const char *source, char **endp) {
  return strtod(source, endp);
}


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

x86 assembly (clang, -O2):
<trio_to_double>:
jmp    1030 <strtod@plt>

LLVM IR (-O0):
define double @trio_to_double(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*** %4
%7 = call double @strtod(i8* %5, i8** %6)
ret double %7
}

LLVM IR (-O2):
define double @trio_to_double(i8* %0, i8** nocapture %1) {
%3 = tail call double @strtod(i8* %0, i8** %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ receiveEvent(int);
void main() { receiveEvent(16); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0x10,%edi
jmp    1030 <receiveEvent@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 @receiveEvent(i32 16)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @receiveEvent(i32 16)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int /*<<< orphan*/);
void t_isbdigit_0x00() {
  Assert_real((isbdigit(0) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              5, ("isbdigit should be 0 for 0x00"));
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <isbdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec2(%rip),%rsi
mov    $0x5,%edx
lea    0xf5f(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
xor    %edi,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec8(%rip),%rsi
lea    0xf6a(%rip),%rcx
mov    $0x5,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x00\00"
define void @t_isbdigit_0x00() {
%1 = call i64 @isbdigit(i32 0)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x00\00"
define void @t_isbdigit_0x00() {
%1 = tail call i64 @isbdigit(i32 0)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void if_test() {
  int a = 3, b = 5;
  if (a > b)
    printf("a(%d) > b(%d)\n", a, b);
  else
    printf("a(%d) < b(%d)\n", a, b);
  if (50 > 30)
    printf("50 > 30\n");
  else
    printf("50 < 30\n");
}


x86 assembly (clang, -O0):
<if_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    114b <if_test+0x3b>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    115f <if_test+0x4f>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<if_test>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x3,%esi
mov    $0x5,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecf(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"a(%d) > b(%d)\0A\00"
@.str.1 = [15 x i8] c"a(%d) < b(%d)\0A\00"
@.str.2 = [9 x i8] c"50 > 30\0A\00"
define void @if_test() {
%1 = alloca i32
%2 = alloca i32
store i32 3, i32* %1
store i32 5, i32* %2
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = icmp sgt i32 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
br label %14
10: ; preds = %0
%11 = load i32, i32* %1
%12 = load i32, i32* %2
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %11, i32 %12)
br label %14
14: ; preds = %10, %6
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [15 x i8] c"a(%d) < b(%d)\0A\00"
@str = [8 x i8] c"50 > 30\00"
define void @if_test() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 3, i32 5)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
void _M2_polar_init(__attribute__((unused)) int argc,
                    __attribute__((unused)) char *argv[]) {}


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

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

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

LLVM IR (-O2):
define void @_M2_polar_init(i32 %0, i8** nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen_call(char *);
void gen_swap(void) { gen_call("_swap"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"_swap\00"
define void @gen_swap() {
%1 = call i32 @gen_call(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"_swap\00"
define void @gen_swap() {
%1 = tail call i32 @gen_call(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int factorial(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int result = factorial(3);
  printf("%d\n", result);
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @factorial(i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
struct fileaccess {
  int dummy;
};

/* Variables and functions */
int file_write_int(struct fileaccess *, int, int /*<<< orphan*/);
int file_write_bool(struct fileaccess *fa, int value) {
  return file_write_int(fa, !!value, 0);
}


x86 assembly (clang, -O0):
<file_write_bool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
cmpl   $0x0,-0xc(%rbp)
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%esi
xor    %edx,%edx
call   1030 <file_write_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_write_bool>:
xor    %eax,%eax
test   %esi,%esi
setne  %al
mov    %eax,%esi
xor    %edx,%edx
jmp    1030 <file_write_int@plt>

LLVM IR (-O0):
%struct.fileaccess = type { i32 }
define i32 @file_write_bool(%struct.fileaccess* %0, i32 %1) {
%3 = alloca %struct.fileaccess*
%4 = alloca i32
store %struct.fileaccess* %0, %struct.fileaccess** %3
store i32 %1, i32* %4
%5 = load %struct.fileaccess*, %struct.fileaccess** %3
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
%11 = call i32 @file_write_int(%struct.fileaccess* %5, i32 %10, i32 0)
ret i32 %11
}

LLVM IR (-O2):
%struct.fileaccess = type { i32 }
define i32 @file_write_bool(%struct.fileaccess* %0, i32 %1) {
%3 = icmp ne i32 %1, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @file_write_int(%struct.fileaccess* %0, i32 %4, i32 0)
ret i32 %5
}
void ff_hevc_put_hevc_bi_w_epel_hv48_12_sse4() {}


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

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

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

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


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @test78_FakePin_targetInit__I() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TimerTickDisable();
void SystickDisable(void) { TimerTickDisable(); }


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

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

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

LLVM IR (-O2):
define void @SystickDisable() {
%1 = tail call i32 (...) @TimerTickDisable()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
void cgentry(void) {
  gen("push\tbp");
  gen("mov\tbp,sp");
}


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

x86 assembly (clang, -O2):
<cgentry>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <gen@plt>
lea    0xee4(%rip),%rdi
pop    %rax
jmp    1030 <gen@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"push\09bp\00"
@.str.1 = [10 x i8] c"mov\09bp,sp\00"
define void @cgentry() {
%1 = call i32 @gen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @gen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"push\09bp\00"
@.str.1 = [10 x i8] c"mov\09bp,sp\00"
define void @cgentry() {
%1 = tail call i32 @gen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @gen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct libavl_allocator {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ free(void *);
void pavl_free(struct libavl_allocator *allocator, void *block) {
  assert(allocator != NULL && block != NULL);
  free(block);
}


x86 assembly (clang, -O0):
<pavl_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     114b <pavl_free+0x2b>
cmpq   $0x0,-0x10(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pavl_free>:
push   %rbx
mov    %rsi,%rbx
test   %rdi,%rdi
setne  %al
test   %rsi,%rsi
setne  %cl
and    %al,%cl
movzbl %cl,%edi
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.libavl_allocator = type { i32 }
define void @pavl_free(%struct.libavl_allocator* %0, i8* %1) {
%3 = alloca %struct.libavl_allocator*
%4 = alloca i8*
store %struct.libavl_allocator* %0, %struct.libavl_allocator** %3
store i8* %1, i8** %4
%5 = load %struct.libavl_allocator*, %struct.libavl_allocator** %3
%6 = icmp ne %struct.libavl_allocator* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i8*, i8** %4
%15 = call i32 @free(i8* %14)
ret void
}

LLVM IR (-O2):
%struct.libavl_allocator = type { i32 }
define void @pavl_free(%struct.libavl_allocator* readnone %0, i8* %1) {
%3 = icmp ne %struct.libavl_allocator* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = tail call i32 @free(i8* %1)
ret void
}
double safeCoord(double r) {
  if (r < 0.0) {
    return 0.0;
  } else if (r > 1.0) {
    return 1.0;
  } else {
    return r;
  }
  __builtin_unreachable();
}


x86 assembly (clang, -O0):
<safeCoord>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1124 <safeCoord+0x24>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1157 <safeCoord+0x57>
movsd  -0x10(%rbp),%xmm0
movsd  0xecf(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    114d <safeCoord+0x4d>
movsd  0xebd(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1157 <safeCoord+0x57>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<safeCoord>:
movsd  0xef8(%rip),%xmm1
minsd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm2,%xmm0
andnpd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @safeCoord(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double 0.000000e+00, double* %2
br label %13
7: ; preds = %1
%8 = load double, double* %3
%9 = fcmp ogt double %8, 1.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %7
store double 1.000000e+00, double* %2
br label %13
11: ; preds = %7
%12 = load double, double* %3
store double %12, double* %2
br label %13
13: ; preds = %11, %10, %6
%14 = load double, double* %2
ret double %14
}

LLVM IR (-O2):
define double @safeCoord(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fcmp ogt double %0, 1.000000e+00
%4 = select i1 %3, double 1.000000e+00, double %0
%5 = select i1 %2, double 0.000000e+00, double %4
ret double %5
}
/* Type definitions */
struct pico_mqtt_serializer {
  int dummy;
};

/* Variables and functions */
int serialize_acknowledge(struct pico_mqtt_serializer *, int);
int serialize_pubrec(struct pico_mqtt_serializer *serializer) {
  do {
  } while (0);
  return serialize_acknowledge(serializer, (5 << 4));
}


x86 assembly (clang, -O0):
<serialize_pubrec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
jmp    1121 <serialize_pubrec+0x11>
mov    -0x8(%rbp),%rdi
mov    $0x50,%esi
call   1030 <serialize_acknowledge@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serialize_pubrec>:
mov    $0x50,%esi
jmp    1030 <serialize_acknowledge@plt>

LLVM IR (-O0):
%struct.pico_mqtt_serializer = type { i32 }
define i32 @serialize_pubrec(%struct.pico_mqtt_serializer* %0) {
%2 = alloca %struct.pico_mqtt_serializer*
store %struct.pico_mqtt_serializer* %0, %struct.pico_mqtt_serializer** %2
br label %3
3: ; preds = %1
br label %4
4: ; preds = %3
%5 = load %struct.pico_mqtt_serializer*, %struct.pico_mqtt_serializer** %2
%6 = call i32 @serialize_acknowledge(%struct.pico_mqtt_serializer* %5, i32 80)
ret i32 %6
}

LLVM IR (-O2):
%struct.pico_mqtt_serializer = type { i32 }
define i32 @serialize_pubrec(%struct.pico_mqtt_serializer* %0) {
%2 = tail call i32 @serialize_acknowledge(%struct.pico_mqtt_serializer* %0, i32 80)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M119_f(char *s) {
  debug("M119_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M119_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M119_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M119_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M119_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M119_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M119_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void warning(char *s) { fprintf(stderr, "warning: %s", s); }


x86 assembly (clang, -O0):
<warning>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<warning>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"warning: %s\00"
define void @warning(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)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"warning: %s\00"
define void @warning(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)
ret void
}
/* Type definitions */
struct group {
  scalar_t__ gr_gid;
};
typedef scalar_t__ gid_t;

/* Variables and functions */
int /*<<< orphan*/ endgrent();
struct group *getgrent();
struct group *getgrgid(gid_t gid) {
  struct group *gr;
  endgrent();
  while ((gr = getgrent()) != NULL && gr->gr_gid != gid) {
  }
  endgrent();
  return gr;
}


x86 assembly (clang, -O0):
<getgrgid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <endgrent@plt>
mov    $0x0,%al
call   1040 <getgrent@plt>
mov    %rax,%rcx
mov    %rcx,-0x10(%rbp)
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
je     1161 <getgrgid+0x41>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
cmp    -0x8(%rbp),%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1171 <getgrgid+0x51>
jmp    1176 <getgrgid+0x56>
jmp    1133 <getgrgid+0x13>
mov    $0x0,%al
call   1030 <endgrent@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getgrgid>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <endgrent@plt>
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <getgrent@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1144 <getgrgid+0x24>
cmp    %r14,(%rbx)
jne    1130 <getgrgid+0x10>
xor    %eax,%eax
call   1030 <endgrent@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.group = type { i64 }
define %struct.group* @getgrgid(i64 %0) {
%2 = alloca i64
%3 = alloca %struct.group*
store i64 %0, i64* %2
%4 = call i32 (...) @endgrent()
br label %5
5: ; preds = %16, %1
%6 = call %struct.group* (...) @getgrent()
store %struct.group* %6, %struct.group** %3
%7 = icmp ne %struct.group* %6, null
br i1 %7, label %8, label %14
8: ; preds = %5
%9 = load %struct.group*, %struct.group** %3
%10 = getelementptr inbounds %struct.group, %struct.group* %9, i32 0, i32 0
%11 = load i64, i64* %10
%12 = load i64, i64* %2
%13 = icmp ne i64 %11, %12
br label %14
14: ; preds = %8, %5
%15 = phi i1 [ false, %5 ], [ %13, %8 ]
br i1 %15, label %16, label %17
16: ; preds = %14
br label %5
17: ; preds = %14
%18 = call i32 (...) @endgrent()
%19 = load %struct.group*, %struct.group** %3
ret %struct.group* %19
}

LLVM IR (-O2):
%struct.group = type { i64 }
define %struct.group* @getgrgid(i64 %0) {
%2 = tail call i32 (...) @endgrent()
br label %3
3: ; preds = %6, %1
%4 = tail call %struct.group* (...) @getgrent()
%5 = icmp eq %struct.group* %4, null
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = getelementptr inbounds %struct.group, %struct.group* %4, i64 0, i32 0
%8 = load i64, i64* %7
%9 = icmp eq i64 %8, %0
br i1 %9, label %10, label %3
10: ; preds = %3, %6
%11 = tail call i32 (...) @endgrent()
ret %struct.group* %4
}
int foo(int i) { return (i * 100) / 10; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x64,-0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
add    %edi,%edi
lea    (%rdi,%rdi,4),%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 100
%5 = sdiv i32 %4, 10
ret i32 %5
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = mul nsw i32 %0, 10
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ done(int);
int /*<<< orphan*/ perror(char *);
void writeError(void) {
  perror("ar write error");
  done(1);
}


x86 assembly (clang, -O0):
<writeError>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1030 <done@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeError>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <done@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"ar write error\00"
define void @writeError() {
%1 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @done(i32 1)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"ar write error\00"
define void @writeError() {
%1 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @done(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ restore_malloc_hooks();
void __bound_exit(void) {
  ;
  restore_malloc_hooks();
}


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

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

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

LLVM IR (-O2):
define void @__bound_exit() {
%1 = tail call i32 (...) @restore_malloc_hooks()
ret void
}
void nullarea(int npts, struct vertex *head) {}


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

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

LLVM IR (-O0):
%struct.vertex = type opaque
define void @nullarea(i32 %0, %struct.vertex* %1) {
%3 = alloca i32
%4 = alloca %struct.vertex*
store i32 %0, i32* %3
store %struct.vertex* %1, %struct.vertex** %4
ret void
}

LLVM IR (-O2):
%struct.vertex = type opaque
define void @nullarea(i32 %0, %struct.vertex* nocapture %1) {
ret void
}
/* Type definitions */
typedef scalar_t__ clock_t;

/* Variables and functions */
scalar_t__ clock();
void delay(int mili) {
  clock_t target = mili + clock();
  while (target > clock())
    ;
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
jle    115c <delay+0x4c>
jmp    1138 <delay+0x28>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
push   %r14
push   %rbx
push   %rax
movslq %edi,%r14
xor    %eax,%eax
call   1030 <clock@plt>
mov    %rax,%rbx
add    %r14,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <clock@plt>
cmp    %rax,%rbx
jg     1130 <delay+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @delay(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = call i64 (...) @clock()
%7 = add nsw i64 %5, %6
store i64 %7, i64* %3
br label %8
8: ; preds = %12, %1
%9 = load i64, i64* %3
%10 = call i64 (...) @clock()
%11 = icmp sgt i64 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %8
br label %8
13: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @delay(i32 %0) {
%2 = sext i32 %0 to i64
%3 = tail call i64 (...) @clock()
%4 = add nsw i64 %3, %2
br label %5
5: ; preds = %5, %1
%6 = tail call i64 (...) @clock()
%7 = icmp sgt i64 %4, %6
br i1 %7, label %5, label %8
8: ; preds = %5
ret void
}
/* Type definitions */
struct prng_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ prng_next(struct prng_state *);
double u64_to_f64(int /*<<< orphan*/);
double prng_double(struct prng_state *st) { return u64_to_f64(prng_next(st)); }


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

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

LLVM IR (-O0):
%struct.prng_state = type { i32 }
define double @prng_double(%struct.prng_state* %0) {
%2 = alloca %struct.prng_state*
store %struct.prng_state* %0, %struct.prng_state** %2
%3 = load %struct.prng_state*, %struct.prng_state** %2
%4 = call i32 @prng_next(%struct.prng_state* %3)
%5 = call double @u64_to_f64(i32 %4)
ret double %5
}

LLVM IR (-O2):
%struct.prng_state = type { i32 }
define double @prng_double(%struct.prng_state* %0) {
%2 = tail call i32 @prng_next(%struct.prng_state* %0)
%3 = tail call double @u64_to_f64(i32 %2)
ret double %3
}
void string_free_split(char **split_string) {
  int i;
  if (split_string) {
    for (i = 0; split_string[i]; i++)
      free(split_string[i]);
    free(split_string);
  }
}


x86 assembly (clang, -O0):
<string_free_split>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1169 <string_free_split+0x59>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1160 <string_free_split+0x50>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112e <string_free_split+0x1e>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_free_split>:
test   %rdi,%rdi
je     1150 <string_free_split+0x40>
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <string_free_split+0x31>
lea    0x8(%r14),%rbx
nopl   0x0(%rax,%rax,1)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <string_free_split+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @string_free_split(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i64 [ %9, %6 ], [ 0, %3 ]
%8 = phi i8* [ %11, %6 ], [ %4, %3 ]
tail call void @free(i8* %8)
%9 = add nuw nsw i64 %7, 1
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %6
13: ; preds = %6, %3
%14 = bitcast i8** %0 to i8*
tail call void @free(i8* %14)
br label %15
15: ; preds = %13, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int const);
void closeHttpd(const int httpd) { close(httpd); }


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

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

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

LLVM IR (-O2):
define void @closeHttpd(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int isgraph(int);
int bow_isgraph(int character) { return isgraph(character); }


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

x86 assembly (clang, -O2):
<bow_isgraph>:
jmp    1030 <isgraph@plt>

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

LLVM IR (-O2):
define i32 @bow_isgraph(i32 %0) {
%2 = tail call i32 @isgraph(i32 %0)
ret i32 %2
}
/* Variables and functions */
int scr_dump(char *);
int wrap_scr_dump(char *filename) { return scr_dump(filename); }


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

x86 assembly (clang, -O2):
<wrap_scr_dump>:
jmp    1030 <scr_dump@plt>

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

LLVM IR (-O2):
define i32 @wrap_scr_dump(i8* %0) {
%2 = tail call i32 @scr_dump(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ handle_PIPE(int /*<<< orphan*/);
int gen_PIPE() { handle_PIPE(0); }


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

x86 assembly (clang, -O2):
<gen_PIPE>:
xor    %edi,%edi
jmp    1030 <handle_PIPE@plt>

LLVM IR (-O0):
define i32 @gen_PIPE() {
%1 = alloca i32
%2 = call i32 @handle_PIPE(i32 0)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @gen_PIPE() {
%1 = tail call i32 @handle_PIPE(i32 0)
ret i32 undef
}