xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ __cpuid(int, unsigned int, unsigned int, unsigned int,
                           unsigned int);
void cpuid(int info, unsigned *eax, unsigned *ebx, unsigned *ecx,
           unsigned *edx) {
  unsigned _eax;
  unsigned _ebx;
  unsigned _ecx;
  unsigned _edx;
  __cpuid(info, _eax, _ebx, _ecx, _edx);
  *eax = _eax;
  *ebx = _ebx;
  *ecx = _ecx;
  *edx = _edx;
}


x86 assembly (clang, -O0):
<cpuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%edx
mov    -0x34(%rbp),%ecx
mov    -0x38(%rbp),%r8d
call   1030 <__cpuid@plt>
mov    -0x2c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x30(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x34(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x38(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid>:
jmp    1030 <__cpuid@plt>

LLVM IR (-O0):
define void @cpuid(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*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = 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
%15 = load i32, i32* %6
%16 = load i32, i32* %11
%17 = load i32, i32* %12
%18 = load i32, i32* %13
%19 = load i32, i32* %14
%20 = call i32 @__cpuid(i32 %15, i32 %16, i32 %17, i32 %18, i32 %19)
%21 = load i32, i32* %11
%22 = load i32*, i32** %7
store i32 %21, i32* %22
%23 = load i32, i32* %12
%24 = load i32*, i32** %8
store i32 %23, i32* %24
%25 = load i32, i32* %13
%26 = load i32*, i32** %9
store i32 %25, i32* %26
%27 = load i32, i32* %14
%28 = load i32*, i32** %10
store i32 %27, i32* %28
ret void
}

LLVM IR (-O2):
define void @cpuid(i32 %0, i32* nocapture readnone %1, i32* nocapture readnone %2, i32* nocapture readnone %3, i32* nocapture readnone %4) {
%6 = tail call i32 @__cpuid(i32 %0, i32 undef, i32 undef, i32 undef, i32 undef)
ret void
}
R0R1(r0, r1, x0, x1, p0, p1) unsigned short r0, r1;
unsigned short *p0, *p1;
{
  if (r0 <= r1)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<R0R1>:
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)
movzwl -0x6(%rbp),%eax
movzwl -0x8(%rbp),%ecx
cmp    %ecx,%eax
jg     113b <R0R1+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <R0R1+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<R0R1>:
movzwl %di,%ecx
movzwl %si,%edx
xor    %eax,%eax
cmp    %edx,%ecx
setbe  %al
ret

LLVM IR (-O0):
define i32 @R0R1(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* %8
%17 = zext i16 %16 to i32
%18 = load i16, i16* %9
%19 = zext i16 %18 to i32
%20 = icmp sle i32 %17, %19
br i1 %20, label %21, label %22
21: ; preds = %6
store i32 1, i32* %7
br label %23
22: ; preds = %6
store i32 0, i32* %7
br label %23
23: ; preds = %22, %21
%24 = load i32, i32* %7
ret i32 %24
}

LLVM IR (-O2):
define i32 @R0R1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture readnone %5) {
%7 = and i32 %0, 65535
%8 = and i32 %1, 65535
%9 = icmp ule i32 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
unsigned char ht_hash(char *key) {
  unsigned char hash = 0;
  char *str = key;
  while (*str) {
    hash += *str++;
  }
  return hash;
}


x86 assembly (clang, -O0):
<ht_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1141 <ht_hash+0x41>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%ecx
movzbl -0x9(%rbp),%eax
add    %ecx,%eax
mov    %al,-0x9(%rbp)
jmp    1114 <ht_hash+0x14>
movzbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ht_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     111e <ht_hash+0x1e>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
add    %cl,%al
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <ht_hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define zeroext i8 @ht_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i8 [ %9, %4 ], [ 0, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = add i8 %5, %7
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
%13 = phi i8 [ 0, %1 ], [ %9, %4 ]
ret i8 %13
}
int chk_weight_range(int i) { return i <= 50 && i >= 1; }


x86 assembly (clang, -O0):
<chk_weight_range>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x32,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jg     1120 <chk_weight_range+0x20>
cmpl   $0x1,-0x4(%rbp)
setge  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chk_weight_range>:
add    $0xffffffff,%edi
xor    %eax,%eax
cmp    $0x32,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @chk_weight_range(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 %3, 50
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sge i32 %6, 1
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @chk_weight_range(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 50
%4 = zext i1 %3 to i32
ret i32 %4
}
void foo() {
  char b;
  char p;
  p = b << 6;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movsbl -0x1(%rbp),%eax
shl    $0x6,%eax
mov    %al,-0x2(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @foo() {
%1 = alloca i8
%2 = alloca i8
%3 = load i8, i8* %1
%4 = sext i8 %3 to i32
%5 = shl i32 %4, 6
%6 = trunc i32 %5 to i8
store i8 %6, i8* %2
ret void
}

LLVM IR (-O2):
define void @foo() {
ret void
}
void INT_TM01H(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_TM01H() {
ret void
}
int sim_islower(int c) { return (c >= 'a') && (c <= 'z'); }


x86 assembly (clang, -O0):
<sim_islower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x61,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <sim_islower+0x20>
cmpl   $0x7a,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sim_islower>:
add    $0xffffff9f,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @sim_islower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @sim_islower(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ FIONBIO;
int /*<<< orphan*/ ioctl(int, int /*<<< orphan*/, int *);
void nonblock(int fd) {
  int i = 1;
  ioctl(fd, FIONBIO, &i);
}


x86 assembly (clang, -O0):
<nonblock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nonblock>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <ioctl@plt>
pop    %rax
ret

LLVM IR (-O0):
@FIONBIO = global i32 0
define void @nonblock(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @FIONBIO
%6 = call i32 @ioctl(i32 %4, i32 %5, i32* %3)
ret void
}

LLVM IR (-O2):
@FIONBIO = global i32 0
define void @nonblock(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* @FIONBIO
%5 = call i32 @ioctl(i32 %0, i32 %4, i32* %2)
ret void
}
int *func(int n) { return n; }


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

x86 assembly (clang, -O2):
<func>:
movslq %edi,%rax
ret

LLVM IR (-O0):
define i32* @func(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}

LLVM IR (-O2):
define i32* @func(i32 %0) {
%2 = sext i32 %0 to i64
%3 = inttoptr i64 %2 to i32*
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int i;
  for (i = 0; i < 256; i++) {
    printf("%d - %c \n", i, i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x100,-0x8(%rbp)
jge    1153 <main+0x43>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec0(%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   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%d - %c \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 = %10, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 256
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
br label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %3
13: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"%d - %c \0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 256
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
unsigned long hash_string(unsigned char *str) {
  unsigned long hash = 5381;
  int c;
  while ((c = *str++)) {
    hash = ((hash << 5) + hash) + c;
  }
  return hash;
}


x86 assembly (clang, -O0):
<hash_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114a <hash_string+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hash_string+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_string>:
mov    (%rdi),%cl
test   %cl,%cl
je     112c <hash_string+0x2c>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movzbl %cl,%eax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_string+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @hash_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = zext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
int foo(int i, int *p) {
  int j;
  if (i > 10) {
    if (p) {
      j = *p;
      if (p)
        return j + 1;
    }
  } else {
    j = *p - 3;
    if (!p)
      return j - 4;
  }
  return i;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0xa,-0x8(%rbp)
jle    114c <foo+0x4c>
cmpq   $0x0,-0x10(%rbp)
je     1147 <foo+0x47>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1142 <foo+0x42>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    117c <foo+0x7c>
jmp    1147 <foo+0x47>
jmp    1176 <foo+0x76>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
sub    $0x3,%eax
mov    %eax,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1171 <foo+0x71>
mov    -0x14(%rbp),%eax
sub    $0x4,%eax
mov    %eax,-0x4(%rbp)
jmp    117c <foo+0x7c>
jmp    1176 <foo+0x76>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %edi,%eax
cmp    $0xb,%edi
jl     1111 <foo+0x11>
test   %rsi,%rsi
je     1111 <foo+0x11>
mov    (%rsi),%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32* %1) {
%3 = icmp slt i32 %0, 11
%4 = icmp eq i32* %1, null
%5 = or i1 %3, %4
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
br label %9
9: ; preds = %2, %6
%10 = phi i32 [ %8, %6 ], [ %0, %2 ]
ret i32 %10
}
void handle_read(int epollfd, int fd) {}


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

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

LLVM IR (-O0):
define void @handle_read(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @handle_read(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double r;
  scanf("%lf", &r);
  printf("A=%.4lf\n", (3.14159 * r * r));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  0xeb9(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm1
movsd  0xec3(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [9 x i8] c"A=%.4lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%4 = load double, double* %2
%5 = fmul double 3.141590e+00, %4
%6 = load double, double* %2
%7 = fmul double %5, %6
%8 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), double %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [9 x i8] c"A=%.4lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = fmul double %4, 3.141590e+00
%6 = fmul double %4, %5
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), double %6)
ret i32 0
}
int ars_compiler_abort(struct ars_packet *pkt, int layer) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.ars_packet = type opaque
define i32 @ars_compiler_abort(%struct.ars_packet* nocapture readnone %0, i32 %1) {
ret i32 0
}
unsigned long my_strlen(const char *s) {
  unsigned long count = 0;
  while ('\0' != *s) {
    count += 1;
    s++;
  }
  return count;
}


x86 assembly (clang, -O0):
<my_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     113e <my_strlen+0x3e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <my_strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strlen>:
cmpb   $0x0,(%rdi)
je     111f <my_strlen+0x1f>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <my_strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @my_strlen(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 ]
%7 = add i64 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i64 [ 0, %1 ], [ %7, %4 ]
ret i64 %12
}
void wifi_evt_system_boot(const struct wifi_msg_system_boot_evt_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.wifi_msg_system_boot_evt_t = type opaque
define void @wifi_evt_system_boot(%struct.wifi_msg_system_boot_evt_t* nocapture %0) {
ret void
}
void vnc_keymap_log(const char *format, ...) {}


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

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

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

LLVM IR (-O2):
define void @vnc_keymap_log(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int ExportedFromExe() {
  printf("This output produced by ExportedFromExe.\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<ExportedFromExe>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [42 x i8] c"This output produced by ExportedFromExe.\0A\00"
define i32 @ExportedFromExe() {
%1 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [41 x i8] c"This output produced by ExportedFromExe.\00"
define i32 @ExportedFromExe() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int execute_sched_getaffinity() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_sched_getaffinity() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sqlite3_malloc(int);
int /*<<< orphan*/ sqlite3_malloc64(int);
int /*<<< orphan*/ sqlite3_msize(char *);
void ignoredReturnValue(char *buf) {
  sqlite3_malloc(10);
  sqlite3_malloc64(5);
  sqlite3_msize(buf);
}


x86 assembly (clang, -O0):
<ignoredReturnValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xa,%edi
call   1050 <sqlite3_malloc@plt>
mov    $0x5,%edi
call   1030 <sqlite3_malloc64@plt>
mov    -0x8(%rbp),%rdi
call   1040 <sqlite3_msize@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ignoredReturnValue>:
push   %rbx
mov    %rdi,%rbx
mov    $0xa,%edi
call   1050 <sqlite3_malloc@plt>
mov    $0x5,%edi
call   1030 <sqlite3_malloc64@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <sqlite3_msize@plt>

LLVM IR (-O0):
define void @ignoredReturnValue(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @sqlite3_malloc(i32 10)
%4 = call i32 @sqlite3_malloc64(i32 5)
%5 = load i8*, i8** %2
%6 = call i32 @sqlite3_msize(i8* %5)
ret void
}

LLVM IR (-O2):
define void @ignoredReturnValue(i8* %0) {
%2 = tail call i32 @sqlite3_malloc(i32 10)
%3 = tail call i32 @sqlite3_malloc64(i32 5)
%4 = tail call i32 @sqlite3_msize(i8* %0)
ret void
}
/* Variables and functions */
bool checkRange(int x, int y) {
  if (x > y)
    return false;
  if (x < 2)
    return false;
  return true;
}


x86 assembly (clang, -O0):
<checkRange>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1122 <checkRange+0x22>
movl   $0x0,-0x4(%rbp)
jmp    113f <checkRange+0x3f>
cmpl   $0x2,-0x8(%rbp)
jge    1138 <checkRange+0x38>
movl   $0x0,-0x4(%rbp)
jmp    113f <checkRange+0x3f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkRange>:
cmp    %esi,%edi
setle  %al
cmp    $0x2,%edi
setge  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @checkRange(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 = icmp sgt i32 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 0, i32* %3
br label %15
10: ; preds = %2
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 2
br i1 %12, label %13, label %14
13: ; preds = %10
store i32 0, i32* %3
br label %15
14: ; preds = %10
store i32 1, i32* %3
br label %15
15: ; preds = %14, %13, %9
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @checkRange(i32 %0, i32 %1) {
%3 = icmp sle i32 %0, %1
%4 = icmp sgt i32 %0, 1
%5 = and i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
void inst_timer() {}


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

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

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

LLVM IR (-O2):
define void @inst_timer() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ERR_free_strings();
void crypto_finish(void) { ERR_free_strings(); }


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

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

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

LLVM IR (-O2):
define void @crypto_finish() {
%1 = tail call i32 (...) @ERR_free_strings()
ret void
}
int test_imm_5Euint32_mem(unsigned int *val) {
  return ((*val) & (0x5E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_5Euint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0x5e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_5Euint32_mem>:
testb  $0x5e,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_5Euint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 94
%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_5Euint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 94
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void gdk_gc_new() {}


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

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

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

LLVM IR (-O2):
define void @gdk_gc_new() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ S(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  printf("Informe um numero inteiro positivo: ");
  scanf("%d", &num);
  printf("S = %lf\n", S(num));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <S@plt>
lea    0xec8(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Informe um numero inteiro positivo: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [9 x i8] c"S = %lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @S(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"Informe um numero inteiro positivo: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [9 x i8] c"S = %lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @S(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
void c() { int x[] = {[1 ... 3] = 8}; }


x86 assembly (clang, -O0):
<c>:
push   %rbp
mov    %rsp,%rbp
mov    0xef5(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xef2(%rip),%rax
mov    %rax,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.c.x = [4 x i32] [i32 0, i32 8, i32 8, i32 8]
define void @c() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
ret void
}

LLVM IR (-O2):
define void @c() {
ret void
}
/* Type definitions */
struct cvmx_coremask {
  int dummy;
};

/* Variables and functions */
int cvmx_coremask_is_set_core(struct cvmx_coremask *, int);
scalar_t__ cvmx_get_core_num();
int cvmx_coremask_is_member_bmp(struct cvmx_coremask *pcm) {
  return cvmx_coremask_is_set_core(pcm, (int)cvmx_get_core_num());
}


x86 assembly (clang, -O0):
<cvmx_coremask_is_member_bmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <cvmx_get_core_num@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1030 <cvmx_coremask_is_set_core@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvmx_coremask_is_member_bmp>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <cvmx_get_core_num@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <cvmx_coremask_is_set_core@plt>

LLVM IR (-O0):
%struct.cvmx_coremask = type { i32 }
define i32 @cvmx_coremask_is_member_bmp(%struct.cvmx_coremask* %0) {
%2 = alloca %struct.cvmx_coremask*
store %struct.cvmx_coremask* %0, %struct.cvmx_coremask** %2
%3 = load %struct.cvmx_coremask*, %struct.cvmx_coremask** %2
%4 = call i64 (...) @cvmx_get_core_num()
%5 = trunc i64 %4 to i32
%6 = call i32 @cvmx_coremask_is_set_core(%struct.cvmx_coremask* %3, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
%struct.cvmx_coremask = type { i32 }
define i32 @cvmx_coremask_is_member_bmp(%struct.cvmx_coremask* %0) {
%2 = tail call i64 (...) @cvmx_get_core_num()
%3 = trunc i64 %2 to i32
%4 = tail call i32 @cvmx_coremask_is_set_core(%struct.cvmx_coremask* %0, i32 %3)
ret i32 %4
}
/* Variables and functions */
scalar_t__ shim_enosys(int /*<<< orphan*/, int);
int shim_unshare(int flags) { return (int)shim_enosys(0, flags); }


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

x86 assembly (clang, -O2):
<shim_unshare>:
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <shim_enosys@plt>

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

LLVM IR (-O2):
define i32 @shim_unshare(i32 %0) {
%2 = tail call i64 @shim_enosys(i32 0, i32 %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
int d_blg_rc1(double a1) { return (__builtin_islessgreater(a1, 100)); }


x86 assembly (clang, -O0):
<d_blg_rc1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
ucomisd %xmm1,%xmm0
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_blg_rc1>:
xor    %eax,%eax
ucomisd 0xef6(%rip),%xmm0
setne  %al
ret

LLVM IR (-O0):
define i32 @d_blg_rc1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp one double %3, 1.000000e+02
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @d_blg_rc1(double %0) {
%2 = fcmp one double %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x3c() {
  Assert_real((isupper(60) == 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_isupper.c",
              305, ("isupper should be 0 for <"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0x3c>:
push   %rax
mov    $0x3c,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x131,%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_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for <\00"
define void @t_isupper_0x3c() {
%1 = call i64 @isupper(i32 60)
%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 305, i8* getelementptr inbounds ([26 x i8], [26 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_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for <\00"
define void @t_isupper_0x3c() {
%1 = tail call i64 @isupper(i32 60)
%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 305, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_arr(int *ar, int len) {
  for (int i = 0; i < len; i++) {
    printf("%i ", ar[i]);
  }
  printf("\n");
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%i \00"
define void @print_arr(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void _sleep(int millis) { usleep(1000 * millis); }


x86 assembly (clang, -O0):
<_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x3e8,-0x4(%rbp),%edi
call   1030 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sleep>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @_sleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 1000, %3
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @_sleep(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ atanf(float);
float cosf(int /*<<< orphan*/);
float __attribute__((no, optimize("Ofast"))) cosatanf(float x) {
  return cosf(atanf(x));
}


x86 assembly (clang, -O0):
<cosatanf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <atanf@plt>
mov    %eax,%edi
call   1040 <cosf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cosatanf>:
push   %rax
call   1030 <atanf@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <cosf@plt>

LLVM IR (-O0):
define float @cosatanf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @atanf(float %3)
%5 = call float @cosf(i32 %4)
ret float %5
}

LLVM IR (-O2):
define float @cosatanf(float %0) {
%2 = tail call i32 @atanf(float %0)
%3 = tail call float @cosf(i32 %2)
ret float %3
}
int is_prime(int a) {
  int i;
  if (a < 0)
    return 0;
  if (a == 0)
    return -1;
  for (i = 2; i < a; i++)
    if (a % i == 0)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111d <is_prime+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    117c <is_prime+0x7c>
cmpl   $0x0,-0x8(%rbp)
jne    1133 <is_prime+0x33>
movl   $0xffffffff,-0x4(%rbp)
jmp    117c <is_prime+0x7c>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1175 <is_prime+0x75>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1162 <is_prime+0x62>
movl   $0x0,-0x4(%rbp)
jmp    117c <is_prime+0x7c>
jmp    1167 <is_prime+0x67>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113a <is_prime+0x3a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
xor    %ecx,%ecx
test   %edi,%edi
js     1136 <is_prime+0x36>
je     1139 <is_prime+0x39>
cmp    $0x3,%edi
jb     1130 <is_prime+0x30>
mov    $0x2,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1136 <is_prime+0x36>
add    $0x1,%esi
cmp    %esi,%edi
jne    1120 <is_prime+0x20>
mov    $0x1,%eax
ret
mov    %ecx,%eax
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = icmp eq i32 %0, 0
br i1 %4, label %14, label %5
5: ; preds = %3
%6 = icmp ugt i32 %0, 2
br i1 %6, label %9, label %14
7: ; preds = %9
%8 = icmp eq i32 %13, %0
br i1 %8, label %14, label %9
9: ; preds = %5, %7
%10 = phi i32 [ %13, %7 ], [ 2, %5 ]
%11 = srem i32 %0, %10
%12 = icmp eq i32 %11, 0
%13 = add nuw nsw i32 %10, 1
br i1 %12, label %14, label %7
14: ; preds = %9, %7, %5, %3, %1
%15 = phi i32 [ 0, %1 ], [ -1, %3 ], [ 1, %5 ], [ 0, %9 ], [ 1, %7 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xc0() {
  Assert_real((isodigit(192) == 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_isodigit.c",
              965, ("isodigit should be 0 for 0xc0"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0xc0>:
push   %rax
mov    $0xc0,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x3c5,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xc0\00"
define void @t_isodigit_0xc0() {
%1 = call i64 @isodigit(i32 192)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 965, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xc0\00"
define void @t_isodigit_0xc0() {
%1 = tail call i64 @isodigit(i32 192)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 965, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int hjemvegen123 = 2;
  int i;
  for (i = 0; i < 5; i = i + 1) {
    int hjemvegen123 = 3;
    printf("%d", hjemvegen123);
  }
  printf("%d", hjemvegen123);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    115b <main+0x4b>
movl   $0x3,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
mov    -0x8(%rbp),%esi
lea    0xe9b(%rip),%rdi
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    $0x3,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 3)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 3)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 3)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 0
}