xunge/DecIR huggingface dataset:
int test_imm_17int8_reg(signed char val) {
  return ((val) & (0x17 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_17int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x17,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_17int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 23
%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_17int8_reg(i8 signext %0) {
%2 = and i8 %0, 23
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void const *);
int /*<<< orphan*/ stderr;
unsigned int SafeUIntFromPointer(const void *ptr) {
  if ((uintptr_t)(ptr) != (unsigned int)(uintptr_t)(ptr)) {
    fprintf(stderr, "EmuGL:WARNING: bad generic pointer %p\n", ptr);
  }
  return (unsigned int)(uintptr_t)(ptr);
}


x86 assembly (clang, -O0):
<SafeUIntFromPointer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    %ecx,%ecx
cmp    %rcx,%rax
je     1148 <SafeUIntFromPointer+0x38>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SafeUIntFromPointer>:
push   %rbx
mov    %rdi,%rbx
mov    %rdi,%rax
shr    $0x20,%rax
je     1135 <SafeUIntFromPointer+0x25>
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
lea    0xed3(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"EmuGL:WARNING: bad generic pointer %p\0A\00"
define i32 @SafeUIntFromPointer(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = load i8*, i8** %2
%6 = ptrtoint i8* %5 to i64
%7 = trunc i64 %6 to i32
%8 = zext i32 %7 to i64
%9 = icmp ne i64 %4, %8
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %2
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %10, %1
%15 = load i8*, i8** %2
%16 = ptrtoint i8* %15 to i64
%17 = trunc i64 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"EmuGL:WARNING: bad generic pointer %p\0A\00"
define i32 @SafeUIntFromPointer(i8* %0) {
%2 = icmp ult i8* %0, inttoptr (i64 4294967296 to i8*)
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %3, %1
%7 = ptrtoint i8* %0 to i64
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Variables and functions */
char *basename(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(const char *program) {
  fprintf(stderr,
          "Usage: %s [options]\n\n"
          "  -s, --server, --host <server>  specify server to connect to\n"
          "                                 (default: localhost)\n"
          "  -p, --port <port>              specify port to connect to\n"
          "                                 (default: 6666)\n"
          "  -o, --output                   print game grid after game\n"
          "                                 (useful in AI vs AI games)\n"
          "  -h, --help                     show this help\n",
          basename((char *)program));
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <basename@plt>
mov    -0xc(%rbp),%edi
mov    %rax,%rdx
lea    0xea2(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
call   1040 <basename@plt>
lea    0xeba(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [415 x i8] c"Usage: %s [options]\0A\0A -s, --server, --host <server> specify server to connect to\0A (default: localhost)\0A -p, --port <port> specify port to connect to\0A (default: 6666)\0A -o, --output print game grid after game\0A (useful in AI vs AI games)\0A -h, --help show this help\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i8* @basename(i8* %4)
%6 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([415 x i8], [415 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [415 x i8] c"Usage: %s [options]\0A\0A -s, --server, --host <server> specify server to connect to\0A (default: localhost)\0A -p, --port <port> specify port to connect to\0A (default: 6666)\0A -o, --output print game grid after game\0A (useful in AI vs AI games)\0A -h, --help show this help\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i8* @basename(i8* %0)
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([415 x i8], [415 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
scalar_t__ IS_ERR(void const *);
long PTR_ERR(void const *);
long PTR_ERR_OR_ZERO(const void *ptr) { return IS_ERR(ptr) ? PTR_ERR(ptr) : 0; }


x86 assembly (clang, -O0):
<PTR_ERR_OR_ZERO>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <IS_ERR@plt>
cmp    $0x0,%rax
je     1151 <PTR_ERR_OR_ZERO+0x31>
mov    -0x8(%rbp),%rdi
call   1030 <PTR_ERR@plt>
mov    %rax,-0x10(%rbp)
jmp    115c <PTR_ERR_OR_ZERO+0x3c>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    115c <PTR_ERR_OR_ZERO+0x3c>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PTR_ERR_OR_ZERO>:
push   %rbx
mov    %rdi,%rbx
call   1040 <IS_ERR@plt>
test   %rax,%rax
je     1137 <PTR_ERR_OR_ZERO+0x17>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <PTR_ERR@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @PTR_ERR_OR_ZERO(i8* %0) {
%2 = tail call i64 @IS_ERR(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i64 @PTR_ERR(i8* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i64 [ %5, %4 ], [ 0, %1 ]
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ host_raise(int);
void host_signal_send_self(int sig_nr) { host_raise(sig_nr); }


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

x86 assembly (clang, -O2):
<host_signal_send_self>:
jmp    1030 <host_raise@plt>

LLVM IR (-O0):
define void @host_signal_send_self(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @host_raise(i32 %3)
ret void
}

LLVM IR (-O2):
define void @host_signal_send_self(i32 %0) {
%2 = tail call i32 @host_raise(i32 %0)
ret void
}
/* Variables and functions */
int rand();
int nonzero_random(int modulo) {
  int range = modulo - 1;
  return rand() % range + 1;
}


x86 assembly (clang, -O0):
<nonzero_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nonzero_random>:
push   %rbx
mov    %edi,%ebx
add    $0xffffffff,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
lea    0x1(%rdx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @nonzero_random(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 1
store i32 %5, i32* %3
%6 = call i32 (...) @rand()
%7 = load i32, i32* %3
%8 = srem i32 %6, %7
%9 = add nsw i32 %8, 1
ret i32 %9
}

LLVM IR (-O2):
define i32 @nonzero_random(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, %2
%5 = add nsw i32 %4, 1
ret i32 %5
}
void *xFindSymbol(void *handle, char *name) {}


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

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

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

LLVM IR (-O2):
define noalias i8* @xFindSymbol(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ Scl_ConGetInLoad(int);
float Scl_Int2Flt(int /*<<< orphan*/);
float Scl_ConGetInLoadFloat(int i) { return Scl_Int2Flt(Scl_ConGetInLoad(i)); }


x86 assembly (clang, -O0):
<Scl_ConGetInLoadFloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <Scl_ConGetInLoad@plt>
mov    %eax,%edi
call   1030 <Scl_Int2Flt@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define float @Scl_ConGetInLoadFloat(i32 %0) {
%2 = tail call i32 @Scl_ConGetInLoad(i32 %0)
%3 = tail call float @Scl_Int2Flt(i32 %2)
ret float %3
}
/* Type definitions */
typedef int uint8_t;
typedef int int16_t;

/* Variables and functions */
uint8_t tlm_encode_wspr_temp(int16_t temperature) {
  if (temperature < -50) {
    return 0;
  }
  if (temperature > 44) {
    return 18;
  }
  return (temperature + 50) / 5;
}


x86 assembly (clang, -O0):
<tlm_encode_wspr_temp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xffffffce,-0x8(%rbp)
jge    111d <tlm_encode_wspr_temp+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1144 <tlm_encode_wspr_temp+0x44>
cmpl   $0x2c,-0x8(%rbp)
jle    1133 <tlm_encode_wspr_temp+0x33>
movl   $0x12,-0x4(%rbp)
jmp    1144 <tlm_encode_wspr_temp+0x44>
mov    -0x8(%rbp),%eax
add    $0x32,%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tlm_encode_wspr_temp>:
xor    %eax,%eax
cmp    $0xffffffce,%edi
jl     1122 <tlm_encode_wspr_temp+0x22>
mov    $0x12,%eax
cmp    $0x2c,%edi
jg     1122 <tlm_encode_wspr_temp+0x22>
add    $0x32,%dil
movzbl %dil,%eax
imul   $0xcd,%eax,%eax
shr    $0xa,%eax
ret

LLVM IR (-O0):
define i32 @tlm_encode_wspr_temp(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, -50
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %15
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 44
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 18, i32* %2
br label %15
11: ; preds = %7
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 50
%14 = sdiv i32 %13, 5
store i32 %14, i32* %2
br label %15
15: ; preds = %11, %10, %6
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @tlm_encode_wspr_temp(i32 %0) {
%2 = icmp slt i32 %0, -50
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = icmp sgt i32 %0, 44
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = trunc i32 %0 to i8
%7 = add nsw i8 %6, 50
%8 = udiv i8 %7, 5
%9 = zext i8 %8 to i32
br label %10
10: ; preds = %3, %1, %5
%11 = phi i32 [ %9, %5 ], [ 0, %1 ], [ 18, %3 ]
ret i32 %11
}
int test_imm_9Bint32_mem(int *val) {
  return ((*val) & (0x9B << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_9Bint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 155
%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_9Bint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 155
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ rb_warning(char *);
void rb_enable_super(void) { rb_warning("rb_enable_super() is obsolete"); }


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"rb_enable_super() is obsolete\00"
define void @rb_enable_super() {
%1 = call i32 @rb_warning(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"rb_enable_super() is obsolete\00"
define void @rb_enable_super() {
%1 = tail call i32 @rb_warning(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ isalnum(int);
int valid_identifier(int ch) {
  if (isalnum(ch) || ch == '-' || ch == '_' || ch == '#') {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<valid_identifier>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isalnum@plt>
cmp    $0x0,%rax
jne    114b <valid_identifier+0x3b>
cmpl   $0x2d,-0x8(%rbp)
je     114b <valid_identifier+0x3b>
cmpl   $0x5f,-0x8(%rbp)
je     114b <valid_identifier+0x3b>
cmpl   $0x23,-0x8(%rbp)
jne    1157 <valid_identifier+0x47>
movl   $0x1,-0x4(%rbp)
jmp    115e <valid_identifier+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_identifier>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1127 <valid_identifier+0x17>
pop    %rbx
ret
add    $0xffffffdd,%ebx
cmp    $0x3c,%ebx
ja     113f <valid_identifier+0x2f>
movabs $0x1000000000000401,%rcx
bt     %rbx,%rcx
jb     1125 <valid_identifier+0x15>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @valid_identifier(i32 %0) {
%2 = tail call i64 @isalnum(i32 %0)
%3 = freeze i64 %2
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
switch i32 %0, label %6 [
i32 95, label %7
i32 45, label %7
i32 35, label %7
]
6: ; preds = %5
br label %7
7: ; preds = %1, %5, %5, %5, %6
%8 = phi i32 [ 0, %6 ], [ 1, %5 ], [ 1, %5 ], [ 1, %5 ], [ 1, %1 ]
ret i32 %8
}
/* Type definitions */
typedef char wint_t;
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
scalar_t__ iswupper_l(char, int /*<<< orphan*/);
wint_t towlower_l(wint_t wc, locale_t locale) {
  if (iswupper_l(wc, locale)) {
    return wc - 'A' + 'a';
  }
  return wc;
}


x86 assembly (clang, -O0):
<towlower_l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x2(%rbp),%al
mov    -0x8(%rbp),%esi
movsbl %al,%edi
call   1030 <iswupper_l@plt>
cmp    $0x0,%rax
je     114b <towlower_l+0x3b>
movsbl -0x2(%rbp),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %al,-0x1(%rbp)
jmp    1151 <towlower_l+0x41>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<towlower_l>:
push   %rbx
mov    %edi,%ebx
call   1030 <iswupper_l@plt>
lea    0x20(%rbx),%ecx
test   %rax,%rax
movzbl %cl,%eax
cmove  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @towlower_l(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
%6 = load i8, i8* %4
%7 = load i32, i32* %5
%8 = call i64 @iswupper_l(i8 signext %6, i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load i8, i8* %4
%12 = sext i8 %11 to i32
%13 = sub nsw i32 %12, 65
%14 = add nsw i32 %13, 97
%15 = trunc i32 %14 to i8
store i8 %15, i8* %3
br label %18
16: ; preds = %2
%17 = load i8, i8* %4
store i8 %17, i8* %3
br label %18
18: ; preds = %16, %10
%19 = load i8, i8* %3
ret i8 %19
}

LLVM IR (-O2):
define signext i8 @towlower_l(i8 signext %0, i32 %1) {
%3 = tail call i64 @iswupper_l(i8 signext %0, i32 %1)
%4 = icmp eq i64 %3, 0
%5 = add i8 %0, 32
%6 = select i1 %4, i8 %0, i8 %5
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ assert(char const *);
scalar_t__ get_key(char const *, int /*<<< orphan*/);
char const *smaunch_fs_has_database();
int smaunch_fs_has_key(const char *key) {
  assert(key);
  assert(smaunch_fs_has_database());
  return ((get_key(key, 0)) >= 0);
}


x86 assembly (clang, -O0):
<smaunch_fs_has_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
mov    $0x0,%al
call   1050 <smaunch_fs_has_database@plt>
mov    %rax,%rdi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1040 <get_key@plt>
cmp    $0x0,%rax
setge  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smaunch_fs_has_key>:
push   %rbx
mov    %rdi,%rbx
call   1030 <assert@plt>
xor    %eax,%eax
call   1050 <smaunch_fs_has_database@plt>
mov    %rax,%rdi
call   1030 <assert@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <get_key@plt>
shr    $0x3f,%rax
xor    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @smaunch_fs_has_key(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @assert(i8* %3)
%5 = call i8* (...) @smaunch_fs_has_database()
%6 = call i32 @assert(i8* %5)
%7 = load i8*, i8** %2
%8 = call i64 @get_key(i8* %7, i32 0)
%9 = icmp sge i64 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @smaunch_fs_has_key(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
%3 = tail call i8* (...) @smaunch_fs_has_database()
%4 = tail call i32 @assert(i8* %3)
%5 = tail call i64 @get_key(i8* %0, i32 0)
%6 = lshr i64 %5, 63
%7 = trunc i64 %6 to i32
%8 = xor i32 %7, 1
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_invalid_command(void) {
  {
    fprintf(
        stderr,
        "The message you typed is incorrect. If you need help type %%HELP\n");
  };
}


x86 assembly (clang, -O0):
<print_invalid_command>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_invalid_command>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [66 x i8] c"The message you typed is incorrect. If you need help type %%HELP\0A\00"
define void @print_invalid_command() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [66 x i8] c"The message you typed is incorrect. If you need help type %%HELP\0A\00"
define void @print_invalid_command() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
ret void
}
int algorithm(int n) {
  int length = 0;
  while (n != 1) {
    if (n % 2 != 0) {
      n = 3 * n + 1;
    } else {
      n /= 2;
    }
    length++;
  }
  return ++length;
}


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

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

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

LLVM IR (-O2):
define i32 @algorithm(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %17, label %3
3: ; preds = %1, %13
%4 = phi i32 [ %15, %13 ], [ 1, %1 ]
%5 = phi i32 [ %14, %13 ], [ %0, %1 ]
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %3
%9 = mul nsw i32 %5, 3
%10 = add nsw i32 %9, 1
br label %13
11: ; preds = %3
%12 = sdiv i32 %5, 2
br label %13
13: ; preds = %11, %8
%14 = phi i32 [ %10, %8 ], [ %12, %11 ]
%15 = add i32 %4, 1
%16 = icmp eq i32 %14, 1
br i1 %16, label %17, label %3
17: ; preds = %13, %1
%18 = phi i32 [ 1, %1 ], [ %15, %13 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("Welcome to pottailex\n"); }


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

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

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

LLVM IR (-O2):
@str = [21 x i8] c"Welcome to pottailex\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ Cyc_Character_isupper(unsigned char);
unsigned char Cyc_Character_tolower(unsigned char c) {
  if (Cyc_Character_isupper(c)) {
    c += 'a' - 'A';
  }
  return c;
}


x86 assembly (clang, -O0):
<Cyc_Character_tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <Cyc_Character_isupper@plt>
cmp    $0x0,%rax
je     113b <Cyc_Character_tolower+0x2b>
movzbl -0x1(%rbp),%eax
add    $0x20,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Character_tolower>:
push   %rbx
mov    %edi,%ebx
call   1030 <Cyc_Character_isupper@plt>
lea    0x20(%rbx),%ecx
test   %rax,%rax
movzbl %cl,%eax
cmove  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i8 @Cyc_Character_tolower(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @Cyc_Character_isupper(i8 zeroext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = add nsw i32 %8, 32
%10 = trunc i32 %9 to i8
store i8 %10, i8* %2
br label %11
11: ; preds = %6, %1
%12 = load i8, i8* %2
ret i8 %12
}

LLVM IR (-O2):
define zeroext i8 @Cyc_Character_tolower(i8 zeroext %0) {
%2 = tail call i64 @Cyc_Character_isupper(i8 zeroext %0)
%3 = icmp eq i64 %2, 0
%4 = add i8 %0, 32
%5 = select i1 %3, i8 %0, i8 %4
ret i8 %5
}
/* Type definitions */
typedef size_t int32_t;

/* Variables and functions */
scalar_t__ tolower(char);
char *http_lc(char *str) {
  for (int32_t i = 0; str[i]; i++)
    str[i] = (char)tolower(str[i]);
  return str;
}


x86 assembly (clang, -O0):
<http_lc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1165 <http_lc+0x55>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <tolower@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <http_lc+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<http_lc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1146 <http_lc+0x36>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <http_lc+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @http_lc(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* %3
br label %4
4: ; preds = %20, %1
%5 = load i8*, i8** %2
%6 = load i64, i64* %3
%7 = getelementptr inbounds i8, i8* %5, i64 %6
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %23
10: ; preds = %4
%11 = load i8*, i8** %2
%12 = load i64, i64* %3
%13 = getelementptr inbounds i8, i8* %11, i64 %12
%14 = load i8, i8* %13
%15 = call i64 @tolower(i8 signext %14)
%16 = trunc i64 %15 to i8
%17 = load i8*, i8** %2
%18 = load i64, i64* %3
%19 = getelementptr inbounds i8, i8* %17, i64 %18
store i8 %16, i8* %19
br label %20
20: ; preds = %10
%21 = load i64, i64* %3
%22 = add i64 %21, 1
store i64 %22, i64* %3
br label %4
23: ; preds = %4
%24 = load i8*, i8** %2
ret i8* %24
}

LLVM IR (-O2):
define i8* @http_lc(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %1
ret i8* %0
5: ; preds = %1, %5
%6 = phi i8 [ %13, %5 ], [ %2, %1 ]
%7 = phi i8* [ %12, %5 ], [ %0, %1 ]
%8 = phi i64 [ %11, %5 ], [ 0, %1 ]
%9 = tail call i64 @tolower(i8 signext %6)
%10 = trunc i64 %9 to i8
store i8 %10, i8* %7
%11 = add i64 %8, 1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %4, label %5
}
/* Variables and functions */
int /*<<< orphan*/ reshapeviewport();
int reshap_() { reshapeviewport(); }


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

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

LLVM IR (-O0):
define i32 @reshap_() {
%1 = alloca i32
%2 = call i32 (...) @reshapeviewport()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @reshap_() {
%1 = tail call i32 (...) @reshapeviewport()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void UserMenu(void) {
  printf(" Make a choice from the Menu below\n\n"
         "\t1 to add item to the list.\n"
         "\t2 to print the items in the list.\n"
         "\t3 to quit the program.\n"
         "\tEnter a number?: ");
}


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

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

LLVM IR (-O0):
@.str = [142 x i8] c" Make a choice from the Menu below\0A\0A\091 to add item to the list.\0A\092 to print the items in the list.\0A\093 to quit the program.\0A\09Enter a number?: \00"
define void @UserMenu() {
%1 = call i32 @printf(i8* getelementptr inbounds ([142 x i8], [142 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [142 x i8] c" Make a choice from the Menu below\0A\0A\091 to add item to the list.\0A\092 to print the items in the list.\0A\093 to quit the program.\0A\09Enter a number?: \00"
define void @UserMenu() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([142 x i8], [142 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void copy(char *arg) {
  char buf[1000];
  memcpy(buf, arg, strlen(arg));
}


x86 assembly (clang, -O0):
<copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x3f0(%rbp),%rax
mov    %rax,-0x400(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x3f8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x400(%rbp),%rdi
mov    -0x3f8(%rbp),%rsi
mov    %eax,%edx
call   1040 <memcpy@plt>
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy>:
push   %rbx
sub    $0x3f0,%rsp
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rsp,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <memcpy@plt>
add    $0x3f0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @copy(i8* %0) {
%2 = alloca i8*
%3 = alloca [1000 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
%8 = call i32 @memcpy(i8* %4, i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @copy(i8* %0) {
%2 = alloca [1000 x i8]
%3 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @strlen(i8* %0)
%5 = call i32 @memcpy(i8* %3, i8* %0, i32 %4)
ret void
}
unsigned long tegra_throttle_governor_speed(unsigned long requested_speed) {
  return requested_speed;
}


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

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

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

LLVM IR (-O2):
define i64 @tegra_throttle_governor_speed(i64 returned %0) {
ret i64 %0
}
int __crow_div(int a, int b) { return a / b; }


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

x86 assembly (clang, -O2):
<__crow_div>:
mov    %edi,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @__crow_div(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* %4
%7 = sdiv i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @__crow_div(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
int main() {
  int x = 7;
  while (1) {
    x = 2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x7,-0x8(%rbp)
movl   $0x2,-0x8(%rbp)
jmp    1112 <main+0x12>

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 7, i32* %2
br label %3
3: ; preds = %0, %3
store i32 2, i32* %2
br label %3
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
int calc_Hbytes(int channels, int subframes) {
  int Hbits = 40 + subframes * channels * 4;
  int Hsize = (Hbits + channels - 1) / channels;
  int Hbytes = ((Hsize + 7) / 8);
  Hbytes = (((Hbytes) > (4)) ? (Hbytes) : (4));
  return (Hbytes);
}


x86 assembly (clang, -O0):
<calc_Hbytes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x4(%rbp),%eax
shl    $0x2,%eax
add    $0x28,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    -0x4(%rbp),%eax
sub    $0x1,%eax
cltd
idivl  -0x4(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x7,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jle    1150 <calc_Hbytes+0x50>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    115d <calc_Hbytes+0x5d>
mov    $0x4,%eax
mov    %eax,-0x18(%rbp)
jmp    115d <calc_Hbytes+0x5d>
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_Hbytes>:
imul   %edi,%esi
lea    (%rdi,%rsi,4),%eax
add    $0x27,%eax
cltd
idiv   %edi
lea    0x7(%rax),%ecx
add    $0xe,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
sar    $0x3,%eax
cmp    $0x5,%eax
mov    $0x4,%ecx
cmovl  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @calc_Hbytes(i32 %0, i32 %1) {
%3 = shl i32 %0, 2
%4 = mul i32 %3, %1
%5 = add i32 %0, 39
%6 = add i32 %5, %4
%7 = sdiv i32 %6, %0
%8 = add nsw i32 %7, 7
%9 = sdiv i32 %8, 8
%10 = icmp sgt i32 %9, 4
%11 = select i1 %10, i32 %9, i32 4
ret i32 %11
}
void RTVfsIoStrmFromRTFile(void) {}


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

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

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

LLVM IR (-O2):
define void @RTVfsIoStrmFromRTFile() {
ret void
}
void dv2o_division(double *output, double *a, double b) {
  output[0] = a[0] / b;
  output[1] = a[1] / b;
}


x86 assembly (clang, -O0):
<dv2o_division>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
divsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
divsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dv2o_division>:
movsd  (%rsi),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rdi)
movsd  0x8(%rsi),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rdi)
ret

LLVM IR (-O0):
define void @dv2o_division(double* %0, double* %1, double %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double
store double* %0, double** %4
store double* %1, double** %5
store double %2, double* %6
%7 = load double*, double** %5
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
%10 = load double, double* %6
%11 = fdiv double %9, %10
%12 = load double*, double** %4
%13 = getelementptr inbounds double, double* %12, i64 0
store double %11, double* %13
%14 = load double*, double** %5
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = load double, double* %6
%18 = fdiv double %16, %17
%19 = load double*, double** %4
%20 = getelementptr inbounds double, double* %19, i64 1
store double %18, double* %20
ret void
}

LLVM IR (-O2):
define void @dv2o_division(double* nocapture writeonly %0, double* nocapture %1, double %2) {
%4 = load double, double* %1
%5 = fdiv double %4, %2
store double %5, double* %0
%6 = getelementptr inbounds double, double* %1, i64 1
%7 = load double, double* %6
%8 = fdiv double %7, %2
%9 = getelementptr inbounds double, double* %0, i64 1
store double %8, double* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void chargeClient() { printf("You have now been charged for your order.\n"); }


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

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

LLVM IR (-O0):
@.str = [43 x i8] c"You have now been charged for your order.\0A\00"
define void @chargeClient() {
%1 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [42 x i8] c"You have now been charged for your order.\00"
define void @chargeClient() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
ret void
}
char *my_index(str, chr) const char *str;
int chr;
{
  while (*str) {
    if (*str == chr)
      return (char *)str;
    str++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<my_index>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <my_index+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1135 <my_index+0x35>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114e <my_index+0x4e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <my_index+0xb>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_index>:
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <my_index+0x23>
mov    %rdi,%rax
nopl   0x0(%rax)
movsbl %cl,%ecx
cmp    %esi,%ecx
je     1125 <my_index+0x25>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <my_index+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @my_index(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %10
%6 = phi i8 [ %12, %10 ], [ %3, %2 ]
%7 = phi i8* [ %11, %10 ], [ %0, %2 ]
%8 = sext i8 %6 to i32
%9 = icmp eq i32 %8, %1
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %10, %2
%15 = phi i8* [ null, %2 ], [ null, %10 ], [ %7, %5 ]
ret i8* %15
}
double dAUX1bp0b(double x) { return -x / 3.0 * (1.0 - 7 * x * x / 30.0); }


x86 assembly (clang, -O0):
<dAUX1bp0b>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xeeb(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xed7(%rip),%xmm2
mulsd  -0x8(%rbp),%xmm2
mulsd  -0x8(%rbp),%xmm2
movsd  0xebd(%rip),%xmm1
divsd  %xmm1,%xmm2
movsd  0xea9(%rip),%xmm1
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dAUX1bp0b>:
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
unpcklpd %xmm1,%xmm0
divpd  0xef4(%rip),%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
movsd  0xedc(%rip),%xmm2
subsd  %xmm1,%xmm2
mulsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @dAUX1bp0b(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
%5 = fdiv double %4, 3.000000e+00
%6 = load double, double* %2
%7 = fmul double 7.000000e+00, %6
%8 = load double, double* %2
%9 = fmul double %7, %8
%10 = fdiv double %9, 3.000000e+01
%11 = fsub double 1.000000e+00, %10
%12 = fmul double %5, %11
ret double %12
}

LLVM IR (-O2):
define double @dAUX1bp0b(double %0) {
%2 = fmul double %0, 7.000000e+00
%3 = fmul double %2, %0
%4 = insertelement <2 x double> poison, double %0, i64 0
%5 = insertelement <2 x double> %4, double %3, i64 1
%6 = fdiv <2 x double> %5, <double -3.000000e+00, double 3.000000e+01>
%7 = extractelement <2 x double> %6, i64 1
%8 = fsub double 1.000000e+00, %7
%9 = extractelement <2 x double> %6, i64 0
%10 = fmul double %9, %8
ret double %10
}
int numcmp(int n1, int n2) {
  if ((unsigned)(n1 & 0xffff) < (unsigned)(n2 & 0xffff))
    return (-1);
  else if ((unsigned)(n1 & 0xffff) > (unsigned)(n2 & 0xffff))
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<numcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffff,%eax
mov    -0xc(%rbp),%ecx
and    $0xffff,%ecx
cmp    %ecx,%eax
jae    112f <numcmp+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    115b <numcmp+0x5b>
mov    -0x8(%rbp),%eax
and    $0xffff,%eax
mov    -0xc(%rbp),%ecx
and    $0xffff,%ecx
cmp    %ecx,%eax
jbe    1154 <numcmp+0x54>
movl   $0x1,-0x4(%rbp)
jmp    115b <numcmp+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numcmp>:
movzwl %di,%eax
movzwl %si,%ecx
xor    %edx,%edx
cmp    %ecx,%eax
seta   %dl
mov    $0xffffffff,%eax
cmovae %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @numcmp(i32 %0, i32 %1) {
%3 = and i32 %0, 65535
%4 = and i32 %1, 65535
%5 = icmp ult i32 %3, %4
%6 = icmp ugt i32 %3, %4
%7 = zext i1 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printw(char *);
int strlen(char *);
void equalizeSpacing(char *name, int maxNameSize) {
  int i = strlen(name);
  while (i != maxNameSize) {
    printw(" ");
    ++i;
  }
}


x86 assembly (clang, -O0):
<equalizeSpacing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1161 <equalizeSpacing+0x41>
lea    0xeb2(%rip),%rdi
call   1040 <printw@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113b <equalizeSpacing+0x1b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<equalizeSpacing>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
call   1030 <strlen@plt>
cmp    %ebx,%eax
je     114d <equalizeSpacing+0x2d>
sub    %eax,%ebx
lea    0xec8(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1040 <printw@plt>
add    $0xffffffff,%ebx
jne    1140 <equalizeSpacing+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define void @equalizeSpacing(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = icmp eq i32 %3, %1
br i1 %4, label %10, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ %3, %2 ]
%7 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = add nsw i32 %6, 1
%9 = icmp eq i32 %8, %1
br i1 %9, label %10, label %5
10: ; preds = %5, %2
ret void
}
/* Variables and functions */
double exp(double const);
double HHNa_alpha2(const double v) { return 0.07 * exp(-v / 20); }


x86 assembly (clang, -O0):
<HHNa_alpha2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xec7(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  0xeab(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HHNa_alpha2>:
push   %rax
divsd  0xee7(%rip),%xmm0
call   1030 <exp@plt>
mulsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @HHNa_alpha2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
%5 = fdiv double %4, 2.000000e+01
%6 = call double @exp(double %5)
%7 = fmul double 7.000000e-02, %6
ret double %7
}

LLVM IR (-O2):
define double @HHNa_alpha2(double %0) {
%2 = fdiv double %0, -2.000000e+01
%3 = tail call double @exp(double %2)
%4 = fmul double %3, 7.000000e-02
ret double %4
}