xunge/DecIR huggingface dataset:
/* Type definitions */
struct _query {
  int dummy;
};
struct _index_searcher {
  int dummy;
};
struct _hits {
  int dummy;
};
struct _filter {
  int dummy;
};

/* Variables and functions */
struct _hits *hits_initial(struct _index_searcher *, struct _query *,
                           struct _filter *);
struct _hits *index_searcher_search_hits(struct _index_searcher *is,
                                         struct _query *query,
                                         struct _filter *filter) {
  return hits_initial(is, query, filter);
}


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

x86 assembly (clang, -O2):
<index_searcher_search_hits>:
jmp    1030 <hits_initial@plt>

LLVM IR (-O0):
%struct._hits = type { i32 }
%struct._index_searcher = type { i32 }
%struct._query = type { i32 }
%struct._filter = type { i32 }
define %struct._hits* @index_searcher_search_hits(%struct._index_searcher* %0, %struct._query* %1, %struct._filter* %2) {
%4 = alloca %struct._index_searcher*
%5 = alloca %struct._query*
%6 = alloca %struct._filter*
store %struct._index_searcher* %0, %struct._index_searcher** %4
store %struct._query* %1, %struct._query** %5
store %struct._filter* %2, %struct._filter** %6
%7 = load %struct._index_searcher*, %struct._index_searcher** %4
%8 = load %struct._query*, %struct._query** %5
%9 = load %struct._filter*, %struct._filter** %6
%10 = call %struct._hits* @hits_initial(%struct._index_searcher* %7, %struct._query* %8, %struct._filter* %9)
ret %struct._hits* %10
}

LLVM IR (-O2):
%struct._hits = type { i32 }
%struct._index_searcher = type { i32 }
%struct._query = type { i32 }
%struct._filter = type { i32 }
define %struct._hits* @index_searcher_search_hits(%struct._index_searcher* %0, %struct._query* %1, %struct._filter* %2) {
%4 = tail call %struct._hits* @hits_initial(%struct._index_searcher* %0, %struct._query* %1, %struct._filter* %2)
ret %struct._hits* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
void study(int ID) {
  printf("Student %d: I am studying\n", ID);
  sleep(1);
}


x86 assembly (clang, -O0):
<study>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<study>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <sleep@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Student %d: I am studying\0A\00"
define void @study(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @sleep(i32 1)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"Student %d: I am studying\0A\00"
define void @study(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @sleep(i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_loadu_si128(int /*<<< orphan*/ *);
__m128i load(const void *p) { return _mm_loadu_si128((__m128i *)p); }


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

x86 assembly (clang, -O2):
<load>:
jmp    1030 <_mm_loadu_si128@plt>

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

LLVM IR (-O2):
define i32 @load(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @_mm_loadu_si128(i32* %2)
ret i32 %3
}
void ft_strclr(char *s) {
  char *d;
  d = s;
  while (*d != '\0')
    *(d++) = '\0';
}


x86 assembly (clang, -O0):
<ft_strclr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1137 <ft_strclr+0x37>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x0,(%rax)
jmp    1110 <ft_strclr+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strclr>:
cmpb   $0x0,(%rdi)
je     111d <ft_strclr+0x1d>
add    $0x1,%rdi
nopl   0x0(%rax)
movb   $0x0,-0x1(%rdi)
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <ft_strclr+0x10>
ret

LLVM IR (-O0):
define void @ft_strclr(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 = %10, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
store i8 0, i8* %11
br label %5
13: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @ft_strclr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %6, %4 ], [ %0, %1 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
store i8 0, i8* %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ byteswap8(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, char const *, int);
uint64_t sas_read8(const char *data, int bswap) {
  uint64_t tmp;
  memcpy(&tmp, data, 8);
  return bswap ? byteswap8(tmp) : tmp;
}


x86 assembly (clang, -O0):
<sas_read8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdi
mov    $0x8,%edx
call   1040 <memcpy@plt>
cmpl   $0x0,-0xc(%rbp)
je     115b <sas_read8+0x3b>
mov    -0x10(%rbp),%edi
call   1030 <byteswap8@plt>
mov    %eax,-0x14(%rbp)
jmp    1161 <sas_read8+0x41>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sas_read8>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
mov    %rdi,%rsi
lea    0xc(%rsp),%rdi
mov    $0x8,%edx
call   1040 <memcpy@plt>
mov    0xc(%rsp),%eax
test   %ebx,%ebx
je     1148 <sas_read8+0x28>
mov    %eax,%edi
call   1030 <byteswap8@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @sas_read8(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = call i32 @memcpy(i32* %5, i8* %6, i32 8)
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* %5
%12 = call i32 @byteswap8(i32 %11)
br label %15
13: ; preds = %2
%14 = load i32, i32* %5
br label %15
15: ; preds = %13, %10
%16 = phi i32 [ %12, %10 ], [ %14, %13 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @sas_read8(i8* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @memcpy(i32* %3, i8* %0, i32 8)
%6 = icmp eq i32 %1, 0
%7 = load i32, i32* %3
br i1 %6, label %10, label %8
8: ; preds = %2
%9 = call i32 @byteswap8(i32 %7)
br label %10
10: ; preds = %2, %8
%11 = phi i32 [ %9, %8 ], [ %7, %2 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ foo(char const *);
int /*<<< orphan*/ vprintf(int /*<<< orphan*/, int /*<<< orphan*/);
void __attribute__((format(printf, 1, 0))) foo2(const char *fmt, va_list va) {
  vprintf(foo(fmt), va);
}


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

x86 assembly (clang, -O2):
<foo2>:
push   %rbx
mov    %esi,%ebx
call   1030 <foo@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <vprintf@plt>

LLVM IR (-O0):
define void @foo2(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 = call i32 @foo(i8* %5)
%7 = load i32, i32* %4
%8 = call i32 @vprintf(i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
define void @foo2(i8* %0, i32 %1) {
%3 = tail call i32 @foo(i8* %0)
%4 = tail call i32 @vprintf(i32 %3, i32 %1)
ret void
}
/* Variables and functions */
int FLT_EPSILON;
int fabs(float);
bool is_equal_flt(float a, float b) {
  return (fabs(a - b) <= (FLT_EPSILON * fabs(b)));
}


x86 assembly (clang, -O0):
<is_equal_flt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
call   1030 <fabs@plt>
mov    %eax,-0xc(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <fabs@plt>
mov    -0x10(%rbp),%ecx
mov    %eax,%edx
mov    -0xc(%rbp),%eax
imul   %edx,%ecx
cmp    %ecx,%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_equal_flt>:
push   %rbp
push   %rbx
push   %rax
movss  %xmm1,0x4(%rsp)
subss  %xmm1,%xmm0
call   1030 <fabs@plt>
mov    %eax,%ebx
mov    0x2eb5(%rip),%rax
mov    (%rax),%ebp
movss  0x4(%rsp),%xmm0
call   1030 <fabs@plt>
imul   %ebp,%eax
xor    %ecx,%ecx
cmp    %eax,%ebx
setle  %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@FLT_EPSILON = global i32 0
define i32 @is_equal_flt(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fsub float %5, %6
%8 = call i32 @fabs(float %7)
%9 = load i32, i32* @FLT_EPSILON
%10 = load float, float* %4
%11 = call i32 @fabs(float %10)
%12 = mul nsw i32 %9, %11
%13 = icmp sle i32 %8, %12
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
@FLT_EPSILON = global i32 0
define i32 @is_equal_flt(float %0, float %1) {
%3 = fsub float %0, %1
%4 = tail call i32 @fabs(float %3)
%5 = load i32, i32* @FLT_EPSILON
%6 = tail call i32 @fabs(float %1)
%7 = mul nsw i32 %6, %5
%8 = icmp sle i32 %4, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int sscanf(char *, char *, int *);
void setlevel(char *optarg) {
  extern int level;
  int scanfargc;
  scanfargc = sscanf(optarg, "%d", &level);
  if (scanfargc != 1 || level < 0 || level > 9) {
    level = -1;
  }
}


x86 assembly (clang, -O0):
<setlevel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    0x2eba(%rip),%rdx
call   1030 <sscanf@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1160 <setlevel+0x50>
mov    0x2ea1(%rip),%rax
cmpl   $0x0,(%rax)
jl     1160 <setlevel+0x50>
mov    0x2e91(%rip),%rax
cmpl   $0x9,(%rax)
jle    116d <setlevel+0x5d>
mov    0x2e81(%rip),%rax
movl   $0xffffffff,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setlevel>:
push   %rbx
lea    0xee8(%rip),%rsi
mov    0x2ec9(%rip),%rbx
mov    %rbx,%rdx
call   1030 <sscanf@plt>
cmp    $0x1,%eax
jne    1139 <setlevel+0x29>
mov    (%rbx),%eax
test   %eax,%eax
js     1139 <setlevel+0x29>
cmp    $0xa,%eax
jge    1139 <setlevel+0x29>
pop    %rbx
ret
movl   $0xffffffff,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@level = external global i32
define void @setlevel(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @sscanf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* @level)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 1
br i1 %7, label %14, label %8
8: ; preds = %1
%9 = load i32, i32* @level
%10 = icmp slt i32 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = load i32, i32* @level
%13 = icmp sgt i32 %12, 9
br i1 %13, label %14, label %15
14: ; preds = %11, %8, %1
store i32 -1, i32* @level
br label %15
15: ; preds = %14, %11
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@level = external global i32
define void @setlevel(i8* nocapture %0) {
%2 = tail call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* @level)
%3 = icmp ne i32 %2, 1
%4 = load i32, i32* @level
%5 = icmp slt i32 %4, 0
%6 = select i1 %3, i1 true, i1 %5
%7 = icmp sgt i32 %4, 9
%8 = select i1 %6, i1 true, i1 %7
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 -1, i32* @level
br label %10
10: ; preds = %1, %9
ret void
}
char *strcpy(char *dest, const char *source) {
  while (*source)
    *(dest++) = *(source++);
  *dest = '\0';
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1140 <strcpy+0x40>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    110c <strcpy+0xc>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1121 <strcpy+0x21>
add    $0x1,%rsi
nopl   (%rax)
mov    %cl,(%rax)
add    $0x1,%rax
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <strcpy+0x10>
movb   $0x0,(%rax)
ret

LLVM IR (-O0):
define i8* @strcpy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %9, %2
%6 = load i8*, i8** %4
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %4
%12 = load i8, i8* %10
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %3
store i8 %12, i8* %13
br label %5
15: ; preds = %5
%16 = load i8*, i8** %3
store i8 0, i8* %16
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
define i8* @strcpy(i8* writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %1, %2 ]
%8 = phi i8* [ %10, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %6, i8* %8
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ wNotYet(char *);
int /*<<< orphan*/ wPushNumber(int /*<<< orphan*/);
void wBasDir() {
  wNotYet("Dir");
  wPushNumber(0);
}


x86 assembly (clang, -O0):
<wBasDir>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <wNotYet@plt>
xor    %edi,%edi
call   1030 <wPushNumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wBasDir>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <wNotYet@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <wPushNumber@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"Dir\00"
define void @wBasDir() {
%1 = call i32 @wNotYet(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @wPushNumber(i32 0)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"Dir\00"
define void @wBasDir() {
%1 = tail call i32 @wNotYet(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @wPushNumber(i32 0)
ret void
}
int check_if_valid_udp_port(int udp_port) { return (1); }


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

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

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

LLVM IR (-O2):
define i32 @check_if_valid_udp_port(i32 %0) {
ret i32 1
}
void g_date_set_time() {}


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

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

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

LLVM IR (-O2):
define void @g_date_set_time() {
ret void
}
int analog10(int port) {}


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

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

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

LLVM IR (-O2):
define i32 @analog10(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int fork();
int fork_process(void (*func)()) {
  int ret = fork();
  if (ret == 0) {
    func();
  }
  if (ret > 0) {
  }
  return ret;
}


x86 assembly (clang, -O0):
<fork_process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <fork@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1135 <fork_process+0x25>
mov    $0x0,%al
call   *-0x8(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1144 <fork_process+0x34>
jmp    1144 <fork_process+0x34>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fork_process>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <fork@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    1127 <fork_process+0x17>
xor    %eax,%eax
call   *%rbx
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fork_process(void (...)* nocapture %0) {
%2 = tail call i32 (...) @fork()
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
tail call void (...) %0()
br label %5
5: ; preds = %4, %1
ret i32 %2
}
void pop_noop(void *ctx) {}


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

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

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

LLVM IR (-O2):
define void @pop_noop(i8* nocapture %0) {
ret void
}
/* Variables and functions */
void *kitsune_get_val(char const *);
int kitsune_old_address_matches(const char *name, void *ptr) {
  return ptr == kitsune_get_val(name);
}


x86 assembly (clang, -O0):
<kitsune_old_address_matches>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <kitsune_get_val@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kitsune_old_address_matches>:
push   %rbx
mov    %rsi,%rbx
call   1030 <kitsune_get_val@plt>
xor    %ecx,%ecx
cmp    %rbx,%rax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @kitsune_old_address_matches(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = call i8* @kitsune_get_val(i8* %6)
%8 = icmp eq i8* %5, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @kitsune_old_address_matches(i8* %0, i8* readnone %1) {
%3 = tail call i8* @kitsune_get_val(i8* %0)
%4 = icmp eq i8* %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
int divide(int a, int b) {
  int res = a / b;
  return res;
}


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

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

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

LLVM IR (-O2):
define i32 @divide(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
int convert_to_lower(int a) {
  int lower_letter = a + 32;
  return lower_letter;
}


x86 assembly (clang, -O0):
<convert_to_lower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_to_lower>:
lea    0x20(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @convert_to_lower(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 32
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @convert_to_lower(i32 %0) {
%2 = add nsw i32 %0, 32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMR66_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMR66_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

LLVM IR (-O0):
define void @U_WMR66_swap(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 @U_WMRNOTIMPLEMENTED_swap(i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @U_WMR66_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
void ar2315_plat_setup(void) {}


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

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

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

LLVM IR (-O2):
define void @ar2315_plat_setup() {
ret void
}
int c072(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @c072() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0xa5() {
  Assert_real((isprint(165) == 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_isprint.c",
              830, ("isprint should be 0 for 0xa5"));
}


x86 assembly (clang, -O0):
<t_isprint_0xa5>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa5,%edi
call   1030 <isprint@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x33e,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0xa5>:
push   %rax
mov    $0xa5,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x33e,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xa5\00"
define void @t_isprint_0xa5() {
%1 = call i64 @isprint(i32 165)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 830, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xa5\00"
define void @t_isprint_0xa5() {
%1 = tail call i64 @isprint(i32 165)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 830, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
long _sum(long EV_a, long EV_b) { return (EV_a + EV_b); }


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

x86 assembly (clang, -O2):
<_sum>:
lea    (%rdi,%rsi,1),%rax
ret

LLVM IR (-O0):
define i64 @_sum(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = add nsw i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @_sum(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ naivePrime(int);
int sqrt(int);
int getNextSize(int number) {
  int nextSize = number + (sqrt(number));
  if (nextSize % 2 == 0)
    nextSize++;
  while (!naivePrime(nextSize))
    nextSize += 2;
  return nextSize;
}


x86 assembly (clang, -O0):
<getNextSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <sqrt@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1160 <getNextSize+0x40>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1165 <getNextSize+0x45>
mov    -0x8(%rbp),%edi
call   1030 <naivePrime@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1182 <getNextSize+0x62>
jmp    1190 <getNextSize+0x70>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    1165 <getNextSize+0x45>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNextSize>:
push   %rbx
mov    %edi,%ebx
call   1040 <sqrt@plt>
add    %ebx,%eax
mov    %eax,%ebx
not    %ebx
and    $0x1,%ebx
add    %eax,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1030 <naivePrime@plt>
add    $0x2,%ebx
test   %eax,%eax
je     1140 <getNextSize+0x20>
add    $0xfffffffe,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @getNextSize(i32 %0) {
%2 = tail call i32 @sqrt(i32 %0)
%3 = add nsw i32 %2, %0
%4 = and i32 %3, 1
%5 = xor i32 %4, 1
%6 = add nsw i32 %5, %3
br label %7
7: ; preds = %7, %1
%8 = phi i32 [ %6, %1 ], [ %11, %7 ]
%9 = tail call i32 @naivePrime(i32 %8)
%10 = icmp eq i32 %9, 0
%11 = add nsw i32 %8, 2
br i1 %10, label %7, label %12
12: ; preds = %7
ret i32 %8
}
void codegen_timing_486_block_start() {}


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

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

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

LLVM IR (-O2):
define void @codegen_timing_486_block_start() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ curs_set(int);
int /*<<< orphan*/ endwin();
int display_end(void) {
  curs_set(1);
  endwin();
  return 0;
}


x86 assembly (clang, -O0):
<display_end>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <curs_set@plt>
mov    $0x0,%al
call   1030 <endwin@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_end>:
push   %rax
mov    $0x1,%edi
call   1040 <curs_set@plt>
xor    %eax,%eax
call   1030 <endwin@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @display_end() {
%1 = call i32 @curs_set(i32 1)
%2 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
define i32 @display_end() {
%1 = tail call i32 @curs_set(i32 1)
%2 = tail call i32 (...) @endwin()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ native_restore_fl(unsigned long);
__attribute__((always_)) void raw_local_irq_restore(unsigned long flags) {
  native_restore_fl(flags);
}


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

x86 assembly (clang, -O2):
<raw_local_irq_restore>:
jmp    1030 <native_restore_fl@plt>

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

LLVM IR (-O2):
define void @raw_local_irq_restore(i64 %0) {
%2 = tail call i32 @native_restore_fl(i64 %0)
ret void
}
int do_206() { return 206; }


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

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

LLVM IR (-O0):
define i32 @do_206() {
ret i32 206
}

LLVM IR (-O2):
define i32 @do_206() {
ret i32 206
}
int sbox(unsigned char data) {
  union {
    unsigned int DATA;
    struct {
      unsigned char low;
      unsigned char high;
    } reg;
  } s;
  s.reg.high = 0;
  s.reg.low = data;
  s.DATA <<= 2;
  return (s.reg.high | s.reg.low);
}


x86 assembly (clang, -O0):
<sbox>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x0,-0x7(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0x8(%rbp)
movzbl -0x7(%rbp),%eax
movzbl -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbox>:
mov    %edi,%eax
shr    $0x6,%al
movzbl %al,%eax
and    $0x3f,%edi
lea    (%rax,%rdi,4),%eax
ret

LLVM IR (-O0):
%union.anon = type { i32 }
%struct.anon = type { i8, i8 }
define i32 @sbox(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca %union.anon
store i8 %0, i8* %2
%4 = bitcast %union.anon* %3 to %struct.anon*
%5 = getelementptr inbounds %struct.anon, %struct.anon* %4, i32 0, i32 1
store i8 0, i8* %5
%6 = load i8, i8* %2
%7 = bitcast %union.anon* %3 to %struct.anon*
%8 = getelementptr inbounds %struct.anon, %struct.anon* %7, i32 0, i32 0
store i8 %6, i8* %8
%9 = bitcast %union.anon* %3 to i32*
%10 = load i32, i32* %9
%11 = shl i32 %10, 2
store i32 %11, i32* %9
%12 = bitcast %union.anon* %3 to %struct.anon*
%13 = getelementptr inbounds %struct.anon, %struct.anon* %12, i32 0, i32 1
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = bitcast %union.anon* %3 to %struct.anon*
%17 = getelementptr inbounds %struct.anon, %struct.anon* %16, i32 0, i32 0
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = or i32 %15, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @sbox(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = shl nuw nsw i32 %2, 2
%4 = lshr i8 %0, 6
%5 = zext i8 %4 to i32
%6 = and i32 %3, 252
%7 = or i32 %6, %5
ret i32 %7
}
long stub_syscall3(long syscall, long arg1, long arg2, long arg3) {
  __asm__("movl %0, %%edx; " : : "g"(arg3) : "%edx");
  return (stub_syscall2(syscall, arg1, arg2));
}


x86 assembly (clang, -O0):
<stub_syscall3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%edx
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1030 <stub_syscall2@plt>
cltq
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i64 @stub_syscall3(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %8
%10 = load i64, i64* %5
%11 = load i64, i64* %6
%12 = load i64, i64* %7
%13 = call i32 (i64, i64, i64, ...) bitcast (i32 (...)* @stub_syscall2 to i32 (i64, i64, i64, ...)*)(i64 %10, i64 %11, i64 %12)
%14 = sext i32 %13 to i64
ret i64 %14
}

LLVM IR (-O2):
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ execl(char *, char *, char *, char const *,
                         int /*<<< orphan*/ *);
scalar_t__ fork();
int /*<<< orphan*/ waitpid(scalar_t__, int /*<<< orphan*/ *,
                           int /*<<< orphan*/);
void system_command(const char *command) {
  pid_t pid = fork();
  if (pid == 0)
    execl("/bin/bash", "bash", "-c", command, NULL);
  else
    waitpid(pid, NULL, 0);
}


x86 assembly (clang, -O0):
<system_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <fork@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    117a <system_command+0x4a>
mov    -0x8(%rbp),%rcx
lea    0xea3(%rip),%rdi
lea    0xea1(%rip),%rsi
lea    0xe9f(%rip),%rdx
xor    %eax,%eax
mov    %eax,%r8d
call   1040 <execl@plt>
jmp    1189 <system_command+0x59>
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <waitpid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<system_command>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <fork@plt>
test   %rax,%rax
je     114d <system_command+0x1d>
mov    %rax,%rdi
xor    %esi,%esi
xor    %edx,%edx
pop    %rbx
jmp    1030 <waitpid@plt>
lea    0xeac(%rip),%rdi
lea    0xeaa(%rip),%rsi
lea    0xea8(%rip),%rdx
mov    %rbx,%rcx
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <execl@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"/bin/bash\00"
@.str.1 = [5 x i8] c"bash\00"
@.str.2 = [3 x i8] c"-c\00"
define void @system_command(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = call i64 (...) @fork()
store i64 %4, i64* %3
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @execl(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %8, i32* null)
br label %13
10: ; preds = %1
%11 = load i64, i64* %3
%12 = call i32 @waitpid(i64 %11, i32* null, i32 0)
br label %13
13: ; preds = %10, %7
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"/bin/bash\00"
@.str.1 = [5 x i8] c"bash\00"
@.str.2 = [3 x i8] c"-c\00"
define void @system_command(i8* %0) {
%2 = tail call i64 (...) @fork()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @execl(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %0, i32* null)
br label %8
6: ; preds = %1
%7 = tail call i32 @waitpid(i64 %2, i32* null, i32 0)
br label %8
8: ; preds = %6, %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ clockid_t;

/* Variables and functions */
int syscall(int, int /*<<< orphan*/, int);
int timerfd_create(clockid_t clockid, int flags) {
  return syscall(283, clockid, flags);
}


x86 assembly (clang, -O0):
<timerfd_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    $0x11b,%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timerfd_create>:
mov    %esi,%edx
mov    %edi,%esi
mov    $0x11b,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @timerfd_create(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 @syscall(i32 283, i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @timerfd_create(i32 %0, i32 %1) {
%3 = tail call i32 @syscall(i32 283, i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int uint64_t;
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint64_t microseconds(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return tv.tv_sec * (uint64_t)1000000 + tv.tv_usec;
}


x86 assembly (clang, -O0):
<microseconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x8(%rbp),%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<microseconds>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,(%rsp),%eax
add    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @microseconds() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = add nsw i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @microseconds() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
ret i32 %9
}
void av_read_image_line() {}


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

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

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

LLVM IR (-O2):
define void @av_read_image_line() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fread(char *, int, size_t, int /*<<< orphan*/ *);
void readData(FILE *file, char *outData, size_t inLength) {
  fread(outData, 1, inLength, file);
}


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

x86 assembly (clang, -O2):
<readData>:
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    $0x1,%esi
jmp    1030 <fread@plt>

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

LLVM IR (-O2):
define void @readData(i32* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @fread(i8* %1, i32 1, i64 %2, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void version() {
  printf("COPRTHR clcc\n");
  printf("Copyright (c) 2008-2011 Brown Deer Technology, LLC."
         " All Rights Reserved.\n");
  printf("This program is free software distributed under GPLv3.\n");
}


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

x86 assembly (clang, -O2):
<version>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee9(%rip),%rdi
call   1030 <puts@plt>
lea    0xf26(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"COPRTHR clcc\0A\00"
@.str.1 = [74 x i8] c"Copyright (c) 2008-2011 Brown Deer Technology, LLC. All Rights Reserved.\0A\00"
@.str.2 = [56 x i8] c"This program is free software distributed under GPLv3.\0A\00"
define void @version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"COPRTHR clcc\00"
@str.3 = [73 x i8] c"Copyright (c) 2008-2011 Brown Deer Technology, LLC. All Rights Reserved.\00"
@str.4 = [55 x i8] c"This program is free software distributed under GPLv3.\00"
define void @version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int linear_product_root_count(int *r) {
  int fail, *b;
  double *c;
  fail = _ada_use_c2phc4c(112, r, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<linear_product_root_count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x70,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<linear_product_root_count>:
mov    %rdi,%rsi
mov    $0x70,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @linear_product_root_count(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32*
%5 = alloca double*
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = load i32*, i32** %4
%8 = load double*, double** %5
%9 = call i32 @_ada_use_c2phc4c(i32 112, i32* %6, i32* %7, double* %8, i32 0)
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @linear_product_root_count(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc4c(i32 112, i32* %0, i32* undef, double* undef, i32 0)
ret i32 %2
}
void ebsa110_mask_and_ack_irq(unsigned int irq) {
  *((volatile unsigned char *)0xf3000000) = 1 << irq;
}


x86 assembly (clang, -O0):
<ebsa110_mask_and_ack_irq>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %al,%cl
mov    $0xf3000000,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ebsa110_mask_and_ack_irq>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    $0xf3000000,%ecx
mov    %al,(%rcx)
ret

LLVM IR (-O0):
define void @ebsa110_mask_and_ack_irq(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 1, %3
%5 = trunc i32 %4 to i8
store volatile i8 %5, i8* inttoptr (i64 4076863488 to i8*)
ret void
}

LLVM IR (-O2):
define void @ebsa110_mask_and_ack_irq(i32 %0) {
%2 = shl nuw i32 1, %0
%3 = trunc i32 %2 to i8
store volatile i8 %3, i8* inttoptr (i64 4076863488 to i8*)
ret void
}
int test_imm_75uint8_mem(unsigned char *val) {
  return ((*val) & (-0x75 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_75uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -117
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int mlock2_(void *start, size_t len, int flags) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<mlock2_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ed2(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb9(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mlock2_>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @mlock2_(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i32, i32* @ENOSYS
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @mlock2_(i8* nocapture readnone %0, i64 %1, i32 %2) {
%4 = load i32, i32* @ENOSYS
store i32 %4, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ motion_set(int);
void soft_right(void) { motion_set(0x02); }


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

x86 assembly (clang, -O2):
<soft_right>:
mov    $0x2,%edi
jmp    1030 <motion_set@plt>

LLVM IR (-O0):
define void @soft_right() {
%1 = call i32 @motion_set(i32 2)
ret void
}

LLVM IR (-O2):
define void @soft_right() {
%1 = tail call i32 @motion_set(i32 2)
ret void
}