xunge/DecIR huggingface dataset:
/* Type definitions */
struct dirent {
  int /*<<< orphan*/ d_name;
};
struct dir_entry_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dir_entry_name(struct dir_entry_info const *);
int strcmp(int /*<<< orphan*/, int /*<<< orphan*/);
int search_comp(const void *pa, const void *pb) {
  const struct dirent *a = (const struct dirent *)pa;
  const struct dir_entry_info *b = *(const struct dir_entry_info **)pb;
  return strcmp(a->d_name, dir_entry_name(b));
}


x86 assembly (clang, -O0):
<search_comp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <dir_entry_name@plt>
mov    -0x24(%rbp),%edi
mov    %eax,%esi
call   1040 <strcmp@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<search_comp>:
push   %rbx
mov    (%rsi),%rax
mov    (%rdi),%ebx
mov    %rax,%rdi
call   1030 <dir_entry_name@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <strcmp@plt>

LLVM IR (-O0):
%struct.dirent = type { i32 }
%struct.dir_entry_info = type { i32 }
define i32 @search_comp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca %struct.dirent*
%6 = alloca %struct.dir_entry_info*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to %struct.dirent*
store %struct.dirent* %8, %struct.dirent** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to %struct.dir_entry_info**
%11 = load %struct.dir_entry_info*, %struct.dir_entry_info** %10
store %struct.dir_entry_info* %11, %struct.dir_entry_info** %6
%12 = load %struct.dirent*, %struct.dirent** %5
%13 = getelementptr inbounds %struct.dirent, %struct.dirent* %12, i32 0, i32 0
%14 = load i32, i32* %13
%15 = load %struct.dir_entry_info*, %struct.dir_entry_info** %6
%16 = call i32 @dir_entry_name(%struct.dir_entry_info* %15)
%17 = call i32 @strcmp(i32 %14, i32 %16)
ret i32 %17
}

LLVM IR (-O2):
%struct.dir_entry_info = type { i32 }
define i32 @search_comp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to %struct.dir_entry_info**
%4 = load %struct.dir_entry_info*, %struct.dir_entry_info** %3
%5 = bitcast i8* %0 to i32*
%6 = load i32, i32* %5
%7 = tail call i32 @dir_entry_name(%struct.dir_entry_info* %4)
%8 = tail call i32 @strcmp(i32 %6, i32 %7)
ret i32 %8
}
int seqSize(int n) {
  int ct = 1;
  while (n != 1) {
    if (n % 2 == 0)
      n /= 2;
    else
      n = 3 * n + 1;
    ct++;
  }
  return ct;
}


x86 assembly (clang, -O0):
<seqSize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
je     1157 <seqSize+0x57>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    113f <seqSize+0x3f>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1149 <seqSize+0x49>
imul   $0x3,-0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <seqSize+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<seqSize>:
mov    $0x1,%eax
cmp    $0x1,%edi
jne    110b <seqSize+0xb>
ret
mov    $0x1,%eax
jmp    112e <seqSize+0x2e>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    (%rdi,%rdi,2),%edi
add    $0x1,%edi
add    $0x1,%eax
cmp    $0x1,%edi
je     110a <seqSize+0xa>
test   $0x1,%dil
jne    1120 <seqSize+0x20>
mov    %edi,%ecx
shr    $0x1f,%ecx
add    %edi,%ecx
sar    %ecx
mov    %ecx,%edi
jmp    1126 <seqSize+0x26>

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

LLVM IR (-O2):
define i32 @seqSize(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %17, label %3
3: ; preds = %1, %13
%4 = phi i32 [ %15, %13 ], [ 1, %1 ]
%5 = phi i32 [ %14, %13 ], [ %0, %1 ]
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = sdiv i32 %5, 2
br label %13
10: ; preds = %3
%11 = mul nsw i32 %5, 3
%12 = add nsw i32 %11, 1
br label %13
13: ; preds = %10, %8
%14 = phi i32 [ %9, %8 ], [ %12, %10 ]
%15 = add nuw nsw i32 %4, 1
%16 = icmp eq i32 %14, 1
br i1 %16, label %17, label %3
17: ; preds = %13, %1
%18 = phi i32 [ 1, %1 ], [ %15, %13 ]
ret i32 %18
}
int test_imm_6Aint16_reg(short val) {
  return ((val) & (-0x6A << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_6Aint16_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, -106
%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_6Aint16_reg(i16 signext %0) {
%2 = and i16 %0, -106
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ geralinha(char *);
int /*<<< orphan*/ printf(char *, ...);
void cabecalho(char s[]) {
  printf("            %s, (c) 2015  \n", s);
  geralinha(s);
  printf("\n");
}


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

x86 assembly (clang, -O2):
<cabecalho>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1050 <geralinha@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [28 x i8] c" %s, (c) 2015 \0A\00"
define void @cabecalho(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @geralinha(i8* %0)
%4 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Init();
void _M2_COROUTINES_init(__attribute__((unused)) int argc,
                         __attribute__((unused)) char *argv[]) {
  Init();
}


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

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

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

LLVM IR (-O2):
define void @_M2_COROUTINES_init(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @Init()
ret void
}
void chop(char *str) {
  for (; *str; str++)
    if (*str == '\n')
      *str = 0;
}


x86 assembly (clang, -O0):
<chop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1142 <chop+0x42>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    112c <chop+0x2c>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
jmp    1131 <chop+0x31>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <chop+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<chop>:
jmp    1117 <chop+0x17>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x0,(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0xa,%al
je     1110 <chop+0x10>
test   %al,%al
jne    1113 <chop+0x13>
ret

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

LLVM IR (-O2):
define void @chop(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
switch i8 %4, label %6 [
i8 0, label %8
i8 10, label %5
]
5: ; preds = %2
store i8 0, i8* %3
br label %6
6: ; preds = %2, %5
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
8: ; preds = %2
ret void
}
int g(int a) { return a + 32; }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
lea    0x20(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @g(i32 %0) {
%2 = add nsw i32 %0, 32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char);
main() {
  char car1 = 'A', car2 = 65, car3 = 0;
  car3 = car1 + 'a' - 'A';
  printf("%d %c\n", car3, car3);
  car3 = car2 + 32;
  printf("%d %c\n", car3, car3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x41,-0x1(%rbp)
movb   $0x41,-0x2(%rbp)
movb   $0x0,-0x3(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x61,%eax
sub    $0x41,%eax
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
lea    0xec5(%rip),%rdi
movsbl %al,%esi
movsbl -0x3(%rbp),%edx
call   1030 <printf@plt>
movsbl -0x2(%rbp),%eax
add    $0x20,%eax
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
lea    0xea5(%rip),%rdi
movsbl %al,%esi
movsbl -0x3(%rbp),%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x61,%esi
mov    $0x61,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x61,%esi
mov    $0x61,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d %c\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i8
store i8 65, i8* %1
store i8 65, i8* %2
store i8 0, i8* %3
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
%6 = add nsw i32 %5, 97
%7 = sub nsw i32 %6, 65
%8 = trunc i32 %7 to i8
store i8 %8, i8* %3
%9 = load i8, i8* %3
%10 = load i8, i8* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 signext %9, i8 signext %10)
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = add nsw i32 %13, 32
%15 = trunc i32 %14 to i8
store i8 %15, i8* %3
%16 = load i8, i8* %3
%17 = load i8, i8* %3
%18 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 signext %16, i8 signext %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d %c\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 signext 97, i8 signext 97)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 signext 97, i8 signext 97)
ret i32 0
}
adr0adrreg1(r0, r1, x0, x1, p0, p1) unsigned short r0, r1;
unsigned short *p0, *p1;
{
  if ((*((unsigned short *)10000000)) <= (p1[1111111 / 4]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adr0adrreg1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    $0x989680,%eax
movzwl (%rax),%eax
mov    -0x20(%rbp),%rcx
movzwl 0x87a22(%rcx),%ecx
cmp    %ecx,%eax
jg     1146 <adr0adrreg1+0x46>
movl   $0x1,-0x4(%rbp)
jmp    114d <adr0adrreg1+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adr0adrreg1>:
movzwl 0x989680,%ecx
xor    %eax,%eax
cmp    0x87a22(%r9),%cx
setbe  %al
ret

LLVM IR (-O0):
define i32 @adr0adrreg1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16, i16* inttoptr (i64 10000000 to i16*)
%17 = zext i16 %16 to i32
%18 = load i16*, i16** %13
%19 = getelementptr inbounds i16, i16* %18, i64 277777
%20 = load i16, i16* %19
%21 = zext i16 %20 to i32
%22 = icmp sle i32 %17, %21
br i1 %22, label %23, label %24
23: ; preds = %6
store i32 1, i32* %7
br label %25
24: ; preds = %6
store i32 0, i32* %7
br label %25
25: ; preds = %24, %23
%26 = load i32, i32* %7
ret i32 %26
}

LLVM IR (-O2):
define i32 @adr0adrreg1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture %5) {
%7 = load i16, i16* inttoptr (i64 10000000 to i16*)
%8 = getelementptr inbounds i16, i16* %5, i64 277777
%9 = load i16, i16* %8
%10 = icmp ule i16 %7, %9
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int encode_unsigned32(uint8_t *apdu, uint32_t value) {
  apdu[0] = (uint8_t)((value & 0xff000000) >> 24);
  apdu[1] = (uint8_t)((value & 0x00ff0000) >> 16);
  apdu[2] = (uint8_t)((value & 0x0000ff00) >> 8);
  apdu[3] = (uint8_t)(value & 0x000000ff);
  return 4;
}


x86 assembly (clang, -O0):
<encode_unsigned32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff000000,%eax
shr    $0x18,%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
and    $0xff0000,%eax
sar    $0x10,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0xc(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x18(%rax)
mov    $0x4,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode_unsigned32>:
mov    %esi,%eax
mov    %esi,%ecx
movzbl %ah,%edx
movzbl %al,%esi
shr    $0x18,%eax
mov    %rax,(%rdi)
shr    $0x10,%ecx
movzbl %cl,%eax
mov    %rax,0x8(%rdi)
mov    %rdx,0x10(%rdi)
mov    %rsi,0x18(%rdi)
mov    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @encode_unsigned32(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, -16777216
%7 = lshr i32 %6, 24
%8 = zext i32 %7 to i64
%9 = load i64*, i64** %3
%10 = getelementptr inbounds i64, i64* %9, i64 0
store i64 %8, i64* %10
%11 = load i32, i32* %4
%12 = and i32 %11, 16711680
%13 = ashr i32 %12, 16
%14 = sext i32 %13 to i64
%15 = load i64*, i64** %3
%16 = getelementptr inbounds i64, i64* %15, i64 1
store i64 %14, i64* %16
%17 = load i32, i32* %4
%18 = and i32 %17, 65280
%19 = ashr i32 %18, 8
%20 = sext i32 %19 to i64
%21 = load i64*, i64** %3
%22 = getelementptr inbounds i64, i64* %21, i64 2
store i64 %20, i64* %22
%23 = load i32, i32* %4
%24 = and i32 %23, 255
%25 = sext i32 %24 to i64
%26 = load i64*, i64** %3
%27 = getelementptr inbounds i64, i64* %26, i64 3
store i64 %25, i64* %27
ret i32 4
}

LLVM IR (-O2):
define i32 @encode_unsigned32(i64* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 24
%4 = zext i32 %3 to i64
store i64 %4, i64* %0
%5 = lshr i32 %1, 16
%6 = and i32 %5, 255
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i64, i64* %0, i64 1
store i64 %7, i64* %8
%9 = lshr i32 %1, 8
%10 = and i32 %9, 255
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds i64, i64* %0, i64 2
store i64 %11, i64* %12
%13 = and i32 %1, 255
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds i64, i64* %0, i64 3
store i64 %14, i64* %15
ret i32 4
}
void test93_Mod1_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test93_Mod1_targetInit__I() {
ret void
}
/* Variables and functions */
int rpartition(int *, int, int);
void rqSort(int ar[], int p, int r) {
  if (p < r) {
    int q = rpartition(ar, p, r);
    rqSort(ar, p, q - 1);
    rqSort(ar, q + 1, r);
  }
}


x86 assembly (clang, -O0):
<rqSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <rqSort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <rpartition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <rqSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <rqSort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rqSort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <rqSort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <rpartition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <rqSort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <rqSort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @rqSort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @rpartition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @rqSort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
init_poly3(poly) double poly[25][25][25];
{ bzero(poly, 25 * 25 * 25 * sizeof(double)); }


x86 assembly (clang, -O0):
<init_poly3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x1e848,%edx
call   1030 <memset@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_poly3>:
mov    $0x1e848,%edx
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define i32 @init_poly3([25 x [25 x double]]* %0) {
%2 = alloca i32
%3 = alloca [25 x [25 x double]]*
store [25 x [25 x double]]* %0, [25 x [25 x double]]** %3
%4 = load [25 x [25 x double]]*, [25 x [25 x double]]** %3
%5 = bitcast [25 x [25 x double]]* %4 to i8*
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @init_poly3([25 x [25 x double]]* nocapture writeonly %0) {
%2 = bitcast [25 x [25 x double]]* %0 to i8*
tail call void @llvm.memset.p0i8.i64(i8* align 8 dereferenceable(125000) %2, i8 0, i64 125000, i1 false)
ret i32 undef
}
/* Type definitions */
struct _reent {
  int dummy;
};

/* Variables and functions */
void *BT_kMalloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *_calloc_r(struct _reent *r, size_t nmemb, size_t size) {
  void *new = BT_kMalloc(size * nmemb);
  ;
  if (!new) {
    return new;
  }
  memset(new, 0, size * nmemb);
  return new;
}


x86 assembly (clang, -O0):
<_calloc_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
imul   -0x18(%rbp),%rdi
call   1040 <BT_kMalloc@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    115e <_calloc_r+0x3e>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    117a <_calloc_r+0x5a>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rdx
imul   -0x18(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_calloc_r>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
imul   %rdx,%rbx
mov    %rbx,%rdi
call   1040 <BT_kMalloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     1148 <_calloc_r+0x28>
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct._reent = type { i32 }
define i8* @_calloc_r(%struct._reent* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca %struct._reent*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i8*
store %struct._reent* %0, %struct._reent** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
%9 = load i64, i64* %7
%10 = load i64, i64* %6
%11 = mul i64 %9, %10
%12 = call i8* @BT_kMalloc(i64 %11)
store i8* %12, i8** %8
%13 = load i8*, i8** %8
%14 = icmp ne i8* %13, null
br i1 %14, label %17, label %15
15: ; preds = %3
%16 = load i8*, i8** %8
store i8* %16, i8** %4
br label %24
17: ; preds = %3
%18 = load i8*, i8** %8
%19 = load i64, i64* %7
%20 = load i64, i64* %6
%21 = mul i64 %19, %20
%22 = call i32 @memset(i8* %18, i32 0, i64 %21)
%23 = load i8*, i8** %8
store i8* %23, i8** %4
br label %24
24: ; preds = %17, %15
%25 = load i8*, i8** %4
ret i8* %25
}

LLVM IR (-O2):
%struct._reent = type { i32 }
define i8* @_calloc_r(%struct._reent* nocapture readnone %0, i64 %1, i64 %2) {
%4 = mul i64 %2, %1
%5 = tail call i8* @BT_kMalloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @memset(i8* %5, i32 0, i64 %4)
br label %9
9: ; preds = %3, %7
ret i8* %5
}
void wait_RnB() {
  while (!(*((unsigned volatile char *)0x70200028) & 0x1))
    ;
}


x86 assembly (clang, -O0):
<wait_RnB>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <wait_RnB+0x9>
mov    $0x70200028,%eax
mov    (%rax),%al
movzbl %al,%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    112b <wait_RnB+0x2b>
jmp    1130 <wait_RnB+0x30>
jmp    1109 <wait_RnB+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_RnB>:
testb  $0x1,0x70200028
01
je     1100 <wait_RnB>
ret

LLVM IR (-O0):
define void @wait_RnB() {
br label %1
1: ; preds = %7, %0
%2 = load volatile i8, i8* inttoptr (i64 1881145384 to i8*)
%3 = zext i8 %2 to i32
%4 = and i32 %3, 1
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
br i1 %6, label %7, label %8
7: ; preds = %1
br label %1
8: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @wait_RnB() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i8, i8* inttoptr (i64 1881145384 to i8*)
%3 = and i8 %2, 1
%4 = icmp eq i8 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fmaxf(float const, double);
float fminf(int /*<<< orphan*/, double);
float clamp(const float num, const float min, const float max) {
  return fminf(fmaxf(num, 0.0), 1.0);
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
call   1040 <fmaxf@plt>
mov    %eax,%edi
movsd  0xeb2(%rip),%xmm0
call   1030 <fminf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
push   %rax
xorps  %xmm1,%xmm1
call   1040 <fmaxf@plt>
movsd  0xecf(%rip),%xmm0
mov    %eax,%edi
pop    %rax
jmp    1030 <fminf@plt>

LLVM IR (-O0):
define float @clamp(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 = call i32 @fmaxf(float %7, double 0.000000e+00)
%9 = call float @fminf(i32 %8, double 1.000000e+00)
ret float %9
}

LLVM IR (-O2):
define float @clamp(float %0, float %1, float %2) {
%4 = tail call i32 @fmaxf(float %0, double 0.000000e+00)
%5 = tail call float @fminf(i32 %4, double 1.000000e+00)
ret float %5
}
/* Type definitions */
typedef scalar_t__ clock_t;

/* Variables and functions */
double CLOCKS_PER_SEC;
scalar_t__ clock();
int /*<<< orphan*/ printf(char *, long, double);
long solve();
int main() {
  clock_t begin = clock();
  long result = solve();
  clock_t end = clock();
  double time = (double)(end - begin) / CLOCKS_PER_SEC;
  printf("%ld [in %f seconds]", result, time);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1040 <clock@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <solve@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <clock@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
sub    -0x8(%rbp),%rax
cvtsi2sd %rax,%xmm0
mov    0x2e7b(%rip),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
movsd  -0x20(%rbp),%xmm0
lea    0xe7a(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <clock@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <solve@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1040 <clock@plt>
sub    %rbx,%rax
cvtsi2sd %rax,%xmm0
mov    0x2e8a(%rip),%rax
divsd  (%rax),%xmm0
lea    0xe97(%rip),%rdi
mov    %r14,%rsi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global double 0.000000e+00
@.str = [20 x i8] c"%ld [in %f seconds]\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
%4 = alloca double
%5 = call i64 (...) @clock()
store i64 %5, i64* %1
%6 = call i64 (...) @solve()
store i64 %6, i64* %2
%7 = call i64 (...) @clock()
store i64 %7, i64* %3
%8 = load i64, i64* %3
%9 = load i64, i64* %1
%10 = sub nsw i64 %8, %9
%11 = sitofp i64 %10 to double
%12 = load double, double* @CLOCKS_PER_SEC
%13 = fdiv double %11, %12
store double %13, double* %4
%14 = load i64, i64* %2
%15 = load double, double* %4
%16 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 %14, double %15)
ret i32 0
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global double 0.000000e+00
@.str = [20 x i8] c"%ld [in %f seconds]\00"
define i32 @main() {
%1 = tail call i64 (...) @clock()
%2 = tail call i64 (...) @solve()
%3 = tail call i64 (...) @clock()
%4 = sub nsw i64 %3, %1
%5 = sitofp i64 %4 to double
%6 = load double, double* @CLOCKS_PER_SEC
%7 = fdiv double %5, %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 %2, double %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ create_trivial_box();
int /*<<< orphan*/ decr();
int /*<<< orphan*/ incr();
void test2() {
  create_trivial_box();
  incr();
  incr();
  decr();
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <create_trivial_box@plt>
mov    $0x0,%al
call   1050 <incr@plt>
mov    $0x0,%al
call   1050 <incr@plt>
mov    $0x0,%al
call   1030 <decr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
push   %rax
xor    %eax,%eax
call   1040 <create_trivial_box@plt>
xor    %eax,%eax
call   1050 <incr@plt>
xor    %eax,%eax
call   1050 <incr@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <decr@plt>

LLVM IR (-O0):
define void @test2() {
%1 = call i32 (...) @create_trivial_box()
%2 = call i32 (...) @incr()
%3 = call i32 (...) @incr()
%4 = call i32 (...) @decr()
ret void
}

LLVM IR (-O2):
define void @test2() {
%1 = tail call i32 (...) @create_trivial_box()
%2 = tail call i32 (...) @incr()
%3 = tail call i32 (...) @incr()
%4 = tail call i32 (...) @decr()
ret void
}
int tcgetattr(void) {
  ;
  return -1;
}


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

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

LLVM IR (-O0):
define i32 @tcgetattr() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @tcgetattr() {
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ SUB_HOST_REG_IMM_B(int, int /*<<< orphan*/);
int /*<<< orphan*/ addbyte(int);
int CMP_HOST_REG_IMM_B(int host_reg, uint8_t imm) {
  if (host_reg & 8) {
    addbyte(0x44);
    addbyte(0x89);
    addbyte(0xc0 | ((host_reg & 7) << 3) | 2);
    host_reg = (host_reg & 0x10) | 2;
  }
  SUB_HOST_REG_IMM_B(host_reg, imm);
  return host_reg;
}


x86 assembly (clang, -O0):
<CMP_HOST_REG_IMM_B>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     1174 <CMP_HOST_REG_IMM_B+0x54>
mov    $0x44,%edi
call   1030 <addbyte@plt>
mov    $0x89,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
and    $0x7,%edi
shl    $0x3,%edi
or     $0xc0,%edi
or     $0x2,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%eax
and    $0x10,%eax
or     $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <SUB_HOST_REG_IMM_B@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CMP_HOST_REG_IMM_B>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
test   $0x8,%bl
je     115a <CMP_HOST_REG_IMM_B+0x3a>
mov    $0x44,%edi
call   1030 <addbyte@plt>
mov    $0x89,%edi
call   1030 <addbyte@plt>
lea    0x0(,%rbx,8),%eax
or     $0xc2,%eax
movzbl %al,%edi
call   1030 <addbyte@plt>
and    $0x10,%ebx
or     $0x2,%ebx
mov    %ebx,%edi
mov    %ebp,%esi
call   1040 <SUB_HOST_REG_IMM_B@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @CMP_HOST_REG_IMM_B(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 = and i32 %5, 8
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %20
8: ; preds = %2
%9 = call i32 @addbyte(i32 68)
%10 = call i32 @addbyte(i32 137)
%11 = load i32, i32* %3
%12 = and i32 %11, 7
%13 = shl i32 %12, 3
%14 = or i32 192, %13
%15 = or i32 %14, 2
%16 = call i32 @addbyte(i32 %15)
%17 = load i32, i32* %3
%18 = and i32 %17, 16
%19 = or i32 %18, 2
store i32 %19, i32* %3
br label %20
20: ; preds = %8, %2
%21 = load i32, i32* %3
%22 = load i32, i32* %4
%23 = call i32 @SUB_HOST_REG_IMM_B(i32 %21, i32 %22)
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @CMP_HOST_REG_IMM_B(i32 %0, i32 %1) {
%3 = and i32 %0, 8
%4 = icmp eq i32 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2
%6 = tail call i32 @addbyte(i32 68)
%7 = tail call i32 @addbyte(i32 137)
%8 = shl i32 %0, 3
%9 = and i32 %8, 56
%10 = or i32 %9, 194
%11 = tail call i32 @addbyte(i32 %10)
%12 = and i32 %0, 16
%13 = or i32 %12, 2
br label %14
14: ; preds = %5, %2
%15 = phi i32 [ %13, %5 ], [ %0, %2 ]
%16 = tail call i32 @SUB_HOST_REG_IMM_B(i32 %15, i32 %1)
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ dbg_break();
void arch_benchmarks_size(void) { dbg_break(); }


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

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

LLVM IR (-O0):
define void @arch_benchmarks_size() {
%1 = call i32 (...) @dbg_break()
ret void
}

LLVM IR (-O2):
define void @arch_benchmarks_size() {
%1 = tail call i32 (...) @dbg_break()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *const, int /*<<< orphan*/, size_t const);
void memzero(void *const ptr, const size_t num) { memset(ptr, 0, num); }


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

x86 assembly (clang, -O2):
<memzero>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @memzero(i8* %0, i64 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i64 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ s2;
typedef int /*<<< orphan*/ s1;

/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strcat(char *, char const *);
int /*<<< orphan*/ strcpy(char *, char *);
char *_strconcat(char *s1, const char *s2) {
  char *result = malloc(sizeof(s1) + sizeof(s2) + 1);
  strcpy(result, s1);
  strcat(s1, s2);
  return s1;
}


x86 assembly (clang, -O0):
<_strconcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x11,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strcat@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_strconcat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x11,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <strcat@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @_strconcat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = call i8* @malloc(i32 17)
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = load i8*, i8** %3
%9 = call i32 @strcpy(i8* %7, i8* %8)
%10 = load i8*, i8** %3
%11 = load i8*, i8** %4
%12 = call i32 @strcat(i8* %10, i8* %11)
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @_strconcat(i8* returned %0, i8* %1) {
%3 = tail call dereferenceable_or_null(17) i8* @malloc(i32 17)
%4 = tail call i32 @strcpy(i8* %3, i8* %0)
%5 = tail call i32 @strcat(i8* %0, i8* %1)
ret i8* %0
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int64_t cfs_stub_fgetxattr(int fd, const char *name, void *data, size_t size) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<cfs_stub_fgetxattr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2ece(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb5(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @cfs_stub_fgetxattr(i32 %0, i8* %1, i8* %2, i64 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i32, i32* @ENOSYS
store i32 %9, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @cfs_stub_fgetxattr(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i64 %3) {
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}
struct ctrl_iface_priv *
wpa_supplicant_ctrl_iface_init(struct wpa_supplicant *wpa_s) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.ctrl_iface_priv = type opaque
%struct.wpa_supplicant = type opaque
define %struct.ctrl_iface_priv* @wpa_supplicant_ctrl_iface_init(%struct.wpa_supplicant* %0) {
%2 = alloca %struct.wpa_supplicant*
store %struct.wpa_supplicant* %0, %struct.wpa_supplicant** %2
ret %struct.ctrl_iface_priv* null
}

LLVM IR (-O2):
%struct.ctrl_iface_priv = type opaque
%struct.wpa_supplicant = type opaque
define noalias %struct.ctrl_iface_priv* @wpa_supplicant_ctrl_iface_init(%struct.wpa_supplicant* nocapture readnone %0) {
ret %struct.ctrl_iface_priv* null
}
struct task_struct *nsc_get_task(void) {
  extern struct task_struct *nsc_task;
  return nsc_task;
}


x86 assembly (clang, -O0):
<nsc_get_task>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsc_get_task>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%rax
ret

LLVM IR (-O0):
%struct.task_struct = type opaque
@nsc_task = external global %struct.task_struct*
define %struct.task_struct* @nsc_get_task() {
%1 = load %struct.task_struct*, %struct.task_struct** @nsc_task
ret %struct.task_struct* %1
}

LLVM IR (-O2):
%struct.task_struct = type opaque
@nsc_task = external global %struct.task_struct*
define %struct.task_struct* @nsc_get_task() {
%1 = load %struct.task_struct*, %struct.task_struct** @nsc_task
ret %struct.task_struct* %1
}
void func3() {
  char var_3[11];
  var_3[10] = 0x3;
}


x86 assembly (clang, -O0):
<func3>:
push   %rbp
mov    %rsp,%rbp
movb   $0x3,-0x1(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @func3() {
%1 = alloca [11 x i8]
%2 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 10
store i8 3, i8* %2
ret void
}

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

/* Variables and functions */
int UnpackXX_fileoutput(int /*<<< orphan*/ *, int, int /*<<< orphan*/ *, int,
                        int, int);
int Unpack29_fileoutput(FILE *outputfile, FILE *inputfile, int DestUnpSize,
                        int UnpPackedSize, int Flags) {
  return UnpackXX_fileoutput(outputfile, 29, inputfile, DestUnpSize,
                             UnpPackedSize, Flags);
}


x86 assembly (clang, -O0):
<Unpack29_fileoutput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x1c(%rbp),%r9d
mov    $0x1d,%esi
call   1030 <UnpackXX_fileoutput@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Unpack29_fileoutput>:
mov    %r8d,%r9d
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %rsi,%rdx
mov    $0x1d,%esi
jmp    1030 <UnpackXX_fileoutput@plt>

LLVM IR (-O0):
define i32 @Unpack29_fileoutput(i32* %0, i32* %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32* %0, i32** %6
store i32* %1, i32** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32*, i32** %6
%12 = load i32*, i32** %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = call i32 @UnpackXX_fileoutput(i32* %11, i32 29, i32* %12, i32 %13, i32 %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @Unpack29_fileoutput(i32* %0, i32* %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @UnpackXX_fileoutput(i32* %0, i32 29, i32* %1, i32 %2, i32 %3, i32 %4)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ syscall(int, int /*<<< orphan*/, int);
int sched_setlimit(pid_t pid, int limit) { syscall(332, pid, limit); }


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

x86 assembly (clang, -O2):
<sched_setlimit>:
mov    %esi,%edx
mov    %edi,%esi
mov    $0x14c,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @sched_setlimit(i32 %0, i32 %1) {
%3 = tail call i32 @syscall(i32 332, i32 %0, i32 %1)
ret i32 undef
}
long lclamp(long x, long minval, long maxval) {
  if (x < minval)
    return minval;
  if (x > maxval)
    return maxval;
  return x;
}


x86 assembly (clang, -O0):
<lclamp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    112b <lclamp+0x2b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114e <lclamp+0x4e>
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jle    1146 <lclamp+0x46>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114e <lclamp+0x4e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lclamp>:
mov    %rdx,%rax
cmp    %rdx,%rdi
cmovle %rdi,%rax
cmp    %rsi,%rdi
cmovl  %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @lclamp(i64 %0, i64 %1, i64 %2) {
%4 = icmp slt i64 %0, %1
%5 = icmp sgt i64 %0, %2
%6 = select i1 %5, i64 %2, i64 %0
%7 = select i1 %4, i64 %1, i64 %6
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *, void *, void *, int);
__attribute__((__weak__, __always___)) void
__softboundcets_introspect_metadata(void *ptr, void *base, void *bound,
                                    int arg_no) {
  printf("[introspect_metadata]ptr=%p, base=%p, bound=%p, arg_no=%d\n", ptr,
         base, bound, arg_no);
}


x86 assembly (clang, -O0):
<__softboundcets_introspect_metadata>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__softboundcets_introspect_metadata>:
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xedd(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [59 x i8] c"[introspect_metadata]ptr=%p, base=%p, bound=%p, arg_no=%d\0A\00"
define weak void @__softboundcets_introspect_metadata(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10, i8* %11, i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [59 x i8] c"[introspect_metadata]ptr=%p, base=%p, bound=%p, arg_no=%d\0A\00"
define weak void @__softboundcets_introspect_metadata(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %2, i32 %3)
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef scalar_t__ uint16_t;

/* Variables and functions */
scalar_t__ co_read16p(scalar_t__ *);
uint32_t co_read32p(void const *ptr32) {
  uint16_t addr_l, addr_h;
  addr_l = co_read16p((uint16_t *)ptr32);
  addr_h = co_read16p((uint16_t *)ptr32 + 1);
  return ((uint32_t)addr_l | (uint32_t)addr_h << 16);
}


x86 assembly (clang, -O0):
<co_read32p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <co_read16p@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x8,%rdi
call   1030 <co_read16p@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
shl    $0x10,%ecx
or     %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<co_read32p>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <co_read16p@plt>
mov    %rax,%r14
add    $0x8,%rbx
mov    %rbx,%rdi
call   1030 <co_read16p@plt>
shl    $0x10,%eax
or     %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @co_read32p(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i64*
%7 = call i64 @co_read16p(i64* %6)
store i64 %7, i64* %3
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i64*
%10 = getelementptr inbounds i64, i64* %9, i64 1
%11 = call i64 @co_read16p(i64* %10)
store i64 %11, i64* %4
%12 = load i64, i64* %3
%13 = trunc i64 %12 to i32
%14 = load i64, i64* %4
%15 = trunc i64 %14 to i32
%16 = shl i32 %15, 16
%17 = or i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @co_read32p(i8* %0) {
%2 = bitcast i8* %0 to i64*
%3 = tail call i64 @co_read16p(i64* %2)
%4 = getelementptr inbounds i8, i8* %0, i64 8
%5 = bitcast i8* %4 to i64*
%6 = tail call i64 @co_read16p(i64* %5)
%7 = trunc i64 %3 to i32
%8 = trunc i64 %6 to i32
%9 = shl i32 %8, 16
%10 = or i32 %9, %7
ret i32 %10
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int syscon_number_of_dobldobl_Laurentials(int *length) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc(552, length, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_number_of_dobldobl_Laurentials>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x228,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_number_of_dobldobl_Laurentials>:
mov    %rdi,%rsi
mov    $0x228,%edi
jmp    1030 <_ada_use_c2phc@plt>

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

LLVM IR (-O2):
define i32 @syscon_number_of_dobldobl_Laurentials(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc(i32 552, i32* %0, i32* undef, double* undef)
ret i32 %2
}