xunge/DecIR huggingface dataset:
unsigned int vseteq4(unsigned int a, unsigned int b) {
  unsigned int r, c;
  r = a ^ b;
  c = r | 0x80808080;
  r = r ^ c;
  c = c - 0x01010101;
  c = r & ~c;
  r = c >> 7;
  return r;
}


x86 assembly (clang, -O0):
<vseteq4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
or     $0x80808080,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1010101,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shr    $0x7,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vseteq4>:
xor    %esi,%edi
mov    %edi,%ecx
or     $0x80808080,%ecx
xor    %ecx,%edi
mov    $0x1010100,%eax
sub    %ecx,%eax
and    %edi,%eax
shr    $0x7,%eax
ret

LLVM IR (-O0):
define i32 @vseteq4(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
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = xor i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = or i32 %10, -2139062144
store i32 %11, i32* %6
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = xor i32 %12, %13
store i32 %14, i32* %5
%15 = load i32, i32* %6
%16 = sub i32 %15, 16843009
store i32 %16, i32* %6
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = xor i32 %18, -1
%20 = and i32 %17, %19
store i32 %20, i32* %6
%21 = load i32, i32* %6
%22 = lshr i32 %21, 7
store i32 %22, i32* %5
%23 = load i32, i32* %5
ret i32 %23
}

LLVM IR (-O2):
define i32 @vseteq4(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
%4 = or i32 %3, -2139062144
%5 = xor i32 %4, %3
%6 = sub i32 16843008, %4
%7 = and i32 %5, %6
%8 = lshr i32 %7, 7
ret i32 %8
}
void spi_tx() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ SIGUSR1;
int /*<<< orphan*/ error(char *, int);
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
void child(pid_t pid) {
  while (1) {
    sleep(2);
    kill(pid, SIGUSR1);
  }
  error("child process failed to terminate correctly", 246);
}


x86 assembly (clang, -O0):
<child>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x2,%edi
call   1040 <sleep@plt>
mov    -0x4(%rbp),%edi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
call   1030 <kill@plt>
jmp    112b <child+0xb>

x86 assembly (clang, -O2):
<child>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ebb(%rip),%r14
nopl   (%rax)
mov    $0x2,%edi
call   1040 <sleep@plt>
mov    (%r14),%esi
mov    %ebx,%edi
call   1030 <kill@plt>
jmp    1130 <child+0x10>

LLVM IR (-O0):
@SIGUSR1 = global i32 0
define void @child(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1, %3
%4 = call i32 @sleep(i32 2)
%5 = load i32, i32* %2
%6 = load i32, i32* @SIGUSR1
%7 = call i32 @kill(i32 %5, i32 %6)
br label %3
}

LLVM IR (-O2):
@SIGUSR1 = global i32 0
define void @child(i32 %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 @sleep(i32 2)
%4 = load i32, i32* @SIGUSR1
%5 = tail call i32 @kill(i32 %0, i32 %4)
br label %2
}
void round_robin() {}


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

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

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

LLVM IR (-O2):
define void @round_robin() {
ret void
}
/* Variables and functions */
double sin_73(double);
double poly_sin(double x) { return sin_73(x); }


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

x86 assembly (clang, -O2):
<poly_sin>:
jmp    1030 <sin_73@plt>

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

LLVM IR (-O2):
define double @poly_sin(double %0) {
%2 = tail call double @sin_73(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ link_error();
void foo(unsigned int s) {
  if (s + 0x70000000 < 0xf0000000U) {
    if (s >= 0x80000000U && s < 0x90000000U)
      link_error();
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70000000,%eax
cmp    $0xf0000000,%eax
jae    1154 <foo+0x44>
cmpl   $0x80000000,-0x4(%rbp)
jb     114f <foo+0x3f>
cmpl   $0x90000000,-0x4(%rbp)
jae    114f <foo+0x3f>
mov    $0x0,%al
call   1030 <link_error@plt>
jmp    1154 <foo+0x44>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 1879048192
%5 = icmp ult i32 %4, -268435456
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp uge i32 %7, -2147483648
br i1 %8, label %9, label %14
9: ; preds = %6
%10 = load i32, i32* %2
%11 = icmp ult i32 %10, -1879048192
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = call i32 (...) @link_error()
br label %14
14: ; preds = %12, %9, %6
br label %15
15: ; preds = %14, %1
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("hello, world!\n");
  return 1;
}


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"hello, world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 1
}
int pixel_get_r(unsigned int pixel) { return pixel & 0xFF; }


x86 assembly (clang, -O0):
<pixel_get_r>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pixel_get_r>:
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @pixel_get_r(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
ret i32 %4
}

LLVM IR (-O2):
define i32 @pixel_get_r(i32 %0) {
%2 = and i32 %0, 255
ret i32 %2
}
void filter_deinit(void) {}


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

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

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

LLVM IR (-O2):
define void @filter_deinit() {
ret void
}
int test_imm_CBint64_midword_reg(long long val) {
  return ((val >> 16) & (0xCB << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_CBint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 203
%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_CBint64_midword_reg(i64 %0) {
%2 = and i64 %0, 13303808
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int comparar(long int A, long int B) {
  if (A > B || A == -1)
    return 1;
  if (A == B)
    return 0;
  return -1;
}


x86 assembly (clang, -O0):
<comparar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jg     1125 <comparar+0x25>
cmpq   $0xffffffffffffffff,-0x10(%rbp)
jne    1131 <comparar+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1152 <comparar+0x52>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    114b <comparar+0x4b>
movl   $0x0,-0x4(%rbp)
jmp    1152 <comparar+0x52>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comparar>:
xor    %eax,%eax
cmp    %rsi,%rdi
setne  %al
neg    %eax
cmp    %rsi,%rdi
mov    $0x1,%ecx
cmovg  %ecx,%eax
cmp    $0xffffffffffffffff,%rdi
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @comparar(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = icmp eq i64 %0, -1
%5 = or i1 %4, %3
%6 = icmp ne i64 %0, %1
%7 = sext i1 %6 to i32
%8 = select i1 %5, i32 1, i32 %7
ret i32 %8
}
int isspace(c)
char c;
{ return c == ' ' || c == '\t' || c == '\n'; }


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     113b <isspace+0x3b>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x2(%rbp)
je     113b <isspace+0x3b>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
shl    $0x18,%edi
mov    $0x1,%eax
cmp    $0x9000000,%edi
je     1118 <isspace+0x18>
cmp    $0x20000000,%edi
jne    1119 <isspace+0x19>
ret
xor    %eax,%eax
cmp    $0xa000000,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isspace(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 32
br i1 %6, label %15, label %7
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 9
br i1 %10, label %15, label %11
11: ; preds = %7
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 10
br label %15
15: ; preds = %11, %7, %1
%16 = phi i1 [ true, %7 ], [ true, %1 ], [ %14, %11 ]
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
%2 = shl i32 %0, 24
switch i32 %2, label %3 [
i32 536870912, label %6
i32 150994944, label %6
]
3: ; preds = %1
%4 = icmp eq i32 %2, 167772160
%5 = zext i1 %4 to i32
br label %6
6: ; preds = %1, %1, %3
%7 = phi i32 [ 1, %1 ], [ %5, %3 ], [ 1, %1 ]
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ j64_true_encode(char *, int);
int /*<<< orphan*/ memset(char *, char, int);
scalar_t__ strcmp(char *, char *);
int test_true_encode_4(void) {
  char buf[4 + 1];
  memset(buf, '\0', sizeof(buf));
  j64_true_encode(buf, 4);
  return strcmp(buf, "true") == 0;
}


x86 assembly (clang, -O0):
<test_true_encode_4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x5(%rbp),%rdi
xor    %esi,%esi
mov    $0x5,%edx
call   1040 <memset@plt>
lea    -0x5(%rbp),%rdi
mov    $0x4,%esi
call   1030 <j64_true_encode@plt>
lea    -0x5(%rbp),%rdi
lea    0xe9f(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_true_encode_4>:
push   %rbx
sub    $0x10,%rsp
lea    0xb(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x5,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <j64_true_encode@plt>
lea    0xea3(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"true\00"
define i32 @test_true_encode_4() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i8 signext 0, i32 5)
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%5 = call i32 @j64_true_encode(i8* %4, i32 4)
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%7 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
@.str = [5 x i8] c"true\00"
define i32 @test_true_encode_4() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i8 signext 0, i32 5)
%4 = call i32 @j64_true_encode(i8* %2, i32 4)
%5 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
int clamp(int value) {
  if (value < 1)
    return 1;
  else if (value > 255)
    return 255;
  else
    return value;
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    111d <clamp+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    113c <clamp+0x3c>
cmpl   $0xff,-0x8(%rbp)
jle    1136 <clamp+0x36>
movl   $0xff,-0x4(%rbp)
jmp    113c <clamp+0x3c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
cmp    $0xff,%edi
mov    $0xff,%ecx
cmovl  %edi,%ecx
test   %ecx,%ecx
mov    $0x1,%eax
cmovg  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @clamp(i32 %0) {
%2 = icmp slt i32 %0, 255
%3 = select i1 %2, i32 %0, i32 255
%4 = icmp sgt i32 %3, 1
%5 = select i1 %4, i32 %3, i32 1
ret i32 %5
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int);
void main() { printf("Hello from the program exec2 with PID: %d\n", getpid()); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"Hello from the program exec2 with PID: %d\0A\00"
define void @main() {
%1 = call i32 (...) @getpid()
%2 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"Hello from the program exec2 with PID: %d\0A\00"
define void @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
void waste_time() {
  long int i, z;
  for (i = 0L; i < 1000000L; i++)
    z = i * i - (i + 1) * (i + 1);
}


x86 assembly (clang, -O0):
<waste_time>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
cmpq   $0xf4240,-0x8(%rbp)
jge    114f <waste_time+0x4f>
mov    -0x8(%rbp),%rax
imul   -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
add    $0x1,%rcx
mov    -0x8(%rbp),%rdx
add    $0x1,%rdx
imul   %rdx,%rcx
sub    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <waste_time+0xc>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @waste_time() {
%1 = alloca i64
%2 = alloca i64
store i64 0, i64* %1
br label %3
3: ; preds = %16, %0
%4 = load i64, i64* %1
%5 = icmp slt i64 %4, 1000000
br i1 %5, label %6, label %19
6: ; preds = %3
%7 = load i64, i64* %1
%8 = load i64, i64* %1
%9 = mul nsw i64 %7, %8
%10 = load i64, i64* %1
%11 = add nsw i64 %10, 1
%12 = load i64, i64* %1
%13 = add nsw i64 %12, 1
%14 = mul nsw i64 %11, %13
%15 = sub nsw i64 %9, %14
store i64 %15, i64* %2
br label %16
16: ; preds = %6
%17 = load i64, i64* %1
%18 = add nsw i64 %17, 1
store i64 %18, i64* %1
br label %3
19: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @waste_time() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int a = 2;
  printf("%d", a);
  scanf("%d", &a);
  printf("%d", a);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x2,0xc(%rsp)
lea    0xecc(%rip),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 2, i32* %1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
extern unsigned short __inwc(unsigned short port) {
  unsigned short _v;
  __asm__ __volatile__("in"
                       "w"
                       " %"
                       ""
                       "1,%"
                       ""
                       "0"
                       : "=a"(_v)
                       : "id"(port));
  return _v;
}


x86 assembly (clang, -O0):
<__inwc>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%ax
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__inwc>:
mov    %edi,%edx
in     (%dx),%ax
ret

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

LLVM IR (-O2):
define zeroext i16 @__inwc(i16 zeroext %0) {
%2 = tail call i16 asm sideeffect "inw $1,$0", "={ax},i{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i16 %2
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *strclone(char *s) {
  if (s) {
    char *res = (char *)malloc(strlen(s) + 1);
    strcpy(res, s);
    return res;
  } else
    return NULL;
}


x86 assembly (clang, -O0):
<strclone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     117a <strclone+0x4a>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1182 <strclone+0x52>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strclone>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     115a <strclone+0x2a>
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
jmp    115d <strclone+0x2d>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strclone(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = add nsw i64 %4, 1
%6 = tail call i64 @malloc(i64 %5)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @strcpy(i8* %7, i8* %0)
br label %9
9: ; preds = %1, %3
%10 = phi i8* [ %7, %3 ], [ null, %1 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_arm_wsr(char *, unsigned int);
void wsr_3(unsigned v) { __builtin_arm_wsr("0:1:2", v); }


x86 assembly (clang, -O0):
<wsr_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <__builtin_arm_wsr@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"0:1:2\00"
define void @wsr_3(i32 %0) {
%2 = tail call i32 @__builtin_arm_wsr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
long double test_cbrtl(long double x) { return __builtin_cbrtl(x); }


x86 assembly (clang, -O0):
<test_cbrtl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <cbrtl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_cbrtl>:
jmp    1030 <cbrtl@plt>

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

LLVM IR (-O2):
define x86_fp80 @test_cbrtl(x86_fp80 %0) {
%2 = tail call x86_fp80 @cbrtl(x86_fp80 %0)
ret x86_fp80 %2
}
void ff_hevc_put_hevc_uni_epel_v64_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_v64_8_sse4() {
ret void
}
const char *check_cptr_ATTRchar(const char *v) { return v; }


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

x86 assembly (clang, -O2):
<check_cptr_ATTRchar>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @check_cptr_ATTRchar(i8* readnone returned %0) {
ret i8* %0
}
void PWM_IRQHandler(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<PWM_IRQHandler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <PWM_IRQHandler+0x9>
jmp    1109 <PWM_IRQHandler+0x9>

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

LLVM IR (-O0):
define void @PWM_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @PWM_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
void CmdNewblock(int code) {}


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

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

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

LLVM IR (-O2):
define void @CmdNewblock(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printstr(char *);
int main(int argc, char *argv[]) {
  char str[] = "Teste!";
  printstr(str);
  return 0;
}


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)
mov    0xed4(%rip),%eax
mov    %eax,-0x17(%rbp)
mov    0xece(%rip),%ax
mov    %ax,-0x13(%rbp)
mov    0xec6(%rip),%al
mov    %al,-0x11(%rbp)
lea    -0x17(%rbp),%rdi
call   1030 <printstr@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x216574,0x3(%rsp)
movl   $0x74736554,(%rsp)
mov    %rsp,%rdi
call   1030 <printstr@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.str = [7 x i8] c"Teste!\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [7 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [7 x i8]* %6 to i8*
%8 = getelementptr inbounds [7 x i8], [7 x i8]* %6, i64 0, i64 0
%9 = call i32 @printstr(i8* %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [7 x i8] c"Teste!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [7 x i8]
%4 = getelementptr inbounds [7 x i8], [7 x i8]* %3, i64 0, i64 0
%5 = call i32 @printstr(i8* %4)
ret i32 0
}
int f7(float x) { return x == 3.14159; }


x86 assembly (clang, -O0):
<f7>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f7>:
cvtss2sd %xmm0,%xmm0
cmpeqsd 0xef3(%rip),%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @f7(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fcmp oeq double %4, 3.141590e+00
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @f7(float %0) {
%2 = fpext float %0 to double
%3 = fcmp oeq double %2, 3.141590e+00
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int bar(char *x) { return __VERIFIER_nondet_int(); }


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

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

LLVM IR (-O0):
define i32 @bar(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @__VERIFIER_nondet_int()
ret i32 %3
}

LLVM IR (-O2):
define i32 @bar(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
int lwm2m_int64ToPlainText(int /*<<< orphan*/, char **);
int lwm2m_int32ToPlainText(int32_t data, char **bufferP) {
  return lwm2m_int64ToPlainText((int64_t)data, bufferP);
}


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

x86 assembly (clang, -O2):
<lwm2m_int32ToPlainText>:
jmp    1030 <lwm2m_int64ToPlainText@plt>

LLVM IR (-O0):
define i32 @lwm2m_int32ToPlainText(i64 %0, i8** %1) {
%3 = alloca i64
%4 = alloca i8**
store i64 %0, i64* %3
store i8** %1, i8*** %4
%5 = load i64, i64* %3
%6 = trunc i64 %5 to i32
%7 = load i8**, i8*** %4
%8 = call i32 @lwm2m_int64ToPlainText(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @lwm2m_int32ToPlainText(i64 %0, i8** %1) {
%3 = trunc i64 %0 to i32
%4 = tail call i32 @lwm2m_int64ToPlainText(i32 %3, i8** %1)
ret i32 %4
}
void foo_2_2_2_2_1_1_1_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_2_2_1_1_1_2_2() {
ret void
}
int uvmperm(void) {
  return (1 << 10) | (3 << 8) | (3 << 2) | (0 << 7) | (1 << 6);
}


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

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

LLVM IR (-O0):
define i32 @uvmperm() {
ret i32 1868
}

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

/* Variables and functions */
int _wmo_read_any_from_file(int /*<<< orphan*/ *, void *, size_t *, int, int);
int wmo_read_any_from_file(FILE *f, void *buffer, size_t *len) {
  return _wmo_read_any_from_file(f, buffer, len, 1, 1);
}


x86 assembly (clang, -O0):
<wmo_read_any_from_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x1,%r8d
mov    %r8d,%ecx
call   1030 <_wmo_read_any_from_file@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wmo_read_any_from_file>:
mov    $0x1,%ecx
mov    $0x1,%r8d
jmp    1030 <_wmo_read_any_from_file@plt>

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

LLVM IR (-O2):
define i32 @wmo_read_any_from_file(i32* %0, i8* %1, i64* %2) {
%4 = tail call i32 @_wmo_read_any_from_file(i32* %0, i8* %1, i64* %2, i32 1, i32 1)
ret i32 %4
}
int length(str)
char *str;
{
  register char *s;
  register int n;
  for (n = 0, s = str; *s++;)
    n++;
  return (n + 1);
}


x86 assembly (clang, -O0):
<length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,(%rax)
je     113d <length+0x3d>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <length+0x17>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<length>:
cmpb   $0x0,(%rdi)
je     111b <length+0x1b>
mov    $0x1,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <length+0x10>
ret
mov    $0x1,%eax
ret

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

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


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

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

LLVM IR (-O0):
define zeroext i8 @GetBeaconAmpRight() {
ret i8 0
}

LLVM IR (-O2):
define zeroext i8 @GetBeaconAmpRight() {
ret i8 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ posix_memalign(void **, size_t, size_t);
void *dav1d_alloc_aligned(size_t sz, size_t align) {
  assert(!(align & (align - 1)));
  void *ptr;
  if (posix_memalign(&ptr, align, sz))
    return NULL;
  return ptr;
}


x86 assembly (clang, -O0):
<dav1d_alloc_aligned>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    -0x20(%rbp),%rdi
call   1040 <posix_memalign@plt>
cmp    $0x0,%rax
je     117a <dav1d_alloc_aligned+0x5a>
movq   $0x0,-0x8(%rbp)
jmp    1182 <dav1d_alloc_aligned+0x62>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dav1d_alloc_aligned>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    -0x1(%rsi),%rax
xor    %edi,%edi
test   %rax,%rsi
sete   %dil
call   1030 <assert@plt>
mov    %rsp,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <posix_memalign@plt>
test   %rax,%rax
jne    1155 <dav1d_alloc_aligned+0x35>
mov    (%rsp),%rax
jmp    1157 <dav1d_alloc_aligned+0x37>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @dav1d_alloc_aligned(i64 %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
store i64 %0, i64* %4
store i64 %1, i64* %5
%7 = load i64, i64* %5
%8 = load i64, i64* %5
%9 = sub i64 %8, 1
%10 = and i64 %7, %9
%11 = icmp ne i64 %10, 0
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i64, i64* %5
%16 = load i64, i64* %4
%17 = call i64 @posix_memalign(i8** %6, i64 %15, i64 %16)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %2
store i8* null, i8** %3
br label %22
20: ; preds = %2
%21 = load i8*, i8** %6
store i8* %21, i8** %3
br label %22
22: ; preds = %20, %19
%23 = load i8*, i8** %3
ret i8* %23
}

LLVM IR (-O2):
define i8* @dav1d_alloc_aligned(i64 %0, i64 %1) {
%3 = alloca i8*
%4 = tail call i64 @llvm.ctpop.i64(i64 %1)
%5 = icmp ult i64 %4, 2
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = bitcast i8** %3 to i8*
%9 = call i64 @posix_memalign(i8** %3, i64 %1, i64 %0)
%10 = icmp eq i64 %9, 0
%11 = load i8*, i8** %3
%12 = select i1 %10, i8* %11, i8* null
ret i8* %12
}
void quit(status) int status;
{
  tidy_utmp();
  omshell_quit(status);
}


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

x86 assembly (clang, -O2):
<quit>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <tidy_utmp@plt>
mov    %ebx,%edi
xor    %eax,%eax
pop    %rbx
jmp    1040 <omshell_quit@plt>

LLVM IR (-O0):
define void @quit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @tidy_utmp()
%4 = load i32, i32* %2
%5 = call i32 (i32, ...) bitcast (i32 (...)* @omshell_quit to i32 (i32, ...)*)(i32 %4)
ret void
}

LLVM IR (-O2):
define void @quit(i32 %0) {
%2 = tail call i32 (...) @tidy_utmp()
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @omshell_quit to i32 (i32, ...)*)(i32 %0)
ret void
}
int StringNumComparisonIntLength(char *input, int length) {
  int output = length;
  int i = 0;
  for (i = 0; i < length; i++) {
    if (input[i] == '0')
      output--;
    else
      break;
  }
  return output;
}


x86 assembly (clang, -O0):
<StringNumComparisonIntLength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1166 <StringNumComparisonIntLength+0x66>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x30,%eax
jne    114e <StringNumComparisonIntLength+0x4e>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1153 <StringNumComparisonIntLength+0x53>
jmp    1166 <StringNumComparisonIntLength+0x66>
jmp    1158 <StringNumComparisonIntLength+0x58>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111f <StringNumComparisonIntLength+0x1f>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<StringNumComparisonIntLength>:
mov    %esi,%eax
test   %esi,%esi
jle    1127 <StringNumComparisonIntLength+0x27>
mov    %eax,%ecx
neg    %rcx
xor    %edx,%edx
nopl   (%rax)
cmpb   $0x30,(%rdi,%rdx,1)
jne    1127 <StringNumComparisonIntLength+0x27>
add    $0xffffffff,%eax
add    $0x1,%rdx
mov    %rcx,%rsi
add    %rdx,%rsi
jne    1110 <StringNumComparisonIntLength+0x10>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @StringNumComparisonIntLength(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
store i32 %7, i32* %5
store i32 0, i32* %6
store i32 0, i32* %6
br label %8
8: ; preds = %25, %2
%9 = load i32, i32* %6
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %28
12: ; preds = %8
%13 = load i8*, i8** %3
%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 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 48
br i1 %19, label %20, label %23
20: ; preds = %12
%21 = load i32, i32* %5
%22 = add nsw i32 %21, -1
store i32 %22, i32* %5
br label %24
23: ; preds = %12
br label %28
24: ; preds = %20
br label %25
25: ; preds = %24
%26 = load i32, i32* %6
%27 = add nsw i32 %26, 1
store i32 %27, i32* %6
br label %8
28: ; preds = %23, %8
%29 = load i32, i32* %5
ret i32 %29
}

LLVM IR (-O2):
define i32 @StringNumComparisonIntLength(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %12
%7 = phi i64 [ 0, %4 ], [ %14, %12 ]
%8 = phi i32 [ %1, %4 ], [ %13, %12 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %7
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 48
br i1 %11, label %12, label %16
12: ; preds = %6
%13 = add nsw i32 %8, -1
%14 = add nuw nsw i64 %7, 1
%15 = icmp eq i64 %14, %5
br i1 %15, label %16, label %6
16: ; preds = %12, %6, %2
%17 = phi i32 [ %1, %2 ], [ %8, %6 ], [ 0, %12 ]
ret i32 %17
}
int main() { return -1 << 2; }


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

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

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

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

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void gt_get_ts(char *str) {
  time_t t = time(NULL);
  struct tm *lt = localtime(&t);
  *str = '\0';
  strftime(str, 100, "%Y-%b-%d @ %r", lt);
}


x86 assembly (clang, -O0):
<gt_get_ts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x64,%esi
lea    0xe90(%rip),%rdx
call   1050 <strftime@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gt_get_ts>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
movb   $0x0,(%rbx)
lea    0xea9(%rip),%rdx
mov    %rbx,%rdi
mov    $0x64,%esi
mov    %rax,%rcx
call   1050 <strftime@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [14 x i8] c"%Y-%b-%d @ %r\00"
define void @gt_get_ts(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.tm*
store i8* %0, i8** %2
%5 = call i32 @time(i32* null)
store i32 %5, i32* %3
%6 = call %struct.tm* @localtime(i32* %3)
store %struct.tm* %6, %struct.tm** %4
%7 = load i8*, i8** %2
store i8 0, i8* %7
%8 = load i8*, i8** %2
%9 = load %struct.tm*, %struct.tm** %4
%10 = call i32 @strftime(i8* %8, i32 100, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), %struct.tm* %9)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [14 x i8] c"%Y-%b-%d @ %r\00"
define void @gt_get_ts(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @time(i32* null)
store i32 %4, i32* %2
%5 = call %struct.tm* @localtime(i32* %2)
store i8 0, i8* %0
%6 = call i32 @strftime(i8* %0, i32 100, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), %struct.tm* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ vfork();
int /*<<< orphan*/ wait(int /*<<< orphan*/);
int /*<<< orphan*/ write(int, char *, int);
int main(int argc, char *argv[]) {
  if (vfork() == 0) {
    write(1, "child\n", 6);
  } else {
    wait(0);
    write(1, "parent\n", 7);
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <vfork@plt>
cmp    $0x0,%rax
jne    1182 <main+0x42>
mov    $0x1,%edi
lea    0xe8d(%rip),%rsi
mov    $0x6,%edx
call   1030 <write@plt>
jmp    119f <main+0x5f>
xor    %edi,%edi
call   1060 <wait@plt>
mov    $0x1,%edi
lea    0xe72(%rip),%rsi
mov    $0x7,%edx
call   1030 <write@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <vfork@plt>
test   %rax,%rax
jne    115b <main+0x1b>
lea    0xeac(%rip),%rsi
mov    $0x6,%edx
jmp    116e <main+0x2e>
xor    %edi,%edi
call   1060 <wait@plt>
lea    0xe9e(%rip),%rsi
mov    $0x7,%edx
mov    $0x1,%edi
call   1030 <write@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"child\0A\00"
@.str.1 = [8 x i8] c"parent\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i64 (...) @vfork()
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @write(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
br label %13
10: ; preds = %2
%11 = call i32 @wait(i32 0)
%12 = call i32 @write(i32 1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 7)
br label %13
13: ; preds = %10, %8
%14 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [7 x i8] c"child\0A\00"
@.str.1 = [8 x i8] c"parent\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 (...) @vfork()
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @wait(i32 0)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 7, %5 ], [ 6, %2 ]
%9 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), %5 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), %2 ]
%10 = tail call i32 @write(i32 1, i8* %9, i32 %8)
%11 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
float RAND_MAX;
scalar_t__ random();
float rand_FloatRange(float a, float b) {
  return ((b - a) * ((float)random() / RAND_MAX)) + a;
}


x86 assembly (clang, -O0):
<rand_FloatRange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
movss  -0xc(%rbp),%xmm0
cvtsi2ss %rax,%xmm2
mov    0x2e9f(%rip),%rax
divss  (%rax),%xmm2
movss  -0x4(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_FloatRange>:
push   %rax
movss  %xmm0,0x4(%rsp)
subss  %xmm0,%xmm1
movss  %xmm1,(%rsp)
xor    %eax,%eax
call   1030 <random@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
mov    0x2eb2(%rip),%rax
divss  (%rax),%xmm0
mulss  (%rsp),%xmm0
addss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global float 0.000000e+00
define float @rand_FloatRange(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = load float, float* %3
%7 = fsub float %5, %6
%8 = call i64 (...) @random()
%9 = sitofp i64 %8 to float
%10 = load float, float* @RAND_MAX
%11 = fdiv float %9, %10
%12 = load float, float* %3
%13 = call float @llvm.fmuladd.f32(float %7, float %11, float %12)
ret float %13
}

LLVM IR (-O2):
@RAND_MAX = global float 0.000000e+00
define float @rand_FloatRange(float %0, float %1) {
%3 = fsub float %1, %0
%4 = tail call i64 (...) @random()
%5 = sitofp i64 %4 to float
%6 = load float, float* @RAND_MAX
%7 = fdiv float %5, %6
%8 = tail call float @llvm.fmuladd.f32(float %3, float %7, float %0)
ret float %8
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ restore_getch();
void exit_handler(int signum) {
  restore_getch();
  _exit(-1);
}


x86 assembly (clang, -O0):
<exit_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <restore_getch@plt>
mov    $0xffffffff,%edi
call   1040 <_exit@plt>

x86 assembly (clang, -O2):
<exit_handler>:
push   %rax
xor    %eax,%eax
call   1030 <restore_getch@plt>
mov    $0xffffffff,%edi
call   1040 <_exit@plt>

LLVM IR (-O0):
define void @exit_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @restore_getch()
%4 = call i32 @_exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define void @exit_handler(i32 %0) {
%2 = tail call i32 (...) @restore_getch()
%3 = tail call i32 @_exit(i32 -1)
unreachable
}