xunge/DecIR huggingface dataset:
/* Variables and functions */
char shift_bit(char, int /*<<< orphan*/);
char crc7end(char cur_val) {
  int i;
  for (i = 0; i < 7; i++)
    cur_val = shift_bit(cur_val, 0);
  return cur_val & 0x7f;
}


x86 assembly (clang, -O0):
<crc7end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x7,-0x8(%rbp)
jge    114b <crc7end+0x3b>
xor    %esi,%esi
movsbl -0x1(%rbp),%edi
call   1030 <shift_bit@plt>
mov    %al,-0x1(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1125 <crc7end+0x15>
movsbl -0x1(%rbp),%eax
and    $0x7f,%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc7end>:
push   %rax
xor    %esi,%esi
call   1030 <shift_bit@plt>
movsbl %al,%edi
xor    %esi,%esi
call   1030 <shift_bit@plt>
movsbl %al,%edi
xor    %esi,%esi
call   1030 <shift_bit@plt>
movsbl %al,%edi
xor    %esi,%esi
call   1030 <shift_bit@plt>
movsbl %al,%edi
xor    %esi,%esi
call   1030 <shift_bit@plt>
movsbl %al,%edi
xor    %esi,%esi
call   1030 <shift_bit@plt>
movsbl %al,%edi
xor    %esi,%esi
call   1030 <shift_bit@plt>
and    $0x7f,%al
pop    %rcx
ret

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

LLVM IR (-O2):
define signext i8 @crc7end(i8 signext %0) {
%2 = tail call signext i8 @shift_bit(i8 signext %0, i32 0)
%3 = tail call signext i8 @shift_bit(i8 signext %2, i32 0)
%4 = tail call signext i8 @shift_bit(i8 signext %3, i32 0)
%5 = tail call signext i8 @shift_bit(i8 signext %4, i32 0)
%6 = tail call signext i8 @shift_bit(i8 signext %5, i32 0)
%7 = tail call signext i8 @shift_bit(i8 signext %6, i32 0)
%8 = tail call signext i8 @shift_bit(i8 signext %7, i32 0)
%9 = and i8 %8, 127
ret i8 %9
}
/* Variables and functions */
int eslib_rtnetlink_linkset(char *, int /*<<< orphan*/);
int eslib_rtnetlink_linksetdown(char *name) {
  return eslib_rtnetlink_linkset(name, 0);
}


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

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

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

LLVM IR (-O2):
define i32 @eslib_rtnetlink_linksetdown(i8* %0) {
%2 = tail call i32 @eslib_rtnetlink_linkset(i8* %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  scanf("%d", &a);
  printf("%s", a == 0 ? "zero" : a > 0 ? "plus" : "minus");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jne    1159 <main+0x39>
lea    0xeb6(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1175 <main+0x55>
mov    -0x8(%rbp),%edx
lea    0xead(%rip),%rax
lea    0xea1(%rip),%rcx
cmp    $0x0,%edx
cmovg  %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
lea    0xecd(%rip),%rax
lea    0xecb(%rip),%rcx
cmovg  %rax,%rcx
lea    0xeb6(%rip),%rsi
cmovne %rcx,%rsi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [5 x i8] c"zero\00"
@.str.3 = [5 x i8] c"plus\00"
@.str.4 = [6 x i8] c"minus\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
br label %12
7: ; preds = %0
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0)
br label %12
12: ; preds = %7, %6
%13 = phi i8* [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), %6 ], [ %11, %7 ]
%14 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %13)
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [5 x i8] c"zero\00"
@.str.3 = [5 x i8] c"plus\00"
@.str.4 = [6 x i8] c"minus\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 0
%6 = icmp sgt i32 %4, 0
%7 = select i1 %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0)
%8 = select i1 %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret i32 0
}
/* Type definitions */
struct functionCall {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct functionCall *);
void freeArray(struct functionCall *array) { free(array); }


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

LLVM IR (-O0):
%struct.functionCall = type { i32 }
define void @freeArray(%struct.functionCall* %0) {
%2 = alloca %struct.functionCall*
store %struct.functionCall* %0, %struct.functionCall** %2
%3 = load %struct.functionCall*, %struct.functionCall** %2
%4 = call i32 @free(%struct.functionCall* %3)
ret void
}

LLVM IR (-O2):
%struct.functionCall = type { i32 }
define void @freeArray(%struct.functionCall* nocapture %0) {
%2 = tail call i32 @free(%struct.functionCall* %0)
ret void
}
void wl_caret(n, p_outf) unsigned long n;
void (*p_outf)(char *);
{
  {
    if (!(n < 1000))
      as_bomb("wl_caret: Argument is out of range.");
  };
  while (--n > 0)
    (*p_outf)(" ");
  (*p_outf)("^\n");
}


x86 assembly (clang, -O0):
<wl_caret>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x3e8,-0x8(%rbp)
jb     113c <wl_caret+0x2c>
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <as_bomb@plt>
jmp    1141 <wl_caret+0x31>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
jbe    1166 <wl_caret+0x56>
lea    0xec6(%rip),%rdi
call   *-0x10(%rbp)
jmp    1141 <wl_caret+0x31>
lea    0xeb9(%rip),%rdi
call   *-0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wl_caret>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
cmp    $0x3e8,%rdi
jae    1129 <wl_caret+0x19>
add    $0xffffffffffffffff,%r15
jne    1141 <wl_caret+0x31>
jmp    1161 <wl_caret+0x51>
lea    0xed0(%rip),%rdi
xor    %eax,%eax
mov    %rsi,%r14
call   1030 <as_bomb@plt>
mov    %r14,%rsi
add    $0xffffffffffffffff,%r15
lea    0xedc(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rsi,%rbx
call   *%rsi
mov    %rbx,%rsi
add    $0xffffffffffffffff,%r15
jne    1150 <wl_caret+0x40>
lea    0xebe(%rip),%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    *%rsi

LLVM IR (-O0):
@.str = [36 x i8] c"wl_caret: Argument is out of range.\00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [3 x i8] c"^\0A\00"
define void @wl_caret(i64 %0, void (i8*)* %1) {
%3 = alloca i64
%4 = alloca void (i8*)*
store i64 %0, i64* %3
store void (i8*)* %1, void (i8*)** %4
%5 = load i64, i64* %3
%6 = icmp ult i64 %5, 1000
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @as_bomb to i32 (i8*, ...)*)(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
br label %10
10: ; preds = %14, %9
%11 = load i64, i64* %3
%12 = add i64 %11, -1
store i64 %12, i64* %3
%13 = icmp ugt i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = load void (i8*)*, void (i8*)** %4
br label %10
16: ; preds = %10
%17 = load void (i8*)*, void (i8*)** %4
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"wl_caret: Argument is out of range.\00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [3 x i8] c"^\0A\00"
define void @wl_caret(i64 %0, void (i8*)* nocapture %1) {
%3 = icmp ult i64 %0, 1000
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @as_bomb to i32 (i8*, ...)*)(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%6 = add i64 %0, -1
br label %10
7: ; preds = %2
%8 = add nsw i64 %0, -1
%9 = icmp eq i64 %8, 0
br i1 %9, label %16, label %10
10: ; preds = %4, %7
%11 = phi i64 [ %8, %7 ], [ %6, %4 ]
br label %12
12: ; preds = %10, %12
%13 = phi i64 [ %14, %12 ], [ %11, %10 ]
tail call void %1(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%14 = add i64 %13, -1
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %12
16: ; preds = %12, %7
tail call void %1(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SYS_gettid;
int /*<<< orphan*/ syscall(int /*<<< orphan*/);
void userlevel_pgflt(void) {
  char *p = (char *)0x400000000000;
  *p = 1;
  syscall(SYS_gettid);
}


x86 assembly (clang, -O0):
<userlevel_pgflt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movabs $0x400000000000,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x1,(%rax)
mov    0x2eb4(%rip),%rax
mov    (%rax),%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<userlevel_pgflt>:
movabs $0x400000000000,%rax
movb   $0x1,(%rax)
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_gettid = global i32 0
define void @userlevel_pgflt() {
%1 = alloca i8*
store i8* inttoptr (i64 70368744177664 to i8*), i8** %1
%2 = load i8*, i8** %1
store i8 1, i8* %2
%3 = load i32, i32* @SYS_gettid
%4 = call i32 @syscall(i32 %3)
ret void
}

LLVM IR (-O2):
@SYS_gettid = global i32 0
define void @userlevel_pgflt() {
store i8 1, i8* inttoptr (i64 70368744177664 to i8*)
%1 = load i32, i32* @SYS_gettid
%2 = tail call i32 @syscall(i32 %1)
ret void
}
char *strrchr(char const *s, int c) {
  char const *last = c ? 0 : s;
  while (*s) {
    if (*s == c) {
      last = s;
    }
    s += 1;
  }
  return (char *)last;
}


x86 assembly (clang, -O0):
<strrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1120 <strrchr+0x20>
xor    %eax,%eax
mov    %rax,-0x20(%rbp)
jmp    1128 <strrchr+0x28>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1166 <strrchr+0x66>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    1155 <strrchr+0x55>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1130 <strrchr+0x30>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrchr>:
xor    %eax,%eax
test   %esi,%esi
cmove  %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     1125 <strrchr+0x25>
xchg   %ax,%ax
movsbl %cl,%ecx
cmp    %esi,%ecx
cmove  %rdi,%rax
movzbl 0x1(%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <strrchr+0x10>
ret

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

LLVM IR (-O2):
define i8* @strrchr(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i8* %0, i8* null
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %17, label %7
7: ; preds = %2, %7
%8 = phi i8 [ %15, %7 ], [ %5, %2 ]
%9 = phi i8* [ %13, %7 ], [ %4, %2 ]
%10 = phi i8* [ %14, %7 ], [ %0, %2 ]
%11 = sext i8 %8 to i32
%12 = icmp eq i32 %11, %1
%13 = select i1 %12, i8* %10, i8* %9
%14 = getelementptr inbounds i8, i8* %10, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %7
17: ; preds = %7, %2
%18 = phi i8* [ %4, %2 ], [ %13, %7 ]
ret i8* %18
}
/* Variables and functions */
scalar_t__ days_of_month(int, int);
int count_days(int year, int month, int day) {
  int all_days = 0;
  for (int i = 1; i < month; i++) {
    all_days += days_of_month(year, i);
  }
  all_days += day;
  return all_days;
}


x86 assembly (clang, -O0):
<count_days>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1161 <count_days+0x51>
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <days_of_month@plt>
mov    %rax,%rcx
movslq -0x10(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112f <count_days+0x1f>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_days>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r14d
xor    %ebp,%ebp
cmp    $0x2,%esi
jl     1144 <count_days+0x34>
mov    %esi,%r12d
mov    %edi,%r15d
xor    %ebp,%ebp
mov    $0x1,%ebx
nop
mov    %r15d,%edi
mov    %ebx,%esi
call   1030 <days_of_month@plt>
add    %eax,%ebp
add    $0x1,%ebx
cmp    %ebx,%r12d
jne    1130 <count_days+0x20>
add    %r14d,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @count_days(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
store i32 1, i32* %8
br label %9
9: ; preds = %21, %3
%10 = load i32, i32* %8
%11 = load i32, i32* %5
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %24
13: ; preds = %9
%14 = load i32, i32* %4
%15 = load i32, i32* %8
%16 = call i64 @days_of_month(i32 %14, i32 %15)
%17 = load i32, i32* %7
%18 = sext i32 %17 to i64
%19 = add nsw i64 %18, %16
%20 = trunc i64 %19 to i32
store i32 %20, i32* %7
br label %21
21: ; preds = %13
%22 = load i32, i32* %8
%23 = add nsw i32 %22, 1
store i32 %23, i32* %8
br label %9
24: ; preds = %9
%25 = load i32, i32* %6
%26 = load i32, i32* %7
%27 = add nsw i32 %26, %25
store i32 %27, i32* %7
%28 = load i32, i32* %7
ret i32 %28
}

LLVM IR (-O2):
define i32 @count_days(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 1
br i1 %4, label %8, label %5
5: ; preds = %8, %3
%6 = phi i32 [ 0, %3 ], [ %13, %8 ]
%7 = add nsw i32 %6, %2
ret i32 %7
8: ; preds = %3, %8
%9 = phi i32 [ %14, %8 ], [ 1, %3 ]
%10 = phi i32 [ %13, %8 ], [ 0, %3 ]
%11 = tail call i64 @days_of_month(i32 %0, i32 %9)
%12 = trunc i64 %11 to i32
%13 = add i32 %10, %12
%14 = add nuw nsw i32 %9, 1
%15 = icmp eq i32 %14, %1
br i1 %15, label %5, label %8
}
/* Variables and functions */
int /*<<< orphan*/ SIGABRT;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ raise(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void _ACC_fatal(const char *msg) {
  fprintf(stderr, "OpenACC runtime error: %s\n", msg);
  raise(SIGABRT);
  exit(1);
}


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

x86 assembly (clang, -O2):
<_ACC_fatal>:
push   %rax
mov    %rdi,%rdx
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"OpenACC runtime error: %s\0A\00"
@SIGABRT = global i32 0
define void @_ACC_fatal(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @SIGABRT
%5 = tail call i32 @raise(i32 %4)
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ clear();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ refresh();
void done_screen(void) {
  (void)clear();
  (void)refresh();
  (void)endwin();
}


x86 assembly (clang, -O0):
<done_screen>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <clear@plt>
mov    $0x0,%al
call   1030 <refresh@plt>
mov    $0x0,%al
call   1040 <endwin@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<done_screen>:
push   %rax
xor    %eax,%eax
call   1050 <clear@plt>
xor    %eax,%eax
call   1030 <refresh@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <endwin@plt>

LLVM IR (-O0):
define void @done_screen() {
%1 = call i32 (...) @clear()
%2 = call i32 (...) @refresh()
%3 = call i32 (...) @endwin()
ret void
}

LLVM IR (-O2):
define void @done_screen() {
%1 = tail call i32 (...) @clear()
%2 = tail call i32 (...) @refresh()
%3 = tail call i32 (...) @endwin()
ret void
}
void g_spawn_async() {}


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

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

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

LLVM IR (-O2):
define void @g_spawn_async() {
ret void
}
void border_nwse_double_diagonal_generic(unsigned char *pic,
                                         unsigned char *mirr) {
  *pic = 0x28;
}


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

x86 assembly (clang, -O2):
<border_nwse_double_diagonal_generic>:
movb   $0x28,(%rdi)
ret

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

LLVM IR (-O2):
define void @border_nwse_double_diagonal_generic(i8* nocapture writeonly %0, i8* nocapture readnone %1) {
store i8 40, i8* %0
ret void
}
unsigned long FindBitRate(int devHandle) { return 0; }


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

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

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

LLVM IR (-O2):
define i64 @FindBitRate(i32 %0) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void pause() {
  db(0xF3);
  db(0x90);
}


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

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

LLVM IR (-O0):
define void @pause() {
%1 = call i32 @db(i32 243)
%2 = call i32 @db(i32 144)
ret void
}

LLVM IR (-O2):
define void @pause() {
%1 = tail call i32 @db(i32 243)
%2 = tail call i32 @db(i32 144)
ret void
}
/* Variables and functions */
int bar();
int foo(void) {
  int a = bar();
  return a;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <bar@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca i32
%2 = call i32 (...) @bar()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @foo() {
%1 = tail call i32 (...) @bar()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void recursive(int number, char *name) {
  if (number == 0)
    return;
  else {
    printf("%s\n", name);
    recursive(number - 1, name);
  }
}


x86 assembly (clang, -O0):
<recursive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    113e <recursive+0x1e>
jmp    115d <recursive+0x3d>
mov    -0x10(%rbp),%rsi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%rsi
call   1040 <recursive@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recursive>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
je     1140 <recursive+0x30>
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xedc(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jne    1130 <recursive+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @recursive(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %0, %2 ]
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%7 = add nsw i32 %5, -1
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
/* Variables and functions */
int f126(int *);
int f127(int *p) { return f126(p); }


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

x86 assembly (clang, -O2):
<f127>:
jmp    1030 <f126@plt>

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

LLVM IR (-O2):
define i32 @f127(i32* %0) {
%2 = tail call i32 @f126(i32* %0)
ret i32 %2
}
int getValueCode(char value) {
  if (value >= 'a' && value <= 'z') {
    return value - 'a';
  }
  if (value >= 'A' && value <= 'Z') {
    return value - 'A';
  }
  return -1;
}


x86 assembly (clang, -O0):
<getValueCode>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1133 <getValueCode+0x33>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     1133 <getValueCode+0x33>
movsbl -0x5(%rbp),%eax
sub    $0x61,%eax
mov    %eax,-0x4(%rbp)
jmp    1163 <getValueCode+0x63>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     115c <getValueCode+0x5c>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     115c <getValueCode+0x5c>
movsbl -0x5(%rbp),%eax
sub    $0x41,%eax
mov    %eax,-0x4(%rbp)
jmp    1163 <getValueCode+0x63>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getValueCode>:
mov    %edi,%eax
lea    -0x61(%rax),%ecx
cmp    $0x19,%cl
ja     110e <getValueCode+0xe>
add    $0xffffff9f,%eax
ret
lea    -0x41(%rax),%ecx
add    $0xffffffbf,%eax
cmp    $0x1a,%cl
mov    $0xffffffff,%ecx
cmovb  %eax,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @getValueCode(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %15
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 122
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 97
store i32 %14, i32* %2
br label %28
15: ; preds = %7, %1
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp sge i32 %17, 65
br i1 %18, label %19, label %27
19: ; preds = %15
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp sle i32 %21, 90
br i1 %22, label %23, label %27
23: ; preds = %19
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = sub nsw i32 %25, 65
store i32 %26, i32* %2
br label %28
27: ; preds = %19, %15
store i32 -1, i32* %2
br label %28
28: ; preds = %27, %23, %11
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
define i32 @getValueCode(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add i8 %0, -97
%4 = icmp ult i8 %3, 26
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = add nsw i32 %2, -97
br label %12
7: ; preds = %1
%8 = add i8 %0, -65
%9 = icmp ult i8 %8, 26
%10 = add nsw i32 %2, -65
%11 = select i1 %9, i32 %10, i32 -1
br label %12
12: ; preds = %7, %5
%13 = phi i32 [ %6, %5 ], [ %11, %7 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void Print_Array(int array[], int size) {
  int i;
  for (i = 0; i < size; i++)
    printf("%d\t", array[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<Print_Array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <Print_Array+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <Print_Array+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Print_Array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <Print_Array+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <Print_Array+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\09\00"
define void @Print_Array(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
void _matrix_3x1_add_3x1(float m1[3][1], float m2[3][1]) {
  int i;
  for (i = 0; i < 3; ++i)
    m1[i][0] = m1[i][0] + m2[i][0];
}


x86 assembly (clang, -O0):
<_matrix_3x1_add_3x1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jge    1152 <_matrix_3x1_add_3x1+0x52>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
addss  (%rax,%rcx,4),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <_matrix_3x1_add_3x1+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_matrix_3x1_add_3x1>:
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
addss  (%rsi),%xmm0
movss  %xmm0,(%rdi)
addss  0x4(%rsi),%xmm1
movss  %xmm1,0x4(%rdi)
movss  0x8(%rdi),%xmm0
addss  0x8(%rsi),%xmm0
movss  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @_matrix_3x1_add_3x1([1 x float]* %0, [1 x float]* %1) {
%3 = alloca [1 x float]*
%4 = alloca [1 x float]*
%5 = alloca i32
store [1 x float]* %0, [1 x float]** %3
store [1 x float]* %1, [1 x float]** %4
store i32 0, i32* %5
br label %6
6: ; preds = %28, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 3
br i1 %8, label %9, label %31
9: ; preds = %6
%10 = load [1 x float]*, [1 x float]** %3
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [1 x float], [1 x float]* %10, i64 %12
%14 = getelementptr inbounds [1 x float], [1 x float]* %13, i64 0, i64 0
%15 = load float, float* %14
%16 = load [1 x float]*, [1 x float]** %4
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [1 x float], [1 x float]* %16, i64 %18
%20 = getelementptr inbounds [1 x float], [1 x float]* %19, i64 0, i64 0
%21 = load float, float* %20
%22 = fadd float %15, %21
%23 = load [1 x float]*, [1 x float]** %3
%24 = load i32, i32* %5
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [1 x float], [1 x float]* %23, i64 %25
%27 = getelementptr inbounds [1 x float], [1 x float]* %26, i64 0, i64 0
store float %22, float* %27
br label %28
28: ; preds = %9
%29 = load i32, i32* %5
%30 = add nsw i32 %29, 1
store i32 %30, i32* %5
br label %6
31: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @_matrix_3x1_add_3x1([1 x float]* nocapture %0, [1 x float]* nocapture %1) {
%3 = getelementptr inbounds [1 x float], [1 x float]* %0, i64 0, i64 0
%4 = load float, float* %3
%5 = getelementptr inbounds [1 x float], [1 x float]* %1, i64 0, i64 0
%6 = load float, float* %5
%7 = fadd float %4, %6
store float %7, float* %3
%8 = getelementptr inbounds [1 x float], [1 x float]* %0, i64 1, i64 0
%9 = load float, float* %8
%10 = getelementptr inbounds [1 x float], [1 x float]* %1, i64 1, i64 0
%11 = load float, float* %10
%12 = fadd float %9, %11
store float %12, float* %8
%13 = getelementptr inbounds [1 x float], [1 x float]* %0, i64 2, i64 0
%14 = load float, float* %13
%15 = getelementptr inbounds [1 x float], [1 x float]* %1, i64 2, i64 0
%16 = load float, float* %15
%17 = fadd float %14, %16
store float %17, float* %13
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGTERM;
int /*<<< orphan*/ SIGUSR2;
int /*<<< orphan*/ getppid();
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ raise(int /*<<< orphan*/);
void childTerminate(int sig) {
  kill(getppid(), SIGUSR2);
  raise(SIGTERM);
  return;
}


x86 assembly (clang, -O0):
<childTerminate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1050 <getppid@plt>
mov    %eax,%edi
mov    0x2e8d(%rip),%rax
mov    (%rax),%esi
call   1040 <kill@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<childTerminate>:
push   %rax
xor    %eax,%eax
call   1050 <getppid@plt>
mov    0x2e99(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
call   1040 <kill@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1030 <raise@plt>

LLVM IR (-O0):
@SIGUSR2 = global i32 0
@SIGTERM = global i32 0
define void @childTerminate(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @getppid()
%4 = load i32, i32* @SIGUSR2
%5 = call i32 @kill(i32 %3, i32 %4)
%6 = load i32, i32* @SIGTERM
%7 = call i32 @raise(i32 %6)
ret void
}

LLVM IR (-O2):
@SIGUSR2 = global i32 0
@SIGTERM = global i32 0
define void @childTerminate(i32 %0) {
%2 = tail call i32 (...) @getppid()
%3 = load i32, i32* @SIGUSR2
%4 = tail call i32 @kill(i32 %2, i32 %3)
%5 = load i32, i32* @SIGTERM
%6 = tail call i32 @raise(i32 %5)
ret void
}
void bounds_reset() {}


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

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

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

LLVM IR (-O2):
define void @bounds_reset() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void USBEndpointDMAChannel(uint32_t ui32Base, uint32_t ui32Endpoint,
                           uint32_t ui32Channel) {
  uint32_t ui32Mask;
  ;

  ;
  ;
  ui32Mask = 0xf << (ui32Channel * 4);
  ui32Mask = (*((volatile uint32_t *)(ui32Base + 0x00000450))) & (~ui32Mask);
  ui32Mask |= (((ui32Endpoint) >> 4)) << (ui32Channel * 4);
  (*((volatile uint32_t *)(ui32Base + 0x00000450))) = ui32Mask;
}


x86 assembly (clang, -O0):
<USBEndpointDMAChannel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
shl    $0x2,%ecx
mov    $0xf,%eax
shl    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x450,%eax
cltq
mov    (%rax),%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x4,%eax
mov    -0xc(%rbp),%ecx
shl    $0x2,%ecx
shl    %cl,%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x450,%eax
cltq
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBEndpointDMAChannel>:
lea    0x0(,%rdx,4),%ecx
mov    $0xf,%eax
shl    %cl,%eax
movslq %edi,%rdx
not    %eax
sar    $0x4,%esi
shl    %cl,%esi
and    0x450(%rdx),%eax
or     %eax,%esi
mov    %esi,0x450(%rdx)
ret

LLVM IR (-O0):
define void @USBEndpointDMAChannel(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
%9 = mul nsw i32 %8, 4
%10 = shl i32 15, %9
store i32 %10, i32* %7
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 1104
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i32*
%15 = load volatile i32, i32* %14
%16 = load i32, i32* %7
%17 = xor i32 %16, -1
%18 = and i32 %15, %17
store i32 %18, i32* %7
%19 = load i32, i32* %5
%20 = ashr i32 %19, 4
%21 = load i32, i32* %6
%22 = mul nsw i32 %21, 4
%23 = shl i32 %20, %22
%24 = load i32, i32* %7
%25 = or i32 %24, %23
store i32 %25, i32* %7
%26 = load i32, i32* %7
%27 = load i32, i32* %4
%28 = add nsw i32 %27, 1104
%29 = sext i32 %28 to i64
%30 = inttoptr i64 %29 to i32*
store volatile i32 %26, i32* %30
ret void
}

LLVM IR (-O2):
define void @USBEndpointDMAChannel(i32 %0, i32 %1, i32 %2) {
%4 = shl nsw i32 %2, 2
%5 = shl i32 15, %4
%6 = add nsw i32 %0, 1104
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = xor i32 %5, -1
%11 = and i32 %9, %10
%12 = ashr i32 %1, 4
%13 = shl i32 %12, %4
%14 = or i32 %11, %13
store volatile i32 %14, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: chmod [-R] mode file...\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"Usage: chmod [-R] mode file...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"Usage: chmod [-R] mode file...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int, unsigned int);
int clear_buf(unsigned char *buf, unsigned int size) {
  int n = 100;
  int error_count = 0;
  while (--n > 0) {
    memset((void *)buf, 0xFF, size);
  }
  return error_count;
}


x86 assembly (clang, -O0):
<clear_buf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x64,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
jle    1155 <clear_buf+0x45>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    $0xff,%esi
call   1030 <memset@plt>
jmp    112d <clear_buf+0x1d>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_buf>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
mov    $0x65,%ebp
nop
mov    %rbx,%rdi
mov    $0xff,%esi
mov    %r14d,%edx
call   1030 <memset@plt>
add    $0xffffffff,%ebp
cmp    $0x2,%ebp
ja     1120 <clear_buf+0x10>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @clear_buf(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 100, i32* %5
store i32 0, i32* %6
br label %7
7: ; preds = %11, %2
%8 = load i32, i32* %5
%9 = add nsw i32 %8, -1
store i32 %9, i32* %5
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i8*, i8** %3
%13 = load i32, i32* %4
%14 = call i32 @memset(i8* %12, i32 255, i32 %13)
br label %7
15: ; preds = %7
%16 = load i32, i32* %6
ret i32 %16
}

LLVM IR (-O2):
define i32 @clear_buf(i8* %0, i32 %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ 100, %2 ], [ %5, %3 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 @memset(i8* %0, i32 255, i32 %1)
%7 = icmp ugt i32 %4, 2
br i1 %7, label %3, label %8
8: ; preds = %3
ret i32 0
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void AESSelectAlgorithm(uint32_t algorithm) {

  ;
  (*((volatile unsigned long *)(0x40024000 + 0x00000700))) = algorithm;
}


x86 assembly (clang, -O0):
<AESSelectAlgorithm>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x40024700,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<AESSelectAlgorithm>:
mov    %rdi,0x40024700
40
ret

LLVM IR (-O0):
define void @AESSelectAlgorithm(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
store volatile i64 %3, i64* inttoptr (i64 1073891072 to i64*)
ret void
}

LLVM IR (-O2):
define void @AESSelectAlgorithm(i64 %0) {
store volatile i64 %0, i64* inttoptr (i64 1073891072 to i64*)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void currentDateTime(char *currentDate) {
  time_t now;
  struct tm *tstruct;
  now = time(NULL);
  tstruct = localtime(&now);
  strftime(currentDate, 15, "%d.%m.%Y", tstruct);
}


x86 assembly (clang, -O0):
<currentDateTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0xf,%esi
lea    0xe97(%rip),%rdx
call   1050 <strftime@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<currentDateTime>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xeac(%rip),%rdx
mov    %rbx,%rdi
mov    $0xf,%esi
mov    %rax,%rcx
call   1050 <strftime@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [9 x i8] c"%d.%m.%Y\00"
define void @currentDateTime(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.tm*
store i8* %0, i8** %2
%5 = call i32 @time(i32* null)
store i32 %5, i32* %3
%6 = call %struct.tm* @localtime(i32* %3)
store %struct.tm* %6, %struct.tm** %4
%7 = load i8*, i8** %2
%8 = load %struct.tm*, %struct.tm** %4
%9 = call i32 @strftime(i8* %7, i32 15, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %struct.tm* %8)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [9 x i8] c"%d.%m.%Y\00"
define void @currentDateTime(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @time(i32* null)
store i32 %4, i32* %2
%5 = call %struct.tm* @localtime(i32* %2)
%6 = call i32 @strftime(i8* %0, i32 15, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %struct.tm* %5)
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
void LCDIDDIndexedWrite(uint32_t ui32Base, uint32_t ui32CS, uint16_t ui16Addr,
                        uint16_t ui16Data) {
  uint32_t ui32Addr;
  ;
  ;
  ui32Addr = ui32CS ? 0x00000020 : 0x00000014;
  (*((volatile uint32_t *)(ui32Base + ui32Addr))) = ui16Addr;
  ui32Addr = ui32CS ? 0x00000024 : 0x00000018;
  (*((volatile uint32_t *)(ui32Base + ui32Addr))) = ui16Data;
}


x86 assembly (clang, -O0):
<LCDIDDIndexedWrite>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%edx
mov    $0x14,%eax
mov    $0x20,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    -0x14(%rbp),%eax
cltq
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edx
mov    $0x18,%eax
mov    $0x24,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    -0x14(%rbp),%eax
cltq
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCDIDDIndexedWrite>:
test   %esi,%esi
mov    $0x14,%eax
mov    $0x20,%esi
cmove  %eax,%esi
movslq %edi,%rax
mov    %edx,(%rsi,%rax,1)
mov    $0x18,%edx
mov    $0x24,%esi
cmove  %edx,%esi
mov    %ecx,(%rsi,%rax,1)
ret

LLVM IR (-O0):
define void @LCDIDDIndexedWrite(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %6
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 32, i32 20
store i32 %13, i32* %9
%14 = load i32, i32* %7
%15 = load i32, i32* %5
%16 = load i32, i32* %9
%17 = add nsw i32 %15, %16
%18 = sext i32 %17 to i64
%19 = inttoptr i64 %18 to i32*
store volatile i32 %14, i32* %19
%20 = load i32, i32* %6
%21 = icmp ne i32 %20, 0
%22 = zext i1 %21 to i64
%23 = select i1 %21, i32 36, i32 24
store i32 %23, i32* %9
%24 = load i32, i32* %8
%25 = load i32, i32* %5
%26 = load i32, i32* %9
%27 = add nsw i32 %25, %26
%28 = sext i32 %27 to i64
%29 = inttoptr i64 %28 to i32*
store volatile i32 %24, i32* %29
ret void
}

LLVM IR (-O2):
define void @LCDIDDIndexedWrite(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %1, 0
%6 = select i1 %5, i32 20, i32 32
%7 = add nsw i32 %6, %0
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store volatile i32 %2, i32* %9
%10 = select i1 %5, i32 24, i32 36
%11 = add nsw i32 %10, %0
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
store volatile i32 %3, i32* %13
ret void
}
/* Type definitions */
typedef int __u8;
typedef int const __u32;

/* Variables and functions */
__u32 get_unaligned_le32(const void *_ptr) {
  const __u8 *ptr = _ptr;
  return ptr[0] | (ptr[1] << 8) | (ptr[2] << 16) | (ptr[3] << 24);
}


x86 assembly (clang, -O0):
<get_unaligned_le32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    0xc(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_unaligned_le32>:
mov    0x4(%rdi),%ecx
mov    0x8(%rdi),%edx
shl    $0x8,%ecx
or     (%rdi),%ecx
shl    $0x10,%edx
mov    0xc(%rdi),%eax
shl    $0x18,%eax
or     %edx,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @get_unaligned_le32(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %10
%12 = shl i32 %11, 8
%13 = or i32 %8, %12
%14 = load i32*, i32** %3
%15 = getelementptr inbounds i32, i32* %14, i64 2
%16 = load i32, i32* %15
%17 = shl i32 %16, 16
%18 = or i32 %13, %17
%19 = load i32*, i32** %3
%20 = getelementptr inbounds i32, i32* %19, i64 3
%21 = load i32, i32* %20
%22 = shl i32 %21, 24
%23 = or i32 %18, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @get_unaligned_le32(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = getelementptr inbounds i8, i8* %0, i64 4
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
%7 = shl i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 8
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
%12 = shl i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 12
%15 = bitcast i8* %14 to i32*
%16 = load i32, i32* %15
%17 = shl i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}