xunge/DecIR huggingface dataset:
int do_443() { return 443; }


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

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

LLVM IR (-O0):
define i32 @do_443() {
ret i32 443
}

LLVM IR (-O2):
define i32 @do_443() {
ret i32 443
}
int test_imm_8Cuint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x8C << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_8Cuint64_lowword_reg>:
test   $0x8c,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_8Cuint64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 140
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_8Cuint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 140
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_KEEPALIVE;
int diminuto_ipc_set_socket(int, int /*<<< orphan*/, int /*<<< orphan*/, int);
int diminuto_ipc_set_keepalive(int fd, int enable) {
  return diminuto_ipc_set_socket(fd, SOL_SOCKET, SO_KEEPALIVE, !!enable);
}


x86 assembly (clang, -O0):
<diminuto_ipc_set_keepalive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    0x2e9f(%rip),%rax
mov    (%rax),%edx
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%ecx
call   1030 <diminuto_ipc_set_socket@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<diminuto_ipc_set_keepalive>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2eb0(%rip),%rcx
mov    (%rcx),%edx
xor    %ecx,%ecx
test   %esi,%esi
setne  %cl
mov    %eax,%esi
jmp    1030 <diminuto_ipc_set_socket@plt>

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_KEEPALIVE = global i32 0
define i32 @diminuto_ipc_set_keepalive(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* @SOL_SOCKET
%7 = load i32, i32* @SO_KEEPALIVE
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
%13 = call i32 @diminuto_ipc_set_socket(i32 %5, i32 %6, i32 %7, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_KEEPALIVE = global i32 0
define i32 @diminuto_ipc_set_keepalive(i32 %0, i32 %1) {
%3 = load i32, i32* @SOL_SOCKET
%4 = load i32, i32* @SO_KEEPALIVE
%5 = icmp ne i32 %1, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @diminuto_ipc_set_socket(i32 %0, i32 %3, i32 %4, i32 %6)
ret i32 %7
}
/* Type definitions */
typedef char wchar_t;

/* Variables and functions */
int /*<<< orphan*/ wprintf(char const *, ...);
void uninitvar_wprintf(wchar_t *Format, int Argument) {
  const wchar_t *format;
  int argument;
  (void)wprintf(format, argument);
  (void)wprintf(format);
  (void)wprintf(Format, argument);
  (void)wprintf(format, Argument);
  (void)wprintf(Format, Argument);
  (void)wprintf(Format);
}


x86 assembly (clang, -O0):
<uninitvar_wprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    $0x0,%al
call   1030 <wprintf@plt>
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1030 <wprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    $0x0,%al
call   1030 <wprintf@plt>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1030 <wprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1030 <wprintf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <wprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_wprintf>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <wprintf@plt>
xor    %eax,%eax
call   1030 <wprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <wprintf@plt>
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <wprintf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <wprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <wprintf@plt>

LLVM IR (-O0):
define void @uninitvar_wprintf(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %5
%8 = load i32, i32* %6
%9 = call i32 (i8*, ...) @wprintf(i8* %7, i32 %8)
%10 = load i8*, i8** %5
%11 = call i32 (i8*, ...) @wprintf(i8* %10)
%12 = load i8*, i8** %3
%13 = load i32, i32* %6
%14 = call i32 (i8*, ...) @wprintf(i8* %12, i32 %13)
%15 = load i8*, i8** %5
%16 = load i32, i32* %4
%17 = call i32 (i8*, ...) @wprintf(i8* %15, i32 %16)
%18 = load i8*, i8** %3
%19 = load i32, i32* %4
%20 = call i32 (i8*, ...) @wprintf(i8* %18, i32 %19)
%21 = load i8*, i8** %3
%22 = call i32 (i8*, ...) @wprintf(i8* %21)
ret void
}

LLVM IR (-O2):
define void @uninitvar_wprintf(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @wprintf(i8* undef, i32 undef)
%4 = tail call i32 (i8*, ...) @wprintf(i8* undef)
%5 = tail call i32 (i8*, ...) @wprintf(i8* %0, i32 undef)
%6 = tail call i32 (i8*, ...) @wprintf(i8* undef, i32 %1)
%7 = tail call i32 (i8*, ...) @wprintf(i8* %0, i32 %1)
%8 = tail call i32 (i8*, ...) @wprintf(i8* %0)
ret void
}
/* Variables and functions */
int ILLutil_our_gcd(int, int);
int ILLutil_our_lcm(int a, int b) {
  int c;
  if (a < 0)
    a = -a;
  if (b < 0)
    b = -b;
  c = ILLutil_our_gcd(a, b);
  return (a / c) * b;
}


x86 assembly (clang, -O0):
<ILLutil_our_lcm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1130 <ILLutil_our_lcm+0x20>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1142 <ILLutil_our_lcm+0x32>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <ILLutil_our_gcd@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
imul   -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ILLutil_our_lcm>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
neg    %ebx
cmovs  %edi,%ebx
mov    %esi,%ebp
neg    %ebp
cmovs  %esi,%ebp
mov    %ebx,%edi
mov    %ebp,%esi
call   1030 <ILLutil_our_gcd@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
imul   %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @ILLutil_our_lcm(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%4 = tail call i32 @llvm.abs.i32(i32 %1, i1 true)
%5 = tail call i32 @ILLutil_our_gcd(i32 %3, i32 %4)
%6 = sdiv i32 %3, %5
%7 = mul nsw i32 %6, %4
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ serial_puts(char *);
int /*<<< orphan*/ test_pe();
void timer_init(void) {
  test_pe();
  serial_puts(" Test should be running\n");
  serial_puts(" --- spinning\n");
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<timer_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <test_pe@plt>
lea    0xece(%rip),%rdi
call   1030 <serial_puts@plt>
lea    0xedb(%rip),%rdi
call   1030 <serial_puts@plt>
jmp    1143 <timer_init+0x23>

x86 assembly (clang, -O2):
<timer_init>:
push   %rax
xor    %eax,%eax
call   1040 <test_pe@plt>
lea    0xed1(%rip),%rdi
call   1030 <serial_puts@plt>
lea    0xede(%rip),%rdi
call   1030 <serial_puts@plt>
jmp    1140 <timer_init+0x20>

LLVM IR (-O0):
@.str = [25 x i8] c" Test should be running\0A\00"
@.str.1 = [15 x i8] c" --- spinning\0A\00"
define void @timer_init() {
%1 = call i32 (...) @test_pe()
%2 = call i32 @serial_puts(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @serial_puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %4
4: ; preds = %4, %0
br label %4
}

LLVM IR (-O2):
@.str = [25 x i8] c" Test should be running\0A\00"
@.str.1 = [15 x i8] c" --- spinning\0A\00"
define void @timer_init() {
%1 = tail call i32 (...) @test_pe()
%2 = tail call i32 @serial_puts(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @serial_puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %4
4: ; preds = %4, %0
br label %4
}
/* Variables and functions */
double __ieee754_fmod(double, double);
double fmod(double x, double y) { return __ieee754_fmod(x, y); }


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

x86 assembly (clang, -O2):
<fmod>:
jmp    1030 <__ieee754_fmod@plt>

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

LLVM IR (-O2):
define double @fmod(double %0, double %1) {
%3 = tail call double @__ieee754_fmod(double %0, double %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ testAfter();
int /*<<< orphan*/ testBefore();
int /*<<< orphan*/ testDelete();
int main(int argc, char *argv[]) {
  testAfter();
  testBefore();
  testDelete();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <testAfter@plt>
mov    $0x0,%al
call   1040 <testBefore@plt>
mov    $0x0,%al
call   1030 <testDelete@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @testAfter()
%7 = call i32 (...) @testBefore()
%8 = call i32 (...) @testDelete()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @testAfter()
%4 = tail call i32 (...) @testBefore()
%5 = tail call i32 (...) @testDelete()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cgi_get_cookies();
int /*<<< orphan*/ init_hex_table();
int cgi_init() {
  init_hex_table();
  cgi_get_cookies();
  return 1;
}


x86 assembly (clang, -O0):
<cgi_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <init_hex_table@plt>
mov    $0x0,%al
call   1030 <cgi_get_cookies@plt>
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @cgi_init() {
%1 = call i32 (...) @init_hex_table()
%2 = call i32 (...) @cgi_get_cookies()
ret i32 1
}

LLVM IR (-O2):
define i32 @cgi_init() {
%1 = tail call i32 (...) @init_hex_table()
%2 = tail call i32 (...) @cgi_get_cookies()
ret i32 1
}
/* Type definitions */
typedef int int32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fgetc(int /*<<< orphan*/ *);
int32_t piece_fget32i(FILE *fd) {
  return (fgetc(fd) | fgetc(fd) << 8 | fgetc(fd) << 16 | fgetc(fd) << 24);
}


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

x86 assembly (clang, -O2):
<piece_fget32i>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r15
call   1030 <fgetc@plt>
mov    %eax,%r14d
mov    %r15,%rdi
call   1030 <fgetc@plt>
mov    %eax,%ebp
shl    $0x8,%ebp
or     %r14d,%ebp
mov    %r15,%rdi
call   1030 <fgetc@plt>
mov    %eax,%ebx
shl    $0x10,%ebx
mov    %r15,%rdi
call   1030 <fgetc@plt>
shl    $0x18,%eax
or     %ebx,%eax
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @piece_fget32i(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fgetc(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @fgetc(i32* %5)
%7 = shl i32 %6, 8
%8 = or i32 %4, %7
%9 = load i32*, i32** %2
%10 = call i32 @fgetc(i32* %9)
%11 = shl i32 %10, 16
%12 = or i32 %8, %11
%13 = load i32*, i32** %2
%14 = call i32 @fgetc(i32* %13)
%15 = shl i32 %14, 24
%16 = or i32 %12, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @piece_fget32i(i32* nocapture %0) {
%2 = tail call i32 @fgetc(i32* %0)
%3 = tail call i32 @fgetc(i32* %0)
%4 = shl i32 %3, 8
%5 = or i32 %4, %2
%6 = tail call i32 @fgetc(i32* %0)
%7 = shl i32 %6, 16
%8 = or i32 %5, %7
%9 = tail call i32 @fgetc(i32* %0)
%10 = shl i32 %9, 24
%11 = or i32 %8, %10
ret i32 %11
}
void proc() {}


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

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

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

LLVM IR (-O2):
define void @proc() {
ret void
}
int test_imm_1Bint16_reg(short val) {
  return ((val) & (-0x1B << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_1Bint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -27
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_1Bint16_reg(i16 signext %0) {
%2 = and i16 %0, -27
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ glutPostRedisplay();
void glIdle(void) { glutPostRedisplay(); }


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

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

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

LLVM IR (-O2):
define void @glIdle() {
%1 = tail call i32 (...) @glutPostRedisplay()
ret void
}
int ptrcmp(void *a, void *b) { return a == b; }


x86 assembly (clang, -O0):
<ptrcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptrcmp>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @ptrcmp(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 = icmp eq i8* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ptrcmp(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct TreeNode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ rob_node(struct TreeNode *, int *, int *);
int rob(struct TreeNode *root) {
  int f, g;
  rob_node(root, &f, &g);
  if (f > g)
    return f;
  else
    return g;
}


x86 assembly (clang, -O0):
<rob>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1030 <rob_node@plt>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    1144 <rob+0x34>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114a <rob+0x3a>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rob>:
push   %rax
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1030 <rob_node@plt>
mov    0x4(%rsp),%ecx
mov    (%rsp),%eax
cmp    %eax,%ecx
cmovg  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.TreeNode = type { i32 }
define i32 @rob(%struct.TreeNode* %0) {
%2 = alloca i32
%3 = alloca %struct.TreeNode*
%4 = alloca i32
%5 = alloca i32
store %struct.TreeNode* %0, %struct.TreeNode** %3
%6 = load %struct.TreeNode*, %struct.TreeNode** %3
%7 = call i32 @rob_node(%struct.TreeNode* %6, i32* %4, i32* %5)
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = icmp sgt i32 %8, %9
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = load i32, i32* %4
store i32 %12, i32* %2
br label %15
13: ; preds = %1
%14 = load i32, i32* %5
store i32 %14, i32* %2
br label %15
15: ; preds = %13, %11
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
%struct.TreeNode = type { i32 }
define i32 @rob(%struct.TreeNode* %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = call i32 @rob_node(%struct.TreeNode* %0, i32* %2, i32* %3)
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = icmp sgt i32 %7, %8
%10 = select i1 %9, i32 %7, i32 %8
ret i32 %10
}
void faultISR(void) {
#pragma diag_push
#pragma CHECK_ULP("-2.1")
  while (1) {
  }
#pragma diag_pop
}


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

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

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

LLVM IR (-O2):
define void @faultISR() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Type definitions */
struct terminal {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ move_cursor(struct terminal *, int /*<<< orphan*/, int);
void bs(struct terminal *term) { move_cursor(term, 0, -1); }


x86 assembly (clang, -O0):
<bs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0xffffffff,%edx
call   1030 <move_cursor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bs>:
xor    %esi,%esi
mov    $0xffffffff,%edx
jmp    1030 <move_cursor@plt>

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

LLVM IR (-O2):
%struct.terminal = type { i32 }
define void @bs(%struct.terminal* %0) {
%2 = tail call i32 @move_cursor(%struct.terminal* %0, i32 0, i32 -1)
ret void
}
/* Variables and functions */
int editor_is_enabled();
int level_editmode() { return editor_is_enabled(); }


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

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

LLVM IR (-O0):
define i32 @level_editmode() {
%1 = call i32 (...) @editor_is_enabled()
ret i32 %1
}

LLVM IR (-O2):
define i32 @level_editmode() {
%1 = tail call i32 (...) @editor_is_enabled()
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ x;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int search(int *, int, int);
int main(void) {
  int x[] = {3, 1};
  int i = 1;
  printf("%d\n", search(x, sizeof(x) / sizeof(x[0]), i));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
lea    -0xc(%rbp),%rdi
mov    -0x10(%rbp),%edx
mov    $0x2,%esi
call   1040 <search@plt>
mov    %eax,%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movabs $0x100000003,%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1040 <search@plt>
lea    0xeb8(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 4294967299, i64* %1
%3 = bitcast i64* %1 to i32*
%4 = call i32 @search(i32* %3, i32 2, i32 1)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
unsigned char inb(int);
int /*<<< orphan*/ outb(int, unsigned char);
unsigned char __attribute__((no)) crtc_reg_read(unsigned char reg) {
  outb(0x3d4, reg);
  return inb(0x3d5);
}


x86 assembly (clang, -O0):
<crtc_reg_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x3d4,%edi
movzbl -0x1(%rbp),%esi
call   1030 <outb@plt>
mov    $0x3d5,%edi
call   1040 <inb@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crtc_reg_read>:
push   %rax
mov    %edi,%esi
mov    $0x3d4,%edi
call   1030 <outb@plt>
mov    $0x3d5,%edi
pop    %rax
jmp    1040 <inb@plt>

LLVM IR (-O0):
define zeroext i8 @crtc_reg_read(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @outb(i32 980, i8 zeroext %3)
%5 = call zeroext i8 @inb(i32 981)
ret i8 %5
}

LLVM IR (-O2):
define zeroext i8 @crtc_reg_read(i8 zeroext %0) {
%2 = tail call i32 @outb(i32 980, i8 zeroext %0)
%3 = tail call zeroext i8 @inb(i32 981)
ret i8 %3
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ __builtin_wrctl(int, int);
void _Nios2_Set_ctlreg_pteaddr(uint32_t value) {
  __builtin_wrctl(8, (int)value);
}


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

x86 assembly (clang, -O2):
<_Nios2_Set_ctlreg_pteaddr>:
mov    %rdi,%rsi
mov    $0x8,%edi
jmp    1030 <__builtin_wrctl@plt>

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

LLVM IR (-O2):
define void @_Nios2_Set_ctlreg_pteaddr(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i32 @__builtin_wrctl(i32 8, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ LCDPort_ClearCE();
int /*<<< orphan*/ LCDPort_ClearRW();
int /*<<< orphan*/ LCDPort_Out8(int /*<<< orphan*/);
int /*<<< orphan*/ LCDPort_SetCE();
int /*<<< orphan*/ LCDPort_SetDirection_Input8();
int /*<<< orphan*/ LCDPort_SetDirection_Output8();
int /*<<< orphan*/ LCDPort_SetRS();
int /*<<< orphan*/ LCDPort_SetRW();
void writeData_8BitIntf(int32_t data) {
  LCDPort_SetRS();
  LCDPort_ClearRW();
  LCDPort_SetCE();
  LCDPort_Out8(data);
  LCDPort_SetDirection_Output8();
  LCDPort_ClearCE();
  LCDPort_SetDirection_Input8();
  LCDPort_SetRW();
}


x86 assembly (clang, -O0):
<writeData_8BitIntf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1090 <LCDPort_SetRS@plt>
mov    $0x0,%al
call   1040 <LCDPort_ClearRW@plt>
mov    $0x0,%al
call   1070 <LCDPort_SetCE@plt>
mov    -0x4(%rbp),%edi
call   1050 <LCDPort_Out8@plt>
mov    $0x0,%al
call   1080 <LCDPort_SetDirection_Output8@plt>
mov    $0x0,%al
call   1030 <LCDPort_ClearCE@plt>
mov    $0x0,%al
call   1060 <LCDPort_SetDirection_Input8@plt>
mov    $0x0,%al
call   10a0 <LCDPort_SetRW@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeData_8BitIntf>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1090 <LCDPort_SetRS@plt>
xor    %eax,%eax
call   1040 <LCDPort_ClearRW@plt>
xor    %eax,%eax
call   1070 <LCDPort_SetCE@plt>
mov    %ebx,%edi
call   1050 <LCDPort_Out8@plt>
xor    %eax,%eax
call   1080 <LCDPort_SetDirection_Output8@plt>
xor    %eax,%eax
call   1030 <LCDPort_ClearCE@plt>
xor    %eax,%eax
call   1060 <LCDPort_SetDirection_Input8@plt>
xor    %eax,%eax
pop    %rbx
jmp    10a0 <LCDPort_SetRW@plt>

LLVM IR (-O0):
define void @writeData_8BitIntf(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @LCDPort_SetRS()
%4 = call i32 (...) @LCDPort_ClearRW()
%5 = call i32 (...) @LCDPort_SetCE()
%6 = load i32, i32* %2
%7 = call i32 @LCDPort_Out8(i32 %6)
%8 = call i32 (...) @LCDPort_SetDirection_Output8()
%9 = call i32 (...) @LCDPort_ClearCE()
%10 = call i32 (...) @LCDPort_SetDirection_Input8()
%11 = call i32 (...) @LCDPort_SetRW()
ret void
}

LLVM IR (-O2):
define void @writeData_8BitIntf(i32 %0) {
%2 = tail call i32 (...) @LCDPort_SetRS()
%3 = tail call i32 (...) @LCDPort_ClearRW()
%4 = tail call i32 (...) @LCDPort_SetCE()
%5 = tail call i32 @LCDPort_Out8(i32 %0)
%6 = tail call i32 (...) @LCDPort_SetDirection_Output8()
%7 = tail call i32 (...) @LCDPort_ClearCE()
%8 = tail call i32 (...) @LCDPort_SetDirection_Input8()
%9 = tail call i32 (...) @LCDPort_SetRW()
ret void
}
/* Variables and functions */
scalar_t__ islower(int);
int toupper(int);
int ToUpper(int c) { return islower(c) ? toupper(c) : c; }


x86 assembly (clang, -O0):
<ToUpper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     114d <ToUpper+0x2d>
mov    -0x4(%rbp),%edi
call   1040 <toupper@plt>
mov    %eax,-0x8(%rbp)
jmp    1153 <ToUpper+0x33>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ToUpper>:
push   %rbx
mov    %edi,%ebx
call   1030 <islower@plt>
test   %rax,%rax
je     1135 <ToUpper+0x15>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <toupper@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ToUpper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @islower(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @toupper(i32 %7)
br label %11
9: ; preds = %1
%10 = load i32, i32* %2
br label %11
11: ; preds = %9, %6
%12 = phi i32 [ %8, %6 ], [ %10, %9 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @ToUpper(i32 %0) {
%2 = tail call i64 @islower(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @toupper(i32 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ %0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ f(char *);
int main() { f("c"); }


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

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

LLVM IR (-O0):
@.str = [2 x i8] c"c\00"
define i32 @main() {
%1 = call i32 @f(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"c\00"
define i32 @main() {
%1 = tail call i32 @f(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ process();
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int count;
  scanf("%d\n", &count);
  for (count; count > 0; count--) {
    process();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jle    115e <main+0x3e>
mov    $0x0,%al
call   1030 <process@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    113f <main+0x1f>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jle    1157 <main+0x37>
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <process@plt>
mov    0x4(%rsp),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,0x4(%rsp)
cmp    $0x1,%eax
jg     1140 <main+0x20>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %0, %6
%7 = call i32 (...) @process()
%8 = load i32, i32* %1
%9 = add nsw i32 %8, -1
store i32 %9, i32* %1
%10 = icmp sgt i32 %8, 1
br i1 %10, label %6, label %11
11: ; preds = %6, %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
void SystraceAsyncBegin(const char *name, const int32_t cookie) {
  (void)name;
  (void)cookie;
}


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

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

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

LLVM IR (-O2):
define void @SystraceAsyncBegin(i8* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
typedef unsigned char uint8_t;

/* Variables and functions */
uint8_t eeprom_unlock_data(void) {
  *(unsigned char *)0x5064 = 0xAE;
  *(unsigned char *)0x5064 = 0x56;
  return (*(unsigned char *)0x505F & (1 << 3));
}


x86 assembly (clang, -O0):
<eeprom_unlock_data>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5064,%eax
movb   $0xae,(%rax)
mov    $0x5064,%eax
movb   $0x56,(%rax)
mov    $0x505f,%eax
movzbl (%rax),%eax
and    $0x8,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eeprom_unlock_data>:
movb   $0x56,0x5064
56
mov    0x505f,%al
and    $0x8,%al
ret

LLVM IR (-O0):
define zeroext i8 @eeprom_unlock_data() {
store i8 -82, i8* inttoptr (i64 20580 to i8*)
store i8 86, i8* inttoptr (i64 20580 to i8*)
%1 = load i8, i8* inttoptr (i64 20575 to i8*)
%2 = zext i8 %1 to i32
%3 = and i32 %2, 8
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define zeroext i8 @eeprom_unlock_data() {
store i8 86, i8* inttoptr (i64 20580 to i8*)
%1 = load i8, i8* inttoptr (i64 20575 to i8*)
%2 = and i8 %1, 8
ret i8 %2
}
/* Variables and functions */
scalar_t__ calloc(int, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
double *make_dv(int len) {
  double *v;
  if (!len)
    len = 1;
  v = (double *)calloc(len, sizeof(double));
  if (!v) {
    fprintf(stderr, "Run-time error in make_dv");
    exit(1);
  }
  return --v;
}


x86 assembly (clang, -O0):
<make_dv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    114c <make_dv+0x1c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x8,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1187 <make_dv+0x57>
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
lea    0xe88(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_dv>:
push   %rax
test   %edi,%edi
mov    $0x1,%eax
cmove  %eax,%edi
mov    $0x8,%esi
call   1030 <calloc@plt>
test   %rax,%rax
je     1150 <make_dv+0x20>
add    $0xfffffffffffffff8,%rax
pop    %rcx
ret
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
lea    0xea0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"Run-time error in make_dv\00"
define double* @make_dv(i32 %0) {
%2 = alloca i32
%3 = alloca double*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %1
store i32 1, i32* %2
br label %7
7: ; preds = %6, %1
%8 = load i32, i32* %2
%9 = call i64 @calloc(i32 %8, i32 8)
%10 = inttoptr i64 %9 to double*
store double* %10, double** %3
%11 = load double*, double** %3
%12 = icmp ne double* %11, null
br i1 %12, label %17, label %13
13: ; preds = %7
%14 = load i32, i32* @stderr
%15 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @exit(i32 1)
unreachable
17: ; preds = %7
%18 = load double*, double** %3
%19 = getelementptr inbounds double, double* %18, i32 -1
store double* %19, double** %3
ret double* %19
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"Run-time error in make_dv\00"
define double* @make_dv(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 1, i32 %0
%4 = tail call i64 @calloc(i32 %3, i32 8)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %1
%11 = inttoptr i64 %4 to double*
%12 = getelementptr inbounds double, double* %11, i64 -1
ret double* %12
}
/* Variables and functions */
int cmpfloats(float const *, float const *, int);
int tcsg__plane_sort_cmp(const void *i_a, const void *i_b) {
  const float *a = (const float *)i_a;
  const float *b = (const float *)i_b;
  return cmpfloats(a, b, 4);
}


x86 assembly (clang, -O0):
<tcsg__plane_sort_cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0x4,%edx
call   1030 <cmpfloats@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcsg__plane_sort_cmp>:
mov    $0x4,%edx
jmp    1030 <cmpfloats@plt>

LLVM IR (-O0):
define i32 @tcsg__plane_sort_cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca float*
%6 = alloca float*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to float*
store float* %8, float** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to float*
store float* %10, float** %6
%11 = load float*, float** %5
%12 = load float*, float** %6
%13 = call i32 @cmpfloats(float* %11, float* %12, i32 4)
ret i32 %13
}

LLVM IR (-O2):
define i32 @tcsg__plane_sort_cmp(i8* %0, i8* %1) {
%3 = bitcast i8* %0 to float*
%4 = bitcast i8* %1 to float*
%5 = tail call i32 @cmpfloats(float* %3, float* %4, i32 4)
ret i32 %5
}
char const *basefilename(const char *const p) {
  char const *b = p, *q = p;
  for (;;)
    switch (*q++) {
    case '/':
      b = q;
      break;
    case 0:
      return b;
    }
}


x86 assembly (clang, -O0):
<basefilename>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
test   %eax,%eax
je     1158 <basefilename+0x58>
jmp    113a <basefilename+0x3a>
mov    -0x1c(%rbp),%eax
sub    $0x2f,%eax
jne    115e <basefilename+0x5e>
jmp    114b <basefilename+0x4b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    115e <basefilename+0x5e>
mov    -0x10(%rbp),%rax
pop    %rbp
ret
jmp    1118 <basefilename+0x18>

x86 assembly (clang, -O2):
<basefilename>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
movsbl (%rcx),%edx
add    $0x1,%rcx
cmp    $0x2f,%edx
je     1122 <basefilename+0x22>
test   %edx,%edx
jne    1110 <basefilename+0x10>
jmp    1127 <basefilename+0x27>
mov    %rcx,%rax
jmp    1110 <basefilename+0x10>
ret

LLVM IR (-O0):
define i8* @basefilename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %3
%6 = load i8*, i8** %2
store i8* %6, i8** %4
br label %7
7: ; preds = %16, %1
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %4
%10 = load i8, i8* %8
%11 = sext i8 %10 to i32
switch i32 %11, label %16 [
i32 47, label %12
i32 0, label %14
]
12: ; preds = %7
%13 = load i8*, i8** %4
store i8* %13, i8** %3
br label %16
14: ; preds = %7
%15 = load i8*, i8** %3
ret i8* %15
16: ; preds = %7, %12
br label %7
}

LLVM IR (-O2):
define i8* @basefilename(i8* %0) {
br label %2
2: ; preds = %4, %1
%3 = phi i8* [ %0, %1 ], [ %6, %4 ]
br label %4
4: ; preds = %2, %4
%5 = phi i8* [ %6, %4 ], [ %3, %2 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = sext i8 %7 to i32
switch i32 %8, label %4 [
i32 47, label %2
i32 0, label %9
]
9: ; preds = %4
ret i8* %3
}
void cleanuptransitionengine() {}


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

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

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

LLVM IR (-O2):
define void @cleanuptransitionengine() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f1(int);
int /*<<< orphan*/ f2(int);
int /*<<< orphan*/ f3(int);
int main() {
  f1(20 - 1);
  f2(20 - 1);
  f3(20 - 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x13,%edi
call   1050 <f1@plt>
mov    $0x13,%edi
call   1030 <f2@plt>
mov    $0x13,%edi
call   1040 <f3@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x13,%edi
call   1050 <f1@plt>
mov    $0x13,%edi
call   1030 <f2@plt>
mov    $0x13,%edi
call   1040 <f3@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f1(i32 19)
%3 = call i32 @f2(i32 19)
%4 = call i32 @f3(i32 19)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f1(i32 19)
%2 = tail call i32 @f2(i32 19)
%3 = tail call i32 @f3(i32 19)
ret i32 0
}
float deg2rad(float deg) {
  deg = 3.14159265 * deg / 180;
  return deg;
}


x86 assembly (clang, -O0):
<deg2rad>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeee(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xeda(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<deg2rad>:
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
divsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @deg2rad(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double 0x400921FB53C8D4F1, %4
%6 = fdiv double %5, 1.800000e+02
%7 = fptrunc double %6 to float
store float %7, float* %2
%8 = load float, float* %2
ret float %8
}

LLVM IR (-O2):
define float @deg2rad(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 0x400921FB53C8D4F1
%4 = fdiv double %3, 1.800000e+02
%5 = fptrunc double %4 to float
ret float %5
}
char encode(int plainChar, char *permutation) {
  int charPosition = plainChar;
  int encodedChar = 0;
  if ((plainChar >= 'a') && (plainChar <= 122)) {
    charPosition = plainChar - 97;
    encodedChar = permutation[charPosition];
  } else {
    encodedChar = plainChar;
  }
  return encodedChar;
}


x86 assembly (clang, -O0):
<encode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     1149 <encode+0x49>
cmpl   $0x7a,-0x4(%rbp)
jg     1149 <encode+0x49>
mov    -0x4(%rbp),%eax
sub    $0x61,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x18(%rbp)
jmp    114f <encode+0x4f>
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode>:
mov    %edi,%eax
lea    -0x61(%rax),%ecx
cmp    $0x19,%ecx
ja     1110 <encode+0x10>
mov    %ecx,%eax
movzbl (%rsi,%rax,1),%eax
ret

LLVM IR (-O0):
define signext i8 @encode(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%7 = load i32, i32* %3
store i32 %7, i32* %5
store i32 0, i32* %6
%8 = load i32, i32* %3
%9 = icmp sge i32 %8, 97
br i1 %9, label %10, label %22
10: ; preds = %2
%11 = load i32, i32* %3
%12 = icmp sle i32 %11, 122
br i1 %12, label %13, label %22
13: ; preds = %10
%14 = load i32, i32* %3
%15 = sub nsw i32 %14, 97
store i32 %15, i32* %5
%16 = load i8*, i8** %4
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
store i32 %21, i32* %6
br label %24
22: ; preds = %10, %2
%23 = load i32, i32* %3
store i32 %23, i32* %6
br label %24
24: ; preds = %22, %13
%25 = load i32, i32* %6
%26 = trunc i32 %25 to i8
ret i8 %26
}

LLVM IR (-O2):
define signext i8 @encode(i32 %0, i8* nocapture %1) {
%3 = add i32 %0, -97
%4 = icmp ult i32 %3, 26
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = zext i32 %3 to i64
%7 = getelementptr inbounds i8, i8* %1, i64 %6
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
br label %10
10: ; preds = %2, %5
%11 = phi i32 [ %9, %5 ], [ %0, %2 ]
%12 = trunc i32 %11 to i8
ret i8 %12
}
/* Type definitions */
struct vec4 {
  int dummy;
};

/* Variables and functions */
int vec4_is_equal(float *, float *);
__attribute__((always_)) bool psvec4_is_equal(struct vec4 *a, struct vec4 *b) {
  return vec4_is_equal((float *)a, (float *)b);
}


x86 assembly (clang, -O0):
<psvec4_is_equal>:
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 <vec4_is_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psvec4_is_equal>:
jmp    1030 <vec4_is_equal@plt>

LLVM IR (-O0):
%struct.vec4 = type { i32 }
define i32 @psvec4_is_equal(%struct.vec4* %0, %struct.vec4* %1) {
%3 = alloca %struct.vec4*
%4 = alloca %struct.vec4*
store %struct.vec4* %0, %struct.vec4** %3
store %struct.vec4* %1, %struct.vec4** %4
%5 = load %struct.vec4*, %struct.vec4** %3
%6 = bitcast %struct.vec4* %5 to float*
%7 = load %struct.vec4*, %struct.vec4** %4
%8 = bitcast %struct.vec4* %7 to float*
%9 = call i32 @vec4_is_equal(float* %6, float* %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.vec4 = type { i32 }
define i32 @psvec4_is_equal(%struct.vec4* %0, %struct.vec4* %1) {
%3 = bitcast %struct.vec4* %0 to float*
%4 = bitcast %struct.vec4* %1 to float*
%5 = tail call i32 @vec4_is_equal(float* %3, float* %4)
ret i32 %5
}
/* Type definitions */
struct pattern {
  int dummy;
};

/* Variables and functions */
int offset(int, int, int, int);
int /*<<< orphan*/ owl_goal_dragon(int);
int autohelperowl_attackpat60(struct pattern *patt, int transformation,
                              int move, int color, int action) {
  int A;
  (void)patt;
  (void)color;
  (void)action;
  A = offset(-1, 2, move, transformation);
  return !owl_goal_dragon(A);
}


x86 assembly (clang, -O0):
<autohelperowl_attackpat60>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%edi
mov    $0x2,%esi
call   1040 <offset@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
call   1030 <owl_goal_dragon@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<autohelperowl_attackpat60>:
push   %rax
mov    %esi,%ecx
mov    $0xffffffff,%edi
mov    $0x2,%esi
call   1040 <offset@plt>
mov    %eax,%edi
call   1030 <owl_goal_dragon@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.pattern = type { i32 }
define i32 @autohelperowl_attackpat60(%struct.pattern* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.pattern*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store %struct.pattern* %0, %struct.pattern** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = load %struct.pattern*, %struct.pattern** %6
%13 = load i32, i32* %9
%14 = load i32, i32* %10
%15 = load i32, i32* %8
%16 = load i32, i32* %7
%17 = call i32 @offset(i32 -1, i32 2, i32 %15, i32 %16)
store i32 %17, i32* %11
%18 = load i32, i32* %11
%19 = call i32 @owl_goal_dragon(i32 %18)
%20 = icmp ne i32 %19, 0
%21 = xor i1 %20, true
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
%struct.pattern = type { i32 }
define i32 @autohelperowl_attackpat60(%struct.pattern* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @offset(i32 -1, i32 2, i32 %2, i32 %1)
%7 = tail call i32 @owl_goal_dragon(i32 %6)
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}