xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int i;
  for (i = 0; i < 1000000; i++) {
    printf("Hello\n");
    printf("World\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xf4240,-0x8(%rbp)
jge    1159 <main+0x49>
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    $0xf4240,%ebp
lea    0xee0(%rip),%r14
lea    0xedf(%rip),%rbx
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
add    $0xffffffff,%ebp
jne    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@str = [6 x i8] c"Hello\00"
@str.2 = [6 x i8] c"World\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.2, i64 0, i64 0))
%5 = add nuw nsw i32 %2, 1
%6 = icmp eq i32 %5, 1000000
br i1 %6, label %7, label %1
7: ; preds = %1
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ UINT32_MAX;
int /*<<< orphan*/ __VERIFIER_assert(int);
int main() {
  uint32_t value = UINT32_MAX;
  ++value;
  __VERIFIER_assert(value == 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ed9(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__VERIFIER_assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ee0(%rip),%rax
xor    %edi,%edi
cmpq   $0xffffffffffffffff,(%rax)
sete   %dil
call   1030 <__VERIFIER_assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@UINT32_MAX = global i64 0
define i32 @main() {
%1 = alloca i64
%2 = load i64, i64* @UINT32_MAX
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = add nsw i64 %3, 1
store i64 %4, i64* %1
%5 = load i64, i64* %1
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @__VERIFIER_assert(i32 %7)
ret i32 0
}

LLVM IR (-O2):
@UINT32_MAX = global i64 0
define i32 @main() {
%1 = load i64, i64* @UINT32_MAX
%2 = icmp eq i64 %1, -1
%3 = zext i1 %2 to i32
%4 = tail call i32 @__VERIFIER_assert(i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ do_csi(char *, int, int, int, int, int, int, int, int);
void deccra(int Pts, int Pl, int Pbs, int Prs, int Pps, int Ptd, int Pld,
            int Ppd) {
  do_csi("%d;%d;%d;%d;%d;%d;%d;%d;$v", Pts, Pl, Pbs, Prs, Pps, Ptd, Pld, Ppd);
}


x86 assembly (clang, -O0):
<deccra>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0x14(%rbp),%r9d
mov    -0x18(%rbp),%r11d
mov    0x10(%rbp),%r10d
mov    0x18(%rbp),%eax
lea    0xeab(%rip),%rdi
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1030 <do_csi@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deccra>:
push   %rax
mov    %r9d,%eax
mov    %r8d,%r9d
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
mov    0x10(%rsp),%r10d
mov    0x18(%rsp),%r11d
sub    $0x8,%rsp
lea    0xecb(%rip),%rdi
push   %r11
push   %r10
push   %rax
call   1030 <do_csi@plt>
add    $0x20,%rsp
pop    %rax
ret

LLVM IR (-O0):
@.str = [27 x i8] c"%d;%d;%d;%d;%d;%d;%d;%d;$v\00"
define void @deccra(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7) {
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
store i32 %0, i32* %9
store i32 %1, i32* %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i32 %6, i32* %15
store i32 %7, i32* %16
%17 = load i32, i32* %9
%18 = load i32, i32* %10
%19 = load i32, i32* %11
%20 = load i32, i32* %12
%21 = load i32, i32* %13
%22 = load i32, i32* %14
%23 = load i32, i32* %15
%24 = load i32, i32* %16
%25 = call i32 @do_csi(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %17, i32 %18, i32 %19, i32 %20, i32 %21, i32 %22, i32 %23, i32 %24)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"%d;%d;%d;%d;%d;%d;%d;%d;$v\00"
define void @deccra(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7) {
%9 = tail call i32 @do_csi(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ SYS_lseek;
int /*<<< orphan*/ syscall(int /*<<< orphan*/, int, int /*<<< orphan*/, int);
off_t lseek(int fd, off_t offset, int whence) {
  return syscall(SYS_lseek, fd, offset, whence);
}


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

x86 assembly (clang, -O2):
<lseek>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
mov    0x2ed3(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_lseek = global i32 0
define i32 @lseek(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* @SYS_lseek
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @syscall(i32 %7, i32 %8, i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
@SYS_lseek = global i32 0
define i32 @lseek(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @SYS_lseek
%5 = tail call i32 @syscall(i32 %4, i32 %0, i32 %1, i32 %2)
ret i32 %5
}
/* Type definitions */
typedef int uint;

/* Variables and functions */
int fat16_next_cluster(int);
int fat16_search_cluster(int);
uint fat16_next_or_new_cluster(uint current_cluster) {
  uint cluster = fat16_next_cluster(current_cluster);
  if (cluster == 0x0)
    return fat16_search_cluster(current_cluster);
  return cluster;
}


x86 assembly (clang, -O0):
<fat16_next_or_new_cluster>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <fat16_next_cluster@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1150 <fat16_next_or_new_cluster+0x30>
mov    -0x8(%rbp),%edi
call   1030 <fat16_search_cluster@plt>
mov    %eax,-0x4(%rbp)
jmp    1156 <fat16_next_or_new_cluster+0x36>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fat16_next_or_new_cluster>:
push   %rbx
mov    %edi,%ebx
call   1040 <fat16_next_cluster@plt>
test   %eax,%eax
je     112e <fat16_next_or_new_cluster+0xe>
pop    %rbx
ret
mov    %ebx,%edi
pop    %rbx
jmp    1030 <fat16_search_cluster@plt>

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

LLVM IR (-O2):
define i32 @fat16_next_or_new_cluster(i32 %0) {
%2 = tail call i32 @fat16_next_cluster(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @fat16_search_cluster(i32 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ %2, %1 ]
ret i32 %7
}
void ARGBToRGB24Row_C() {}


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

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

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

LLVM IR (-O2):
define void @ARGBToRGB24Row_C() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xa2() {
  Assert_real((iscntrl(162) == 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_iscntrl.c",
              815, ("iscntrl should be 0 for 0xa2"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0xa2>:
push   %rax
mov    $0xa2,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x32f,%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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xa2\00"
define void @t_iscntrl_0xa2() {
%1 = call i64 @iscntrl(i32 162)
%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 815, 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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xa2\00"
define void @t_iscntrl_0xa2() {
%1 = tail call i64 @iscntrl(i32 162)
%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 815, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ qtime_gmt_strf(char *, int, int /*<<< orphan*/, char *);
char *qtime_gmt_str(time_t utctime) {
  int size = sizeof(char) * ((sizeof("Mon, 00 Jan 0000 00:00:00 GMT") - 1) + 1);
  char *timestr = (char *)malloc(size);
  qtime_gmt_strf(timestr, size, utctime, "%a, %d %b %Y %H:%M:%S GMT");
  return timestr;
}


x86 assembly (clang, -O0):
<qtime_gmt_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1e,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xeb1(%rip),%rcx
call   1040 <qtime_gmt_strf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qtime_gmt_str>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x1e,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
lea    0xec7(%rip),%rcx
mov    %rax,%rdi
mov    $0x1e,%esi
mov    %ebp,%edx
call   1040 <qtime_gmt_strf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"%a, %d %b %Y %H:%M:%S GMT\00"
define i8* @qtime_gmt_str(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %2
store i32 30, i32* %3
%5 = load i32, i32* %3
%6 = call i64 @malloc(i32 %5)
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %4
%8 = load i8*, i8** %4
%9 = load i32, i32* %3
%10 = load i32, i32* %2
%11 = call i32 @qtime_gmt_strf(i8* %8, i32 %9, i32 %10, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%12 = load i8*, i8** %4
ret i8* %12
}

LLVM IR (-O2):
@.str = [26 x i8] c"%a, %d %b %Y %H:%M:%S GMT\00"
define i8* @qtime_gmt_str(i32 %0) {
%2 = tail call i64 @malloc(i32 30)
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 @qtime_gmt_strf(i8* %3, i32 30, i32 %0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ BIGNUM;

/* Variables and functions */
int /*<<< orphan*/ *BN_dup(int /*<<< orphan*/ *);
int /*<<< orphan*/ BN_sub_word(int /*<<< orphan*/ *, int);
BIGNUM *BN_dup_m1(BIGNUM *bn) {
  BIGNUM *ret = BN_dup(bn);
  BN_sub_word(ret, 1);
  return ret;
}


x86 assembly (clang, -O0):
<BN_dup_m1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <BN_dup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1030 <BN_sub_word@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BN_dup_m1>:
push   %rbx
call   1040 <BN_dup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x1,%esi
call   1030 <BN_sub_word@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i32* @BN_dup_m1(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32* @BN_dup(i32* %4)
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @BN_sub_word(i32* %6, i32 1)
%8 = load i32*, i32** %3
ret i32* %8
}

LLVM IR (-O2):
define i32* @BN_dup_m1(i32* %0) {
%2 = tail call i32* @BN_dup(i32* %0)
%3 = tail call i32 @BN_sub_word(i32* %2, i32 1)
ret i32* %2
}
int neiln1(long a) { return -(a != 1); }


x86 assembly (clang, -O0):
<neiln1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x1,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%ecx
xor    %eax,%eax
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<neiln1>:
xor    %eax,%eax
cmp    $0x1,%rdi
setne  %al
neg    %eax
ret

LLVM IR (-O0):
define i32 @neiln1(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ne i64 %3, 1
%5 = zext i1 %4 to i32
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @neiln1(i64 %0) {
%2 = icmp ne i64 %0, 1
%3 = sext i1 %2 to i32
ret i32 %3
}
void swapvalues(int i, int j, double *data) {
  const double tmp = data[i];
  data[i] = data[j];
  data[j] = tmp;
  return;
}


x86 assembly (clang, -O0):
<swapvalues>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapvalues>:
movslq %edi,%rax
movsd  (%rdx,%rax,8),%xmm0
movslq %esi,%rcx
movsd  (%rdx,%rcx,8),%xmm1
movsd  %xmm1,(%rdx,%rax,8)
movsd  %xmm0,(%rdx,%rcx,8)
ret

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

LLVM IR (-O2):
define void @swapvalues(i32 %0, i32 %1, double* nocapture %2) {
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds double, double* %2, i64 %4
%6 = load double, double* %5
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds double, double* %2, i64 %7
%9 = load double, double* %8
store double %9, double* %5
store double %6, double* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void signalhandler(int sig) { exit(0); }


x86 assembly (clang, -O0):
<signalhandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<signalhandler>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @signalhandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @signalhandler(i32 %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t ev3_sdcard_opendir(const char *path) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ev3_sdcard_opendir(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ func_a();
int main(int argc, char *argv[]) {
  func_a();
  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    $0x0,%al
call   1030 <func_a@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
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 = call i32 (...) @func_a()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @func_a()
ret i32 0
}
/* Variables and functions */
long long atoll(char *);
long long atoll_woffset(char *ptr, int offset) { return atoll(ptr + offset); }


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

x86 assembly (clang, -O2):
<atoll_woffset>:
movslq %esi,%rax
add    %rax,%rdi
jmp    1030 <atoll@plt>

LLVM IR (-O0):
define i64 @atoll_woffset(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = call i64 @atoll(i8* %8)
ret i64 %9
}

LLVM IR (-O2):
define i64 @atoll_woffset(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = tail call i64 @atoll(i8* %4)
ret i64 %5
}
int h(int i) { return (i + (-2)) > i; }


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xfffffffe,%eax
cmp    -0x4(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @h(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, -2
%5 = load i32, i32* %2
%6 = icmp sgt i32 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @h(i32 %0) {
ret i32 0
}
void foo2(int n) {}


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

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

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

LLVM IR (-O2):
define void @foo2(i32 %0) {
ret void
}
extern unsigned short __inwc_p(unsigned short port) {
  unsigned short _v;
  __asm__ __volatile__("in"
                       "w"
                       " %"
                       ""
                       "1,%"
                       ""
                       "0"
                       : "=a"(_v)
                       : "id"(port));
  __asm__ __volatile__("jmp 1f\n1:\tjmp 1f\n1:");
  return _v;
}


x86 assembly (clang, -O0):
<__inwc_p>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%ax
mov    %ax,-0x4(%rbp)
jmp    111a <__inwc_p+0x1a>
jmp    111f <__inwc_p+0x1f>
movzwl -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__inwc_p>:
mov    %edi,%edx
in     (%dx),%ax
jmp    1106 <__inwc_p+0x6>
jmp    1108 <__inwc_p+0x8>
ret

LLVM IR (-O0):
define zeroext i16 @__inwc_p(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i16 asm sideeffect "inw $1,$0", "={ax},i{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i16 %5, i16* %3
%6 = load i16, i16* %3
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @__inwc_p(i16 zeroext %0) {
%2 = tail call i16 asm sideeffect "inw $1,$0", "={ax},i{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
tail call void asm sideeffect "jmp 1f\0A1:\09jmp 1f\0A1:", "~{dirflag},~{fpsr},~{flags}"()
ret i16 %2
}
/* Type definitions */
struct sync_fence_info_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct sync_fence_info_data *);
void sync_fence_info_free(struct sync_fence_info_data *info) { free(info); }


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

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

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

LLVM IR (-O2):
%struct.sync_fence_info_data = type { i32 }
define void @sync_fence_info_free(%struct.sync_fence_info_data* nocapture %0) {
%2 = tail call i32 @free(%struct.sync_fence_info_data* %0)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t gf2_matrix_times(uint32_t *mat, uint32_t vec) {
  uint32_t sum;
  sum = 0;
  while (vec) {
    if (vec & 1)
      sum ^= *mat;
    vec >>= 1;
    mat++;
  }
  return sum;
}


x86 assembly (clang, -O0):
<gf2_matrix_times>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1151 <gf2_matrix_times+0x51>
mov    -0xc(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1137 <gf2_matrix_times+0x37>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
jmp    1112 <gf2_matrix_times+0x12>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gf2_matrix_times>:
xor    %eax,%eax
test   %esi,%esi
jne    111f <gf2_matrix_times+0x1f>
ret
nopw   0x0(%rax,%rax,1)
mov    %esi,%ecx
sar    %ecx
add    $0x4,%rdi
cmp    $0x1,%esi
mov    %ecx,%esi
jbe    1106 <gf2_matrix_times+0x6>
test   $0x1,%sil
je     1110 <gf2_matrix_times+0x10>
xor    (%rdi),%eax
jmp    1110 <gf2_matrix_times+0x10>

LLVM IR (-O0):
define i32 @gf2_matrix_times(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 = %18, %2
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %23
9: ; preds = %6
%10 = load i32, i32* %4
%11 = and i32 %10, 1
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %9
%14 = load i32*, i32** %3
%15 = load i32, i32* %14
%16 = load i32, i32* %5
%17 = xor i32 %16, %15
store i32 %17, i32* %5
br label %18
18: ; preds = %13, %9
%19 = load i32, i32* %4
%20 = ashr i32 %19, 1
store i32 %20, i32* %4
%21 = load i32*, i32** %3
%22 = getelementptr inbounds i32, i32* %21, i32 1
store i32* %22, i32** %3
br label %6
23: ; preds = %6
%24 = load i32, i32* %5
ret i32 %24
}

LLVM IR (-O2):
define i32 @gf2_matrix_times(i32* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %18, label %4
4: ; preds = %2, %13
%5 = phi i32 [ %14, %13 ], [ 0, %2 ]
%6 = phi i32 [ %15, %13 ], [ %1, %2 ]
%7 = phi i32* [ %16, %13 ], [ %0, %2 ]
%8 = and i32 %6, 1
%9 = icmp eq i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %4
%11 = load i32, i32* %7
%12 = xor i32 %11, %5
br label %13
13: ; preds = %10, %4
%14 = phi i32 [ %12, %10 ], [ %5, %4 ]
%15 = ashr i32 %6, 1
%16 = getelementptr inbounds i32, i32* %7, i64 1
%17 = icmp ult i32 %6, 2
br i1 %17, label %18, label %4
18: ; preds = %13, %2
%19 = phi i32 [ 0, %2 ], [ %14, %13 ]
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int i;
  for (i = 0; i < 1000000; i++)
    if (i % 100000 == 0)
      printf("Hello world!\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xf4240,-0x8(%rbp)
jge    1166 <main+0x56>
mov    -0x8(%rbp),%eax
mov    $0x186a0,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1153 <main+0x43>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
jmp    1158 <main+0x48>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %ebp,%ebp
lea    0xee3(%rip),%r14
xor    %ebx,%ebx
jmp    113e <main+0x2e>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebx
add    $0xffffffff,%ebp
cmp    $0xfff0bdc0,%ebp
je     1162 <main+0x52>
mov    %ebx,%eax
shr    $0x5,%eax
imul   $0xa7c5ac5,%rax,%rax
shr    $0x27,%rax
imul   $0xfffe7960,%eax,%eax
cmp    %ebp,%eax
jne    1130 <main+0x20>
mov    %r14,%rdi
call   1030 <puts@plt>
jmp    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello world!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %13, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 1000000
br i1 %5, label %6, label %16
6: ; preds = %3
%7 = load i32, i32* %2
%8 = srem i32 %7, 100000
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %6
br label %13
13: ; preds = %12
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %3
16: ; preds = %3
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello world!\00"
define i32 @main() {
br label %1
1: ; preds = %0, %7
%2 = phi i32 [ 0, %0 ], [ %8, %7 ]
%3 = urem i32 %2, 100000
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
br label %7
7: ; preds = %1, %5
%8 = add nuw nsw i32 %2, 1
%9 = icmp eq i32 %8, 1000000
br i1 %9, label %10, label %1
10: ; preds = %7
ret i32 0
}
int lcm_2(int a, int b) {
  return (int)((long long int)(a) * (long long int)(b)) / gcd(a, b);
}


x86 assembly (clang, -O0):
<lcm_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rax
movslq -0x8(%rbp),%rcx
imul   %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x0,%al
call   1030 <gcd@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcm_2>:
push   %rbx
mov    %esi,%ebx
imul   %edi,%ebx
xor    %eax,%eax
call   1030 <gcd@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
pop    %rbx
ret

LLVM IR (-O0):
define i32 @lcm_2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = sext i32 %5 to i64
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = mul nsw i64 %6, %8
%10 = trunc i64 %9 to i32
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = call i32 (i32, i32, ...) bitcast (i32 (...)* @gcd to i32 (i32, i32, ...)*)(i32 %11, i32 %12)
%14 = sdiv i32 %10, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @lcm_2(i32 %0, i32 %1) {
%3 = mul i32 %1, %0
%4 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @gcd to i32 (i32, i32, ...)*)(i32 %0, i32 %1)
%5 = sdiv i32 %3, %4
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t parity_even_bit(const uint8_t v) {
  uint8_t ret = v;
  ret ^= ret >> 4;
  ret ^= ret >> 2;
  ret ^= ret >> 1;
  ret &= 0x01;
  return ret;
}


x86 assembly (clang, -O0):
<parity_even_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x4,%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x2,%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parity_even_bit>:
mov    %edi,%eax
sar    $0x4,%eax
xor    %edi,%eax
mov    %eax,%ecx
sar    $0x2,%ecx
xor    %eax,%ecx
mov    %ecx,%eax
shr    %eax
xor    %ecx,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @parity_even_bit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = ashr i32 %5, 4
%7 = load i32, i32* %3
%8 = xor i32 %7, %6
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = ashr i32 %9, 2
%11 = load i32, i32* %3
%12 = xor i32 %11, %10
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = ashr i32 %13, 1
%15 = load i32, i32* %3
%16 = xor i32 %15, %14
store i32 %16, i32* %3
%17 = load i32, i32* %3
%18 = and i32 %17, 1
store i32 %18, i32* %3
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @parity_even_bit(i32 %0) {
%2 = ashr i32 %0, 4
%3 = xor i32 %2, %0
%4 = ashr i32 %3, 2
%5 = xor i32 %4, %3
%6 = lshr i32 %5, 1
%7 = xor i32 %6, %5
%8 = and i32 %7, 1
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void putTTY(char *buf) { write(1, buf, strlen(buf)); }


x86 assembly (clang, -O0):
<putTTY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putTTY>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @putTTY(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @write(i32 1, i8* %3, i32 %5)
ret void
}

LLVM IR (-O2):
define void @putTTY(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @write(i32 1, i8* %0, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
scalar_t__ ENOTSUP;
int /*<<< orphan*/ PTHREAD_SCOPE_PROCESS;
int /*<<< orphan*/ pthread_attr_destroy(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_attr_init(int /*<<< orphan*/ *);
scalar_t__ pthread_attr_setscope(int /*<<< orphan*/ *, int /*<<< orphan*/);
bool tp_info_procscopeissupported() {
  pthread_attr_t attr;
  pthread_attr_init(&attr);
  bool result = pthread_attr_setscope(&attr, PTHREAD_SCOPE_PROCESS) == ENOTSUP
                    ? false
                    : true;
  pthread_attr_destroy(&attr);
  return result;
}


x86 assembly (clang, -O0):
<tp_info_procscopeissupported>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1030 <pthread_attr_init@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%esi
lea    -0x4(%rbp),%rdi
call   1040 <pthread_attr_setscope@plt>
mov    %rax,%rdx
mov    0x2e8b(%rip),%rax
mov    (%rax),%rsi
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
mov    %eax,-0x8(%rbp)
lea    -0x4(%rbp),%rdi
call   1050 <pthread_attr_destroy@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tp_info_procscopeissupported>:
push   %rbp
push   %rbx
push   %rax
lea    0x4(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <pthread_attr_init@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1040 <pthread_attr_setscope@plt>
mov    0x2e90(%rip),%rcx
xor    %ebp,%ebp
cmp    (%rcx),%rax
setne  %bpl
mov    %rbx,%rdi
call   1050 <pthread_attr_destroy@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@PTHREAD_SCOPE_PROCESS = global i32 0
@ENOTSUP = global i64 0
define i32 @tp_info_procscopeissupported() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @pthread_attr_init(i32* %1)
%4 = load i32, i32* @PTHREAD_SCOPE_PROCESS
%5 = call i64 @pthread_attr_setscope(i32* %1, i32 %4)
%6 = load i64, i64* @ENOTSUP
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 0, i32 1
store i32 %9, i32* %2
%10 = call i32 @pthread_attr_destroy(i32* %1)
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@PTHREAD_SCOPE_PROCESS = global i32 0
@ENOTSUP = global i64 0
define i32 @tp_info_procscopeissupported() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @pthread_attr_init(i32* %1)
%4 = load i32, i32* @PTHREAD_SCOPE_PROCESS
%5 = call i64 @pthread_attr_setscope(i32* %1, i32 %4)
%6 = load i64, i64* @ENOTSUP
%7 = icmp ne i64 %5, %6
%8 = zext i1 %7 to i32
%9 = call i32 @pthread_attr_destroy(i32* %1)
ret i32 %8
}
int main() {
  signed long long int a = 4L;
  return a;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 4
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISDIR(int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
int iupUnixIsDirectory(const char *name) {
  struct stat status;
  if (stat(name, &status) != 0)
    return 0;
  if (S_ISDIR(status.st_mode))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<iupUnixIsDirectory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
je     114f <iupUnixIsDirectory+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1174 <iupUnixIsDirectory+0x54>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
cmp    $0x0,%rax
je     116d <iupUnixIsDirectory+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    1174 <iupUnixIsDirectory+0x54>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iupUnixIsDirectory>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1135 <iupUnixIsDirectory+0x15>
pop    %rcx
ret
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @iupUnixIsDirectory(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i64 @S_ISDIR(i32 %8)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ 0, %1 ], [ %11, %6 ]
ret i32 %13
}
int hfsplus_init_acl(struct inode *inode, struct inode *dir) { return 0; }


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

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

LLVM IR (-O0):
%struct.inode = type opaque
define i32 @hfsplus_init_acl(%struct.inode* %0, %struct.inode* %1) {
%3 = alloca %struct.inode*
%4 = alloca %struct.inode*
store %struct.inode* %0, %struct.inode** %3
store %struct.inode* %1, %struct.inode** %4
ret i32 0
}

LLVM IR (-O2):
%struct.inode = type opaque
define i32 @hfsplus_init_acl(%struct.inode* nocapture readnone %0, %struct.inode* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
int __serialize_string(uint8_t *out, int out_sz, const char *s) {
  int l = (int)(strlen(s) + 1);
  if (out_sz < l)
    return (-1);
  strcpy((char *)out, s);
  return (out_sz - l);
}


x86 assembly (clang, -O0):
<__serialize_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%rax
mov    %eax,-0x24(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    115b <__serialize_string+0x3b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1171 <__serialize_string+0x51>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x14(%rbp),%eax
sub    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__serialize_string>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%r15
mov    %rdx,%rdi
call   1040 <strlen@plt>
mov    %rax,%rbx
add    $0x1,%ebx
mov    $0xffffffff,%eax
cmp    %ebp,%ebx
jg     1155 <__serialize_string+0x35>
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
sub    %ebx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @__serialize_string(i32* %0, i32 %1, i8* %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %2)
%5 = trunc i64 %4 to i32
%6 = add i32 %5, 1
%7 = icmp sgt i32 %6, %1
br i1 %7, label %12, label %8
8: ; preds = %3
%9 = bitcast i32* %0 to i8*
%10 = tail call i32 @strcpy(i8* %9, i8* %2)
%11 = sub nsw i32 %1, %6
br label %12
12: ; preds = %3, %8
%13 = phi i32 [ %11, %8 ], [ -1, %3 ]
ret i32 %13
}
float clampf(float x, float min, float max) {
  return (x < min) ? min : (x > max) ? max : x;
}


x86 assembly (clang, -O0):
<clampf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1135 <clampf+0x35>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1167 <clampf+0x67>
movss  -0x4(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1153 <clampf+0x53>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    115d <clampf+0x5d>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<clampf>:
minss  %xmm0,%xmm2
cmpltss %xmm1,%xmm0
movaps %xmm0,%xmm3
andnps %xmm2,%xmm3
andps  %xmm1,%xmm0
orps   %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @clampf(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = fcmp olt float %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load float, float* %5
br label %22
12: ; preds = %3
%13 = load float, float* %4
%14 = load float, float* %6
%15 = fcmp ogt float %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load float, float* %6
br label %20
18: ; preds = %12
%19 = load float, float* %4
br label %20
20: ; preds = %18, %16
%21 = phi float [ %17, %16 ], [ %19, %18 ]
br label %22
22: ; preds = %20, %10
%23 = phi float [ %11, %10 ], [ %21, %20 ]
ret float %23
}

LLVM IR (-O2):
define float @clampf(float %0, float %1, float %2) {
%4 = fcmp olt float %0, %1
%5 = fcmp ogt float %0, %2
%6 = select i1 %5, float %2, float %0
%7 = select i1 %4, float %1, float %6
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void syslog(int priority, const char *format, ...) { assert(!"NYI"); }


x86 assembly (clang, -O0):
<syslog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syslog>:
xor    %edi,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"NYI\00"
define void @syslog(i32 %0, i8* %1, ...) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = call i32 @assert(i32 0)
ret void
}

LLVM IR (-O2):
define void @syslog(i32 %0, i8* nocapture readnone %1, ...) {
%3 = tail call i32 @assert(i32 0)
ret void
}
void ft_strclr(char *s) {
  int i;
  i = 0;
  while (s[i] != '\0') {
    s[i] = '\0';
    i++;
  }
}


x86 assembly (clang, -O0):
<ft_strclr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     113e <ft_strclr+0x3e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <ft_strclr+0xf>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @ft_strclr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
store i8 0, i8* %6
%7 = add nuw nsw i64 %5, 1
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int ones_add(int, int *, int /*<<< orphan*/);
int __fa(int ea, int target[]) { return ones_add(ea, target, 0); }


x86 assembly (clang, -O0):
<__fa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1030 <ones_add@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fa>:
xor    %edx,%edx
jmp    1030 <ones_add@plt>

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

LLVM IR (-O2):
define i32 @__fa(i32 %0, i32* %1) {
%3 = tail call i32 @ones_add(i32 %0, i32* %1, i32 0)
ret i32 %3
}
void ble_rsp_hardware_io_port_config_pull(
    const struct ble_msg_hardware_io_port_config_pull_rsp_t *msg) {}


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

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

LLVM IR (-O0):
%struct.ble_msg_hardware_io_port_config_pull_rsp_t = type opaque
define void @ble_rsp_hardware_io_port_config_pull(%struct.ble_msg_hardware_io_port_config_pull_rsp_t* %0) {
%2 = alloca %struct.ble_msg_hardware_io_port_config_pull_rsp_t*
store %struct.ble_msg_hardware_io_port_config_pull_rsp_t* %0, %struct.ble_msg_hardware_io_port_config_pull_rsp_t** %2
ret void
}

LLVM IR (-O2):
%struct.ble_msg_hardware_io_port_config_pull_rsp_t = type opaque
define void @ble_rsp_hardware_io_port_config_pull(%struct.ble_msg_hardware_io_port_config_pull_rsp_t* nocapture %0) {
ret void
}