xunge/DecIR huggingface dataset:
void take_a(int ii) {
  printf("%s -- start\n", __func__);
  printf("%s -- end\n", __func__);
  return;
}


x86 assembly (clang, -O0):
<take_a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
lea    0xee4(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
lea    0xecf(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<take_a>:
push   %rbx
lea    0xee8(%rip),%rdi
lea    0xeee(%rip),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"%s -- start\0A\00"
@__func__.take_a = [7 x i8] c"take_a\00"
@.str.1 = [11 x i8] c"%s -- end\0A\00"
define void @take_a(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__func__.take_a, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__func__.take_a, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%s -- start\0A\00"
@__func__.take_a = [7 x i8] c"take_a\00"
@.str.1 = [11 x i8] c"%s -- end\0A\00"
define void @take_a(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__func__.take_a, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__func__.take_a, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isprint(int);
int /*<<< orphan*/ sprintf(char *, char *, int);
char *ascii(char *position, int c) {
  if (!isprint(c))
    c = '.';
  sprintf(position, "%c", c);
  return (++position);
}


x86 assembly (clang, -O0):
<ascii>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <isprint@plt>
cmp    $0x0,%eax
jne    1147 <ascii+0x27>
movl   $0x2e,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xeab(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ascii>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <isprint@plt>
test   %eax,%eax
mov    $0x2e,%eax
cmovne %ebp,%eax
mov    %al,(%rbx)
movb   $0x0,0x1(%rbx)
add    $0x1,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @ascii(i8* writeonly %0, i32 %1) {
%3 = tail call i32 @isprint(i32 %1)
%4 = icmp eq i32 %3, 0
%5 = trunc i32 %1 to i8
%6 = select i1 %4, i8 46, i8 %5
store i8 %6, i8* %0
%7 = getelementptr i8, i8* %0, i64 1
store i8 0, i8* %7
ret i8* %7
}
void fc204(int n) {
a : {
  typedef int(*b)[n];
  {
    typedef int(*c)[n];
    0;
  }
  {
    typedef int(*d)[n];
    0;
  };
  typedef int(*e)[n];
  0;
};
  {
    typedef int(*f)[n];
    {
      typedef int(*g)[n];
      0;
    };
    {
      typedef int(*h)[n];
      0;
    };
    goto a;
    ;
    typedef int(*i)[n];
    0;
  };
  ;
  typedef int(*j)[n];
  0;
}


x86 assembly (clang, -O0):
<fc204>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fc204+0x7>

x86 assembly (clang, -O2):
<fc204>:
jmp    1100 <fc204>

LLVM IR (-O0):
define void @fc204(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
%4 = load i32, i32* %2
%5 = zext i32 %4 to i64
%6 = load i32, i32* %2
%7 = zext i32 %6 to i64
%8 = load i32, i32* %2
%9 = zext i32 %8 to i64
%10 = load i32, i32* %2
%11 = zext i32 %10 to i64
%12 = load i32, i32* %2
%13 = zext i32 %12 to i64
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
%16 = load i32, i32* %2
%17 = zext i32 %16 to i64
br label %3
18: ; No predecessors!
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
%21 = load i32, i32* %2
%22 = zext i32 %21 to i64
ret void
}

LLVM IR (-O2):
define void @fc204(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
int /*<<< orphan*/ strcmp(char *, char *);
char **handle_switch_o(char *arg, char **next) {
  if (!strcmp(arg, "o")) {
    if (!*++next)
      die("argument to '-o' is missing");
  }
  return next;
}


x86 assembly (clang, -O0):
<handle_switch_o>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec5(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1174 <handle_switch_o+0x54>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
cmpq   $0x0,0x8(%rax)
jne    116f <handle_switch_o+0x4f>
lea    0xe98(%rip),%rdi
call   1040 <die@plt>
jmp    1174 <handle_switch_o+0x54>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_switch_o>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
lea    0xed2(%rip),%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     113c <handle_switch_o+0x1c>
mov    %rbx,%r14
jmp    1153 <handle_switch_o+0x33>
lea    0x8(%rbx),%r14
cmpq   $0x0,0x8(%rbx)
jne    1153 <handle_switch_o+0x33>
lea    0xeb4(%rip),%rdi
call   1040 <die@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"o\00"
@.str.1 = [28 x i8] c"argument to '-o' is missing\00"
define i8** @handle_switch_o(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = load i8*, i8** %3
%6 = call i32 @strcmp(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = icmp ne i32 %6, 0
br i1 %7, label %16, label %8
8: ; preds = %2
%9 = load i8**, i8*** %4
%10 = getelementptr inbounds i8*, i8** %9, i32 1
store i8** %10, i8*** %4
%11 = load i8*, i8** %10
%12 = icmp ne i8* %11, null
br i1 %12, label %15, label %13
13: ; preds = %8
%14 = call i32 @die(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %13, %8
br label %16
16: ; preds = %15, %2
%17 = load i8**, i8*** %4
ret i8** %17
}

LLVM IR (-O2):
@.str = [2 x i8] c"o\00"
@.str.1 = [28 x i8] c"argument to '-o' is missing\00"
define i8** @handle_switch_o(i8* nocapture %0, i8** %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = tail call i32 @die(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %5, %9, %2
%12 = phi i8** [ %1, %2 ], [ %6, %5 ], [ %6, %9 ]
ret i8** %12
}
/* Variables and functions */
int /*<<< orphan*/ PlayMusic(int);
void PlayMusicInt(int music) {
  static int current_music = 0;
  if (current_music != music) {
    current_music = music;
    PlayMusic(current_music);
  }
}


x86 assembly (clang, -O0):
<PlayMusicInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2f0b(%rip),%eax
cmp    -0x4(%rbp),%eax
je     113e <PlayMusicInt+0x2e>
mov    -0x4(%rbp),%eax
mov    %eax,0x2ef9(%rip)
mov    0x2ef3(%rip),%edi
call   1030 <PlayMusic@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PlayMusicInt>:
cmp    %edi,0x2f16(%rip)
jne    1119 <PlayMusicInt+0x9>
ret
mov    %edi,0x2f0d(%rip)
jmp    1030 <PlayMusic@plt>

LLVM IR (-O0):
@PlayMusicInt.current_music = internal global i32 0
define void @PlayMusicInt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @PlayMusicInt.current_music
%4 = load i32, i32* %2
%5 = icmp ne i32 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
store i32 %7, i32* @PlayMusicInt.current_music
%8 = load i32, i32* @PlayMusicInt.current_music
%9 = call i32 @PlayMusic(i32 %8)
br label %10
10: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@PlayMusicInt.current_music = internal unnamed_addr global i32 0
define void @PlayMusicInt(i32 %0) {
%2 = load i32, i32* @PlayMusicInt.current_music
%3 = icmp eq i32 %2, %0
br i1 %3, label %6, label %4
4: ; preds = %1
store i32 %0, i32* @PlayMusicInt.current_music
%5 = tail call i32 @PlayMusic(i32 %0)
br label %6
6: ; preds = %4, %1
ret void
}
void call_back_6(void *target, void *routine_ptr) {
  (((void (*)(void *))routine_ptr)(target));
}


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

x86 assembly (clang, -O2):
<call_back_6>:
jmp    *%rsi

LLVM IR (-O0):
define void @call_back_6(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to void (i8*)*
%7 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
define void @call_back_6(i8* %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to void (i8*)*
tail call void %3(i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ isLower(int const);
int toLower(const int c) { return isLower(c) ? c + 32 : c; }


x86 assembly (clang, -O0):
<toLower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isLower@plt>
cmp    $0x0,%rax
je     113b <toLower+0x2b>
mov    -0x4(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <toLower+0x31>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toLower>:
push   %rbx
mov    %edi,%ebx
call   1030 <isLower@plt>
lea    0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @toLower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isLower(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 32
br label %11
9: ; preds = %1
%10 = load i32, i32* %2
br label %11
11: ; preds = %9, %6
%12 = phi i32 [ %8, %6 ], [ %10, %9 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @toLower(i32 %0) {
%2 = tail call i64 @isLower(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ print_define_l_off();
int /*<<< orphan*/ print_define_l_on();
int /*<<< orphan*/ print_define_pwm_ctrl();
void main(void) {
  print_define_l_on();
  print_define_l_off();
  print_define_pwm_ctrl();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <print_define_l_on@plt>
mov    $0x0,%al
call   1030 <print_define_l_off@plt>
mov    $0x0,%al
call   1050 <print_define_pwm_ctrl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <print_define_l_on@plt>
xor    %eax,%eax
call   1030 <print_define_l_off@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <print_define_pwm_ctrl@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @print_define_l_on()
%2 = call i32 (...) @print_define_l_off()
%3 = call i32 (...) @print_define_pwm_ctrl()
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @print_define_l_on()
%2 = tail call i32 (...) @print_define_l_off()
%3 = tail call i32 (...) @print_define_pwm_ctrl()
ret void
}
int fun2() { return 22; }


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

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

LLVM IR (-O0):
define i32 @fun2() {
ret i32 22
}

LLVM IR (-O2):
define i32 @fun2() {
ret i32 22
}
int test_imm_A2int8_reg(signed char val) {
  return ((val) & (-0xA2 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A2int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff5e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_A2int8_reg>:
test   $0xffffff5e,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_A2int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -162
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ guess(int, int);
int main() {
  while (guess(1, 1000))
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x3e8,%esi
call   1030 <guess@plt>
cmp    $0x0,%rax
je     113d <main+0x2d>
jmp    111f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
mov    $0x3e8,%esi
call   1030 <guess@plt>
test   %rax,%rax
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %5, %0
%3 = call i64 @guess(i32 1, i32 1000)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %2
br label %2
6: ; preds = %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 @guess(i32 1, i32 1000)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %1
4: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ display(int *, int);
int /*<<< orphan*/ insertion_sort(int *, int);
int main() {
  int n = 10;
  int a1[] = {2, 3, 6, 4, 76, 11, 9, 4, 33, 87};
  insertion_sort(a1, n);
  display(a1, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeaf(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1050 <insertion_sort@plt>
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1030 <display@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    0xef4(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebc(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <insertion_sort@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <display@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.a1 = [10 x i32] [i32 2, i32 3, i32 6, i32 4, i32 76, i32 11, i32 9, i32 4, i32 33, i32 87]
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [10 x i32]
store i32 0, i32* %1
store i32 10, i32* %2
%4 = bitcast [10 x i32]* %3 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%6 = load i32, i32* %2
%7 = call i32 @insertion_sort(i32* %5, i32 %6)
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%9 = load i32, i32* %2
%10 = call i32 @display(i32* %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a1 = [10 x i32] [i32 2, i32 3, i32 6, i32 4, i32 76, i32 11, i32 9, i32 4, i32 33, i32 87]
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @insertion_sort(i32* %3, i32 10)
%5 = call i32 @display(i32* %3, i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ StopAllTasks();
int /*<<< orphan*/ hogCPU();
int /*<<< orphan*/ nxtDisplayCenteredBigTextLine(int, char *);
int /*<<< orphan*/ stopLift();
int /*<<< orphan*/ wait1Msec(int);
void liftFatalErr() {
  hogCPU();
  stopLift();
  nxtDisplayCenteredBigTextLine(1, "Lift Err");
  wait1Msec(20 * 1000);
  StopAllTasks();
}


x86 assembly (clang, -O0):
<liftFatalErr>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <hogCPU@plt>
mov    $0x0,%al
call   1060 <stopLift@plt>
mov    $0x1,%edi
lea    0xe92(%rip),%rsi
call   1030 <nxtDisplayCenteredBigTextLine@plt>
mov    $0x4e20,%edi
call   1050 <wait1Msec@plt>
mov    $0x0,%al
call   1070 <StopAllTasks@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<liftFatalErr>:
push   %rax
xor    %eax,%eax
call   1040 <hogCPU@plt>
xor    %eax,%eax
call   1060 <stopLift@plt>
lea    0xe9a(%rip),%rsi
mov    $0x1,%edi
call   1030 <nxtDisplayCenteredBigTextLine@plt>
mov    $0x4e20,%edi
call   1050 <wait1Msec@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <StopAllTasks@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"Lift Err\00"
define void @liftFatalErr() {
%1 = call i32 (...) @hogCPU()
%2 = call i32 (...) @stopLift()
%3 = call i32 @nxtDisplayCenteredBigTextLine(i32 1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @wait1Msec(i32 20000)
%5 = call i32 (...) @StopAllTasks()
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"Lift Err\00"
define void @liftFatalErr() {
%1 = tail call i32 (...) @hogCPU()
%2 = tail call i32 (...) @stopLift()
%3 = tail call i32 @nxtDisplayCenteredBigTextLine(i32 1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @wait1Msec(i32 20000)
%5 = tail call i32 (...) @StopAllTasks()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HiveX_motor_setDirection(int, int);
void turnRight() {
  HiveX_motor_setDirection(1, 0);
  HiveX_motor_setDirection(0, 1);
}


x86 assembly (clang, -O0):
<turnRight>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <HiveX_motor_setDirection@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <HiveX_motor_setDirection@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<turnRight>:
push   %rax
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <HiveX_motor_setDirection@plt>
xor    %edi,%edi
mov    $0x1,%esi
pop    %rax
jmp    1030 <HiveX_motor_setDirection@plt>

LLVM IR (-O0):
define void @turnRight() {
%1 = call i32 @HiveX_motor_setDirection(i32 1, i32 0)
%2 = call i32 @HiveX_motor_setDirection(i32 0, i32 1)
ret void
}

LLVM IR (-O2):
define void @turnRight() {
%1 = tail call i32 @HiveX_motor_setDirection(i32 1, i32 0)
%2 = tail call i32 @HiveX_motor_setDirection(i32 0, i32 1)
ret void
}
/* Variables and functions */
size_t strlen(char const *);
size_t u_n_bytes(const char *str) { return strlen(str); }


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

x86 assembly (clang, -O2):
<u_n_bytes>:
jmp    1030 <strlen@plt>

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

LLVM IR (-O2):
define i64 @u_n_bytes(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ SIGKILL;
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
void force_exit(void) { kill(getpid(), SIGKILL); }


x86 assembly (clang, -O0):
<force_exit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
call   1040 <kill@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<force_exit>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
mov    0x2eb1(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
pop    %rax
jmp    1040 <kill@plt>

LLVM IR (-O0):
@SIGKILL = global i32 0
define void @force_exit() {
%1 = call i32 (...) @getpid()
%2 = load i32, i32* @SIGKILL
%3 = call i32 @kill(i32 %1, i32 %2)
ret void
}

LLVM IR (-O2):
@SIGKILL = global i32 0
define void @force_exit() {
%1 = tail call i32 (...) @getpid()
%2 = load i32, i32* @SIGKILL
%3 = tail call i32 @kill(i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
void mprint(int start, int max, int buff[]) {
  int i;
  for (i = start; i < max; i++) {
    putchar(buff[i]);
  }
}


x86 assembly (clang, -O0):
<mprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1152 <mprint+0x42>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <putchar@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1128 <mprint+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mprint>:
push   %r15
push   %r14
push   %rbx
cmp    %esi,%edi
jge    1142 <mprint+0x32>
mov    %esi,%r15d
movslq %edi,%rax
lea    (%rdx,%rax,4),%r14
sub    %edi,%r15d
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %ebx,%r15d
jne    1130 <mprint+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @mprint(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* %4
store i32 %8, i32* %7
br label %9
9: ; preds = %20, %3
%10 = load i32, i32* %7
%11 = load i32, i32* %5
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %23
13: ; preds = %9
%14 = load i32*, i32** %6
%15 = load i32, i32* %7
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
%19 = call i32 @putchar(i32 %18)
br label %20
20: ; preds = %13
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 1
store i32 %22, i32* %7
br label %9
23: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @mprint(i32 %0, i32 %1, i32* nocapture %2) {
%4 = icmp slt i32 %0, %1
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = sext i32 %0 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ %6, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds i32, i32* %2, i64 %8
%10 = load i32, i32* %9
%11 = tail call i32 @putchar(i32 %10)
%12 = add nsw i64 %8, 1
%13 = trunc i64 %12 to i32
%14 = icmp eq i32 %13, %1
br i1 %14, label %15, label %7
15: ; preds = %7, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t
hci_event_change_connection_link_key_complete_get_status(const uint8_t *event) {
  return event[2];
}


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

x86 assembly (clang, -O2):
<hci_event_change_connection_link_key_complete_get_status>:
mov    0x8(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @hci_event_change_connection_link_key_complete_get_status(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
scalar_t__ unknown();
int test14() { (void)(1 || unknown()); }


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

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

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

LLVM IR (-O2):
define i32 @test14() {
ret i32 undef
}
int main(void) {
  (3 ? "a" : "b");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"a\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int solve_by_dobldobl_Laurent_homotopy_continuation(int number_of_tasks) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc(775, &number_of_tasks, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<solve_by_dobldobl_Laurent_homotopy_continuation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x307,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solve_by_dobldobl_Laurent_homotopy_continuation>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x307,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @solve_by_dobldobl_Laurent_homotopy_continuation(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc(i32 775, i32* %2, i32* undef, double* undef, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ logo();
int main() {
  logo();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <logo@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @logo()
ret i32 0
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
scalar_t__ time(scalar_t__ *);
int main(void) {
  time_t x = (time_t)-1;
  time_t t = time(&x);
  if (t == (time_t)-1 || t != x)
    abort();
  printf("pass\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0xffffffffffffffff,-0x10(%rbp)
ff
lea    -0x10(%rbp),%rdi
call   1050 <time@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0xffffffffffffffff,-0x18(%rbp)
je     117d <main+0x3d>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1184 <main+0x44>
mov    $0x0,%al
call   1030 <abort@plt>
lea    0xe75(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
movq   $0xffffffffffffffff,(%rsp)
ff
mov    %rsp,%rdi
call   1050 <time@plt>
cmp    $0xffffffffffffffff,%rax
je     1170 <main+0x30>
cmp    (%rsp),%rax
jne    1170 <main+0x30>
lea    0xe9c(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1060 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
@str = [5 x i8] c"pass\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 -1, i64* %1
%3 = call i64 @time(i64* %1)
%4 = icmp ne i64 %3, -1
%5 = load i64, i64* %1
%6 = icmp eq i64 %3, %5
%7 = select i1 %4, i1 %6, i1 false
br i1 %7, label %10, label %8
8: ; preds = %0
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %0
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%12 = call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
void *memchr(const void *ptr, int c, size_t n) {
  unsigned char ch = (unsigned char)c;
  const unsigned char *p = ptr;
  while (n-- > 0) {
    if (*p == ch)
      return (void *)p;
    p += 1;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<memchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    %al,-0x21(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x20(%rbp)
cmp    $0x0,%rax
jbe    1167 <memchr+0x67>
mov    -0x30(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x21(%rbp),%ecx
cmp    %ecx,%eax
jne    1156 <memchr+0x56>
mov    -0x30(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116f <memchr+0x6f>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    111d <memchr+0x1d>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memchr>:
test   %rdx,%rdx
je     1122 <memchr+0x22>
mov    %rdi,%rax
nopl   0x0(%rax,%rax,1)
cmp    %sil,(%rax)
je     1124 <memchr+0x24>
add    $0xffffffffffffffff,%rdx
add    $0x1,%rax
test   %rdx,%rdx
jne    1110 <memchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @memchr(i8* %0, i32 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %16, label %5
5: ; preds = %3
%6 = trunc i32 %1 to i8
br label %7
7: ; preds = %5, %13
%8 = phi i64 [ %2, %5 ], [ %10, %13 ]
%9 = phi i8* [ %0, %5 ], [ %14, %13 ]
%10 = add i64 %8, -1
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, %6
br i1 %12, label %16, label %13
13: ; preds = %7
%14 = getelementptr inbounds i8, i8* %9, i64 1
%15 = icmp eq i64 %10, 0
br i1 %15, label %16, label %7
16: ; preds = %7, %13, %3
%17 = phi i8* [ null, %3 ], [ null, %13 ], [ %9, %7 ]
ret i8* %17
}
int is_smp_system(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @is_smp_system() {
ret i32 0
}
/* Variables and functions */
int errno;
int unlink(char *);
int remove(char *path) {
  errno = 0;
  if ((unlink(path)) == -1) {
    return -errno;
  }
  return 0;
}


x86 assembly (clang, -O0):
<remove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    0x2ebd(%rip),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <unlink@plt>
cmp    $0xffffffff,%eax
jne    114e <remove+0x3e>
xor    %eax,%eax
mov    0x2e9c(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1155 <remove+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove>:
push   %rbx
mov    0x2ec8(%rip),%rbx
movl   $0x0,(%rbx)
call   1030 <unlink@plt>
xor    %ecx,%ecx
sub    (%rbx),%ecx
xor    %edx,%edx
cmp    $0xffffffff,%eax
cmovne %edx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @remove(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
store i32 0, i32* @errno
%4 = load i8*, i8** %3
%5 = call i32 @unlink(i8* %4)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* @errno
%9 = sub nsw i32 0, %8
store i32 %9, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %7
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @remove(i8* nocapture %0) {
store i32 0, i32* @errno
%2 = tail call i32 @unlink(i8* %0)
%3 = icmp eq i32 %2, -1
%4 = load i32, i32* @errno
%5 = sub nsw i32 0, %4
%6 = select i1 %3, i32 %5, i32 0
ret i32 %6
}
/* Variables and functions */
double db10_0_(int, double *);
double db20_(double *x) { return db10_0_(1, x); }


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

x86 assembly (clang, -O2):
<db20_>:
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <db10_0_@plt>

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

LLVM IR (-O2):
define double @db20_(double* %0) {
%2 = tail call double @db10_0_(i32 1, double* %0)
ret double %2
}
/* Variables and functions */
int waiting(volatile int *a) { return (*a); }


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

x86 assembly (clang, -O2):
<waiting>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @waiting(i32* %0) {
%2 = load volatile i32, i32* %0
ret i32 %2
}
/* Variables and functions */
int __VERIFIER_nondet_int();
scalar_t__ alloca(int);
int /*<<< orphan*/ cstrchr(char *, int);
int main() {
  int length = __VERIFIER_nondet_int();
  if (length < 1) {
    length = 1;
  }
  char *nondetString = (char *)alloca(length * sizeof(char));
  nondetString[length - 1] = '\0';
  cstrchr(nondetString, __VERIFIER_nondet_int());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    115a <main+0x2a>
movl   $0x1,-0x8(%rbp)
movslq -0x8(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <alloca@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1050 <__VERIFIER_nondet_int@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1030 <cstrchr@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
mov    $0x1,%ebx
cmovg  %eax,%ebx
mov    %ebx,%edi
call   1040 <alloca@plt>
mov    %rax,%r14
add    $0xffffffff,%ebx
movb   $0x0,(%rax,%rbx,1)
xor    %eax,%eax
call   1050 <__VERIFIER_nondet_int@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <cstrchr@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 0, i32* %1
%4 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 1
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 1, i32* %2
br label %8
8: ; preds = %7, %0
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = mul i64 %10, 1
%12 = trunc i64 %11 to i32
%13 = call i64 @alloca(i32 %12)
%14 = inttoptr i64 %13 to i8*
store i8* %14, i8** %3
%15 = load i8*, i8** %3
%16 = load i32, i32* %2
%17 = sub nsw i32 %16, 1
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %15, i64 %18
store i8 0, i8* %19
%20 = load i8*, i8** %3
%21 = call i32 (...) @__VERIFIER_nondet_int()
%22 = call i32 @cstrchr(i8* %20, i32 %21)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = icmp sgt i32 %1, 1
%3 = select i1 %2, i32 %1, i32 1
%4 = tail call i64 @alloca(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = add nsw i32 %3, -1
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
store i8 0, i8* %8
%9 = tail call i32 (...) @__VERIFIER_nondet_int()
%10 = tail call i32 @cstrchr(i8* %5, i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ simple_loop_run(void *);
void simple_loop_run_int(int core_id) {
  long y = core_id;
  simple_loop_run((void *)y);
}


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

x86 assembly (clang, -O2):
<simple_loop_run_int>:
movslq %edi,%rdi
jmp    1030 <simple_loop_run@plt>

LLVM IR (-O0):
define void @simple_loop_run_int(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = inttoptr i64 %6 to i8*
%8 = call i32 @simple_loop_run(i8* %7)
ret void
}

LLVM IR (-O2):
define void @simple_loop_run_int(i32 %0) {
%2 = sext i32 %0 to i64
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 @simple_loop_run(i8* %3)
ret void
}
int _strlen(char str[]) {
  int i = 0, len = 0;
  while ('\0' != str[i]) {
    len++;
    i++;
  }
  return len;
}


x86 assembly (clang, -O0):
<_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     1143 <_strlen+0x43>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <_strlen+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_strlen>:
cmpb   $0x0,(%rdi)
je     111c <_strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <_strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @_strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %6, %4 ], [ 0, %1 ]
%6 = add nuw nsw i64 %5, 1
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %4
10: ; preds = %4
%11 = trunc i64 %6 to i32
br label %12
12: ; preds = %10, %1
%13 = phi i32 [ 0, %1 ], [ %11, %10 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ cldrv_serialize(unsigned char *);
int /*<<< orphan*/ leddrv_getstates(unsigned char *);
int cldrv_states(void) {
  unsigned char led_states[80];
  leddrv_getstates(led_states);
  cldrv_serialize(led_states);
  return 0;
}


x86 assembly (clang, -O0):
<cldrv_states>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x50(%rbp),%rdi
call   1030 <leddrv_getstates@plt>
lea    -0x50(%rbp),%rdi
call   1040 <cldrv_serialize@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cldrv_states>:
push   %rbx
sub    $0x50,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <leddrv_getstates@plt>
mov    %rbx,%rdi
call   1040 <cldrv_serialize@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @cldrv_states() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = call i32 @leddrv_getstates(i8* %2)
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%5 = call i32 @cldrv_serialize(i8* %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @cldrv_states() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = call i32 @leddrv_getstates(i8* %2)
%4 = call i32 @cldrv_serialize(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ g();
int main() { g(); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <g@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @g()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @g()
ret i32 0
}
/* Variables and functions */
int pow(float, int);
float f(float x) { return pow(x, 3) + 3 * pow(x, 2) - 4; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mov    $0x3,%edi
call   1030 <pow@plt>
mov    %eax,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
imul   $0x3,%ecx,%ecx
add    %ecx,%eax
sub    $0x4,%eax
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
mov    $0x3,%edi
call   1030 <pow@plt>
mov    %eax,%ebx
movss  0xc(%rsp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
lea    (%rax,%rax,2),%eax
add    %ebx,%eax
add    $0xfffffffc,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @pow(float %3, i32 3)
%5 = load float, float* %2
%6 = call i32 @pow(float %5, i32 2)
%7 = mul nsw i32 3, %6
%8 = add nsw i32 %4, %7
%9 = sub nsw i32 %8, 4
%10 = sitofp i32 %9 to float
ret float %10
}

LLVM IR (-O2):
define float @f(float %0) {
%2 = tail call i32 @pow(float %0, i32 3)
%3 = tail call i32 @pow(float %0, i32 2)
%4 = mul nsw i32 %3, 3
%5 = add i32 %2, -4
%6 = add i32 %5, %4
%7 = sitofp i32 %6 to float
ret float %7
}
int bob_test_forwarding_test() { return 42; }


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

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

LLVM IR (-O0):
define i32 @bob_test_forwarding_test() {
ret i32 42
}

LLVM IR (-O2):
define i32 @bob_test_forwarding_test() {
ret i32 42
}
/* Variables and functions */
int rand();
int randomSaver(void) { return rand() % 3 + 1; }


x86 assembly (clang, -O0):
<randomSaver>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomSaver>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x55555556,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @randomSaver() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 3
%3 = add nsw i32 %2, 1
ret i32 %3
}

LLVM IR (-O2):
define i32 @randomSaver() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 3
%3 = add nsw i32 %2, 1
ret i32 %3
}
/* Variables and functions */
float fabsf(float);
float copysignf(float x, float y) {
  if (y < 0) {
    return -fabsf(x);
  }
  return fabsf(x);
}


x86 assembly (clang, -O0):
<copysignf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1142 <copysignf+0x42>
movss  -0x8(%rbp),%xmm0
movaps 0xed9(%rip),%xmm1
pand   %xmm1,%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1157 <copysignf+0x57>
movss  -0x8(%rbp),%xmm0
movaps 0xeb2(%rip),%xmm1
pand   %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<copysignf>:
movaps 0xef9(%rip),%xmm2
andps  %xmm0,%xmm2
orps   0xeff(%rip),%xmm0
xorps  %xmm3,%xmm3
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm0
andnps %xmm2,%xmm1
orps   %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @copysignf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %5
%7 = fcmp olt float %6, 0.000000e+00
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load float, float* %4
%10 = call float @llvm.fabs.f32(float %9)
%11 = fneg float %10
store float %11, float* %3
br label %15
12: ; preds = %2
%13 = load float, float* %4
%14 = call float @llvm.fabs.f32(float %13)
store float %14, float* %3
br label %15
15: ; preds = %12, %8
%16 = load float, float* %3
ret float %16
}

LLVM IR (-O2):
define float @copysignf(float %0, float %1) {
%3 = fcmp olt float %1, 0.000000e+00
%4 = tail call float @llvm.fabs.f32(float %0)
%5 = fneg float %4
%6 = select i1 %3, float %5, float %4
ret float %6
}