xunge/DecIR huggingface dataset:
int offset_and_clip_value(int input_value, int offset_value, int min_val,
                          int max_val) {
  int offset_and_clipped = input_value + offset_value;
  if (offset_and_clipped > max_val)
    offset_and_clipped = max_val;
  else if (offset_and_clipped < min_val)
    offset_and_clipped = min_val;
  return (offset_and_clipped);
}


x86 assembly (clang, -O0):
<offset_and_clip_value>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1130 <offset_and_clip_value+0x30>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1147 <offset_and_clip_value+0x47>
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1142 <offset_and_clip_value+0x42>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1147 <offset_and_clip_value+0x47>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<offset_and_clip_value>:
mov    %edx,%eax
add    %esi,%edi
cmp    %edx,%edi
cmovge %edi,%eax
cmp    %ecx,%edi
cmovg  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @offset_and_clip_value(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %1, %0
%6 = icmp sgt i32 %5, %3
%7 = icmp slt i32 %5, %2
%8 = select i1 %7, i32 %2, i32 %5
%9 = select i1 %6, i32 %3, i32 %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ ReverseN(void *, int);
void Reverse64(void *ptr) { ReverseN(ptr, 8); }


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

x86 assembly (clang, -O2):
<Reverse64>:
mov    $0x8,%esi
jmp    1030 <ReverseN@plt>

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

LLVM IR (-O2):
define void @Reverse64(i8* %0) {
%2 = tail call i32 @ReverseN(i8* %0, i32 8)
ret void
}
/* Variables and functions */
int SIM_power_gatecap(double, int);
double SIM_array_outdrv_chgdata_cap(void) {
  return ((SIM_power_gatecap((24.0 * 0.0875), 1) +
           SIM_power_gatecap((10.0 * 0.0875), 1) +
           SIM_power_gatecap((6.0 * 0.0875), 1) +
           SIM_power_gatecap((40.0 * 0.0875), 1)) /
          2);
}


x86 assembly (clang, -O0):
<SIM_array_outdrv_chgdata_cap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  0xef8(%rip),%xmm0
mov    $0x1,%edi
call   1030 <SIM_power_gatecap@plt>
mov    %eax,-0xc(%rbp)
movsd  0xedb(%rip),%xmm0
mov    $0x1,%edi
call   1030 <SIM_power_gatecap@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
movsd  0xeb7(%rip),%xmm0
mov    $0x1,%edi
call   1030 <SIM_power_gatecap@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
movsd  0xe93(%rip),%xmm0
mov    $0x1,%edi
call   1030 <SIM_power_gatecap@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
add    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SIM_array_outdrv_chgdata_cap>:
push   %rbp
push   %rbx
push   %rax
movsd  0xee5(%rip),%xmm0
mov    $0x1,%edi
call   1030 <SIM_power_gatecap@plt>
mov    %eax,%ebx
movsd  0xed9(%rip),%xmm0
mov    $0x1,%edi
call   1030 <SIM_power_gatecap@plt>
mov    %eax,%ebp
add    %ebx,%ebp
movsd  0xecb(%rip),%xmm0
mov    $0x1,%edi
call   1030 <SIM_power_gatecap@plt>
mov    %eax,%ebx
add    %ebp,%ebx
movsd  0xebd(%rip),%xmm0
mov    $0x1,%edi
call   1030 <SIM_power_gatecap@plt>
add    %ebx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define double @SIM_array_outdrv_chgdata_cap() {
%1 = call i32 @SIM_power_gatecap(double 0x4000CCCCCCCCCCCC, i32 1)
%2 = call i32 @SIM_power_gatecap(double 8.750000e-01, i32 1)
%3 = add nsw i32 %1, %2
%4 = call i32 @SIM_power_gatecap(double 0x3FE0CCCCCCCCCCCC, i32 1)
%5 = add nsw i32 %3, %4
%6 = call i32 @SIM_power_gatecap(double 3.500000e+00, i32 1)
%7 = add nsw i32 %5, %6
%8 = sdiv i32 %7, 2
%9 = sitofp i32 %8 to double
ret double %9
}

LLVM IR (-O2):
define double @SIM_array_outdrv_chgdata_cap() {
%1 = tail call i32 @SIM_power_gatecap(double 0x4000CCCCCCCCCCCC, i32 1)
%2 = tail call i32 @SIM_power_gatecap(double 8.750000e-01, i32 1)
%3 = add nsw i32 %2, %1
%4 = tail call i32 @SIM_power_gatecap(double 0x3FE0CCCCCCCCCCCC, i32 1)
%5 = add nsw i32 %3, %4
%6 = tail call i32 @SIM_power_gatecap(double 3.500000e+00, i32 1)
%7 = add nsw i32 %5, %6
%8 = sdiv i32 %7, 2
%9 = sitofp i32 %8 to double
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo() { printf("HELLO WORLD\n"); }


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"HELLO WORLD\00"
define void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo();
void test_invalid_clause() {
  int i;
#pragma omp parallel
#pragma omp single foo bar
  foo();
}


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

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

LLVM IR (-O0):
define void @test_invalid_clause() {
%1 = alloca i32
%2 = call i32 (...) @foo()
ret void
}

LLVM IR (-O2):
define void @test_invalid_clause() {
%1 = tail call i32 (...) @foo()
ret void
}
void writeClose(void) {
  int volatile *IO = (int *)(0x3c000000 + 4 * 0x00000020);
  *(IO + 1) = 1;
}


x86 assembly (clang, -O0):
<writeClose>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3c000080,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeClose>:
movl   $0x1,0x3c000084
ret

LLVM IR (-O0):
define void @writeClose() {
%1 = alloca i32*
store i32* inttoptr (i64 1006633088 to i32*), i32** %1
%2 = load i32*, i32** %1
%3 = getelementptr inbounds i32, i32* %2, i64 1
store volatile i32 1, i32* %3
ret void
}

LLVM IR (-O2):
define void @writeClose() {
store volatile i32 1, i32* inttoptr (i64 1006633092 to i32*)
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint64_t time_now_usecs() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return (tv.tv_sec * 1000000) + tv.tv_usec;
}


x86 assembly (clang, -O0):
<time_now_usecs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x10(%rbp),%eax
cltq
add    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_now_usecs>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq 0x8(%rsp),%rax
imul   $0xf4240,%rax,%rax
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i64 @time_now_usecs() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000000
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%8 = load i64, i64* %7
%9 = add nsw i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i64 @time_now_usecs() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%9 = load i64, i64* %8
%10 = add nsw i64 %9, %7
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void init_scanner() {
  printf("%-20s%s\n", "TOKEN-TYPE", "TOKEN-VALUE");
  printf("-------------------------------------------------\n");
}


x86 assembly (clang, -O0):
<init_scanner>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee7(%rip),%rsi
lea    0xeeb(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_scanner>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xeda(%rip),%rsi
lea    0xede(%rip),%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xedc(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"%-20s%s\0A\00"
@.str.1 = [11 x i8] c"TOKEN-TYPE\00"
@.str.2 = [12 x i8] c"TOKEN-VALUE\00"
@.str.3 = [51 x i8] c"-------------------------------------------------\0A\00"
define void @init_scanner() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"%-20s%s\0A\00"
@.str.1 = [11 x i8] c"TOKEN-TYPE\00"
@.str.2 = [12 x i8] c"TOKEN-VALUE\00"
@str = [50 x i8] c"-------------------------------------------------\00"
define void @init_scanner() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ST7735_SetTextColor(int /*<<< orphan*/);
void Output_Color(uint32_t newColor) { ST7735_SetTextColor(newColor); }


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

x86 assembly (clang, -O2):
<Output_Color>:
jmp    1030 <ST7735_SetTextColor@plt>

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

LLVM IR (-O2):
define void @Output_Color(i32 %0) {
%2 = tail call i32 @ST7735_SetTextColor(i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ readide(int, int /*<<< orphan*/);
uint8_t ide_read_qua(uint16_t addr, void *priv) { return readide(3, addr); }


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

x86 assembly (clang, -O2):
<ide_read_qua>:
mov    %edi,%esi
mov    $0x3,%edi
jmp    1030 <readide@plt>

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

LLVM IR (-O2):
define i32 @ide_read_qua(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 @readide(i32 3, i32 %0)
ret i32 %3
}
void oil_test_get_source_data(void) {}


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

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

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

LLVM IR (-O2):
define void @oil_test_get_source_data() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gpio_dir(int, int /*<<< orphan*/);
int /*<<< orphan*/ gpio_export(int);
void water_init(void) {
  gpio_export(20);
  gpio_export(21);
  gpio_dir(20, 0);
  gpio_dir(21, 0);
}


x86 assembly (clang, -O0):
<water_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x14,%edi
call   1040 <gpio_export@plt>
mov    $0x15,%edi
call   1040 <gpio_export@plt>
mov    $0x14,%edi
xor    %esi,%esi
call   1030 <gpio_dir@plt>
mov    $0x15,%edi
xor    %esi,%esi
call   1030 <gpio_dir@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<water_init>:
push   %rax
mov    $0x14,%edi
call   1040 <gpio_export@plt>
mov    $0x15,%edi
call   1040 <gpio_export@plt>
mov    $0x14,%edi
xor    %esi,%esi
call   1030 <gpio_dir@plt>
mov    $0x15,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <gpio_dir@plt>

LLVM IR (-O0):
define void @water_init() {
%1 = call i32 @gpio_export(i32 20)
%2 = call i32 @gpio_export(i32 21)
%3 = call i32 @gpio_dir(i32 20, i32 0)
%4 = call i32 @gpio_dir(i32 21, i32 0)
ret void
}

LLVM IR (-O2):
define void @water_init() {
%1 = tail call i32 @gpio_export(i32 20)
%2 = tail call i32 @gpio_export(i32 21)
%3 = tail call i32 @gpio_dir(i32 20, i32 0)
%4 = tail call i32 @gpio_dir(i32 21, i32 0)
ret void
}
unsigned char opdi_slave_init() { return 0; }


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

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

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

LLVM IR (-O2):
define zeroext i8 @opdi_slave_init() {
ret i8 0
}
/* Variables and functions */
char chars_to_upper(char);
int chars_order_ignore_case(char c1, char c2) {
  c1 = chars_to_upper(c1);
  c2 = chars_to_upper(c2);
  if (c1 > c2)
    return -1;
  else if (c1 < c2)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<chars_order_ignore_case>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <chars_to_upper@plt>
mov    %al,-0x5(%rbp)
movsbl -0x6(%rbp),%edi
call   1030 <chars_to_upper@plt>
mov    %al,-0x6(%rbp)
movsbl -0x5(%rbp),%eax
movsbl -0x6(%rbp),%ecx
cmp    %ecx,%eax
jle    1158 <chars_order_ignore_case+0x48>
movl   $0xffffffff,-0x4(%rbp)
jmp    117b <chars_order_ignore_case+0x6b>
movsbl -0x5(%rbp),%eax
movsbl -0x6(%rbp),%ecx
cmp    %ecx,%eax
jge    1174 <chars_order_ignore_case+0x64>
movl   $0x1,-0x4(%rbp)
jmp    117b <chars_order_ignore_case+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chars_order_ignore_case>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1030 <chars_to_upper@plt>
mov    %eax,%ebx
mov    %ebp,%edi
call   1030 <chars_to_upper@plt>
xor    %ecx,%ecx
cmp    %al,%bl
setl   %cl
mov    $0xffffffff,%eax
cmovle %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @chars_order_ignore_case(i8 signext %0, i8 signext %1) {
%3 = tail call signext i8 @chars_to_upper(i8 signext %0)
%4 = tail call signext i8 @chars_to_upper(i8 signext %1)
%5 = icmp sgt i8 %3, %4
%6 = icmp slt i8 %3, %4
%7 = zext i1 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
int test_imm_01uint16_reg(unsigned short val) {
  return ((val) & (-0x01 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_01uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -1
%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_01uint16_reg(i16 zeroext %0) {
%2 = icmp eq i16 %0, 0
%3 = select i1 %2, i32 -40, i32 -20
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ _T(char *);
int /*<<< orphan*/ _tprintf(int /*<<< orphan*/);
void DisplayHeader() {
  _tprintf(_T("Microsoft Windows CE Disk Partitioning Utility\n"));
  _tprintf(_T("Copyright 2006\n\n"));
}


x86 assembly (clang, -O0):
<DisplayHeader>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <_T@plt>
mov    %eax,%edi
call   1030 <_tprintf@plt>
lea    0xef2(%rip),%rdi
call   1040 <_T@plt>
mov    %eax,%edi
call   1030 <_tprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DisplayHeader>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <_T@plt>
mov    %eax,%edi
call   1030 <_tprintf@plt>
lea    0xef5(%rip),%rdi
call   1040 <_T@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <_tprintf@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"Microsoft Windows CE Disk Partitioning Utility\0A\00"
@.str.1 = [17 x i8] c"Copyright 2006\0A\0A\00"
define void @DisplayHeader() {
%1 = call i32 @_T(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @_tprintf(i32 %1)
%3 = call i32 @_T(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @_tprintf(i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [48 x i8] c"Microsoft Windows CE Disk Partitioning Utility\0A\00"
@.str.1 = [17 x i8] c"Copyright 2006\0A\0A\00"
define void @DisplayHeader() {
%1 = tail call i32 @_T(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @_tprintf(i32 %1)
%3 = tail call i32 @_T(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @_tprintf(i32 %3)
ret void
}
/* Variables and functions */
int I2CWrapperReadByte(int, int);
int ValidateDevice(int handle) {
  if (I2CWrapperReadByte(handle, 7) == 0xe7)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ValidateDevice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x7,%esi
call   1030 <I2CWrapperReadByte@plt>
cmp    $0xe7,%eax
jne    113f <ValidateDevice+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    1146 <ValidateDevice+0x36>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ValidateDevice>:
push   %rax
mov    $0x7,%esi
call   1030 <I2CWrapperReadByte@plt>
xor    %ecx,%ecx
cmp    $0xe7,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ValidateDevice(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @I2CWrapperReadByte(i32 %4, i32 7)
%6 = icmp eq i32 %5, 231
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @ValidateDevice(i32 %0) {
%2 = tail call i32 @I2CWrapperReadByte(i32 %0, i32 7)
%3 = icmp eq i32 %2, 231
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int getkth(int *, int, int *, int, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int a[] = {1, 3, 5, 7, 9};
  int b[] = {2, 4, 6};
  printf("%d\n", getkth(a, 5, b, 3, 7));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xebe(%rip),%eax
mov    %eax,-0x20(%rbp)
mov    0xeb8(%rip),%rax
mov    %rax,-0x3c(%rbp)
mov    0xeb6(%rip),%eax
mov    %eax,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
lea    -0x3c(%rbp),%rdx
mov    $0x5,%esi
mov    $0x3,%ecx
mov    $0x7,%r8d
call   1040 <getkth@plt>
mov    %eax,%esi
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xee6(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xecb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
mov    0xedc(%rip),%eax
mov    %eax,0x8(%rsp)
mov    0xec9(%rip),%rax
mov    %rax,(%rsp)
lea    0x10(%rsp),%rdi
mov    %rsp,%rdx
mov    $0x5,%esi
mov    $0x3,%ecx
mov    $0x7,%r8d
call   1040 <getkth@plt>
lea    0xead(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
@__const.main.a = [5 x i32] [i32 1, i32 3, i32 5, i32 7, i32 9]
@__const.main.b = [3 x i32] [i32 2, i32 4, i32 6]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [5 x i32]
%4 = alloca [3 x i32]
%5 = bitcast [5 x i32]* %3 to i8*
%6 = bitcast [3 x i32]* %4 to i8*
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
%9 = call i32 @getkth(i32* %7, i32 5, i32* %8, i32 3, i32 7)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}
unsigned xrop3_196_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~D;
  stk2 = T | stk3;
  stk1 = S & stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_196_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_196_1_1>:
mov    %edi,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_196_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %7
%26 = load i32, i32* %10
%27 = or i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %6
%29 = load i32, i32* %9
%30 = and i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
%32 = load i32, i32* %6
%33 = xor i32 %32, -1
%34 = and i32 %31, %33
%35 = load i32, i32* %7
%36 = xor i32 %35, -1
%37 = and i32 %34, %36
%38 = load i32, i32* %5
%39 = load i32, i32* %6
%40 = and i32 %38, %39
%41 = or i32 %37, %40
%42 = load i32, i32* %5
%43 = load i32, i32* %7
%44 = and i32 %42, %43
%45 = or i32 %41, %44
ret i32 %45
}

LLVM IR (-O2):
define i32 @xrop3_196_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = or i8 %1, %0
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
uint8_t *dhcp_append_option32(uint8_t *p_options, uint8_t opt, uint32_t val) {
  *p_options++ = opt;
  *p_options++ = 4;
  memcpy(p_options, &val, 4);
  p_options += 4;
  return p_options;
}


x86 assembly (clang, -O0):
<dhcp_append_option32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
movl   $0x4,(%rax)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dhcp_append_option32>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %edx,0xc(%rsp)
mov    %esi,(%rdi)
add    $0x8,%rdi
movl   $0x4,0x4(%rbx)
lea    0xc(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x18,%rbx
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32* @dhcp_append_option32(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i32 1
store i32* %9, i32** %4
store i32 %7, i32* %8
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i32 1
store i32* %11, i32** %4
store i32 4, i32* %10
%12 = load i32*, i32** %4
%13 = call i32 @memcpy(i32* %12, i32* %6, i32 4)
%14 = load i32*, i32** %4
%15 = getelementptr inbounds i32, i32* %14, i64 4
store i32* %15, i32** %4
%16 = load i32*, i32** %4
ret i32* %16
}

LLVM IR (-O2):
define i32* @dhcp_append_option32(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32
store i32 %2, i32* %4
%5 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %1, i32* %0
%6 = getelementptr inbounds i32, i32* %0, i64 2
store i32 4, i32* %5
%7 = call i32 @memcpy(i32* %6, i32* %4, i32 4)
%8 = getelementptr inbounds i32, i32* %0, i64 6
ret i32* %8
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t x87_compare(double a, double b) {
  uint32_t out = 0;
  if (a == b)
    out |= (1 << 14);
  else if (a < b)
    out |= (1 << 8);
  return out;
}


x86 assembly (clang, -O0):
<x87_compare>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jne    113b <x87_compare+0x3b>
jp     113b <x87_compare+0x3b>
mov    -0x14(%rbp),%eax
or     $0x4000,%eax
mov    %eax,-0x14(%rbp)
jmp    115f <x87_compare+0x5f>
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    115a <x87_compare+0x5a>
mov    -0x14(%rbp),%eax
or     $0x100,%eax
mov    %eax,-0x14(%rbp)
jmp    115f <x87_compare+0x5f>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<x87_compare>:
mov    $0x4000,%eax
ucomisd %xmm1,%xmm0
jne    110e <x87_compare+0xe>
jp     110e <x87_compare+0xe>
ret
xor    %eax,%eax
ucomisd %xmm0,%xmm1
jbe    110d <x87_compare+0xd>
mov    $0x100,%eax
ret

LLVM IR (-O0):
define i32 @x87_compare(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i32
store double %0, double* %3
store double %1, double* %4
store i32 0, i32* %5
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fcmp oeq double %6, %7
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i32, i32* %5
%11 = or i32 %10, 16384
store i32 %11, i32* %5
br label %20
12: ; preds = %2
%13 = load double, double* %3
%14 = load double, double* %4
%15 = fcmp olt double %13, %14
br i1 %15, label %16, label %19
16: ; preds = %12
%17 = load i32, i32* %5
%18 = or i32 %17, 256
store i32 %18, i32* %5
br label %19
19: ; preds = %16, %12
br label %20
20: ; preds = %19, %9
%21 = load i32, i32* %5
ret i32 %21
}

LLVM IR (-O2):
define i32 @x87_compare(double %0, double %1) {
%3 = fcmp oeq double %0, %1
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = fcmp olt double %0, %1
br i1 %5, label %6, label %7
6: ; preds = %4
br label %7
7: ; preds = %2, %4, %6
%8 = phi i32 [ 256, %6 ], [ 0, %4 ], [ 16384, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ X_OK;
scalar_t__ access(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ is_dir(char const *);
int executable_exists(const char path[]) {
  return access(path, X_OK) == 0 && !is_dir(path);
}


x86 assembly (clang, -O0):
<executable_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1040 <access@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    1164 <executable_exists+0x44>
mov    -0x8(%rbp),%rdi
call   1030 <is_dir@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<executable_exists>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
call   1040 <access@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     113e <executable_exists+0x1e>
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <is_dir@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
@X_OK = global i32 0
define i32 @executable_exists(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @X_OK
%5 = call i64 @access(i8* %3, i32 %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @is_dir(i8* %8)
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
br label %12
12: ; preds = %7, %1
%13 = phi i1 [ false, %1 ], [ %11, %7 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
@X_OK = global i32 0
define i32 @executable_exists(i8* %0) {
%2 = load i32, i32* @X_OK
%3 = tail call i64 @access(i8* %0, i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = tail call i32 @is_dir(i8* %0)
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %1
%10 = phi i32 [ 0, %1 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ xxx();
void www(void) { xxx(); }


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

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

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

LLVM IR (-O2):
define void @www() {
%1 = tail call i32 (...) @xxx()
ret void
}
/* Type definitions */
struct __sk_buff {
  int dummy;
};
typedef int /*<<< orphan*/ __u8;

/* Variables and functions */
int skb_store_bytes(struct __sk_buff *, int, int /*<<< orphan*/ *, int,
                    int /*<<< orphan*/);
int eth_store_daddr(struct __sk_buff *skb, __u8 *mac, int off) {
  return skb_store_bytes(skb, off, mac, 6, 0);
}


x86 assembly (clang, -O0):
<eth_store_daddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    $0x6,%ecx
xor    %r8d,%r8d
call   1030 <skb_store_bytes@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eth_store_daddr>:
mov    %rsi,%rax
mov    %edx,%esi
mov    %rax,%rdx
mov    $0x6,%ecx
xor    %r8d,%r8d
jmp    1030 <skb_store_bytes@plt>

LLVM IR (-O0):
%struct.__sk_buff = type { i32 }
define i32 @eth_store_daddr(%struct.__sk_buff* %0, i32* %1, i32 %2) {
%4 = alloca %struct.__sk_buff*
%5 = alloca i32*
%6 = alloca i32
store %struct.__sk_buff* %0, %struct.__sk_buff** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load %struct.__sk_buff*, %struct.__sk_buff** %4
%8 = load i32, i32* %6
%9 = load i32*, i32** %5
%10 = call i32 @skb_store_bytes(%struct.__sk_buff* %7, i32 %8, i32* %9, i32 6, i32 0)
ret i32 %10
}

LLVM IR (-O2):
%struct.__sk_buff = type { i32 }
define i32 @eth_store_daddr(%struct.__sk_buff* %0, i32* %1, i32 %2) {
%4 = tail call i32 @skb_store_bytes(%struct.__sk_buff* %0, i32 %2, i32* %1, i32 6, i32 0)
ret i32 %4
}
/* Variables and functions */
int get(int, int);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int a = get(1, 3);
  int b = get(3, 300);
  printf("a=%d,b=%d\n", a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x3,%esi
call   1040 <get@plt>
mov    %eax,-0x8(%rbp)
mov    $0x3,%edi
mov    $0x12c,%esi
call   1040 <get@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
mov    $0x3,%esi
call   1040 <get@plt>
mov    %eax,%ebx
mov    $0x3,%edi
mov    $0x12c,%esi
call   1040 <get@plt>
lea    0xeb8(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"a=%d,b=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @get(i32 1, i32 3)
%2 = tail call i32 @get(i32 3, i32 300)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret i32 0
}
int set_direct_map_invalid_noflush(struct page *page) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.page = type opaque
define i32 @set_direct_map_invalid_noflush(%struct.page* nocapture readnone %0) {
ret i32 0
}
void db88f628x_init(void) {}


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

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

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

LLVM IR (-O2):
define void @db88f628x_init() {
ret void
}
int numberofDivisors(long long trianglenumber) {
  long long i = 2;
  int divisorcounter = 2;
  while (i * i <= trianglenumber) {
    if (trianglenumber % i == 0) {
      divisorcounter += 2;
    }
    i++;
  }
  return divisorcounter;
}


x86 assembly (clang, -O0):
<numberofDivisors>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x2,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
mov    -0x10(%rbp),%rax
imul   -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jg     1158 <numberofDivisors+0x58>
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
cmp    $0x0,%rdx
jne    1147 <numberofDivisors+0x47>
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1117 <numberofDivisors+0x17>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numberofDivisors>:
mov    $0x2,%esi
cmp    $0x4,%rdi
jge    1111 <numberofDivisors+0x11>
mov    $0x2,%eax
ret
mov    $0x2,%ecx
jmp    1143 <numberofDivisors+0x43>
nopl   0x0(%rax,%rax,1)
mov    %rdi,%rax
cqto
idiv   %rcx
lea    0x2(%rsi),%eax
test   %rdx,%rdx
cmovne %esi,%eax
add    $0x1,%rcx
mov    %rcx,%rdx
imul   %rcx,%rdx
mov    %eax,%esi
cmp    %rdi,%rdx
jg     1157 <numberofDivisors+0x57>
mov    %rdi,%rax
or     %rcx,%rax
shr    $0x20,%rax
jne    1120 <numberofDivisors+0x20>
mov    %edi,%eax
xor    %edx,%edx
div    %ecx
jmp    1128 <numberofDivisors+0x28>
ret

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

LLVM IR (-O2):
define i32 @numberofDivisors(i64 %0) {
%2 = icmp slt i64 %0, 4
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ 2, %1 ]
%5 = phi i64 [ %10, %3 ], [ 2, %1 ]
%6 = srem i64 %0, %5
%7 = icmp eq i64 %6, 0
%8 = add nsw i32 %4, 2
%9 = select i1 %7, i32 %8, i32 %4
%10 = add nuw nsw i64 %5, 1
%11 = mul nsw i64 %10, %10
%12 = icmp sgt i64 %11, %0
br i1 %12, label %13, label %3
13: ; preds = %3, %1
%14 = phi i32 [ 2, %1 ], [ %9, %3 ]
ret i32 %14
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ pad;
};
typedef TYPE_1__ XEvent;

/* Variables and functions */
void *get_XEvent_pad(void *_p) { return (void *)(((XEvent *)_p)->pad); }


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i8* @get_XEvent_pad(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}

LLVM IR (-O2):
define i8* @get_XEvent_pad(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
__attribute__((gnu_)) double carmen_degrees_to_radians(double theta) {
  return (theta * 3.14159265358979323846 / 180.0);
}


x86 assembly (clang, -O0):
<carmen_degrees_to_radians>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xee2(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<carmen_degrees_to_radians>:
mulsd  0xef8(%rip),%xmm0
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @carmen_degrees_to_radians(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 0x400921FB54442D18
%5 = fdiv double %4, 1.800000e+02
ret double %5
}

LLVM IR (-O2):
define double @carmen_degrees_to_radians(double %0) {
%2 = fmul double %0, 0x400921FB54442D18
%3 = fdiv double %2, 1.800000e+02
ret double %3
}
int swaps32(int x) { return __builtin_bswap32(x); }


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

x86 assembly (clang, -O2):
<swaps32>:
mov    %edi,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @swaps32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @llvm.bswap.i32(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @swaps32(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
void cb6(struct ns_connection *nc, int ev, void *ev_data) {
  (void)nc;
  (void)ev;
  (void)ev_data;
}


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

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

LLVM IR (-O0):
%struct.ns_connection = type opaque
define void @cb6(%struct.ns_connection* %0, i32 %1, i8* %2) {
%4 = alloca %struct.ns_connection*
%5 = alloca i32
%6 = alloca i8*
store %struct.ns_connection* %0, %struct.ns_connection** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load %struct.ns_connection*, %struct.ns_connection** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
ret void
}

LLVM IR (-O2):
%struct.ns_connection = type opaque
define void @cb6(%struct.ns_connection* nocapture %0, i32 %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int isfinite(double);
int my_finite(double x) { return isfinite(x); }


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

x86 assembly (clang, -O2):
<my_finite>:
jmp    1030 <isfinite@plt>

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

LLVM IR (-O2):
define i32 @my_finite(double %0) {
%2 = tail call i32 @isfinite(double %0)
ret i32 %2
}
void I420ToARGB4444() {}


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

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

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

LLVM IR (-O2):
define void @I420ToARGB4444() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ I2CIntHandler();
void I2C3_Handler(void) { I2CIntHandler(); }


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

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

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

LLVM IR (-O2):
define void @I2C3_Handler() {
%1 = tail call i32 (...) @I2CIntHandler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ puts(char *);
void doUsage(const char *prog) {
  printf("Usage: %s [-c|-v] <filename>\n", prog);
  puts("  Options:");
  puts("\t-c\tUse non-FIPS mode");
  puts("\t-v\tVerbose output");
}


x86 assembly (clang, -O0):
<doUsage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
lea    0xee4(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doUsage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
lea    0xee7(%rip),%rdi
call   1030 <puts@plt>
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
lea    0xef0(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Usage: %s [-c|-v] <filename>\0A\00"
@.str.1 = [11 x i8] c" Options:\00"
@.str.2 = [22 x i8] c"\09-c\09Use non-FIPS mode\00"
@.str.3 = [19 x i8] c"\09-v\09Verbose output\00"
define void @doUsage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @puts(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"Usage: %s [-c|-v] <filename>\0A\00"
@.str.1 = [11 x i8] c" Options:\00"
@.str.2 = [22 x i8] c"\09-c\09Use non-FIPS mode\00"
@.str.3 = [19 x i8] c"\09-v\09Verbose output\00"
define void @doUsage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
ret void
}