xunge/DecIR huggingface dataset:
int test_imm_FAuint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xFA << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_FAuint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 250
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int foo(int /*<<< orphan*/);
int main() {
  assert(foo(0) == 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1040 <foo@plt>
cmp    $0xa,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <foo@plt>
xor    %edi,%edi
cmp    $0xa,%eax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 0)
%3 = icmp eq i32 %2, 10
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 0)
%2 = icmp eq i32 %1, 10
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret i32 0
}
void __attribute__((micromips)) foo(void) {}


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

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

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

LLVM IR (-O2):
define void @foo() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DeinitFields();
void SwitchFrom_75K0(void) { DeinitFields(); }


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

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

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

LLVM IR (-O2):
define void @SwitchFrom_75K0() {
%1 = tail call i32 (...) @DeinitFields()
ret void
}
void fn00401768() { return; }


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @fn00401768() {
ret void
}
int fib(int i) {
  if (i <= 2) {
    return 1;
  } else {
    return fib(i - 1) + fib(i - 2);
  }
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jg     1131 <fib+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1154 <fib+0x44>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
cmp    $0x3,%edi
jl     1145 <fib+0x35>
mov    %edi,%ebx
add    $0x2,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    -0x3(%rbx),%edi
call   1030 <fib@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x4,%ebx
ja     1130 <fib+0x20>
add    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp slt i32 %0, 3
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fib(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 5
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = add i32 %9, 1
br label %13
13: ; preds = %11, %1
%14 = phi i32 [ 1, %1 ], [ %12, %11 ]
ret i32 %14
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
int _file_exists(const char *file_name) {
  struct stat file_stat;
  return (stat(file_name, &file_stat) == 0) ? 1 : 0;
}


x86 assembly (clang, -O0):
<_file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_file_exists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @_file_exists(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 1, i32 0
ret i32 %8
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @_file_exists(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ left_motor_speed_received(unsigned char);
void notify_left_motor_speed_received(unsigned char speed) {
  left_motor_speed_received(speed);
}


x86 assembly (clang, -O0):
<notify_left_motor_speed_received>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <left_motor_speed_received@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<notify_left_motor_speed_received>:
jmp    1030 <left_motor_speed_received@plt>

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

LLVM IR (-O2):
define void @notify_left_motor_speed_received(i8 zeroext %0) {
%2 = tail call i32 @left_motor_speed_received(i8 zeroext %0)
ret void
}
int kill(int i, int j) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @kill(i32 %0, i32 %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int vsprintf(char *, char const *, int /*<<< orphan*/);
int vfprintf(FILE *fp, const char *fmt, va_list ap) {
  int n;
  char buf[1024];
  n = vsprintf(buf, fmt, ap);
  fputs(buf, fp);
  return (n);
}


x86 assembly (clang, -O0):
<vfprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    -0x420(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <vsprintf@plt>
mov    %eax,-0x18(%rbp)
lea    -0x420(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <fputs@plt>
mov    -0x18(%rbp),%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vfprintf>:
push   %rbp
push   %r14
push   %rbx
sub    $0x400,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <vsprintf@plt>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <fputs@plt>
mov    %ebp,%eax
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @vfprintf(i32* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = alloca [1024 x i8]
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%6 = call i32 @vsprintf(i8* %5, i8* %1, i32 %2)
%7 = call i32 @fputs(i8* %5, i32* %0)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ getch();
int /*<<< orphan*/ printf(char *, int);
int system(char *);
int main() {
  int i;
  for (;;) {
    i = system("key.exe");
    printf("%d\n", i);
    i = 0;
    getch();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <system@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1050 <getch@plt>
jmp    113f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%r14
lea    0xec6(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <system@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getch@plt>
jmp    1150 <main+0x20>

LLVM IR (-O0):
@.str = [8 x i8] c"key.exe\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %3, %0
%4 = call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
store i32 0, i32* %2
%7 = call i32 (...) @getch()
br label %3
}

LLVM IR (-O2):
@.str = [8 x i8] c"key.exe\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = tail call i32 (...) @getch()
br label %1
}
/* Variables and functions */
int do_io(int, char **);
int st_do_io(int a, char **b) { return do_io(a, b); }


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

x86 assembly (clang, -O2):
<st_do_io>:
jmp    1030 <do_io@plt>

LLVM IR (-O0):
define i32 @st_do_io(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 = load i8**, i8*** %4
%7 = call i32 @do_io(i32 %5, i8** %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @st_do_io(i32 %0, i8** %1) {
%3 = tail call i32 @do_io(i32 %0, i8** %1)
ret i32 %3
}
/* Type definitions */
struct dirent {
  int /*<<< orphan*/ d_name;
};

/* Variables and functions */
int strcmp(int /*<<< orphan*/, int /*<<< orphan*/);
int cramsort(const void *a, const void *b) {
  return strcmp((*(const struct dirent **)a)->d_name,
                (*(const struct dirent **)b)->d_name);
}


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

x86 assembly (clang, -O2):
<cramsort>:
mov    (%rdi),%rax
mov    (%rax),%edi
mov    (%rsi),%rax
mov    (%rax),%esi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
%struct.dirent = type { i32 }
define i32 @cramsort(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to %struct.dirent**
%7 = load %struct.dirent*, %struct.dirent** %6
%8 = getelementptr inbounds %struct.dirent, %struct.dirent* %7, i32 0, i32 0
%9 = load i32, i32* %8
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to %struct.dirent**
%12 = load %struct.dirent*, %struct.dirent** %11
%13 = getelementptr inbounds %struct.dirent, %struct.dirent* %12, i32 0, i32 0
%14 = load i32, i32* %13
%15 = call i32 @strcmp(i32 %9, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
define i32 @cramsort(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to %struct.dirent**
%4 = load %struct.dirent*, %struct.dirent** %3
%5 = getelementptr inbounds %struct.dirent, %struct.dirent* %4, i64 0, i32 0
%6 = load i32, i32* %5
%7 = bitcast i8* %1 to %struct.dirent**
%8 = load %struct.dirent*, %struct.dirent** %7
%9 = getelementptr inbounds %struct.dirent, %struct.dirent* %8, i64 0, i32 0
%10 = load i32, i32* %9
%11 = tail call i32 @strcmp(i32 %6, i32 %10)
ret i32 %11
}
/* Type definitions */
typedef int int32_t;
typedef int int16_t;

/* Variables and functions */
int16_t clamp16_from_float(float f) {
  static const float offset = (float)(3 << (22 - 15));
  static const int32_t limneg = (0x10f << 22) - 32768;
  static const int32_t limpos = (0x10f << 22) + 32767;
  union {
    float f;
    int32_t i;
  } u;
  u.f = f + offset;
  if (u.i < limneg)
    u.i = -32768;
  else if (u.i > limpos)
    u.i = 32767;
  return u.i;
}


x86 assembly (clang, -O0):
<clamp16_from_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
cmpl   $0x43bf8000,-0x8(%rbp)
jge    1134 <clamp16_from_float+0x34>
movl   $0xffff8000,-0x8(%rbp)
jmp    114d <clamp16_from_float+0x4d>
cmpl   $0x43c07fff,-0x8(%rbp)
jle    1148 <clamp16_from_float+0x48>
movl   $0x7fff,-0x8(%rbp)
jmp    114d <clamp16_from_float+0x4d>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp16_from_float>:
addss  0xef8(%rip),%xmm0
movd   %xmm0,%eax
cmp    $0x43c08000,%eax
mov    $0x7fff,%ecx
cmovl  %eax,%ecx
cmp    $0x43bf8000,%eax
mov    $0xffff8000,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
%union.anon = type { float }
@clamp16_from_float.offset = internal constant float 3.840000e+02
@clamp16_from_float.limneg = internal constant i32 1136623616
@clamp16_from_float.limpos = internal constant i32 1136689151
define i32 @clamp16_from_float(float %0) {
%2 = alloca float
%3 = alloca %union.anon
store float %0, float* %2
%4 = load float, float* %2
%5 = fadd float %4, 3.840000e+02
%6 = bitcast %union.anon* %3 to float*
store float %5, float* %6
%7 = bitcast %union.anon* %3 to i32*
%8 = load i32, i32* %7
%9 = icmp slt i32 %8, 1136623616
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = bitcast %union.anon* %3 to i32*
store i32 -32768, i32* %11
br label %19
12: ; preds = %1
%13 = bitcast %union.anon* %3 to i32*
%14 = load i32, i32* %13
%15 = icmp sgt i32 %14, 1136689151
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = bitcast %union.anon* %3 to i32*
store i32 32767, i32* %17
br label %18
18: ; preds = %16, %12
br label %19
19: ; preds = %18, %10
%20 = bitcast %union.anon* %3 to i32*
%21 = load i32, i32* %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @clamp16_from_float(float %0) {
%2 = fadd float %0, 3.840000e+02
%3 = bitcast float %2 to i32
%4 = icmp slt i32 %3, 1136623616
%5 = icmp sgt i32 %3, 1136689151
%6 = select i1 %5, i32 32767, i32 %3
%7 = select i1 %4, i32 -32768, i32 %6
ret i32 %7
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int IsNameIdentical(char *firstName, char *secondName) {
  return strcmp(firstName, secondName) == 0;
}


x86 assembly (clang, -O0):
<IsNameIdentical>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsNameIdentical>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @IsNameIdentical(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @IsNameIdentical(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
const char *enable_disable(bool b) { return b ? "enable" : "disable"; }


x86 assembly (clang, -O0):
<enable_disable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xef6(%rip),%rax
lea    0xee8(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<enable_disable>:
test   %edi,%edi
lea    0xefe(%rip),%rcx
lea    0xef0(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"enable\00"
@.str.1 = [8 x i8] c"disable\00"
define i8* @enable_disable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0)
ret i8* %6
}

LLVM IR (-O2):
@.str = [7 x i8] c"enable\00"
@.str.1 = [8 x i8] c"disable\00"
define i8* @enable_disable(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void die_perror(char *msg) {
  perror(msg);
  exit(1);
}


x86 assembly (clang, -O0):
<die_perror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die_perror>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @die_perror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @die_perror(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
index(a, s) char *s;
{
  register int k;
  for (k = 0; s[k]; k++)
    if (s[k] == a)
      return (k);
  return (-1);
}


x86 assembly (clang, -O0):
<index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1157 <index+0x57>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    -0x8(%rbp),%eax
jne    1144 <index+0x44>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115e <index+0x5e>
jmp    1149 <index+0x49>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1112 <index+0x12>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<index>:
mov    (%rsi),%dl
mov    $0xffffffff,%eax
test   %dl,%dl
je     1124 <index+0x24>
xor    %ecx,%ecx
nopl   (%rax)
movsbl %dl,%edx
cmp    %edi,%edx
je     1125 <index+0x25>
movzbl 0x1(%rsi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <index+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @index(i32 %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %2, %10
%6 = phi i64 [ %11, %10 ], [ 0, %2 ]
%7 = phi i8 [ %13, %10 ], [ %3, %2 ]
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, %0
br i1 %9, label %15, label %10
10: ; preds = %5
%11 = add nuw i64 %6, 1
%12 = getelementptr inbounds i8, i8* %1, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %17, label %5
15: ; preds = %5
%16 = trunc i64 %6 to i32
br label %17
17: ; preds = %10, %15, %2
%18 = phi i32 [ -1, %2 ], [ %16, %15 ], [ -1, %10 ]
ret i32 %18
}
void cmd_zap(char *arg) {
  if (!*arg) {
    status(1), printf("#zap: no connection name.\n");
  } else
    tcp_close(arg);
}


x86 assembly (clang, -O0):
<cmd_zap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1168 <cmd_zap+0x38>
mov    $0x1,%edi
mov    $0x0,%al
call   1050 <status@plt>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1173 <cmd_zap+0x43>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <tcp_close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_zap>:
push   %rax
cmpb   $0x0,(%rdi)
je     113e <cmd_zap+0xe>
xor    %eax,%eax
pop    %rcx
jmp    1040 <tcp_close@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1050 <status@plt>
lea    0xeaf(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"#zap: no connection name.\0A\00"
define void @cmd_zap(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = icmp ne i8 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = call i32 (i32, ...) bitcast (i32 (...)* @status to i32 (i32, ...)*)(i32 1)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %12
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @tcp_close to i32 (i8*, ...)*)(i8* %10)
br label %12
12: ; preds = %9, %6
ret void
}

LLVM IR (-O2):
@str = [26 x i8] c"#zap: no connection name.\00"
define void @cmd_zap(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @status to i32 (i32, ...)*)(i32 1)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
br label %9
7: ; preds = %1
%8 = tail call i32 (i8*, ...) bitcast (i32 (...)* @tcp_close to i32 (i8*, ...)*)(i8* %0)
br label %9
9: ; preds = %7, %4
ret void
}
int isPalindrome(int n) {
  int temp = n;
  int rev = 0;
  while (temp) {
    rev = (rev * 10) + (temp % 10);
    temp /= 10;
  }
  return n == rev ? 1 : 0;
}


x86 assembly (clang, -O0):
<isPalindrome>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     114b <isPalindrome+0x4b>
imul   $0xa,-0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%eax
add    %edx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    1114 <isPalindrome+0x14>
mov    -0x4(%rbp),%edx
mov    -0xc(%rbp),%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPalindrome>:
xor    %edx,%edx
test   %edi,%edi
je     1141 <isPalindrome+0x41>
mov    %edi,%eax
nopl   0x0(%rax,%rax,1)
lea    (%rdx,%rdx,4),%r8d
movslq %eax,%rcx
imul   $0x66666667,%rcx,%rax
mov    %rax,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rax
add    %esi,%eax
lea    (%rax,%rax,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %ecx,%edx
sub    %esi,%edx
lea    (%rdx,%r8,2),%edx
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <isPalindrome+0x10>
xor    %eax,%eax
cmp    %edi,%edx
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isPalindrome(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ %0, %1 ]
%6 = mul nsw i32 %4, 10
%7 = srem i32 %5, 10
%8 = add nsw i32 %6, %7
%9 = sdiv i32 %5, 10
%10 = add i32 %5, 9
%11 = icmp ult i32 %10, 19
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %8, %3 ]
%14 = icmp eq i32 %13, %0
%15 = zext i1 %14 to i32
ret i32 %15
}
/* Variables and functions */
int xyzzy1(int);
int test1(void) { return xyzzy1(5); }


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
call   1030 <xyzzy1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
mov    $0x5,%edi
jmp    1030 <xyzzy1@plt>

LLVM IR (-O0):
define i32 @test1() {
%1 = call i32 @xyzzy1(i32 5)
ret i32 %1
}

LLVM IR (-O2):
define i32 @test1() {
%1 = tail call i32 @xyzzy1(i32 5)
ret i32 %1
}
float hPa2inHg(float hPa) {
  if (hPa < 0)
    return hPa;
  return hPa / 33.8639;
}


x86 assembly (clang, -O0):
<hPa2inHg>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1125 <hPa2inHg+0x25>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1143 <hPa2inHg+0x43>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeca(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<hPa2inHg>:
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
ja     1118 <hPa2inHg+0x18>
cvtss2sd %xmm0,%xmm0
divsd  0xeec(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @hPa2inHg(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp olt float %4, 0.000000e+00
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load float, float* %3
store float %7, float* %2
br label %13
8: ; preds = %1
%9 = load float, float* %3
%10 = fpext float %9 to double
%11 = fdiv double %10, 3.386390e+01
%12 = fptrunc double %11 to float
store float %12, float* %2
br label %13
13: ; preds = %8, %6
%14 = load float, float* %2
ret float %14
}

LLVM IR (-O2):
define float @hPa2inHg(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = fpext float %0 to double
%5 = fdiv double %4, 3.386390e+01
%6 = fptrunc double %5 to float
br label %7
7: ; preds = %1, %3
%8 = phi float [ %6, %3 ], [ %0, %1 ]
ret float %8
}
/* Variables and functions */
char *gnu_get_libc_version();
int main(void) {
  const char *version = gnu_get_libc_version();
  return (long)version;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* (...) @gnu_get_libc_version()
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
%6 = trunc i64 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8* (...) @gnu_get_libc_version()
%2 = ptrtoint i8* %1 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
void gtk_file_selection_get_filename() {}


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

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

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

LLVM IR (-O2):
define void @gtk_file_selection_get_filename() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("cough\n");
  printf("cough\n");
  printf("cough\n");
}


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

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

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

LLVM IR (-O2):
@str.2 = [6 x i8] c"cough\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.2, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
unsigned char h8max_inb(unsigned char a) {
  return *(unsigned char *)(0x800600 + (a << 1) + 1);
}


x86 assembly (clang, -O0):
<h8max_inb>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x1,%eax
add    $0x800600,%eax
add    $0x1,%eax
cltq
movzbl (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h8max_inb>:
mov    %edi,%eax
mov    0x800601(%rax,%rax,1),%al
ret

LLVM IR (-O0):
define zeroext i8 @h8max_inb(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl i32 %4, 1
%6 = add nsw i32 8390144, %5
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
%10 = load i8, i8* %9
ret i8 %10
}

LLVM IR (-O2):
define zeroext i8 @h8max_inb(i8 zeroext %0) {
%2 = zext i8 %0 to i64
%3 = shl nuw nsw i64 %2, 1
%4 = or i64 %3, 8390145
%5 = inttoptr i64 %4 to i8*
%6 = load i8, i8* %5
ret i8 %6
}
void gdk_window_get_group() {}


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

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

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

LLVM IR (-O2):
define void @gdk_window_get_group() {
ret void
}
/* Variables and functions */
int inb(int);
int uart_charav(int offset) { return inb(0x2fd + offset) & 1; }


x86 assembly (clang, -O0):
<uart_charav>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
add    $0x2fd,%edi
call   1030 <inb@plt>
and    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_charav>:
push   %rax
add    $0x2fd,%edi
call   1030 <inb@plt>
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @uart_charav(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 765, %3
%5 = call i32 @inb(i32 %4)
%6 = and i32 %5, 1
ret i32 %6
}

LLVM IR (-O2):
define i32 @uart_charav(i32 %0) {
%2 = add nsw i32 %0, 765
%3 = tail call i32 @inb(i32 %2)
%4 = and i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int main(int argc, char **argv) {
  abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @abort()
unreachable
}
int cmp_int(void *a, void *b) {
  if (!a || !b)
    return -1;
  return !(*(int *)a == *(int *)b);
}


x86 assembly (clang, -O0):
<cmp_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1122 <cmp_int+0x22>
cmpq   $0x0,-0x18(%rbp)
jne    112e <cmp_int+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1147 <cmp_int+0x47>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
sete   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_int>:
mov    $0xffffffff,%eax
test   %rdi,%rdi
je     1118 <cmp_int+0x18>
test   %rsi,%rsi
je     1118 <cmp_int+0x18>
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
setne  %al
ret

LLVM IR (-O0):
define i32 @cmp_int(i8* %0, i8* %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 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %12, label %11
11: ; preds = %8, %2
store i32 -1, i32* %3
br label %22
12: ; preds = %8
%13 = load i8*, i8** %4
%14 = bitcast i8* %13 to i32*
%15 = load i32, i32* %14
%16 = load i8*, i8** %5
%17 = bitcast i8* %16 to i32*
%18 = load i32, i32* %17
%19 = icmp eq i32 %15, %18
%20 = xor i1 %19, true
%21 = zext i1 %20 to i32
store i32 %21, i32* %3
br label %22
22: ; preds = %12, %11
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @cmp_int(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %13
6: ; preds = %2
%7 = bitcast i8* %0 to i32*
%8 = load i32, i32* %7
%9 = bitcast i8* %1 to i32*
%10 = load i32, i32* %9
%11 = icmp ne i32 %8, %10
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %2, %6
%14 = phi i32 [ %12, %6 ], [ -1, %2 ]
ret i32 %14
}
/* Variables and functions */
int f();
int /*<<< orphan*/ printf(char *, int);
int main() { printf("%d", f()); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 (...) @f()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int test_imm_F4int16_reg(short val) {
  return ((val) & (-0xF4 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_F4int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -244
%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_F4int16_reg(i16 signext %0) {
%2 = and i16 %0, -244
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int64_t;
typedef int /*<<< orphan*/ u_int32_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ mftb32(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ mftb64();
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/, int /*<<< orphan*/,
                          int /*<<< orphan*/);
int main(void) {
  u_int64_t tb64;
  u_int32_t tb32u, tb32l;
  tb64 = mftb64();
  mftb32(&tb32u, &tb32l);
  printf("%llx %x%08x\n", tb64, tb32l, tb32u);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <mftb64@plt>
mov    %eax,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <mftb32@plt>
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xe8a(%rip),%rdi
call   1050 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1040 <mftb64@plt>
mov    %eax,%ebx
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <mftb32@plt>
mov    0x8(%rsp),%edx
mov    0xc(%rsp),%ecx
lea    0xe94(%rip),%rdi
mov    %ebx,%esi
call   1050 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"%llx %x%08x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (...) @mftb64()
store i32 %5, i32* %2
%6 = call i32 @mftb32(i32* %3, i32* %4)
%7 = load i32, i32* %2
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
%11 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [13 x i8] c"%llx %x%08x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (...) @mftb64()
%6 = call i32 @mftb32(i32* %1, i32* %2)
%7 = load i32, i32* %2
%8 = load i32, i32* %1
%9 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %7, i32 %8)
%10 = call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void justquit(int signum) {
  (void)signum;
  exit(0);
}


x86 assembly (clang, -O0):
<justquit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<justquit>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @justquit(i32 %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
unsigned long bl(unsigned long li) {
  return (18 << 26) | (li << 2) | (0 << 1) | (1 << 0);
}


x86 assembly (clang, -O0):
<bl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x2,%rax
or     $0x48000000,%rax
or     $0x0,%rax
or     $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bl>:
lea    0x0(,%rdi,4),%rax
or     $0x48000001,%rax
ret

LLVM IR (-O0):
define i64 @bl(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = shl i64 %3, 2
%5 = or i64 1207959552, %4
%6 = or i64 %5, 0
%7 = or i64 %6, 1
ret i64 %7
}

LLVM IR (-O2):
define i64 @bl(i64 %0) {
%2 = shl i64 %0, 2
%3 = or i64 %2, 1207959553
ret i64 %3
}
/* Type definitions */
typedef int wint_t;

/* Variables and functions */
int iswcntrl(wint_t wc) {
  return (unsigned)wc < 32 || (unsigned)(wc - 0x7f) < 33 ||
         (unsigned)(wc - 0x2028) < 2 || (unsigned)(wc - 0xfff9) < 3;
}


x86 assembly (clang, -O0):
<iswcntrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jb     1152 <iswcntrl+0x52>
mov    -0x4(%rbp),%ecx
sub    $0x7f,%ecx
mov    $0x1,%al
cmp    $0x21,%ecx
mov    %al,-0x5(%rbp)
jb     1152 <iswcntrl+0x52>
mov    -0x4(%rbp),%ecx
sub    $0x2028,%ecx
mov    $0x1,%al
cmp    $0x2,%ecx
mov    %al,-0x5(%rbp)
jb     1152 <iswcntrl+0x52>
mov    -0x4(%rbp),%eax
sub    $0xfff9,%eax
cmp    $0x3,%eax
setb   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswcntrl>:
cmp    $0x20,%edi
setb   %al
lea    -0x7f(%rdi),%ecx
cmp    $0x21,%ecx
setb   %cl
or     %al,%cl
mov    %edi,%eax
and    $0xfffffffe,%eax
cmp    $0x2028,%eax
sete   %al
add    $0xffff0007,%edi
cmp    $0x3,%edi
setb   %dl
or     %al,%dl
or     %cl,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @iswcntrl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ult i32 %3, 32
br i1 %4, label %17, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 %6, 127
%8 = icmp ult i32 %7, 33
br i1 %8, label %17, label %9
9: ; preds = %5
%10 = load i32, i32* %2
%11 = sub nsw i32 %10, 8232
%12 = icmp ult i32 %11, 2
br i1 %12, label %17, label %13
13: ; preds = %9
%14 = load i32, i32* %2
%15 = sub nsw i32 %14, 65529
%16 = icmp ult i32 %15, 3
br label %17
17: ; preds = %13, %9, %5, %1
%18 = phi i1 [ true, %9 ], [ true, %5 ], [ true, %1 ], [ %16, %13 ]
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @iswcntrl(i32 %0) {
%2 = icmp ult i32 %0, 32
%3 = add nsw i32 %0, -127
%4 = icmp ult i32 %3, 33
%5 = select i1 %2, i1 true, i1 %4
%6 = and i32 %0, -2
%7 = icmp eq i32 %6, 8232
%8 = or i1 %7, %5
%9 = add nsw i32 %0, -65529
%10 = icmp ult i32 %9, 3
%11 = select i1 %8, i1 true, i1 %10
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void I2CMasterIntDisable(uint32_t ui32Base) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000010))) = 0;
}


x86 assembly (clang, -O0):
<I2CMasterIntDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterIntDisable>:
movq   $0x0,0x10(%rdi)
ret

LLVM IR (-O0):
define void @I2CMasterIntDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 16
%5 = inttoptr i64 %4 to i64*
store volatile i64 0, i64* %5
ret void
}

LLVM IR (-O2):
define void @I2CMasterIntDisable(i64 %0) {
%2 = add nsw i64 %0, 16
%3 = inttoptr i64 %2 to i64*
store volatile i64 0, i64* %3
ret void
}
int test_imm_14int16_reg(short val) {
  return ((val) & (0x14 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_14int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 20
%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_14int16_reg(i16 signext %0) {
%2 = and i16 %0, 20
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ val;

/* Variables and functions */
int /*<<< orphan*/ IPPROTO_TCP;
int setsockopt(int, int /*<<< orphan*/, int, int *, int);
int BMI_sockio_set_tcpopt(int s, int optname, int val) {
  if (setsockopt(s, IPPROTO_TCP, optname, &val, sizeof(val)) == -1)
    return (-1);
  else
    return (val);
}


x86 assembly (clang, -O0):
<BMI_sockio_set_tcpopt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
lea    -0x10(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
cmp    $0xffffffff,%eax
jne    1154 <BMI_sockio_set_tcpopt+0x44>
movl   $0xffffffff,-0x4(%rbp)
jmp    115a <BMI_sockio_set_tcpopt+0x4a>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BMI_sockio_set_tcpopt>:
push   %rax
mov    %esi,%eax
mov    %edx,0x4(%rsp)
mov    0x2eca(%rip),%rcx
mov    (%rcx),%esi
lea    0x4(%rsp),%rcx
mov    %eax,%edx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
cmp    $0xffffffff,%eax
je     113b <BMI_sockio_set_tcpopt+0x2b>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@IPPROTO_TCP = global i32 0
define i32 @BMI_sockio_set_tcpopt(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
store i32 %2, i32* %4
%5 = load i32, i32* @IPPROTO_TCP
%6 = call i32 @setsockopt(i32 %0, i32 %5, i32 %1, i32* %4, i32 4)
%7 = icmp eq i32 %6, -1
%8 = load i32, i32* %4
%9 = select i1 %7, i32 -1, i32 %8
ret i32 %9
}
/* Variables and functions */
void *initialization(int parallelism, int *vector, int size, char *arg) {
  (void)parallelism;
  (void)vector;
  (void)size;
  (void)arg;
  return NULL;
}


x86 assembly (clang, -O0):
<initialization>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @initialization(i32 %0, i32* %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i8*
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i32, i32* %5
%10 = load i32*, i32** %6
%11 = load i32, i32* %7
%12 = load i8*, i8** %8
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @initialization(i32 %0, i32* nocapture readnone %1, i32 %2, i8* nocapture readnone %3) {
ret i8* null
}