xunge/DecIR huggingface dataset:
int f2(int x[][2]) { return x[2][3]; }


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

x86 assembly (clang, -O2):
<f2>:
mov    0x1c(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @f2([2 x i32]* %0) {
%2 = alloca [2 x i32]*
store [2 x i32]* %0, [2 x i32]** %2
%3 = load [2 x i32]*, [2 x i32]** %2
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 2
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 3
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @f2([2 x i32]* nocapture %0) {
%2 = getelementptr inbounds [2 x i32], [2 x i32]* %0, i64 2, i64 3
%3 = load i32, i32* %2
ret i32 %3
}
int is_numeric(char c) { return c >= '0' && c <= '9'; }


x86 assembly (clang, -O0):
<is_numeric>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <is_numeric+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_numeric>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_numeric(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_numeric(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
int test_imm_74uint16_reg(unsigned short val) {
  return ((val) & (-0x74 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_74uint16_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, -116
%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_74uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -116
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
void glmAdd3fv(float out[3], const float x[3], const float y[3]) {
  for (size_t i = 0; i < 3; ++i)
    out[i] = x[i] + y[i];
}


x86 assembly (clang, -O0):
<glmAdd3fv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x3,-0x20(%rbp)
jae    115b <glmAdd3fv+0x5b>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
addss  (%rax,%rcx,4),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1118 <glmAdd3fv+0x18>
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmAdd3fv>:
movss  (%rsi),%xmm0
addss  (%rdx),%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
addss  0x4(%rdx),%xmm0
movss  %xmm0,0x4(%rdi)
movss  0x8(%rsi),%xmm0
addss  0x8(%rdx),%xmm0
movss  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @glmAdd3fv(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
%7 = alloca i64
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
store i64 0, i64* %7
br label %8
8: ; preds = %24, %3
%9 = load i64, i64* %7
%10 = icmp ult i64 %9, 3
br i1 %10, label %11, label %27
11: ; preds = %8
%12 = load float*, float** %5
%13 = load i64, i64* %7
%14 = getelementptr inbounds float, float* %12, i64 %13
%15 = load float, float* %14
%16 = load float*, float** %6
%17 = load i64, i64* %7
%18 = getelementptr inbounds float, float* %16, i64 %17
%19 = load float, float* %18
%20 = fadd float %15, %19
%21 = load float*, float** %4
%22 = load i64, i64* %7
%23 = getelementptr inbounds float, float* %21, i64 %22
store float %20, float* %23
br label %24
24: ; preds = %11
%25 = load i64, i64* %7
%26 = add i64 %25, 1
store i64 %26, i64* %7
br label %8
27: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @glmAdd3fv(float* nocapture writeonly %0, float* nocapture %1, float* nocapture %2) {
%4 = load float, float* %1
%5 = load float, float* %2
%6 = fadd float %4, %5
store float %6, float* %0
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %2, i64 1
%10 = load float, float* %9
%11 = fadd float %8, %10
%12 = getelementptr inbounds float, float* %0, i64 1
store float %11, float* %12
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = getelementptr inbounds float, float* %2, i64 2
%16 = load float, float* %15
%17 = fadd float %14, %16
%18 = getelementptr inbounds float, float* %0, i64 2
store float %17, float* %18
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int main() {
  char buf[128];
  char test[] = "abcdef";
  strncpy(buf, test + 1, 3);
  printf("%s\n", buf);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0x97(%rbp)
mov    0xebf(%rip),%ax
mov    %ax,-0x93(%rbp)
mov    0xeb4(%rip),%al
mov    %al,-0x91(%rbp)
lea    -0x90(%rbp),%rdi
lea    -0x97(%rbp),%rsi
add    $0x1,%rsi
mov    $0x3,%edx
call   1030 <strncpy@plt>
lea    -0x90(%rbp),%rsi
lea    0xe85(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x90,%rsp
movl   $0x666564,0xb(%rsp)
movl   $0x64636261,0x8(%rsp)
64
lea    0x9(%rsp),%rsi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x3,%edx
call   1030 <strncpy@plt>
lea    0xeb1(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@__const.main.test = [7 x i8] c"abcdef\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [128 x i8]
%2 = alloca [7 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 1
%6 = call i32 @strncpy(i8* %3, i8* %5, i32 3)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
void test_8(int code) {
  _Bool temp = testit();
  _Bool rotate = (code == 22);
  if (temp == 0 || !rotate)
    oof();
}


x86 assembly (clang, -O0):
<test_8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <testit@plt>
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
mov    %al,-0x5(%rbp)
cmpl   $0x16,-0x4(%rbp)
sete   %al
and    $0x1,%al
mov    %al,-0x6(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x0,%eax
je     1164 <test_8+0x44>
testb  $0x1,-0x6(%rbp)
jne    116b <test_8+0x4b>
mov    $0x0,%al
call   1040 <oof@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_8>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <testit@plt>
cmp    $0x16,%ebx
jne    1135 <test_8+0x15>
test   %eax,%eax
je     1135 <test_8+0x15>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
jmp    1040 <oof@plt>

LLVM IR (-O0):
define void @test_8(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
store i32 %0, i32* %2
%5 = call i32 (...) @testit()
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i8
store i8 %7, i8* %3
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 22
%10 = zext i1 %9 to i8
store i8 %10, i8* %4
%11 = load i8, i8* %3
%12 = trunc i8 %11 to i1
%13 = zext i1 %12 to i32
%14 = icmp eq i32 %13, 0
br i1 %14, label %18, label %15
15: ; preds = %1
%16 = load i8, i8* %4
%17 = trunc i8 %16 to i1
br i1 %17, label %20, label %18
18: ; preds = %15, %1
%19 = call i32 (...) @oof()
br label %20
20: ; preds = %18, %15
ret void
}

LLVM IR (-O2):
define void @test_8(i32 %0) {
%2 = tail call i32 (...) @testit()
%3 = icmp ne i32 %2, 0
%4 = icmp eq i32 %0, 22
%5 = and i1 %4, %3
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 (...) @oof()
br label %8
8: ; preds = %1, %6
ret void
}
/* Variables and functions */
int unlink(char const *);
int os_unlink(const char *name) { return unlink(name); }


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

x86 assembly (clang, -O2):
<os_unlink>:
jmp    1030 <unlink@plt>

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

LLVM IR (-O2):
define i32 @os_unlink(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ UpnpResponseGeneric(void const *, char *, char *, char *);
void UpnpResponse_MediaRenderer_AVTransport_Seek(const void *UPnPToken) {
  UpnpResponseGeneric(UPnPToken, "urn:schemas-upnp-org:service:AVTransport:1",
                      "Seek", "");
}


x86 assembly (clang, -O0):
<UpnpResponse_MediaRenderer_AVTransport_Seek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    0xefd(%rip),%rdx
lea    0xef5(%rip),%rcx
call   1030 <UpnpResponseGeneric@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UpnpResponse_MediaRenderer_AVTransport_Seek>:
lea    0xee9(%rip),%rsi
lea    0xf0d(%rip),%rdx
lea    0xf05(%rip),%rcx
jmp    1030 <UpnpResponseGeneric@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"urn:schemas-upnp-org:service:AVTransport:1\00"
@.str.1 = [5 x i8] c"Seek\00"
@.str.2 = [1 x i8] zeroinitializer
define void @UpnpResponse_MediaRenderer_AVTransport_Seek(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @UpnpResponseGeneric(i8* %3, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"urn:schemas-upnp-org:service:AVTransport:1\00"
@.str.1 = [5 x i8] c"Seek\00"
@.str.2 = [1 x i8] zeroinitializer
define void @UpnpResponse_MediaRenderer_AVTransport_Seek(i8* %0) {
%2 = tail call i32 @UpnpResponseGeneric(i8* %0, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
ret void
}
int calc_tzcnt_u32(int src) {
  int i;
  int res = 0;
  while ((res < 32) && ((src & 1) == 0)) {
    ++res;
    src >>= 1;
  }
  return res;
}


x86 assembly (clang, -O0):
<calc_tzcnt_u32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x20,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jge    112c <calc_tzcnt_u32+0x2c>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    113c <calc_tzcnt_u32+0x3c>
jmp    1153 <calc_tzcnt_u32+0x53>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <calc_tzcnt_u32+0xe>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_tzcnt_u32>:
xor    %eax,%eax
test   $0x1,%dil
jne    1125 <calc_tzcnt_u32+0x25>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
mov    %eax,%ecx
lea    0x1(%rcx),%eax
cmp    $0x1e,%ecx
ja     1125 <calc_tzcnt_u32+0x25>
mov    %edi,%ecx
sar    %ecx
and    $0x2,%edi
mov    %ecx,%edi
je     1110 <calc_tzcnt_u32+0x10>
ret

LLVM IR (-O0):
define i32 @calc_tzcnt_u32(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %4
br label %5
5: ; preds = %14, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 32
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = load i32, i32* %2
%10 = and i32 %9, 1
%11 = icmp eq i32 %10, 0
br label %12
12: ; preds = %8, %5
%13 = phi i1 [ false, %5 ], [ %11, %8 ]
br i1 %13, label %14, label %19
14: ; preds = %12
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
store i32 %16, i32* %4
%17 = load i32, i32* %2
%18 = ashr i32 %17, 1
store i32 %18, i32* %2
br label %5
19: ; preds = %12
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
define i32 @calc_tzcnt_u32(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i32 [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = ashr i32 %6, 1
%9 = icmp ult i32 %5, 31
%10 = and i32 %6, 2
%11 = icmp eq i32 %10, 0
%12 = select i1 %9, i1 %11, i1 false
br i1 %12, label %4, label %13
13: ; preds = %4, %1
%14 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void _flockfile_debug_stub(FILE *fp, char *fname, int lineno) {}


x86 assembly (clang, -O0):
<_flockfile_debug_stub>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @_flockfile_debug_stub(i32* nocapture %0, i8* nocapture %1, i32 %2) {
ret void
}
int irc_isnickchar(char c, int first) {
  return ((c >= 0x41 && c <= 0x7D) ||
          (!first && ((c >= 0x30 && c <= 0x39) || c == '-')));
}


x86 assembly (clang, -O0):
<irc_isnickchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     112c <irc_isnickchar+0x2c>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7d,%ecx
mov    %al,-0x9(%rbp)
jle    1173 <irc_isnickchar+0x73>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xa(%rbp)
jne    116d <irc_isnickchar+0x6d>
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     115a <irc_isnickchar+0x5a>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x39,%ecx
mov    %al,-0xb(%rbp)
jle    1167 <irc_isnickchar+0x67>
movsbl -0x1(%rbp),%eax
cmp    $0x2d,%eax
sete   %al
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_isnickchar>:
lea    -0x41(%rdi),%ecx
mov    $0x1,%eax
cmp    $0x3d,%cl
jb     1113 <irc_isnickchar+0x13>
xor    %eax,%eax
test   %esi,%esi
je     1114 <irc_isnickchar+0x14>
ret
lea    -0x30(%rdi),%ecx
mov    $0x1,%eax
cmp    $0xa,%cl
jb     1113 <irc_isnickchar+0x13>
xor    %eax,%eax
cmp    $0x2d,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @irc_isnickchar(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = icmp sge i32 %6, 65
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp sle i32 %10, 125
br i1 %11, label %31, label %12
12: ; preds = %8, %2
%13 = load i32, i32* %4
%14 = icmp ne i32 %13, 0
br i1 %14, label %29, label %15
15: ; preds = %12
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp sge i32 %17, 48
br i1 %18, label %19, label %23
19: ; preds = %15
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp sle i32 %21, 57
br i1 %22, label %27, label %23
23: ; preds = %19, %15
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 45
br label %27
27: ; preds = %23, %19
%28 = phi i1 [ true, %19 ], [ %26, %23 ]
br label %29
29: ; preds = %27, %12
%30 = phi i1 [ false, %12 ], [ %28, %27 ]
br label %31
31: ; preds = %29, %8
%32 = phi i1 [ true, %8 ], [ %30, %29 ]
%33 = zext i1 %32 to i32
ret i32 %33
}

LLVM IR (-O2):
define i32 @irc_isnickchar(i8 signext %0, i32 %1) {
%3 = add i8 %0, -65
%4 = icmp ult i8 %3, 61
br i1 %4, label %13, label %5
5: ; preds = %2
%6 = icmp eq i32 %1, 0
br i1 %6, label %7, label %13
7: ; preds = %5
%8 = add i8 %0, -48
%9 = icmp ult i8 %8, 10
br i1 %9, label %13, label %10
10: ; preds = %7
%11 = icmp eq i8 %0, 45
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %5, %7, %10, %2
%14 = phi i32 [ 1, %2 ], [ 0, %5 ], [ %12, %10 ], [ 1, %7 ]
ret i32 %14
}
/* Variables and functions */
double sqrt(double);
double half_tan(double x) { return (sqrt(1.0 + x * x) - 1.0) / x; }


x86 assembly (clang, -O0):
<half_tan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xecd(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movsd  0xebc(%rip),%xmm1
subsd  %xmm1,%xmm0
divsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<half_tan>:
push   %rax
movapd %xmm0,%xmm2
mulsd  %xmm0,%xmm0
addsd  0xedf(%rip),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1131 <half_tan+0x21>
sqrtsd %xmm0,%xmm0
jmp    1140 <half_tan+0x30>
movsd  %xmm2,(%rsp)
call   1030 <sqrt@plt>
movsd  (%rsp),%xmm2
addsd  0xec0(%rip),%xmm0
divsd  %xmm2,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @half_tan(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = call double @llvm.fmuladd.f64(double %3, double %4, double 1.000000e+00)
%6 = call double @sqrt(double %5)
%7 = fsub double %6, 1.000000e+00
%8 = load double, double* %2
%9 = fdiv double %7, %8
ret double %9
}

LLVM IR (-O2):
define double @half_tan(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double %0, double 1.000000e+00)
%3 = tail call double @sqrt(double %2)
%4 = fadd double %3, -1.000000e+00
%5 = fdiv double %4, %0
ret double %5
}
int ep93xx_pwm_acquire_gpio(struct platform_device *pdev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.platform_device = type opaque
define i32 @ep93xx_pwm_acquire_gpio(%struct.platform_device* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
__attribute__((visibility("default"))) void *sd_resolve_query_unref(void *q) {
  return NULL;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @sd_resolve_query_unref(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
char *strrchr(char *, char);
char *glp_lib_strtrim(char *str) {
  char *t;
  for (t = strrchr(str, '\0') - 1; t >= str; t--) {
    if (*t != ' ')
      break;
    *t = '\0';
  }
  return str;
}


x86 assembly (clang, -O0):
<glp_lib_strtrim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <strrchr@plt>
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jb     116a <glp_lib_strtrim+0x5a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     1152 <glp_lib_strtrim+0x42>
jmp    116a <glp_lib_strtrim+0x5a>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    112f <glp_lib_strtrim+0x1f>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glp_lib_strtrim>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
add    %rbx,%rax
add    $0xffffffffffffffff,%rax
cmp    %rbx,%rax
jb     1141 <glp_lib_strtrim+0x31>
cs nopw 0x0(%rax,%rax,1)
nop
cmpb   $0x20,(%rax)
jne    1141 <glp_lib_strtrim+0x31>
movb   $0x0,(%rax)
add    $0xffffffffffffffff,%rax
cmp    %rbx,%rax
jae    1130 <glp_lib_strtrim+0x20>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @glp_lib_strtrim(i8* returned %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = getelementptr i8, i8* %0, i64 %2
%4 = getelementptr inbounds i8, i8* %3, i64 -1
%5 = icmp ult i8* %4, %0
br i1 %5, label %13, label %6
6: ; preds = %1, %10
%7 = phi i8* [ %11, %10 ], [ %4, %1 ]
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 32
br i1 %9, label %10, label %13
10: ; preds = %6
store i8 0, i8* %7
%11 = getelementptr inbounds i8, i8* %7, i64 -1
%12 = icmp ult i8* %11, %0
br i1 %12, label %13, label %6
13: ; preds = %10, %6, %1
ret i8* %0
}
int xmlUCSIsHalfwidthandFullwidthForms(int code) {
  return (((code >= 0xFF00) && (code <= 0xFFEF)));
}


x86 assembly (clang, -O0):
<xmlUCSIsHalfwidthandFullwidthForms>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0xff00,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsHalfwidthandFullwidthForms+0x26>
cmpl   $0xffef,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsHalfwidthandFullwidthForms>:
add    $0xffff0100,%edi
xor    %eax,%eax
cmp    $0xf0,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsHalfwidthandFullwidthForms(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65280
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 65519
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @xmlUCSIsHalfwidthandFullwidthForms(i32 %0) {
%2 = add i32 %0, -65280
%3 = icmp ult i32 %2, 240
%4 = zext i1 %3 to i32
ret i32 %4
}
int test_imm_C9int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xC9 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_C9int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 13172736
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
short math___Float_native_is_inf___impl(double);
short int core__math___Float___native_is_inf(double self) {
  short int var;
  short int var1;
  var1 = math___Float_native_is_inf___impl(self);
  var = var1;
  goto RET_LABEL;
RET_LABEL:;
  return var;
}


x86 assembly (clang, -O0):
<core__math___Float___native_is_inf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <math___Float_native_is_inf___impl@plt>
mov    %ax,-0xc(%rbp)
mov    -0xc(%rbp),%ax
mov    %ax,-0xa(%rbp)
movswl -0xa(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<core__math___Float___native_is_inf>:
jmp    1030 <math___Float_native_is_inf___impl@plt>

LLVM IR (-O0):
define signext i16 @core__math___Float___native_is_inf(double %0) {
%2 = alloca double
%3 = alloca i16
%4 = alloca i16
store double %0, double* %2
%5 = load double, double* %2
%6 = call signext i16 @math___Float_native_is_inf___impl(double %5)
store i16 %6, i16* %4
%7 = load i16, i16* %4
store i16 %7, i16* %3
br label %8
8: ; preds = %1
%9 = load i16, i16* %3
ret i16 %9
}

LLVM IR (-O2):
define signext i16 @core__math___Float___native_is_inf(double %0) {
%2 = tail call signext i16 @math___Float_native_is_inf___impl(double %0)
ret i16 %2
}
/* Variables and functions */
int get_data_int();
int /*<<< orphan*/ iface_set_option_state(char const *, int);
int /*<<< orphan*/ option_set_int(char const *, int);
int /*<<< orphan*/ send_int_to_srv(int);
int /*<<< orphan*/ send_str_to_srv(char const *);
void sync_int_option(const char *name) {
  int value;
  send_int_to_srv(0x08);
  send_str_to_srv(name);
  value = get_data_int();
  option_set_int(name, value);
  iface_set_option_state(name, value);
}


x86 assembly (clang, -O0):
<sync_int_option>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x8,%edi
call   1030 <send_int_to_srv@plt>
mov    -0x8(%rbp),%rdi
call   1060 <send_str_to_srv@plt>
mov    $0x0,%al
call   1040 <get_data_int@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <option_set_int@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1070 <iface_set_option_state@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sync_int_option>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x8,%edi
call   1030 <send_int_to_srv@plt>
mov    %rbx,%rdi
call   1060 <send_str_to_srv@plt>
xor    %eax,%eax
call   1040 <get_data_int@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <option_set_int@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1070 <iface_set_option_state@plt>

LLVM IR (-O0):
define void @sync_int_option(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i32 @send_int_to_srv(i32 8)
%5 = load i8*, i8** %2
%6 = call i32 @send_str_to_srv(i8* %5)
%7 = call i32 (...) @get_data_int()
store i32 %7, i32* %3
%8 = load i8*, i8** %2
%9 = load i32, i32* %3
%10 = call i32 @option_set_int(i8* %8, i32 %9)
%11 = load i8*, i8** %2
%12 = load i32, i32* %3
%13 = call i32 @iface_set_option_state(i8* %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @sync_int_option(i8* %0) {
%2 = tail call i32 @send_int_to_srv(i32 8)
%3 = tail call i32 @send_str_to_srv(i8* %0)
%4 = tail call i32 (...) @get_data_int()
%5 = tail call i32 @option_set_int(i8* %0, i32 %4)
%6 = tail call i32 @iface_set_option_state(i8* %0, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, float, double);
int /*<<< orphan*/ stdout;
main() {
  float x;
  double y;
  x = -10.3;
  y = x;
  fprintf(stdout, "%f %lf\n", x, y);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  0xee0(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
movss  -0x4(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    0xeb7(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xeef(%rip),%rsi
movss  0xed7(%rip),%xmm0
movsd  0xed7(%rip),%xmm1
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [8 x i8] c"%f %lf\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca double
store float 0xC0249999A0000000, float* %1
%3 = load float, float* %1
%4 = fpext float %3 to double
store double %4, double* %2
%5 = load i32, i32* @stdout
%6 = load float, float* %1
%7 = load double, double* %2
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), float %6, double %7)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [8 x i8] c"%f %lf\0A\00"
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), float 0xC0249999A0000000, double 0xC0249999A0000000)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_spaces(int n) {
  if (n <= 0)
    return;
  while (n--)
    printf(" ");
}


x86 assembly (clang, -O0):
<print_spaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jg     112a <print_spaces+0x1a>
jmp    1154 <print_spaces+0x44>
jmp    112f <print_spaces+0x1f>
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1154 <print_spaces+0x44>
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <print_spaces+0x1f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_spaces>:
push   %rbx
test   %edi,%edi
jle    112f <print_spaces+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <print_spaces+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @print_spaces(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 @putchar(i32 32)
%7 = icmp eq i32 %5, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
float getNHMmultiplier(void) {
  unsigned int msr_lo, msr_hi;
  float coef;
  __asm__ __volatile__("rdmsr" : "=a"(msr_lo), "=d"(msr_hi) : "c"(0x194));
  if ((msr_lo >> 16) & 1) {
    coef = (msr_lo >> 8) & 0xFF;
  } else {
    __asm__ __volatile__("rdmsr" : "=a"(msr_lo), "=d"(msr_hi) : "c"(0xCE));
    coef = (msr_lo >> 8) & 0xFF;
  }
  return coef;
}


x86 assembly (clang, -O0):
<getNHMmultiplier>:
push   %rbp
mov    %rsp,%rbp
mov    $0x194,%ecx
rdmsr
mov    %eax,-0x4(%rbp)
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1135 <getNHMmultiplier+0x35>
movzbl -0x3(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    114f <getNHMmultiplier+0x4f>
mov    $0xce,%ecx
rdmsr
mov    %eax,-0x4(%rbp)
mov    %edx,-0x8(%rbp)
movzbl -0x3(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNHMmultiplier>:
mov    $0x194,%ecx
rdmsr
test   $0x10000,%eax
jne    1115 <getNHMmultiplier+0x15>
mov    $0xce,%ecx
rdmsr
movzbl %ah,%eax
cvtsi2ss %eax,%xmm0
ret

LLVM IR (-O0):
define float @getNHMmultiplier() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = call { i32, i32 } asm sideeffect "rdmsr", "={ax},={dx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 404)
%5 = extractvalue { i32, i32 } %4, 0
%6 = extractvalue { i32, i32 } %4, 1
store i32 %5, i32* %1
store i32 %6, i32* %2
%7 = load i32, i32* %1
%8 = lshr i32 %7, 16
%9 = and i32 %8, 1
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %0
%12 = load i32, i32* %1
%13 = lshr i32 %12, 8
%14 = and i32 %13, 255
%15 = uitofp i32 %14 to float
store float %15, float* %3
br label %24
16: ; preds = %0
%17 = call { i32, i32 } asm sideeffect "rdmsr", "={ax},={dx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 206)
%18 = extractvalue { i32, i32 } %17, 0
%19 = extractvalue { i32, i32 } %17, 1
store i32 %18, i32* %1
store i32 %19, i32* %2
%20 = load i32, i32* %1
%21 = lshr i32 %20, 8
%22 = and i32 %21, 255
%23 = uitofp i32 %22 to float
store float %23, float* %3
br label %24
24: ; preds = %16, %11
%25 = load float, float* %3
ret float %25
}

LLVM IR (-O2):
define float @getNHMmultiplier() {
%1 = tail call { i32, i32 } asm sideeffect "rdmsr", "={ax},={dx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 404)
%2 = extractvalue { i32, i32 } %1, 0
%3 = and i32 %2, 65536
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = tail call { i32, i32 } asm sideeffect "rdmsr", "={ax},={dx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 206)
%7 = extractvalue { i32, i32 } %6, 0
br label %8
8: ; preds = %0, %5
%9 = phi i32 [ %7, %5 ], [ %2, %0 ]
%10 = lshr i32 %9, 8
%11 = and i32 %10, 255
%12 = uitofp i32 %11 to float
ret float %12
}
/* Type definitions */
struct RoommateInfo {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct RoommateInfo *);
void del_student(struct RoommateInfo *student) {
  if (student != NULL)
    free(student);
}


x86 assembly (clang, -O0):
<del_student>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <del_student+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<del_student>:
test   %rdi,%rdi
je     111a <del_student+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.RoommateInfo = type { i32 }
define void @del_student(%struct.RoommateInfo* %0) {
%2 = alloca %struct.RoommateInfo*
store %struct.RoommateInfo* %0, %struct.RoommateInfo** %2
%3 = load %struct.RoommateInfo*, %struct.RoommateInfo** %2
%4 = icmp ne %struct.RoommateInfo* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load %struct.RoommateInfo*, %struct.RoommateInfo** %2
%7 = call i32 @free(%struct.RoommateInfo* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.RoommateInfo = type { i32 }
define void @del_student(%struct.RoommateInfo* %0) {
%2 = icmp eq %struct.RoommateInfo* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.RoommateInfo* %0)
br label %5
5: ; preds = %3, %1
ret void
}
void stop_timer(int itime) { double delta; }


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

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

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

LLVM IR (-O2):
define void @stop_timer(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_creds_get_owner_uid(void *c, uid_t *uid) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_creds_get_owner_uid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ecb(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_creds_get_owner_uid>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_creds_get_owner_uid(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_creds_get_owner_uid(i8* nocapture readnone %0, i32* nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
__attribute__((__always___)) int _xtest_rtm(void) {
  unsigned char out;
  asm volatile(".byte 0x0f,0x01,0xd6 ; setnz %0" : "=r"(out)::"memory");
  return out;
}


x86 assembly (clang, -O0):
<_xtest_rtm>:
push   %rbp
mov    %rsp,%rbp
xtest
setne  %al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_xtest_rtm>:
xtest
setne  %al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @_xtest_rtm() {
%1 = alloca i8
%2 = call i8 asm sideeffect ".byte 0x0f,0x01,0xd6 ; setnz $0", "=r,~{memory},~{dirflag},~{fpsr},~{flags}"()
store i8 %2, i8* %1
%3 = load i8, i8* %1
%4 = zext i8 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @_xtest_rtm() {
%1 = tail call i8 asm sideeffect ".byte 0x0f,0x01,0xd6 ; setnz $0", "=r,~{memory},~{dirflag},~{fpsr},~{flags}"()
%2 = zext i8 %1 to i32
ret i32 %2
}
int generic_no_op_func(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @generic_no_op_func() {
ret i32 0
}

LLVM IR (-O2):
define i32 @generic_no_op_func() {
ret i32 0
}
/* Variables and functions */
scalar_t__ VIM_HAPI_GetFrmCount();
unsigned long V5H_Capture_GetFrmCount(void) {
  { return ((unsigned short)VIM_HAPI_GetFrmCount()); }
}


x86 assembly (clang, -O0):
<V5H_Capture_GetFrmCount>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <VIM_HAPI_GetFrmCount@plt>
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<V5H_Capture_GetFrmCount>:
push   %rax
xor    %eax,%eax
call   1030 <VIM_HAPI_GetFrmCount@plt>
movzwl %ax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @V5H_Capture_GetFrmCount() {
%1 = call i64 (...) @VIM_HAPI_GetFrmCount()
%2 = trunc i64 %1 to i16
%3 = zext i16 %2 to i64
ret i64 %3
}

LLVM IR (-O2):
define i64 @V5H_Capture_GetFrmCount() {
%1 = tail call i64 (...) @VIM_HAPI_GetFrmCount()
%2 = and i64 %1, 65535
ret i64 %2
}
void TRNGDisable(void) {
  (*((volatile unsigned long
          *)(((unsigned long)(0x40028000 + 0x00000014) & 0xF0000000) |
             0x02000000 |
             (((unsigned long)(0x40028000 + 0x00000014) & 0x000FFFFF) << 5) |
             ((10) << 2)))) = 0;
}


x86 assembly (clang, -O0):
<TRNGDisable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x425002a8,%eax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TRNGDisable>:
movq   $0x0,0x425002a8
ret

LLVM IR (-O0):
define void @TRNGDisable() {
store volatile i64 0, i64* inttoptr (i64 1112539816 to i64*)
ret void
}

LLVM IR (-O2):
define void @TRNGDisable() {
store volatile i64 0, i64* inttoptr (i64 1112539816 to i64*)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t fread(void *, size_t, size_t, int /*<<< orphan*/ *);
size_t fread_internal(void *ptr, size_t size, size_t nmemb, void *fp) {
  return fread(ptr, size, nmemb, (FILE *)fp);
}


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

x86 assembly (clang, -O2):
<fread_internal>:
jmp    1030 <fread@plt>

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

LLVM IR (-O2):
define i64 @fread_internal(i8* nocapture %0, i64 %1, i64 %2, i8* nocapture %3) {
%5 = bitcast i8* %3 to i32*
%6 = tail call i64 @fread(i8* %0, i64 %1, i64 %2, i32* %5)
ret i64 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ XNoExposeEvent;

/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ malloc(int);
void *alloc_XNoExposeEvent(void) {
  XNoExposeEvent *_p = (XNoExposeEvent *)malloc(sizeof(XNoExposeEvent));
  if (_p == NULL)
    abort();
  return (void *)_p;
}


x86 assembly (clang, -O0):
<alloc_XNoExposeEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <alloc_XNoExposeEvent+0x28>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_XNoExposeEvent>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1132 <alloc_XNoExposeEvent+0x12>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @alloc_XNoExposeEvent() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = load i32*, i32** %1
%10 = bitcast i32* %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
define i8* @alloc_XNoExposeEvent() {
%1 = tail call i64 @malloc(i32 4)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = inttoptr i64 %1 to i8*
ret i8* %6
}
void TAMPER_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @TAMPER_IRQHandler() {
ret void
}
/* Variables and functions */
char base32hexchar(int x) {
  static const char table[32] = "0123456789"
                                "ABCDEFGHIJKLMNOPQRSTUV";
  return table[x & 31];
}


x86 assembly (clang, -O0):
<base32hexchar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1f,%eax
movslq %eax,%rcx
lea    0xee9(%rip),%rax
movsbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base32hexchar>:
and    $0x1f,%edi
lea    0xef6(%rip),%rax
mov    (%rdi,%rax,1),%al
ret

LLVM IR (-O0):
@base32hexchar.table = internal constant [32 x i8] c"0123456789ABCDEFGHIJKLMNOPQRSTUV"
define signext i8 @base32hexchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 31
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [32 x i8], [32 x i8]* @base32hexchar.table, i64 0, i64 %5
%7 = load i8, i8* %6
ret i8 %7
}

LLVM IR (-O2):
@base32hexchar.table = internal unnamed_addr constant [32 x i8] c"0123456789ABCDEFGHIJKLMNOPQRSTUV"
define signext i8 @base32hexchar(i32 %0) {
%2 = and i32 %0, 31
%3 = zext i32 %2 to i64
%4 = getelementptr inbounds [32 x i8], [32 x i8]* @base32hexchar.table, i64 0, i64 %3
%5 = load i8, i8* %4
ret i8 %5
}
long toDWord(const char *bytes) {
  long result;
  result = 0;
  result = 0X000000FF & bytes[0];
  result = (bytes[1] << 8) | result;
  result = 0X0000FFFF & result;
  result = (bytes[2] << 16) | result;
  result = 0X00FFFFFF & result;
  result = (bytes[3] << 24) | result;
  return result;
}


x86 assembly (clang, -O0):
<toDWord>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
and    $0xff,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
shl    $0x8,%eax
cltq
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0xffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x2(%rax),%eax
shl    $0x10,%eax
cltq
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0xffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x3(%rax),%eax
shl    $0x18,%eax
cltq
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toDWord>:
movzbl (%rdi),%eax
movzbl 0x1(%rdi),%ecx
shl    $0x8,%ecx
movzwl %cx,%ecx
or     %rax,%rcx
movzbl 0x2(%rdi),%eax
movzbl %al,%edx
shl    $0x10,%rdx
or     %rcx,%rdx
movzbl 0x3(%rdi),%eax
shl    $0x18,%eax
cltq
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @toDWord(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* %3
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = and i32 255, %7
%9 = sext i32 %8 to i64
store i64 %9, i64* %3
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = shl i32 %13, 8
%15 = sext i32 %14 to i64
%16 = load i64, i64* %3
%17 = or i64 %15, %16
store i64 %17, i64* %3
%18 = load i64, i64* %3
%19 = and i64 65535, %18
store i64 %19, i64* %3
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 2
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = shl i32 %23, 16
%25 = sext i32 %24 to i64
%26 = load i64, i64* %3
%27 = or i64 %25, %26
store i64 %27, i64* %3
%28 = load i64, i64* %3
%29 = and i64 16777215, %28
store i64 %29, i64* %3
%30 = load i8*, i8** %2
%31 = getelementptr inbounds i8, i8* %30, i64 3
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = shl i32 %33, 24
%35 = sext i32 %34 to i64
%36 = load i64, i64* %3
%37 = or i64 %35, %36
store i64 %37, i64* %3
%38 = load i64, i64* %3
ret i64 %38
}

LLVM IR (-O2):
define i64 @toDWord(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = sext i8 %5 to i64
%7 = shl nsw i64 %6, 8
%8 = and i64 %7, 65280
%9 = or i64 %8, %3
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i64
%13 = shl nsw i64 %12, 16
%14 = and i64 %13, 16711680
%15 = or i64 %9, %14
%16 = getelementptr inbounds i8, i8* %0, i64 3
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = shl nuw i32 %18, 24
%20 = sext i32 %19 to i64
%21 = or i64 %15, %20
ret i64 %21
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main() {
  printf("%d\n", ';');
  printf("%d\n", '?');
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext 59)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext 63)
ret i32 0
}