xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ swapArrayElements(int *, int, int);
void swapOfInsertionSortMethod(int *s, int lh, int rh) {
  for (int i = rh; i > lh; i--) {
    swapArrayElements(s, i, i - 1);
  }
}


x86 assembly (clang, -O0):
<swapOfInsertionSortMethod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1154 <swapOfInsertionSortMethod+0x44>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1030 <swapArrayElements@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1128 <swapOfInsertionSortMethod+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapOfInsertionSortMethod>:
push   %rbp
push   %r14
push   %rbx
cmp    %esi,%edx
jle    1135 <swapOfInsertionSortMethod+0x25>
mov    %esi,%ebx
mov    %rdi,%r14
nopl   (%rax)
lea    -0x1(%rdx),%ebp
mov    %r14,%rdi
mov    %edx,%esi
mov    %ebp,%edx
call   1030 <swapArrayElements@plt>
mov    %ebp,%edx
cmp    %ebx,%ebp
jg     1120 <swapOfInsertionSortMethod+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @swapOfInsertionSortMethod(i32* %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, %1
br i1 %4, label %6, label %5
5: ; preds = %6, %3
ret void
6: ; preds = %3, %6
%7 = phi i32 [ %8, %6 ], [ %2, %3 ]
%8 = add nsw i32 %7, -1
%9 = tail call i32 @swapArrayElements(i32* %0, i32 %7, i32 %8)
%10 = icmp sgt i32 %8, %1
br i1 %10, label %6, label %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void show_usage(const char *progname) {
  printf("[Usage]\n"
         "  $ %s [options] FILE\n\n",
         progname);
  printf("[Options]\n"
         "  -a, --apple\n"
         "    apple apple apple\n"
         "  -b BANANA, --banana=BANANA\n"
         "    banana banana banana\n"
         "  -c [CAKE], --cake[=CAKE]\n"
         "    cake cake cake\n"
         "  -h, --help\n"
         "    Show help of this program\n"
         "  -v, --version\n"
         "    Show version of this program\n");
}


x86 assembly (clang, -O0):
<show_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee7(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"[Usage]\0A $ %s [options] FILE\0A\0A\00"
@.str.1 = [239 x i8] c"[Options]\0A -a, --apple\0A apple apple apple\0A -b BANANA, --banana=BANANA\0A banana banana banana\0A -c [CAKE], --cake[=CAKE]\0A cake cake cake\0A -h, --help\0A Show help of this program\0A -v, --version\0A Show version of this program\0A\00"
define void @show_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([239 x i8], [239 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"[Usage]\0A $ %s [options] FILE\0A\0A\00"
@str = [238 x i8] c"[Options]\0A -a, --apple\0A apple apple apple\0A -b BANANA, --banana=BANANA\0A banana banana banana\0A -c [CAKE], --cake[=CAKE]\0A cake cake cake\0A -h, --help\0A Show help of this program\0A -v, --version\0A Show version of this program\00"
define void @show_usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([238 x i8], [238 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *proclist_alloc_base();
void *mv_state_alloc(void) { return proclist_alloc_base(); }


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

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

LLVM IR (-O0):
define i8* @mv_state_alloc() {
%1 = call i8* (...) @proclist_alloc_base()
ret i8* %1
}

LLVM IR (-O2):
define i8* @mv_state_alloc() {
%1 = tail call i8* (...) @proclist_alloc_base()
ret i8* %1
}
/* Type definitions */
typedef int time_t;

/* Variables and functions */
scalar_t__ _ttime_number(char **, int *);
int _ttime_hour(char **p, time_t *time) {
  time_t res;
  if (_ttime_number(p, &res) != 0)
    return 1;
  *time += res * 60 * 60;
  return 0;
}


x86 assembly (clang, -O0):
<_ttime_hour>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
call   1030 <_ttime_number@plt>
cmp    $0x0,%rax
je     1143 <_ttime_hour+0x33>
movl   $0x1,-0x4(%rbp)
jmp    1159 <_ttime_hour+0x49>
imul   $0x3c,-0x1c(%rbp),%eax
imul   $0x3c,%eax,%ecx
mov    -0x18(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ttime_hour>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0xc(%rsp),%rsi
call   1030 <_ttime_number@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
jne    113b <_ttime_hour+0x2b>
imul   $0xe10,0xc(%rsp),%eax
add    %eax,(%rbx)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @_ttime_hour(i8** %0, i32* nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i64 @_ttime_number(i8** %0, i32* %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i32, i32* %3
%9 = mul i32 %8, 3600
%10 = load i32, i32* %1
%11 = add nsw i32 %10, %9
store i32 %11, i32* %1
br label %12
12: ; preds = %2, %7
%13 = phi i32 [ 0, %7 ], [ 1, %2 ]
ret i32 %13
}
void AL_evaluatePitch(int pitch, int *exponent, int *mantissa) {
  int shift = 21;
  while ((*mantissa = (int)((float)pitch * (1 << --shift) / 50000.0)) > 0X3FF)
    ;
  *exponent = 20 - shift;
}


x86 assembly (clang, -O0):
<AL_evaluatePitch>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x15,-0x1c(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
mov    -0x1c(%rbp),%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x1c(%rbp)
mov    $0x1,%eax
shl    %cl,%eax
cvtsi2ss %eax,%xmm1
mulss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec1(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    -0x18(%rbp),%rcx
mov    %eax,(%rcx)
cmp    $0x3ff,%eax
jle    115d <AL_evaluatePitch+0x5d>
jmp    1116 <AL_evaluatePitch+0x16>
mov    $0x14,%ecx
sub    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<AL_evaluatePitch>:
cvtsi2ss %edi,%xmm0
xor    %eax,%eax
movsd  0xef2(%rip),%xmm1
xchg   %ax,%ax
lea    0x14(%rax),%ecx
mov    $0x1,%edi
shl    %cl,%edi
xorps  %xmm2,%xmm2
cvtsi2ss %edi,%xmm2
mulss  %xmm0,%xmm2
cvtss2sd %xmm2,%xmm2
divsd  %xmm1,%xmm2
cvttsd2si %xmm2,%ecx
add    $0xffffffff,%eax
cmp    $0x3ff,%ecx
jg     1110 <AL_evaluatePitch+0x10>
mov    %ecx,(%rdx)
not    %eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @AL_evaluatePitch(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
store i32 21, i32* %7
br label %8
8: ; preds = %21, %3
%9 = load i32, i32* %4
%10 = sitofp i32 %9 to float
%11 = load i32, i32* %7
%12 = add nsw i32 %11, -1
store i32 %12, i32* %7
%13 = shl i32 1, %12
%14 = sitofp i32 %13 to float
%15 = fmul float %10, %14
%16 = fpext float %15 to double
%17 = fdiv double %16, 5.000000e+04
%18 = fptosi double %17 to i32
%19 = load i32*, i32** %6
store i32 %18, i32* %19
%20 = icmp sgt i32 %18, 1023
br i1 %20, label %21, label %22
21: ; preds = %8
br label %8
22: ; preds = %8
%23 = load i32, i32* %7
%24 = sub nsw i32 20, %23
%25 = load i32*, i32** %5
store i32 %24, i32* %25
ret void
}

LLVM IR (-O2):
define void @AL_evaluatePitch(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = sitofp i32 %0 to float
br label %5
5: ; preds = %5, %3
%6 = phi i32 [ 21, %3 ], [ %7, %5 ]
%7 = add nsw i32 %6, -1
%8 = shl nuw i32 1, %7
%9 = sitofp i32 %8 to float
%10 = fmul float %4, %9
%11 = fpext float %10 to double
%12 = fdiv double %11, 5.000000e+04
%13 = fptosi double %12 to i32
%14 = icmp sgt i32 %13, 1023
br i1 %14, label %5, label %15
15: ; preds = %5
store i32 %13, i32* %2
%16 = sub i32 21, %6
store i32 %16, i32* %1
ret void
}
/* Variables and functions */
char *getenv(char *);
char *get_hw_config() {
  char *hw_config;
  hw_config = getenv("HW_CONFIG");
  return hw_config ? hw_config : "etc/hardware.ini";
}


x86 assembly (clang, -O0):
<get_hw_config>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1140 <get_hw_config+0x30>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1150 <get_hw_config+0x40>
lea    0xec3(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1150 <get_hw_config+0x40>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_hw_config>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
lea    0xee3(%rip),%rcx
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"HW_CONFIG\00"
@.str.1 = [17 x i8] c"etc/hardware.ini\00"
define i8* @get_hw_config() {
%1 = alloca i8*
%2 = call i8* @getenv(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = load i8*, i8** %1
br label %8
7: ; preds = %0
br label %8
8: ; preds = %7, %5
%9 = phi i8* [ %6, %5 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), %7 ]
ret i8* %9
}

LLVM IR (-O2):
@.str = [10 x i8] c"HW_CONFIG\00"
@.str.1 = [17 x i8] c"etc/hardware.ini\00"
define i8* @get_hw_config() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
%3 = select i1 %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %1
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *);
int /*<<< orphan*/ stderr;
int not_usr(const char *s, const char *arg) {
  fprintf(stderr, "'%s' argument ('%s') is not a USR\n", s, arg);
  return 1;
}


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

x86 assembly (clang, -O2):
<not_usr>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
lea    0xed9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"'%s' argument ('%s') is not a USR\0A\00"
define i32 @not_usr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"'%s' argument ('%s') is not a USR\0A\00"
define i32 @not_usr(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret i32 1
}
void delay(int i) {
  for (int n = 0; n < i; n++)
    ;
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    112d <delay+0x2d>
jmp    111f <delay+0x1f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <delay+0xe>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @delay(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Testing...\n..1\n...2\n....3\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [26 x i8] c"Testing...\0A..1\0A...2\0A....3\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __cpu_to_le32s(unsigned int *);
void cpu_to_le32_array(unsigned int *buf, unsigned int words) {
  while (words--) {
    __cpu_to_le32s(buf);
    buf++;
  }
}


x86 assembly (clang, -O0):
<cpu_to_le32_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     114d <cpu_to_le32_array+0x3d>
mov    -0x8(%rbp),%rdi
call   1030 <__cpu_to_le32s@plt>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
jmp    111f <cpu_to_le32_array+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_to_le32_array>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
je     1131 <cpu_to_le32_array+0x21>
mov    %esi,%ebp
mov    %rdi,%rbx
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1030 <__cpu_to_le32s@plt>
add    $0x4,%rbx
add    $0xffffffff,%ebp
jne    1120 <cpu_to_le32_array+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @cpu_to_le32_array(i32* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32* [ %9, %4 ], [ %0, %2 ]
%7 = add i32 %5, -1
%8 = tail call i32 @__cpu_to_le32s(i32* %6)
%9 = getelementptr inbounds i32, i32* %6, i64 1
%10 = icmp eq i32 %7, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %2
ret void
}
/* Type definitions */
struct tm {
  int dummy;
};
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
size_t strftime(char *, size_t, char *, struct tm *);
int test(void) {
  size_t length;
  size_t max_length;
  char buffer[80];
  struct tm timestruct;
  max_length = sizeof(buffer);
  length = strftime(buffer, max_length, "%A", &timestruct);
  return (length != 0);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movq   $0x50,-0x10(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0xed1(%rip),%rdx
lea    -0x68(%rbp),%rcx
call   1030 <strftime@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
sub    $0x68,%rsp
lea    0xee5(%rip),%rdx
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rcx
mov    $0x50,%esi
call   1030 <strftime@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
add    $0x68,%rsp
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [3 x i8] c"%A\00"
define i32 @test() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca [80 x i8]
%4 = alloca %struct.tm
store i64 80, i64* %2
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%6 = load i64, i64* %2
%7 = call i64 @strftime(i8* %5, i64 %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %struct.tm* %4)
store i64 %7, i64* %1
%8 = load i64, i64* %1
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [3 x i8] c"%A\00"
define i32 @test() {
%1 = alloca [80 x i8]
%2 = alloca %struct.tm
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%4 = bitcast %struct.tm* %2 to i8*
%5 = call i64 @strftime(i8* %3, i64 80, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %struct.tm* %2)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
int fun815() { return 815; }


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

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

LLVM IR (-O0):
define i32 @fun815() {
ret i32 815
}

LLVM IR (-O2):
define i32 @fun815() {
ret i32 815
}
/* Type definitions */
struct timeval {
  int /*<<< orphan*/ tv_usec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ memset(char *, int, int);
int /*<<< orphan*/ sprintf(char *, char *, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int getTimeStamp(char *ts) {
  memset(ts, 0x00, 30);
  struct timeval secs;
  gettimeofday(&secs, NULL);
  sprintf(ts, "%ld.%ld", secs.tv_sec, secs.tv_usec);
  return 0;
}


x86 assembly (clang, -O0):
<getTimeStamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x1e,%edx
call   1040 <memset@plt>
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe96(%rip),%rsi
call   1050 <sprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTimeStamp>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
xor    %esi,%esi
mov    $0x1e,%edx
call   1040 <memset@plt>
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    0x8(%rsp),%ecx
mov    0xc(%rsp),%edx
lea    0xea1(%rip),%rsi
mov    %rbx,%rdi
call   1050 <sprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
@.str = [8 x i8] c"%ld.%ld\00"
define i32 @getTimeStamp(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.timeval
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @memset(i8* %4, i32 0, i32 30)
%6 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%7 = load i8*, i8** %2
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%9 = load i32, i32* %8
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %11)
ret i32 0
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
@.str = [8 x i8] c"%ld.%ld\00"
define i32 @getTimeStamp(i8* %0) {
%2 = alloca %struct.timeval
%3 = tail call i32 @memset(i8* %0, i32 0, i32 30)
%4 = bitcast %struct.timeval* %2 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
%7 = load i32, i32* %6
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%9 = load i32, i32* %8
%10 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9)
ret i32 0
}
void insl(int port, void *addr, unsigned long count) {
  __asm__ __volatile__("rep; insl"
                       : "+D"(addr), "+c"(count)
                       : "d"(port)
                       : "memory");
}


x86 assembly (clang, -O0):
<insl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    -0x4(%rbp),%edx
rep insl (%dx),%es:(%rdi)
mov    %rdi,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<insl>:
mov    %rdx,%rcx
mov    %edi,%edx
mov    %rsi,%rdi
rep insl (%dx),%es:(%rdi)
ret

LLVM IR (-O0):
define void @insl(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 { i8*, i64 } asm sideeffect "rep; insl", "={di},={cx},{dx},0,1,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 %9, i8* %7, i64 %8)
%11 = extractvalue { i8*, i64 } %10, 0
%12 = extractvalue { i8*, i64 } %10, 1
store i8* %11, i8** %5
store i64 %12, i64* %6
ret void
}

LLVM IR (-O2):
define void @insl(i32 %0, i8* %1, i64 %2) {
%4 = tail call { i8*, i64 } asm sideeffect "rep; insl", "={di},={cx},{dx},0,1,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 %0, i8* %1, i64 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t vlsi_read_sci(uint8_t reg) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @vlsi_read_sci(i32 %0) {
ret i32 0
}
void hash_digest_final(__attribute__((unused)) void *hash,
                       __attribute__((unused)) unsigned int *len) {}


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

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

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

LLVM IR (-O2):
define void @hash_digest_final(i8* nocapture %0, i32* nocapture %1) {
ret void
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int strlen(char const *);
char *xxstrdup(const char *s) {
  size_t size = strlen(s) + 1;
  char *p = malloc(size);
  if (p) {
    memcpy(p, s, size);
  }
  return p;
}


x86 assembly (clang, -O0):
<xxstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1177 <xxstrdup+0x47>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xxstrdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1161 <xxstrdup+0x31>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @xxstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = call i8* @malloc(i64 %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %18
13: ; preds = %1
%14 = load i8*, i8** %4
%15 = load i8*, i8** %2
%16 = load i64, i64* %3
%17 = call i32 @memcpy(i8* %14, i8* %15, i64 %16)
br label %18
18: ; preds = %13, %1
%19 = load i8*, i8** %4
ret i8* %19
}

LLVM IR (-O2):
define i8* @xxstrdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %4)
br label %9
9: ; preds = %7, %1
ret i8* %5
}
match(s, p) char *s, *p;
{
  if (*s == '.' && *p != '.')
    return (0);
  return (amatch(s, p));
}


x86 assembly (clang, -O0):
<match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    114c <match+0x3c>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
je     114c <match+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    115e <match+0x4e>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <amatch@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<match>:
cmpb   $0x2e,(%rdi)
jne    111a <match+0xa>
cmpb   $0x2e,(%rsi)
jne    1121 <match+0x11>
xor    %eax,%eax
jmp    1030 <amatch@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @match(i8* %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 46
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i8, i8* %1
%7 = icmp eq i8 %6, 46
br i1 %7, label %8, label %10
8: ; preds = %5, %2
%9 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @amatch to i32 (i8*, i8*, ...)*)(i8* %0, i8* %1)
br label %10
10: ; preds = %5, %8
%11 = phi i32 [ %9, %8 ], [ 0, %5 ]
ret i32 %11
}
/* Type definitions */
typedef int __le16;

/* Variables and functions */
int cpu_to_le16(int);
int ieee80211_is_ctl(__le16 fc) {
  return (fc & cpu_to_le16(0x000c)) == cpu_to_le16(0x0004);
}


x86 assembly (clang, -O0):
<ieee80211_is_ctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xc,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x4,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee80211_is_ctl>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0xc,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ebp
and    %ebx,%ebp
mov    $0x4,%edi
call   1030 <cpu_to_le16@plt>
xor    %ecx,%ecx
cmp    %eax,%ebp
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ieee80211_is_ctl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @cpu_to_le16(i32 12)
%5 = and i32 %3, %4
%6 = call i32 @cpu_to_le16(i32 4)
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ieee80211_is_ctl(i32 %0) {
%2 = tail call i32 @cpu_to_le16(i32 12)
%3 = and i32 %2, %0
%4 = tail call i32 @cpu_to_le16(i32 4)
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ SIGUSR1;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ getpid();
int /*<<< orphan*/ getppid();
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
void child_function(void) {
  printf("I'm here!!!  My pid is %d.\n", (int)getpid());
  kill(getppid(), SIGUSR1);
  puts("Bye, now....");
  exit(0);
}


x86 assembly (clang, -O0):
<child_function>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <getpid@plt>
mov    %eax,%esi
lea    0xe8c(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1070 <getppid@plt>
mov    %eax,%edi
mov    0x2e5f(%rip),%rax
mov    (%rax),%esi
call   1060 <kill@plt>
lea    0xe85(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1080 <exit@plt>

x86 assembly (clang, -O2):
<child_function>:
push   %rax
xor    %eax,%eax
call   1040 <getpid@plt>
lea    0xe91(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
xor    %eax,%eax
call   1070 <getppid@plt>
mov    0x2e64(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
call   1060 <kill@plt>
lea    0xe88(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"I'm here!!! My pid is %d.\0A\00"
@SIGUSR1 = global i32 0
@.str.1 = [13 x i8] c"Bye, now....\00"
define void @child_function() {
%1 = call i64 (...) @getpid()
%2 = trunc i64 %1 to i32
%3 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 (...) @getppid()
%5 = load i32, i32* @SIGUSR1
%6 = call i32 @kill(i32 %4, i32 %5)
%7 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [28 x i8] c"I'm here!!! My pid is %d.\0A\00"
@SIGUSR1 = global i32 0
@.str.1 = [13 x i8] c"Bye, now....\00"
define void @child_function() {
%1 = tail call i64 (...) @getpid()
%2 = trunc i64 %1 to i32
%3 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 (...) @getppid()
%5 = load i32, i32* @SIGUSR1
%6 = tail call i32 @kill(i32 %4, i32 %5)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
long read(int, void *, int);
int /*<<< orphan*/ wasintr();
long iread(int f, void *a, int n) {
  long m;
  for (;;) {
    m = read(f, a, n);
    if (m >= 0 || !wasintr())
      break;
  }
  return m;
}


x86 assembly (clang, -O0):
<iread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <read@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jge    1160 <iread+0x40>
mov    $0x0,%al
call   1030 <wasintr@plt>
cmp    $0x0,%eax
jne    1165 <iread+0x45>
jmp    116a <iread+0x4a>
jmp    1132 <iread+0x12>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iread>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %rsi,%r15
mov    %edi,%ebp
nop
mov    %ebp,%edi
mov    %r15,%rsi
mov    %r14d,%edx
call   1040 <read@plt>
mov    %rax,%rbx
test   %rax,%rax
jns    1150 <iread+0x30>
xor    %eax,%eax
call   1030 <wasintr@plt>
test   %eax,%eax
jne    1130 <iread+0x10>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i64 @iread(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
br label %8
8: ; preds = %19, %3
%9 = load i32, i32* %4
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i64 @read(i32 %9, i8* %10, i32 %11)
store i64 %12, i64* %7
%13 = load i64, i64* %7
%14 = icmp sge i64 %13, 0
br i1 %14, label %18, label %15
15: ; preds = %8
%16 = call i32 (...) @wasintr()
%17 = icmp ne i32 %16, 0
br i1 %17, label %19, label %18
18: ; preds = %15, %8
br label %20
19: ; preds = %15
br label %8
20: ; preds = %18
%21 = load i64, i64* %7
ret i64 %21
}

LLVM IR (-O2):
define i64 @iread(i32 %0, i8* nocapture %1, i32 %2) {
br label %4
4: ; preds = %7, %3
%5 = tail call i64 @read(i32 %0, i8* %1, i32 %2)
%6 = icmp sgt i64 %5, -1
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = tail call i32 (...) @wasintr()
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %4
10: ; preds = %4, %7
ret i64 %5
}
/* Variables and functions */
char *cdb_errmsg(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int, int,
                           char *);
int /*<<< orphan*/ stderr;
void cdb_deferrorcb(void *arg, int errno, const char *file, int line) {
  fprintf(stderr, "DBERR: [%s:%d] %d - %s\n", file, line, errno,
          cdb_errmsg(errno));
}


x86 assembly (clang, -O0):
<cdb_deferrorcb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    0x2ea3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <cdb_errmsg@plt>
mov    -0x34(%rbp),%edi
mov    -0x30(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    %rax,%r9
lea    0xe8a(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdb_deferrorcb>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %rdx,%r15
mov    %esi,%ebp
mov    0x2eaa(%rip),%rax
mov    (%rax),%ebx
mov    %esi,%edi
call   1030 <cdb_errmsg@plt>
lea    0xeba(%rip),%rsi
mov    %ebx,%edi
mov    %r15,%rdx
mov    %r14d,%ecx
mov    %ebp,%r8d
mov    %rax,%r9
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"DBERR: [%s:%d] %d - %s\0A\00"
define void @cdb_deferrorcb(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %7
%11 = load i32, i32* %8
%12 = load i32, i32* %6
%13 = load i32, i32* %6
%14 = call i8* @cdb_errmsg(i32 %13)
%15 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %11, i32 %12, i8* %14)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"DBERR: [%s:%d] %d - %s\0A\00"
define void @cdb_deferrorcb(i8* nocapture readnone %0, i32 %1, i8* %2, i32 %3) {
%5 = load i32, i32* @stderr
%6 = tail call i8* @cdb_errmsg(i32 %1)
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %3, i32 %1, i8* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ syscall8(unsigned long long, unsigned long long,
                            unsigned long long, unsigned long long);
void sys8_panic(void) { syscall8(7ULL, 0ULL, 0ULL, 0ULL); }


x86 assembly (clang, -O0):
<sys8_panic>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7,%edi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rsi
mov    %rcx,%rdx
call   1030 <syscall8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys8_panic>:
mov    $0x7,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <syscall8@plt>

LLVM IR (-O0):
define void @sys8_panic() {
%1 = call i32 @syscall8(i64 7, i64 0, i64 0, i64 0)
ret void
}

LLVM IR (-O2):
define void @sys8_panic() {
%1 = tail call i32 @syscall8(i64 7, i64 0, i64 0, i64 0)
ret void
}
void ASN1_item_d2i_bio(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_item_d2i_bio() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void fsubrp() {
  db(0xDE);
  db(0xE1);
}


x86 assembly (clang, -O0):
<fsubrp>:
push   %rbp
mov    %rsp,%rbp
mov    $0xde,%edi
call   1030 <db@plt>
mov    $0xe1,%edi
call   1030 <db@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsubrp>:
push   %rax
mov    $0xde,%edi
call   1030 <db@plt>
mov    $0xe1,%edi
pop    %rax
jmp    1030 <db@plt>

LLVM IR (-O0):
define void @fsubrp() {
%1 = call i32 @db(i32 222)
%2 = call i32 @db(i32 225)
ret void
}

LLVM IR (-O2):
define void @fsubrp() {
%1 = tail call i32 @db(i32 222)
%2 = tail call i32 @db(i32 225)
ret void
}
/* Variables and functions */
int close(int);
int close_socket(int socket) {
  return close(socket);
  return -1;
}


x86 assembly (clang, -O0):
<close_socket>:
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):
<close_socket>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @close_socket(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
main() {
  printf("Hello World from Hassan Almotairi\n");
  printf("I learned that 2+2= %d\n", 4);
  printf("The grade I am working for is %c\n", 'A');
  printf("The temperature outside is barely %f\n", 30.0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef7(%rip),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefc(%rip),%rdi
mov    $0x41,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf0b(%rip),%rdi
movsd  0xe9e(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf40(%rip),%rdi
call   1030 <puts@plt>
lea    0xed4(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed9(%rip),%rdi
mov    $0x41,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee8(%rip),%rdi
movsd  0xe9e(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Hello World from Hassan Almotairi\0A\00"
@.str.1 = [24 x i8] c"I learned that 2+2= %d\0A\00"
@.str.2 = [34 x i8] c"The grade I am working for is %c\0A\00"
@.str.3 = [38 x i8] c"The temperature outside is barely %f\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 4)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i32 65)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), double 3.000000e+01)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [24 x i8] c"I learned that 2+2= %d\0A\00"
@.str.2 = [34 x i8] c"The grade I am working for is %c\0A\00"
@.str.3 = [38 x i8] c"The temperature outside is barely %f\0A\00"
@str = [34 x i8] c"Hello World from Hassan Almotairi\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 4)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i32 65)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), double 3.000000e+01)
ret i32 0
}
void movie_indicators_show() {}


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

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

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

LLVM IR (-O2):
define void @movie_indicators_show() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug();
int /*<<< orphan*/ ipc();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ timer();
int main() {
  debug();
  ipc();
  timer();
  printf("\nHello Makefile!\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <debug@plt>
xor    %eax,%eax
call   1050 <ipc@plt>
xor    %eax,%eax
call   1040 <timer@plt>
lea    0xea3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"\0AHello Makefile!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @debug()
%3 = call i32 (...) @ipc()
%4 = call i32 (...) @timer()
%5 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [17 x i8] c"\0AHello Makefile!\00"
define i32 @main() {
%1 = tail call i32 (...) @debug()
%2 = tail call i32 (...) @ipc()
%3 = tail call i32 (...) @timer()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void usage(void) {
  printf("Pseudo InfiniBand HCA switch"
         " v"
         "0.4.6"
         "\n"
         "Usage: pibnetd [options]\n"
         "Options:\n"
         "\n"
         "--daemon, -B\n"
         "\tRun in daemon mode\n"
         "\n"
         "--port, -p=<port-number>\n"
         "\tSpecify the number of UDP (default: %u)\n"
         "\n"
         "--verbose, -v\n"
         "\tIncrease the log verbosity level.\n"
         "\n"
         "--help, -h\n"
         "\tDisplay this usage\n",
         (8432));
}


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

x86 assembly (clang, -O2):
<usage>:
lea    0xee9(%rip),%rdi
mov    $0x20f0,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [254 x i8] c"Pseudo InfiniBand HCA switch v0.4.6\0AUsage: pibnetd [options]\0AOptions:\0A\0A--daemon, -B\0A\09Run in daemon mode\0A\0A--port, -p=<port-number>\0A\09Specify the number of UDP (default: %u)\0A\0A--verbose, -v\0A\09Increase the log verbosity level.\0A\0A--help, -h\0A\09Display this usage\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([254 x i8], [254 x i8]* @.str, i64 0, i64 0), i32 8432)
ret void
}

LLVM IR (-O2):
@.str = [254 x i8] c"Pseudo InfiniBand HCA switch v0.4.6\0AUsage: pibnetd [options]\0AOptions:\0A\0A--daemon, -B\0A\09Run in daemon mode\0A\0A--port, -p=<port-number>\0A\09Specify the number of UDP (default: %u)\0A\0A--verbose, -v\0A\09Increase the log verbosity level.\0A\0A--help, -h\0A\09Display this usage\0A\00"
define void @usage() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([254 x i8], [254 x i8]* @.str, i64 0, i64 0), i32 8432)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void delete_testcase(char *testcase) { free(testcase); }


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

x86 assembly (clang, -O2):
<delete_testcase>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @delete_testcase(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0xf6() {
  Assert_real((isspace(246) == 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_isspace.c",
              1235, ("isspace should be 0 for 0xf6"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0xf6>:
push   %rax
mov    $0xf6,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4d3,%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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xf6\00"
define void @t_isspace_0xf6() {
%1 = call i64 @isspace(i32 246)
%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 1235, 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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xf6\00"
define void @t_isspace_0xf6() {
%1 = tail call i64 @isspace(i32 246)
%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 1235, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}