xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int lower_bits(int x, int n) {
  int w = sizeof(int) << 3;
  int mask = ~0;
  n == w || (mask = (1 << n) - 1);
  printf("mask now is %x\n", mask);
  return mask;
}


x86 assembly (clang, -O0):
<lower_bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x20,-0xc(%rbp)
movl   $0xffffffff,-0x10(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%al
cmp    -0xc(%rbp),%ecx
mov    %al,-0x11(%rbp)
je     1156 <lower_bits+0x46>
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
mov    -0x10(%rbp),%esi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower_bits>:
push   %rbx
mov    %esi,%ecx
mov    $0xffffffff,%eax
mov    $0xffffffff,%ebx
shl    %cl,%ebx
cmp    $0x20,%esi
not    %ebx
cmove  %eax,%ebx
lea    0xed2(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"mask now is %x\0A\00"
define i32 @lower_bits(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 32, i32* %5
store i32 -1, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = icmp eq i32 %7, %8
br i1 %9, label %15, label %10
10: ; preds = %2
%11 = load i32, i32* %4
%12 = shl i32 1, %11
%13 = sub nsw i32 %12, 1
store i32 %13, i32* %6
%14 = icmp ne i32 %13, 0
br label %15
15: ; preds = %10, %2
%16 = phi i1 [ true, %2 ], [ %14, %10 ]
%17 = zext i1 %16 to i32
%18 = load i32, i32* %6
%19 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %18)
%20 = load i32, i32* %6
ret i32 %20
}

LLVM IR (-O2):
@.str = [16 x i8] c"mask now is %x\0A\00"
define i32 @lower_bits(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 32
%4 = shl nsw i32 -1, %1
%5 = xor i32 %4, -1
%6 = select i1 %3, i32 -1, i32 %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 %6
}
int st_relayfs_open(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @st_relayfs_open() {
ret i32 0
}
int test_imm_BCuint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0xBC << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_BCuint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x10,%rdx
and    $0xbc,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_BCuint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 188
%6 = icmp ne i64 %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_BCuint64_midword_reg(i64 %0) {
%2 = and i64 %0, 12320768
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int setbits(int x, int p, int n, int y) {
  x = x & (~((~(~0 << n)) << p));
  y = (y & (~(~0 << n))) << p;
  return x | y;
}


x86 assembly (clang, -O0):
<setbits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
xor    $0xffffffff,%edx
mov    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
or     -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setbits>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
mov    %eax,%edx
mov    %esi,%ecx
shl    %cl,%edx
not    %edx
and    %edi,%edx
and    %r8d,%eax
shl    %cl,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @setbits(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %7
%11 = shl i32 -1, %10
%12 = xor i32 %11, -1
%13 = load i32, i32* %6
%14 = shl i32 %12, %13
%15 = xor i32 %14, -1
%16 = and i32 %9, %15
store i32 %16, i32* %5
%17 = load i32, i32* %8
%18 = load i32, i32* %7
%19 = shl i32 -1, %18
%20 = xor i32 %19, -1
%21 = and i32 %17, %20
%22 = load i32, i32* %6
%23 = shl i32 %21, %22
store i32 %23, i32* %8
%24 = load i32, i32* %5
%25 = load i32, i32* %8
%26 = or i32 %24, %25
ret i32 %26
}

LLVM IR (-O2):
define i32 @setbits(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = shl nsw i32 -1, %2
%6 = xor i32 %5, -1
%7 = shl i32 %6, %1
%8 = xor i32 %7, -1
%9 = and i32 %8, %0
%10 = and i32 %6, %3
%11 = shl i32 %10, %1
%12 = or i32 %9, %11
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ assume(int);
int main() {
  int x;
  assume(x >= 0);
  while (x < 100 && x >= 0) {
    x++;
  }
  assert(x >= 100);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assume@plt>
xor    %eax,%eax
cmpl   $0x64,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jge    1159 <main+0x39>
cmpl   $0x0,-0x8(%rbp)
setge  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1169 <main+0x49>
jmp    1177 <main+0x57>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1140 <main+0x20>
cmpl   $0x64,-0x8(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assume(i32 %5)
br label %7
7: ; preds = %15, %0
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 100
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32, i32* %2
%12 = icmp sge i32 %11, 0
br label %13
13: ; preds = %10, %7
%14 = phi i1 [ false, %7 ], [ %12, %10 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 1
store i32 %17, i32* %2
br label %7
18: ; preds = %13
%19 = load i32, i32* %2
%20 = icmp sge i32 %19, 100
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assume(i32 1)
%2 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, int *, int);
void memcpy_integer_Good() {
  int src = 5;
  int dst;
  memcpy(&dst, &src, sizeof(int));
  int a[10];
  a[dst] = 0;
}


x86 assembly (clang, -O0):
<memcpy_integer_Good>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x5,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
movslq -0x8(%rbp),%rax
movl   $0x0,-0x30(%rbp,%rax,4)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcpy_integer_Good>:
push   %rax
movl   $0x5,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @memcpy_integer_Good() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [10 x i32]
store i32 5, i32* %1
%4 = call i32 @memcpy(i32* %2, i32* %1, i32 4)
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %6
store i32 0, i32* %7
ret void
}

LLVM IR (-O2):
define void @memcpy_integer_Good() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 5, i32* %1
%4 = bitcast i32* %2 to i8*
%5 = call i32 @memcpy(i32* %2, i32* %1, i32 4)
ret void
}
__attribute__((no, noclone)) int foo(int x) {
  int v = 0;
  switch (x) {
  case 11:
    v = 67;
    break;
  case 12:
    v = 68;
    break;
  case 13:
    v = 69;
    break;
  }
  return v;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0xb,%eax
je     1144 <foo+0x44>
jmp    1122 <foo+0x22>
mov    -0xc(%rbp),%eax
sub    $0xc,%eax
je     1150 <foo+0x50>
jmp    1133 <foo+0x33>
mov    -0xc(%rbp),%eax
sub    $0xd,%eax
je     115c <foo+0x5c>
jmp    1163 <foo+0x63>
movl   $0x43,-0x8(%rbp)
jmp    1163 <foo+0x63>
movl   $0x44,-0x8(%rbp)
jmp    1163 <foo+0x63>
movl   $0x45,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    -0xb(%rdi),%ecx
lea    0x38(%rdi),%edx
xor    %eax,%eax
cmp    $0x3,%ecx
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
switch i32 %4, label %8 [
i32 11, label %5
i32 12, label %6
i32 13, label %7
]
5: ; preds = %1
store i32 67, i32* %3
br label %8
6: ; preds = %1
store i32 68, i32* %3
br label %8
7: ; preds = %1
store i32 69, i32* %3
br label %8
8: ; preds = %1, %7, %6, %5
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = add i32 %0, -11
%3 = icmp ult i32 %2, 3
%4 = add i32 %0, 56
%5 = select i1 %3, i32 %4, i32 0
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ mpz_t;

/* Variables and functions */
int /*<<< orphan*/ mpz_mul(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
void comp_module(mpz_t p, mpz_t q, mpz_t n) { mpz_mul(n, p, q); }


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

x86 assembly (clang, -O2):
<comp_module>:
mov    %edx,%eax
mov    %esi,%edx
mov    %edi,%esi
mov    %eax,%edi
jmp    1030 <mpz_mul@plt>

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

LLVM IR (-O2):
define void @comp_module(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @mpz_mul(i32 %2, i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ polygon(int, int, int, int);
void colorcube() {
  polygon(0, 3, 2, 1);
  polygon(2, 3, 7, 6);
  polygon(0, 4, 7, 3);
  polygon(1, 2, 6, 5);
  polygon(4, 5, 6, 7);
  polygon(0, 1, 5, 4);
}


x86 assembly (clang, -O0):
<colorcube>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x3,%esi
mov    $0x2,%edx
mov    $0x1,%ecx
call   1030 <polygon@plt>
mov    $0x2,%edi
mov    $0x3,%esi
mov    $0x7,%edx
mov    $0x6,%ecx
call   1030 <polygon@plt>
xor    %edi,%edi
mov    $0x4,%esi
mov    $0x7,%edx
mov    $0x3,%ecx
call   1030 <polygon@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x6,%edx
mov    $0x5,%ecx
call   1030 <polygon@plt>
mov    $0x4,%edi
mov    $0x5,%esi
mov    $0x6,%edx
mov    $0x7,%ecx
call   1030 <polygon@plt>
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x5,%edx
mov    $0x4,%ecx
call   1030 <polygon@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<colorcube>:
push   %rax
xor    %edi,%edi
mov    $0x3,%esi
mov    $0x2,%edx
mov    $0x1,%ecx
call   1030 <polygon@plt>
mov    $0x2,%edi
mov    $0x3,%esi
mov    $0x7,%edx
mov    $0x6,%ecx
call   1030 <polygon@plt>
xor    %edi,%edi
mov    $0x4,%esi
mov    $0x7,%edx
mov    $0x3,%ecx
call   1030 <polygon@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x6,%edx
mov    $0x5,%ecx
call   1030 <polygon@plt>
mov    $0x4,%edi
mov    $0x5,%esi
mov    $0x6,%edx
mov    $0x7,%ecx
call   1030 <polygon@plt>
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x5,%edx
mov    $0x4,%ecx
pop    %rax
jmp    1030 <polygon@plt>

LLVM IR (-O0):
define void @colorcube() {
%1 = call i32 @polygon(i32 0, i32 3, i32 2, i32 1)
%2 = call i32 @polygon(i32 2, i32 3, i32 7, i32 6)
%3 = call i32 @polygon(i32 0, i32 4, i32 7, i32 3)
%4 = call i32 @polygon(i32 1, i32 2, i32 6, i32 5)
%5 = call i32 @polygon(i32 4, i32 5, i32 6, i32 7)
%6 = call i32 @polygon(i32 0, i32 1, i32 5, i32 4)
ret void
}

LLVM IR (-O2):
define void @colorcube() {
%1 = tail call i32 @polygon(i32 0, i32 3, i32 2, i32 1)
%2 = tail call i32 @polygon(i32 2, i32 3, i32 7, i32 6)
%3 = tail call i32 @polygon(i32 0, i32 4, i32 7, i32 3)
%4 = tail call i32 @polygon(i32 1, i32 2, i32 6, i32 5)
%5 = tail call i32 @polygon(i32 4, i32 5, i32 6, i32 7)
%6 = tail call i32 @polygon(i32 0, i32 1, i32 5, i32 4)
ret void
}
/* Variables and functions */
scalar_t__ SH_DoCommand(int, int /*<<< orphan*/, int *);
char SH_GetChar() {
  int nRet;
  while (SH_DoCommand(0x101, 0, &nRet) != 0) {
    if (nRet != 0) {
      SH_DoCommand(0x07, 0, &nRet);
      return (char)nRet;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<SH_GetChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x101,%edi
xor    %esi,%esi
lea    -0x8(%rbp),%rdx
call   1030 <SH_DoCommand@plt>
cmp    $0x0,%rax
je     115c <SH_GetChar+0x4c>
cmpl   $0x0,-0x8(%rbp)
je     1157 <SH_GetChar+0x47>
mov    $0x7,%edi
xor    %esi,%esi
lea    -0x8(%rbp),%rdx
call   1030 <SH_DoCommand@plt>
mov    -0x8(%rbp),%eax
mov    %al,-0x1(%rbp)
jmp    1160 <SH_GetChar+0x50>
jmp    1118 <SH_GetChar+0x8>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SH_GetChar>:
push   %r14
push   %rbx
push   %rax
lea    0x4(%rsp),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    $0x101,%edi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <SH_DoCommand@plt>
test   %rax,%rax
je     1150 <SH_GetChar+0x40>
cmpl   $0x0,0x4(%rsp)
je     1120 <SH_GetChar+0x10>
lea    0x4(%rsp),%rdx
mov    $0x7,%edi
xor    %esi,%esi
call   1030 <SH_DoCommand@plt>
mov    0x4(%rsp),%bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define signext i8 @SH_GetChar() {
%1 = alloca i8
%2 = alloca i32
br label %3
3: ; preds = %13, %0
%4 = call i64 @SH_DoCommand(i32 257, i32 0, i32* %2)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = call i64 @SH_DoCommand(i32 7, i32 0, i32* %2)
%11 = load i32, i32* %2
%12 = trunc i32 %11 to i8
store i8 %12, i8* %1
br label %15
13: ; preds = %6
br label %3
14: ; preds = %3
store i8 0, i8* %1
br label %15
15: ; preds = %14, %9
%16 = load i8, i8* %1
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @SH_GetChar() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %6, %0
%4 = call i64 @SH_DoCommand(i32 257, i32 0, i32* %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3
%7 = load i32, i32* %1
%8 = icmp eq i32 %7, 0
br i1 %8, label %3, label %9
9: ; preds = %6
%10 = call i64 @SH_DoCommand(i32 7, i32 0, i32* %1)
%11 = load i32, i32* %1
%12 = trunc i32 %11 to i8
br label %13
13: ; preds = %3, %9
%14 = phi i8 [ %12, %9 ], [ 0, %3 ]
ret i8 %14
}
void fa138(void) {
P0A:
  goto P0A;
  ({
    P01A:
      goto P01A;
      ({
        P012A:
          goto P012A;
          0;
      });
    P01B:
      goto P01B;
      ({
        P013A:
          goto P013A;
          0;
      });
    P01C:
      goto P01C;
      0;
  });
P0B:
  goto P0B;
  ({
    P02A:
      goto P02A;
      ({
        P024A:
          goto P024A;
          0;
      });
    p02B:
      goto p02B;
      goto a;
    P02B:
      goto P02B;
      ({
        P025A:
          goto P025A;
          0;
      });
    P02C:
      goto P02C;
      0;
  });
a:
  0;
P0D:
  goto P0D;
}


x86 assembly (clang, -O0):
<fa138>:
push   %rbp
mov    %rsp,%rbp
jmp    1104 <fa138+0x4>

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

LLVM IR (-O0):
define void @fa138() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
br label %7
7: ; preds = %7, %0
br label %7
8: ; No predecessors!
br label %9
9: ; preds = %9, %8
br label %9
10: ; No predecessors!
br label %11
11: ; preds = %11, %10
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
br label %14
14: ; preds = %14, %13
br label %14
15: ; preds = %15
br label %15
16: ; preds = %16
br label %16
17: ; No predecessors!
br label %18
18: ; preds = %18, %17
br label %18
19: ; No predecessors!
br label %20
20: ; preds = %20, %19
br label %20
21: ; preds = %21
br label %21
22: ; preds = %22
br label %22
23: ; No predecessors!
br label %24
24: ; preds = %24, %23
br label %24
25: ; preds = %25
br label %25
26: ; No predecessors!
br label %27
27: ; preds = %27, %26
br label %27
}

LLVM IR (-O2):
define void @fa138() {
br label %1
1: ; preds = %1, %0
br label %1
}
void cmd_exec_background(struct tokens *tokens) {}


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

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

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

LLVM IR (-O2):
%struct.tokens = type opaque
define void @cmd_exec_background(%struct.tokens* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint64_t;

/* Variables and functions */
uint64_t pes_get_dts(const uint8_t *p_pes) {
  return (((uint64_t)p_pes[14] & 0xe)) << 29 | (p_pes[15] << 22) |
         ((p_pes[16] & 0xfe) << 14) | (p_pes[17] << 7) |
         ((p_pes[18] & 0xfe) >> 1);
}


x86 assembly (clang, -O0):
<pes_get_dts>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x38(%rax),%eax
and    $0xe,%eax
shl    $0x1d,%eax
mov    -0x8(%rbp),%rcx
mov    0x3c(%rcx),%ecx
shl    $0x16,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x40(%rcx),%ecx
and    $0xfe,%ecx
shl    $0xe,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x44(%rcx),%ecx
shl    $0x7,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x48(%rcx),%ecx
and    $0xfe,%ecx
sar    $0x1,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pes_get_dts>:
mov    0x38(%rdi),%eax
mov    0x3c(%rdi),%ecx
and    $0xfffffffe,%eax
shl    $0x1d,%eax
shl    $0x16,%ecx
or     %eax,%ecx
mov    0x40(%rdi),%eax
shl    $0xe,%eax
and    $0x3f8000,%eax
or     %ecx,%eax
mov    0x44(%rdi),%ecx
shl    $0x7,%ecx
or     %eax,%ecx
mov    0x48(%rdi),%eax
shr    %eax
and    $0x7f,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @pes_get_dts(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 14
%5 = load i32, i32* %4
%6 = and i32 %5, 14
%7 = shl i32 %6, 29
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 15
%10 = load i32, i32* %9
%11 = shl i32 %10, 22
%12 = or i32 %7, %11
%13 = load i32*, i32** %2
%14 = getelementptr inbounds i32, i32* %13, i64 16
%15 = load i32, i32* %14
%16 = and i32 %15, 254
%17 = shl i32 %16, 14
%18 = or i32 %12, %17
%19 = load i32*, i32** %2
%20 = getelementptr inbounds i32, i32* %19, i64 17
%21 = load i32, i32* %20
%22 = shl i32 %21, 7
%23 = or i32 %18, %22
%24 = load i32*, i32** %2
%25 = getelementptr inbounds i32, i32* %24, i64 18
%26 = load i32, i32* %25
%27 = and i32 %26, 254
%28 = ashr i32 %27, 1
%29 = or i32 %23, %28
ret i32 %29
}

LLVM IR (-O2):
define i32 @pes_get_dts(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 14
%3 = load i32, i32* %2
%4 = shl i32 %3, 29
%5 = and i32 %4, -1073741824
%6 = getelementptr inbounds i32, i32* %0, i64 15
%7 = load i32, i32* %6
%8 = shl i32 %7, 22
%9 = or i32 %5, %8
%10 = getelementptr inbounds i32, i32* %0, i64 16
%11 = load i32, i32* %10
%12 = shl i32 %11, 14
%13 = and i32 %12, 4161536
%14 = or i32 %9, %13
%15 = getelementptr inbounds i32, i32* %0, i64 17
%16 = load i32, i32* %15
%17 = shl i32 %16, 7
%18 = or i32 %14, %17
%19 = getelementptr inbounds i32, i32* %0, i64 18
%20 = load i32, i32* %19
%21 = lshr i32 %20, 1
%22 = and i32 %21, 127
%23 = or i32 %18, %22
ret i32 %23
}
void testfunc15(void) {
  int a[10];
  a[1] = 041;
  a[2] = 052;
}


x86 assembly (clang, -O0):
<testfunc15>:
push   %rbp
mov    %rsp,%rbp
movl   $0x21,-0x2c(%rbp)
movl   $0x2a,-0x28(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @testfunc15() {
ret void
}
/* Variables and functions */
int strcmp(void const *, void const *);
int cmp_str(const void *x, const void *y) { return strcmp(x, y); }


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

x86 assembly (clang, -O2):
<cmp_str>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @cmp_str(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void b(void) { printf("bar b() called\n"); }


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

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

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

LLVM IR (-O2):
@str = [15 x i8] c"bar b() called\00"
define void @b() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
int compare(const void *first, const void *second) {
  const int a = *(int *)first;
  const int b = *(int *)second;
  return (a < b) ? -1 : (a > b);
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1137 <compare+0x37>
mov    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    1148 <compare+0x48>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = icmp sgt i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
void EMU_run(char *binPath) {
  (void)printf("EMU_run called\n");
  if ((0) != ROM_load(binPath)) {
    (void)printf("Failed to load ROM: %s\n", binPath);
    return;
  }
  unsigned char *bin = 0u;
  CPU_exec(bin);
}


x86 assembly (clang, -O0):
<EMU_run>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1050 <ROM_load@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     1178 <EMU_run+0x48>
mov    -0x8(%rbp),%rsi
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    118b <EMU_run+0x5b>
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <CPU_exec@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EMU_run>:
push   %rbx
mov    %rdi,%rbx
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <ROM_load@plt>
test   %eax,%eax
je     1170 <EMU_run+0x30>
lea    0xe9b(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>
xor    %edi,%edi
xor    %eax,%eax
pop    %rbx
jmp    1050 <CPU_exec@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"EMU_run called\0A\00"
@.str.1 = [24 x i8] c"Failed to load ROM: %s\0A\00"
define void @EMU_run(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @ROM_load to i32 (i8*, ...)*)(i8* %5)
%7 = icmp ne i32 0, %6
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %9)
br label %14
11: ; preds = %1
store i8* null, i8** %3
%12 = load i8*, i8** %3
%13 = call i32 (i8*, ...) bitcast (i32 (...)* @CPU_exec to i32 (i8*, ...)*)(i8* %12)
br label %14
14: ; preds = %11, %8
ret void
}

LLVM IR (-O2):
@.str.1 = [24 x i8] c"Failed to load ROM: %s\0A\00"
@str = [15 x i8] c"EMU_run called\00"
define void @EMU_run(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ROM_load to i32 (i8*, ...)*)(i8* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %9
7: ; preds = %1
%8 = tail call i32 (i8*, ...) bitcast (i32 (...)* @CPU_exec to i32 (i8*, ...)*)(i8* null)
br label %9
9: ; preds = %7, %5
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[]) {
  puts("argumenty:");
  for (int i = 0; i < argc; i++)
    puts(argv[i]);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1164 <main+0x54>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <puts@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1139 <main+0x29>
mov    0x2e75(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
test   %ebp,%ebp
jle    1142 <main+0x32>
mov    %ebp,%ebp
xor    %ebx,%ebx
nopl   (%rax)
mov    (%r14,%rbx,8),%rdi
call   1030 <puts@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1130 <main+0x20>
mov    0x2e97(%rip),%rax
mov    (%rax),%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"argumenty:\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = zext i32 %0 to i64
br label %9
7: ; preds = %9, %2
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
9: ; preds = %5, %9
%10 = phi i64 [ 0, %5 ], [ %14, %9 ]
%11 = getelementptr inbounds i8*, i8** %1, i64 %10
%12 = load i8*, i8** %11
%13 = tail call i32 @puts(i8* dereferenceable(1) %12)
%14 = add nuw nsw i64 %10, 1
%15 = icmp eq i64 %14, %6
br i1 %15, label %7, label %9
}
int stack_array_top(struct Stack *s) {}


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

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

LLVM IR (-O0):
%struct.Stack = type opaque
define i32 @stack_array_top(%struct.Stack* %0) {
%2 = alloca i32
%3 = alloca %struct.Stack*
store %struct.Stack* %0, %struct.Stack** %3
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
%struct.Stack = type opaque
define i32 @stack_array_top(%struct.Stack* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ mvprintw(int, int, char *);
int /*<<< orphan*/ refresh();
int clean_bottom_line(int row, int col) {
  int i;
  for (i = 0; i < col; ++i) {
    mvprintw(row - 1, i, " ");
    refresh();
  }
  return 0;
}


x86 assembly (clang, -O0):
<clean_bottom_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    116b <clean_bottom_line+0x4b>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
mov    -0xc(%rbp),%esi
lea    0xeaf(%rip),%rdx
call   1040 <mvprintw@plt>
mov    $0x0,%al
call   1030 <refresh@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1135 <clean_bottom_line+0x15>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean_bottom_line>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    115b <clean_bottom_line+0x3b>
mov    %esi,%r15d
mov    %edi,%ebp
add    $0xffffffff,%ebp
lea    0xec6(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    %ebp,%edi
mov    %ebx,%esi
mov    %r14,%rdx
call   1040 <mvprintw@plt>
xor    %eax,%eax
call   1030 <refresh@plt>
add    $0x1,%ebx
cmp    %ebx,%r15d
jne    1140 <clean_bottom_line+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define i32 @clean_bottom_line(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 = %16, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 1
%13 = load i32, i32* %5
%14 = call i32 @mvprintw(i32 %12, i32 %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%15 = call i32 (...) @refresh()
br label %16
16: ; preds = %10
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
br label %6
19: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define i32 @clean_bottom_line(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = add nsw i32 %0, -1
br label %6
6: ; preds = %4, %6
%7 = phi i32 [ 0, %4 ], [ %10, %6 ]
%8 = tail call i32 @mvprintw(i32 %5, i32 %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 (...) @refresh()
%10 = add nuw nsw i32 %7, 1
%11 = icmp eq i32 %10, %1
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ led(long);
int /*<<< orphan*/ stop(int);
int /*<<< orphan*/ usleep(long);
void blink(long int led_id, long int len) {
  led(led_id);
  usleep(len);
  stop(250000);
}


x86 assembly (clang, -O0):
<blink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <led@plt>
mov    -0x10(%rbp),%rdi
call   1050 <usleep@plt>
mov    $0x3d090,%edi
call   1040 <stop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blink>:
push   %rbx
mov    %rsi,%rbx
call   1030 <led@plt>
mov    %rbx,%rdi
call   1050 <usleep@plt>
mov    $0x3d090,%edi
pop    %rbx
jmp    1040 <stop@plt>

LLVM IR (-O0):
define void @blink(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = call i32 @led(i64 %5)
%7 = load i64, i64* %4
%8 = call i32 @usleep(i64 %7)
%9 = call i32 @stop(i32 250000)
ret void
}

LLVM IR (-O2):
define void @blink(i64 %0, i64 %1) {
%3 = tail call i32 @led(i64 %0)
%4 = tail call i32 @usleep(i64 %1)
%5 = tail call i32 @stop(i32 250000)
ret void
}
/* Type definitions */
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int getsockname(int, struct sockaddr *, int *);
int Xgetsockname(int s, struct sockaddr *a, int *l) {
  int rl;
  int code;
  rl = *l;
  code = getsockname(s, a, &rl);
  *l = rl;
  return code;
}


x86 assembly (clang, -O0):
<Xgetsockname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1030 <getsockname@plt>
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Xgetsockname>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
mov    (%rdx),%eax
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdx
call   1030 <getsockname@plt>
mov    0xc(%rsp),%ecx
mov    %ecx,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @Xgetsockname(i32 %0, %struct.sockaddr* %1, i32* %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i32* %2, i32** %6
%9 = load i32*, i32** %6
%10 = load i32, i32* %9
store i32 %10, i32* %7
%11 = load i32, i32* %4
%12 = load %struct.sockaddr*, %struct.sockaddr** %5
%13 = call i32 @getsockname(i32 %11, %struct.sockaddr* %12, i32* %7)
store i32 %13, i32* %8
%14 = load i32, i32* %7
%15 = load i32*, i32** %6
store i32 %14, i32* %15
%16 = load i32, i32* %8
ret i32 %16
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @Xgetsockname(i32 %0, %struct.sockaddr* %1, i32* nocapture %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = load i32, i32* %2
store i32 %6, i32* %4
%7 = call i32 @getsockname(i32 %0, %struct.sockaddr* %1, i32* %4)
%8 = load i32, i32* %4
store i32 %8, i32* %2
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char);
void print_uchar(unsigned char n) { printf("%hhu", n); }


x86 assembly (clang, -O0):
<print_uchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
movzbl -0x1(%rbp),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_uchar>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%hhu\00"
define void @print_uchar(i8 zeroext %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %0)
ret void
}
/* Variables and functions */
int add(int, int);
int /*<<< orphan*/ printf(char *, int, int, int);
int main() { printf("\a\a %d + %d = %d\n", 10, 20, add(10, 20)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
mov    $0x14,%esi
call   1030 <add@plt>
mov    %eax,%ecx
lea    0xec4(%rip),%rdi
mov    $0xa,%esi
mov    $0x14,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
mov    $0x14,%esi
call   1030 <add@plt>
lea    0xec9(%rip),%rdi
mov    $0xa,%esi
mov    $0x14,%edx
mov    %eax,%ecx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"\07\07 %d + %d = %d\0A\00"
define i32 @main() {
%1 = call i32 @add(i32 10, i32 20)
%2 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 10, i32 20, i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"\07\07 %d + %d = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @add(i32 10, i32 20)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 10, i32 20, i32 %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ mpfr_srcptr;
typedef int /*<<< orphan*/ mpfr_ptr;

/* Variables and functions */
int /*<<< orphan*/ MPFR_RNDN;
int mpfr_atan2(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
               int /*<<< orphan*/);
int p1788_fwd_atan2_2(mpfr_ptr rop, mpfr_srcptr op, const void *env) {
  mpfr_srcptr op1 = (mpfr_srcptr)env;
  return mpfr_atan2(rop, op1, op, MPFR_RNDN);
}


x86 assembly (clang, -O0):
<p1788_fwd_atan2_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    0x2eaf(%rip),%rax
mov    (%rax),%ecx
call   1030 <mpfr_atan2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p1788_fwd_atan2_2>:
mov    %esi,%eax
mov    0x2ecf(%rip),%rcx
mov    (%rcx),%ecx
mov    %edx,%esi
mov    %eax,%edx
jmp    1030 <mpfr_atan2@plt>

LLVM IR (-O0):
@MPFR_RNDN = global i32 0
define i32 @p1788_fwd_atan2_2(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = ptrtoint i8* %8 to i32
store i32 %9, i32* %7
%10 = load i32, i32* %4
%11 = load i32, i32* %7
%12 = load i32, i32* %5
%13 = load i32, i32* @MPFR_RNDN
%14 = call i32 @mpfr_atan2(i32 %10, i32 %11, i32 %12, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
@MPFR_RNDN = global i32 0
define i32 @p1788_fwd_atan2_2(i32 %0, i32 %1, i8* %2) {
%4 = ptrtoint i8* %2 to i64
%5 = trunc i64 %4 to i32
%6 = load i32, i32* @MPFR_RNDN
%7 = tail call i32 @mpfr_atan2(i32 %0, i32 %5, i32 %1, i32 %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_getpwnam_malloc() {
  printf("NOT IMPLEMENTED:"
         "pa_getpwnam_malloc"
         "\n");
}


x86 assembly (clang, -O0):
<pa_getpwnam_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [36 x i8] c"NOT IMPLEMENTED:pa_getpwnam_malloc\0A\00"
define i32 @pa_getpwnam_malloc() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [35 x i8] c"NOT IMPLEMENTED:pa_getpwnam_malloc\00"
define i32 @pa_getpwnam_malloc() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int fromRep16(int);
uint16_t makeNaN16(uint16_t rand) {
  return fromRep16(0x7c00U | (rand & 0x7fffU));
}


x86 assembly (clang, -O0):
<makeNaN16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
and    $0x7fff,%edi
or     $0x7c00,%edi
call   1030 <fromRep16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeNaN16>:
and    $0x3ff,%edi
or     $0x7c00,%edi
jmp    1030 <fromRep16@plt>

LLVM IR (-O0):
define i32 @makeNaN16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 32767
%5 = or i32 31744, %4
%6 = call i32 @fromRep16(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @makeNaN16(i32 %0) {
%2 = and i32 %0, 1023
%3 = or i32 %2, 31744
%4 = tail call i32 @fromRep16(i32 %3)
ret i32 %4
}
void DMTimerCounterSet(unsigned int baseAdd, unsigned int counter) {
  (*((volatile unsigned int *)(baseAdd + (0x3C)))) = counter;
}


x86 assembly (clang, -O0):
<DMTimerCounterSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x3c,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<DMTimerCounterSet>:
add    $0x3c,%edi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @DMTimerCounterSet(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = add i32 %6, 60
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store volatile i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @DMTimerCounterSet(i32 %0, i32 %1) {
%3 = add i32 %0, 60
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
store volatile i32 %1, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int print3(int x) {
  printf("2 + %d = %d", x, 2 + x);
  return 2 + x;
}


x86 assembly (clang, -O0):
<print3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
add    $0x2,%edx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x2,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print3>:
push   %rbx
mov    %edi,%esi
lea    0x2(%rsi),%ebx
lea    0xee3(%rip),%rdi
mov    %ebx,%edx
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"2 + %d = %d\00"
define i32 @print3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 2, %4
%6 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5)
%7 = load i32, i32* %2
%8 = add nsw i32 2, %7
ret i32 %8
}

LLVM IR (-O2):
@.str = [12 x i8] c"2 + %d = %d\00"
define i32 @print3(i32 %0) {
%2 = add nsw i32 %0, 2
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %2)
ret i32 %2
}
/* Variables and functions */
int add_el_full(char *, int, int, int);
int add_arc(int left, int con, int right, char *id) {
  con = (con & ((0x80 | 0x40 | 0x100) | (0x20 | 0x10 | 0x08))) | 0x02;
  return add_el_full(id, con, left, right);
}


x86 assembly (clang, -O0):
<add_arc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1f8,%eax
or     $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0xc(%rbp),%ecx
call   1030 <add_el_full@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_arc>:
mov    %edx,%eax
mov    %edi,%edx
and    $0x1f8,%esi
or     $0x2,%esi
mov    %rcx,%rdi
mov    %eax,%ecx
jmp    1030 <add_el_full@plt>

LLVM IR (-O0):
define i32 @add_arc(i32 %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i32, i32* %6
%10 = and i32 %9, 504
%11 = or i32 %10, 2
store i32 %11, i32* %6
%12 = load i8*, i8** %8
%13 = load i32, i32* %6
%14 = load i32, i32* %5
%15 = load i32, i32* %7
%16 = call i32 @add_el_full(i8* %12, i32 %13, i32 %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @add_arc(i32 %0, i32 %1, i32 %2, i8* %3) {
%5 = and i32 %1, 504
%6 = or i32 %5, 2
%7 = tail call i32 @add_el_full(i8* %3, i32 %6, i32 %0, i32 %2)
ret i32 %7
}
void fn_1(int unused) {}


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

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

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

LLVM IR (-O2):
define void @fn_1(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ randomScore(int *);
void test_randomScore() {
  printf("Teste of randomScore()...\n");
  int score = 0;
  randomScore(&score);
  printf("Found: %d\n", score);
}


x86 assembly (clang, -O0):
<test_randomScore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1040 <randomScore@plt>
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_randomScore>:
push   %rax
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1050 <randomScore@plt>
mov    0x4(%rsp),%esi
lea    0xea6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Teste of randomScore()...\0A\00"
@.str.1 = [11 x i8] c"Found: %d\0A\00"
define void @test_randomScore() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
%3 = call i32 @randomScore(i32* %1)
%4 = load i32, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str.1 = [11 x i8] c"Found: %d\0A\00"
@str = [26 x i8] c"Teste of randomScore()...\00"
define void @test_randomScore() {
%1 = alloca i32
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = call i32 @randomScore(i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret void
}