xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ mail_data();
scalar_t__ mail_from();
scalar_t__ mail_stream(int /*<<< orphan*/);
scalar_t__ rcpt_to();
int /*<<< orphan*/ stdin;
int niscy_mail() {
  if ((mail_from() != 0) || (rcpt_to() != 0) || (mail_data() != 0) ||
      (mail_stream(stdin) != 0)) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<niscy_mail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <mail_from@plt>
cmp    $0x0,%rax
jne    1193 <niscy_mail+0x53>
mov    $0x0,%al
call   1050 <rcpt_to@plt>
cmp    $0x0,%rax
jne    1193 <niscy_mail+0x53>
mov    $0x0,%al
call   1030 <mail_data@plt>
cmp    $0x0,%rax
jne    1193 <niscy_mail+0x53>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
call   1060 <mail_stream@plt>
cmp    $0x0,%rax
je     119f <niscy_mail+0x5f>
movl   $0xffffffff,-0x4(%rbp)
jmp    11a6 <niscy_mail+0x66>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<niscy_mail>:
push   %rbx
xor    %eax,%eax
call   1040 <mail_from@plt>
mov    $0xffffffff,%ebx
test   %rax,%rax
jne    117d <niscy_mail+0x3d>
xor    %eax,%eax
call   1050 <rcpt_to@plt>
test   %rax,%rax
jne    117d <niscy_mail+0x3d>
xor    %eax,%eax
call   1030 <mail_data@plt>
test   %rax,%rax
jne    117d <niscy_mail+0x3d>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
call   1060 <mail_stream@plt>
neg    %rax
sbb    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @niscy_mail() {
%1 = alloca i32
%2 = call i64 (...) @mail_from()
%3 = icmp ne i64 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %0
%5 = call i64 (...) @rcpt_to()
%6 = icmp ne i64 %5, 0
br i1 %6, label %14, label %7
7: ; preds = %4
%8 = call i64 (...) @mail_data()
%9 = icmp ne i64 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %7
%11 = load i32, i32* @stdin
%12 = call i64 @mail_stream(i32 %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %10, %7, %4, %0
store i32 -1, i32* %1
br label %16
15: ; preds = %10
store i32 0, i32* %1
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @niscy_mail() {
%1 = tail call i64 (...) @mail_from()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %14
3: ; preds = %0
%4 = tail call i64 (...) @rcpt_to()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = tail call i64 (...) @mail_data()
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %6
%10 = load i32, i32* @stdin
%11 = tail call i64 @mail_stream(i32 %10)
%12 = icmp ne i64 %11, 0
%13 = sext i1 %12 to i32
br label %14
14: ; preds = %9, %0, %3, %6
%15 = phi i32 [ -1, %6 ], [ -1, %3 ], [ -1, %0 ], [ %13, %9 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
void infoSetMinWordLength(void) {
  printf("Sets the minimum word length (default = %d).%s", 3, "\n");
}


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

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

LLVM IR (-O0):
@.str = [47 x i8] c"Sets the minimum word length (default = %d).%s\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @infoSetMinWordLength() {
%1 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [47 x i8] c"Sets the minimum word length (default = %d).%s\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @infoSetMinWordLength() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void openxcas_set_provid(uint32_t UNUSED__provid __attribute__((unused))) {}


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

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

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

LLVM IR (-O2):
define void @openxcas_set_provid(i32 %0) {
ret void
}
/* Variables and functions */
int spi_command_write(int, char *, int, char *);
int nrf_write_tx_payload(char *txpayload, int length, char *retstatus) {
  return spi_command_write(0xA0, txpayload, length, retstatus);
}


x86 assembly (clang, -O0):
<nrf_write_tx_payload>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0xa0,%edi
call   1030 <spi_command_write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrf_write_tx_payload>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0xa0,%edi
jmp    1030 <spi_command_write@plt>

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

LLVM IR (-O2):
define i32 @nrf_write_tx_payload(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @spi_command_write(i32 160, i8* %0, i32 %1, i8* %2)
ret i32 %4
}
void h_changeallpath(char *name, int argc, char **argv, void *user_data) {
  printf("Called: %s\n", __FUNCTION__);
}


x86 assembly (clang, -O0):
<h_changeallpath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    0xed2(%rip),%rdi
lea    0xed7(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h_changeallpath>:
lea    0xee9(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Called: %s\0A\00"
@__FUNCTION__.h_changeallpath = [16 x i8] c"h_changeallpath\00"
define void @h_changeallpath(i8* %0, i32 %1, i8** %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
store i8* %3, i8** %8
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__FUNCTION__.h_changeallpath, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Called: %s\0A\00"
@__FUNCTION__.h_changeallpath = [16 x i8] c"h_changeallpath\00"
define void @h_changeallpath(i8* nocapture readnone %0, i32 %1, i8** nocapture readnone %2, i8* nocapture readnone %3) {
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__FUNCTION__.h_changeallpath, i64 0, i64 0))
ret void
}
void literal_pool_jumpover(int n) { (void)n; }


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

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

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

LLVM IR (-O2):
define void @literal_pool_jumpover(i32 %0) {
ret void
}
int HelpItem50(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem50() {
ret i32 0
}
int ft_is_prime(int nb) {
  int test;
  test = 2;
  if (nb < 2) {
    return (0);
  }
  if (nb == 2) {
    return (1);
  }
  while (((test - 1) * (test - 1)) < nb) {
    if ((nb % test) == 0) {
      return (0);
    }
    test += 1;
  }
  return (1);
}


x86 assembly (clang, -O0):
<ft_is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1124 <ft_is_prime+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1188 <ft_is_prime+0x88>
cmpl   $0x2,-0x8(%rbp)
jne    113a <ft_is_prime+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1188 <ft_is_prime+0x88>
jmp    113f <ft_is_prime+0x3f>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
imul   %ecx,%eax
cmp    -0x8(%rbp),%eax
jge    1181 <ft_is_prime+0x81>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1173 <ft_is_prime+0x73>
movl   $0x0,-0x4(%rbp)
jmp    1188 <ft_is_prime+0x88>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113f <ft_is_prime+0x3f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_is_prime>:
xor    %ecx,%ecx
cmp    $0x2,%edi
jge    110a <ft_is_prime+0xa>
mov    %ecx,%eax
ret
jne    1112 <ft_is_prime+0x12>
mov    $0x1,%eax
ret
mov    $0x2,%esi
nopw   0x0(%rax,%rax,1)
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1107 <ft_is_prime+0x7>
lea    0x1(%rsi),%eax
imul   %esi,%esi
cmp    %edi,%esi
mov    %eax,%esi
jl     1120 <ft_is_prime+0x20>
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @ft_is_prime(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 2, i32* %4
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 2
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %31
8: ; preds = %1
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 2
br i1 %10, label %11, label %12
11: ; preds = %8
store i32 1, i32* %2
br label %31
12: ; preds = %8
br label %13
13: ; preds = %27, %12
%14 = load i32, i32* %4
%15 = sub nsw i32 %14, 1
%16 = load i32, i32* %4
%17 = sub nsw i32 %16, 1
%18 = mul nsw i32 %15, %17
%19 = load i32, i32* %3
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %30
21: ; preds = %13
%22 = load i32, i32* %3
%23 = load i32, i32* %4
%24 = srem i32 %22, %23
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %27
26: ; preds = %21
store i32 0, i32* %2
br label %31
27: ; preds = %21
%28 = load i32, i32* %4
%29 = add nsw i32 %28, 1
store i32 %29, i32* %4
br label %13
30: ; preds = %13
store i32 1, i32* %2
br label %31
31: ; preds = %30, %26, %11, %7
%32 = load i32, i32* %2
ret i32 %32
}

LLVM IR (-O2):
define i32 @ft_is_prime(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = icmp eq i32 %0, 2
br i1 %4, label %13, label %9
5: ; preds = %9
%6 = add nuw nsw i32 %10, 1
%7 = mul nsw i32 %10, %10
%8 = icmp slt i32 %7, %0
br i1 %8, label %9, label %13
9: ; preds = %3, %5
%10 = phi i32 [ %6, %5 ], [ 2, %3 ]
%11 = srem i32 %0, %10
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %9, %5, %3, %1
%14 = phi i32 [ 0, %1 ], [ 1, %3 ], [ 0, %9 ], [ 1, %5 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char const *);
void hexdump_print(const char *str, void *user_data) {
  printf("%s%s\n", (char *)user_data, str);
}


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

x86 assembly (clang, -O2):
<hexdump_print>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"%s%s\0A\00"
define void @hexdump_print(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %0)
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int ZwClose(int Handle) {
  {
    int tmp_ndt_10;
    tmp_ndt_10 = __VERIFIER_nondet_int();
    if (tmp_ndt_10 == 0) {
      goto switch_9_0;
    } else {
      goto switch_9_default;
      if (0) {
      switch_9_0:;
        return (0);
      switch_9_default:;
        return (-1073741823);
      } else {
      }
    }
  }
}


x86 assembly (clang, -O0):
<ZwClose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1134 <ZwClose+0x24>
jmp    1139 <ZwClose+0x29>
jmp    1145 <ZwClose+0x35>
movl   $0x0,-0x4(%rbp)
jmp    114c <ZwClose+0x3c>
movl   $0xc0000001,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZwClose>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
mov    $0xc0000001,%ecx
cmovne %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ZwClose(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %5, i32* %4
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
br label %12
9: ; preds = %1
br label %13
10: ; No predecessors!
br i1 false, label %11, label %14
11: ; preds = %10
br label %12
12: ; preds = %11, %8
store i32 0, i32* %2
br label %16
13: ; preds = %9
store i32 -1073741823, i32* %2
br label %16
14: ; preds = %10
br label %15
15: ; preds = %14
br label %16
16: ; preds = %12, %13, %15
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @ZwClose(i32 %0) {
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 0, i32 -1073741823
ret i32 %4
}
void swap_u_short_2(unsigned short *tni2) {
  *tni2 = (((*tni2 >> 8) & 0xff) | ((*tni2 & 0xff) << 8));
}


x86 assembly (clang, -O0):
<swap_u_short_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    -0x8(%rbp),%rcx
movzwl (%rcx),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %ax,%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_u_short_2>:
rolw   $0x8,(%rdi)
ret

LLVM IR (-O0):
define void @swap_u_short_2(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = ashr i32 %5, 8
%7 = and i32 %6, 255
%8 = load i16*, i16** %2
%9 = load i16, i16* %8
%10 = zext i16 %9 to i32
%11 = and i32 %10, 255
%12 = shl i32 %11, 8
%13 = or i32 %7, %12
%14 = trunc i32 %13 to i16
%15 = load i16*, i16** %2
store i16 %14, i16* %15
ret void
}

LLVM IR (-O2):
define void @swap_u_short_2(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
store i16 %3, i16* %0
ret void
}
/* Variables and functions */
int stdc_B6D92AC3(char const *, char const *);
int strcasecmp(const char *s1, const char *s2) { return stdc_B6D92AC3(s1, s2); }


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

x86 assembly (clang, -O2):
<strcasecmp>:
jmp    1030 <stdc_B6D92AC3@plt>

LLVM IR (-O0):
define i32 @strcasecmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @stdc_B6D92AC3(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @strcasecmp(i8* %0, i8* %1) {
%3 = tail call i32 @stdc_B6D92AC3(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  printf("Hello world (%s)!\n", argv[0]);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"Hello world (%s)!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Hello world (%s)!\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
unsigned long read_cr0(void) {
  unsigned long cr0;
  asm volatile("mov %%cr0, %0" : "=r"(cr0));
  return cr0;
}


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

x86 assembly (clang, -O2):
<read_cr0>:
mov    %cr0,%rax
ret

LLVM IR (-O0):
define i64 @read_cr0() {
%1 = alloca i64
%2 = call i64 asm sideeffect "mov %cr0, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @read_cr0() {
%1 = tail call i64 asm sideeffect "mov %cr0, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0xa0() {
  Assert_real((isalnum(160) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalnum.c",
              805, ("isalnum should be 0 for 0xa0"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xa0\00"
define void @t_isalnum_0xa0() {
%1 = tail call i64 @isalnum(i32 160)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 805, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void ClearIntegerArray(int array[], int n) {
  int i;
  for (i = 0; i < n; i++) {
    array[i] = 0;
  }
}


x86 assembly (clang, -O0):
<ClearIntegerArray>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113b <ClearIntegerArray+0x3b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <ClearIntegerArray+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ClearIntegerArray>:
test   %esi,%esi
jle    1126 <ClearIntegerArray+0x16>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @ClearIntegerArray(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 = %15, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %18
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
store i32 0, i32* %14
br label %15
15: ; preds = %10
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %6
18: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @ClearIntegerArray(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int foo();
int main() {
  int x = -1;
  x = foo();
#pragma omp taskwait
  assert(x == 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffffff,-0x4(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <foo@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 -1, i32* %1
%2 = call i32 (...) @foo()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, 1
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
FILE *tmpfile(void) {
  errno = ENOSYS;
  return NULL;
}


x86 assembly (clang, -O0):
<tmpfile>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec4(%rip),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32* @tmpfile() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret i32* null
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define noalias i32* @tmpfile() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret i32* null
}
int clk_enable_before(void *privdata) {
  printk("%s] :%s\n", __func__, privdata);
  return 0;
}


x86 assembly (clang, -O0):
<clk_enable_before>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
lea    0xedb(%rip),%rsi
mov    $0x0,%al
call   1030 <printk@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clk_enable_before>:
push   %rax
mov    %rdi,%rdx
lea    0xee5(%rip),%rdi
lea    0xee7(%rip),%rsi
xor    %eax,%eax
call   1030 <printk@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%s] :%s\0A\00"
@__func__.clk_enable_before = [18 x i8] c"clk_enable_before\00"
define i32 @clk_enable_before(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.clk_enable_before, i64 0, i64 0), i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%s] :%s\0A\00"
@__func__.clk_enable_before = [18 x i8] c"clk_enable_before\00"
define i32 @clk_enable_before(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.clk_enable_before, i64 0, i64 0), i8* %0)
ret i32 0
}
void XkbFreeGeomShapes() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void free_Depth(void *_p) {
  if (_p == NULL)
    abort();
  free((Depth *)_p);
}


x86 assembly (clang, -O0):
<free_Depth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113e <free_Depth+0x1e>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_Depth>:
test   %rdi,%rdi
je     112a <free_Depth+0xa>
jmp    1030 <free@plt>
push   %rax
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define void @free_Depth(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = call i32 @free(i32* %9)
ret void
}

LLVM IR (-O2):
define void @free_Depth(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
%6 = bitcast i8* %0 to i32*
%7 = tail call i32 @free(i32* %6)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ vfprintf(int /*<<< orphan*/, char const *,
                            int /*<<< orphan*/);
void pdbg_logfunc_default(int loglevel, const char *fmt, va_list ap) {
  vfprintf(stderr, fmt, ap);
}


x86 assembly (clang, -O0):
<pdbg_logfunc_default>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <vfprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pdbg_logfunc_default>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <vfprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
define void @pdbg_logfunc_default(i32 %0, i8* %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @vfprintf(i32 %4, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("hello, ");
  printf("world");
  printf("\n");
}


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"hello, \00"
@.str.1 = [6 x i8] c"world\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
double vec3d_norm(double const *);
int /*<<< orphan*/ vec3d_scalarDiv_new(double *, double const *, double);
void vec3d_normalize_new(double dest[3], const double src[3]) {
  double len = vec3d_norm(src);
  vec3d_scalarDiv_new(dest, src, len);
}


x86 assembly (clang, -O0):
<vec3d_normalize_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <vec3d_norm@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movsd  -0x18(%rbp),%xmm0
call   1040 <vec3d_scalarDiv_new@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3d_normalize_new>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <vec3d_norm@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <vec3d_scalarDiv_new@plt>

LLVM IR (-O0):
define void @vec3d_normalize_new(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %4
%7 = call double @vec3d_norm(double* %6)
store double %7, double* %5
%8 = load double*, double** %3
%9 = load double*, double** %4
%10 = load double, double* %5
%11 = call i32 @vec3d_scalarDiv_new(double* %8, double* %9, double %10)
ret void
}

LLVM IR (-O2):
define void @vec3d_normalize_new(double* %0, double* %1) {
%3 = tail call double @vec3d_norm(double* %1)
%4 = tail call i32 @vec3d_scalarDiv_new(double* %0, double* %1, double %3)
ret void
}
char *strcpy(char *dest, char *src) {
  unsigned int i;
  for (i = 0; src[i] != 0; i++) {
    dest[i] = src[i];
  }
  dest[i] = 0;
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1149 <strcpy+0x49>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <strcpy+0x13>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%dl
xor    %ecx,%ecx
test   %dl,%dl
je     1120 <strcpy+0x20>
nopl   0x0(%rax,%rax,1)
mov    %dl,(%rax,%rcx,1)
add    $0x1,%ecx
movzbl (%rsi,%rcx,1),%edx
test   %dl,%dl
jne    1110 <strcpy+0x10>
mov    %ecx,%ecx
movb   $0x0,(%rax,%rcx,1)
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i64 [ %11, %5 ], [ 0, %2 ]
%8 = phi i32 [ %10, %5 ], [ 0, %2 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %6, i8* %9
%10 = add i32 %8, 1
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %1, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5
%16 = zext i32 %10 to i64
br label %17
17: ; preds = %2, %15
%18 = phi i64 [ %16, %15 ], [ 0, %2 ]
%19 = getelementptr inbounds i8, i8* %0, i64 %18
store i8 0, i8* %19
ret i8* %0
}
/* Variables and functions */
float sin(float);
float fncinf(float x) { return (float)(sin(x) / (x * x)); }


x86 assembly (clang, -O0):
<fncinf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sin@plt>
movss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fncinf>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1030 <sin@plt>
movss  0x4(%rsp),%xmm1
mulss  %xmm1,%xmm1
divss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @fncinf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @sin(float %3)
%5 = load float, float* %2
%6 = load float, float* %2
%7 = fmul float %5, %6
%8 = fdiv float %4, %7
ret float %8
}

LLVM IR (-O2):
define float @fncinf(float %0) {
%2 = tail call float @sin(float %0)
%3 = fmul float %0, %0
%4 = fdiv float %2, %3
ret float %4
}
/* Variables and functions */
float *atv();
float *tv(float x, float y, float z) {
  float *v = atv();
  ((v)[0] = (x), (v)[1] = (y), (v)[2] = (z));
  return v;
}


x86 assembly (clang, -O0):
<tv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
mov    $0x0,%al
call   1030 <atv@plt>
mov    %rax,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x8(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x4(%rax)
movss  -0xc(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x8(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tv>:
sub    $0x18,%rsp
movss  %xmm2,0x14(%rsp)
movss  %xmm1,0x10(%rsp)
movss  %xmm0,0xc(%rsp)
xor    %eax,%eax
call   1030 <atv@plt>
movss  0xc(%rsp),%xmm0
movss  %xmm0,(%rax)
movss  0x10(%rsp),%xmm0
movss  %xmm0,0x4(%rax)
movss  0x14(%rsp),%xmm0
movss  %xmm0,0x8(%rax)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float* @tv(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float*
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%8 = call float* (...) @atv()
store float* %8, float** %7
%9 = load float, float* %4
%10 = load float*, float** %7
%11 = getelementptr inbounds float, float* %10, i64 0
store float %9, float* %11
%12 = load float, float* %5
%13 = load float*, float** %7
%14 = getelementptr inbounds float, float* %13, i64 1
store float %12, float* %14
%15 = load float, float* %6
%16 = load float*, float** %7
%17 = getelementptr inbounds float, float* %16, i64 2
store float %15, float* %17
%18 = load float*, float** %7
ret float* %18
}

LLVM IR (-O2):
define float* @tv(float %0, float %1, float %2) {
%4 = tail call float* (...) @atv()
store float %0, float* %4
%5 = getelementptr inbounds float, float* %4, i64 1
store float %1, float* %5
%6 = getelementptr inbounds float, float* %4, i64 2
store float %2, float* %6
ret float* %4
}
int test_imm_CBint16_reg(short val) {
  return ((val) & (-0xCB << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_CBint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff35,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_CBint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -203
%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_CBint16_reg(i16 signext %0) {
%2 = and i16 %0, -203
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
double tan(double);
double libm_tan(double x) { return tan(x); }


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

x86 assembly (clang, -O2):
<libm_tan>:
jmp    1030 <tan@plt>

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

LLVM IR (-O2):
define double @libm_tan(double %0) {
%2 = tail call double @tan(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void plugin_close_rig(void) { printf("Test plugin closed.\n"); }


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"Test plugin closed.\0A\00"
define void @plugin_close_rig() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"Test plugin closed.\00"
define void @plugin_close_rig() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SYS_gettid;
int /*<<< orphan*/ syscall(int /*<<< orphan*/);
void xgettid(const char *fn) { syscall(SYS_gettid); }


x86 assembly (clang, -O0):
<xgettid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xgettid>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_gettid = global i32 0
define void @xgettid(i8* %0) {
%2 = alloca i8*
store i8* %0, 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 @xgettid(i8* nocapture readnone %0) {
%2 = load i32, i32* @SYS_gettid
%3 = tail call i32 @syscall(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(unsigned long);
int /*<<< orphan*/ printf(char *, int, unsigned long);
__attribute__((__noreturn__)) void exitfunc8(int status, void *arg) {
  printf("Executing exitfunc"
         "8"
         " (status=%d, arg=%lu)\n",
         status, (unsigned long)arg);
  exit((unsigned long)arg);
}


x86 assembly (clang, -O0):
<exitfunc8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exitfunc8>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%esi
lea    0xed3(%rip),%rdi
mov    %rbx,%rdx
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"Executing exitfunc8 (status=%d, arg=%lu)\0A\00"
define void @exitfunc8(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 = load i8*, i8** %4
%7 = ptrtoint i8* %6 to i64
%8 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %5, i64 %7)
%9 = load i8*, i8** %4
%10 = ptrtoint i8* %9 to i64
%11 = call i32 @exit(i64 %10)
unreachable
}

LLVM IR (-O2):
@.str = [42 x i8] c"Executing exitfunc8 (status=%d, arg=%lu)\0A\00"
define void @exitfunc8(i32 %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %0, i64 %3)
%5 = tail call i32 @exit(i64 %3)
unreachable
}
void g_param_spec_sink() {}


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

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

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

LLVM IR (-O2):
define void @g_param_spec_sink() {
ret void
}
/* Variables and functions */
size_t strnlen(const char *str, size_t maxlen) {
  const char *cp;
  for (cp = str; maxlen != 0 && *cp != '\0'; cp++, maxlen--)
    ;
  return (size_t)(cp - str);
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x19(%rbp)
je     1134 <strnlen+0x34>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1144 <strnlen+0x44>
jmp    1166 <strnlen+0x66>
jmp    1149 <strnlen+0x49>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    1114 <strnlen+0x14>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
mov    %rdi,%rax
test   %rsi,%rsi
je     1122 <strnlen+0x22>
lea    (%rdi,%rsi,1),%rcx
mov    %rdi,%rax
nop
cmpb   $0x0,(%rax)
je     1122 <strnlen+0x22>
add    $0x1,%rax
add    $0xffffffffffffffff,%rsi
jne    1110 <strnlen+0x10>
mov    %rcx,%rax
sub    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @strnlen(i8* %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %15, label %4
4: ; preds = %2
%5 = getelementptr i8, i8* %0, i64 %1
br label %6
6: ; preds = %4, %11
%7 = phi i8* [ %12, %11 ], [ %0, %4 ]
%8 = phi i64 [ %13, %11 ], [ %1, %4 ]
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = add i64 %8, -1
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %6, %11, %2
%16 = phi i8* [ %0, %2 ], [ %5, %11 ], [ %7, %6 ]
%17 = ptrtoint i8* %16 to i64
%18 = ptrtoint i8* %0 to i64
%19 = sub i64 %17, %18
ret i64 %19
}
/* Variables and functions */
int /*<<< orphan*/ CleanupExtensions();
int /*<<< orphan*/ StopProtocolListenerMgr();
void CatchTerm(int signo) {
  CleanupExtensions();
  StopProtocolListenerMgr();
}


x86 assembly (clang, -O0):
<CatchTerm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <CleanupExtensions@plt>
mov    $0x0,%al
call   1030 <StopProtocolListenerMgr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CatchTerm>:
push   %rax
xor    %eax,%eax
call   1040 <CleanupExtensions@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <StopProtocolListenerMgr@plt>

LLVM IR (-O0):
define void @CatchTerm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @CleanupExtensions()
%4 = call i32 (...) @StopProtocolListenerMgr()
ret void
}

LLVM IR (-O2):
define void @CatchTerm(i32 %0) {
%2 = tail call i32 (...) @CleanupExtensions()
%3 = tail call i32 (...) @StopProtocolListenerMgr()
ret void
}
void caller_1_1_2_2_2_2_1() {}


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

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

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

LLVM IR (-O2):
define void @caller_1_1_2_2_2_2_1() {
ret void
}
/* Variables and functions */
double factorial(double);
double gamma(double x) {
  double r;
  r = factorial(x - 1.0);
  return (r);
}


x86 assembly (clang, -O0):
<gamma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <factorial@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gamma>:
addsd  0xee8(%rip),%xmm0
jmp    1030 <factorial@plt>

LLVM IR (-O0):
define double @gamma(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fsub double %4, 1.000000e+00
%6 = call double @factorial(double %5)
store double %6, double* %3
%7 = load double, double* %3
ret double %7
}

LLVM IR (-O2):
define double @gamma(double %0) {
%2 = fadd double %0, -1.000000e+00
%3 = tail call double @factorial(double %2)
ret double %3
}
/* Variables and functions */
size_t strlen(const char *str) {
  const char *s;
  for (s = str; *s; ++s)
    ;
  return (s - str);
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1133 <strlen+0x33>
jmp    1122 <strlen+0x22>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
ret i64 %10
}