xunge/DecIR huggingface dataset:
int are_equal(const unsigned char *str1, const unsigned char *str2, int len) {
  int i;
  for (i = 0; i < len; i++) {
    if (!(*(str1 + i) & *(str2 + i)))
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<are_equal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1164 <are_equal+0x64>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    -0x18(%rbp),%rcx
movslq -0x20(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
and    %ecx,%eax
cmp    $0x0,%eax
jne    1151 <are_equal+0x51>
movl   $0x0,-0x4(%rbp)
jmp    116b <are_equal+0x6b>
jmp    1156 <are_equal+0x56>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1116 <are_equal+0x16>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<are_equal>:
mov    $0x1,%eax
test   %edx,%edx
jle    1122 <are_equal+0x22>
mov    %edx,%r8d
xor    %edx,%edx
xchg   %ax,%ax
movzbl (%rsi,%rdx,1),%ecx
test   %cl,(%rdi,%rdx,1)
je     1123 <are_equal+0x23>
add    $0x1,%rdx
cmp    %rdx,%r8
jne    1110 <are_equal+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @are_equal(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %18
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %17, %6
br i1 %8, label %18, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %17, %7 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = getelementptr inbounds i8, i8* %1, i64 %10
%14 = load i8, i8* %13
%15 = and i8 %14, %12
%16 = icmp eq i8 %15, 0
%17 = add nuw nsw i64 %10, 1
br i1 %16, label %18, label %7
18: ; preds = %9, %7, %3
%19 = phi i32 [ 1, %3 ], [ 1, %7 ], [ 0, %9 ]
ret i32 %19
}
void ble_rsp_flash_erase_page(
    const struct ble_msg_flash_erase_page_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.ble_msg_flash_erase_page_rsp_t = type opaque
define void @ble_rsp_flash_erase_page(%struct.ble_msg_flash_erase_page_rsp_t* nocapture %0) {
ret void
}
double GLRadians(double degrees) { return (degrees * 3.1415926535 / 180); }


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

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

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

LLVM IR (-O2):
define double @GLRadians(double %0) {
%2 = fmul double %0, 0x400921FB54411744
%3 = fdiv double %2, 1.800000e+02
ret double %3
}
int BuildHeap() {}


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

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

LLVM IR (-O0):
define i32 @BuildHeap() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @BuildHeap() {
ret i32 undef
}
/* Variables and functions */
int match(char const *, char *);
int is_hidden(const char *path) {
  char *regexString = "/\\.";
  return match(path, regexString);
}


x86 assembly (clang, -O0):
<is_hidden>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <match@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_hidden>:
lea    0xee9(%rip),%rsi
jmp    1030 <match@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"/\\.\00"
define i32 @is_hidden(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %2
%5 = load i8*, i8** %3
%6 = call i32 @match(i8* %4, i8* %5)
ret i32 %6
}

LLVM IR (-O2):
@.str = [4 x i8] c"/\\.\00"
define i32 @is_hidden(i8* %0) {
%2 = tail call i32 @match(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
float CG_OpFuncCompareOr(const float a, const float b) { return (a || b); }


x86 assembly (clang, -O0):
<CG_OpFuncCompareOr>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mov    $0x1,%al
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
mov    %al,-0x9(%rbp)
jne    1140 <CG_OpFuncCompareOr+0x40>
jp     1140 <CG_OpFuncCompareOr+0x40>
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
setne  %al
setp   %cl
or     %cl,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cvtsi2ss %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_OpFuncCompareOr>:
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm0
setp   %al
setne  %cl
or     %al,%cl
ucomiss %xmm2,%xmm1
setp   %al
setne  %dl
or     %al,%dl
or     %cl,%dl
movzbl %dl,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
ret

LLVM IR (-O0):
define float @CG_OpFuncCompareOr(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = fcmp une float %5, 0.000000e+00
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load float, float* %4
%9 = fcmp une float %8, 0.000000e+00
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ true, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = sitofp i32 %12 to float
ret float %13
}

LLVM IR (-O2):
define float @CG_OpFuncCompareOr(float %0, float %1) {
%3 = fcmp une float %0, 0.000000e+00
%4 = fcmp une float %1, 0.000000e+00
%5 = or i1 %3, %4
%6 = uitofp i1 %5 to float
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
long strtol(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ sum(int /*<<< orphan*/, int /*<<< orphan*/, long);
int main(int argc, char **argv) {
  long n = strtol(argv[1], 0, 10);
  printf("%ld\n", sum(0, 0, n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdx
xor    %esi,%esi
mov    %esi,%edi
call   1050 <sum@plt>
mov    %eax,%esi
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %rax,%rdx
call   1050 <sum@plt>
lea    0xeac(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i64 @strtol(i8* %4, i32 0, i32 10)
%6 = tail call i32 @sum(i32 0, i32 0, i64 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ rSizeInt;

/* Variables and functions */
char *calloc(int, int);
int /*<<< orphan*/ printf(char *, char *);
int read(int, ...);
const char *recvCmd(int con) {
  int rSizeInt;
  int rS = read(con, &rSizeInt, sizeof(rSizeInt));
  char *conCmdBuff;
  conCmdBuff = calloc(rSizeInt + 1, sizeof(char));
  read(con, conCmdBuff, rSizeInt);
  printf("%s\n", conCmdBuff);
  return conCmdBuff;
}


x86 assembly (clang, -O0):
<recvCmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
mov    $0x0,%al
call   1040 <read@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
add    $0x1,%edi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%edx
mov    $0x0,%al
call   1040 <read@plt>
mov    -0x18(%rbp),%rsi
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recvCmd>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edi,%r14d
lea    0xc(%rsp),%rsi
mov    $0x4,%edx
xor    %eax,%eax
call   1040 <read@plt>
mov    0xc(%rsp),%ebx
lea    0x1(%rbx),%edi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,%rbp
mov    %r14d,%edi
mov    %rax,%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <read@plt>
lea    0xe8a(%rip),%rdi
mov    %rbp,%rsi
call   1030 <printf@plt>
mov    %rbp,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i8* @recvCmd(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = call i32 (i32, ...) @read(i32 %6, i32* %3, i64 4)
store i32 %7, i32* %4
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 1
%10 = call i8* @calloc(i32 %9, i32 1)
store i8* %10, i8** %5
%11 = load i32, i32* %2
%12 = load i8*, i8** %5
%13 = load i32, i32* %3
%14 = call i32 (i32, ...) @read(i32 %11, i8* %12, i32 %13)
%15 = load i8*, i8** %5
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i8* @recvCmd(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 (i32, ...) @read(i32 %0, i32* %2, i64 4)
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
%7 = call i8* @calloc(i32 %6, i32 1)
%8 = call i32 (i32, ...) @read(i32 %0, i8* %7, i32 %5)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
ret i8* %7
}
/* Variables and functions */
int INT_MIN;
int test6(int x) {
  int y = INT_MIN;
  return ~(x - y);
}


x86 assembly (clang, -O0):
<test6>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2eda(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test6>:
mov    %edi,%eax
mov    0x2edf(%rip),%rcx
not    %eax
add    (%rcx),%eax
ret

LLVM IR (-O0):
@INT_MIN = global i32 0
define i32 @test6(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* @INT_MIN
store i32 %4, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = sub nsw i32 %5, %6
%8 = xor i32 %7, -1
ret i32 %8
}

LLVM IR (-O2):
@INT_MIN = global i32 0
define i32 @test6(i32 %0) {
%2 = load i32, i32* @INT_MIN
%3 = xor i32 %0, -1
%4 = add i32 %2, %3
ret i32 %4
}
void swap2(int *px, int *py) {
  int temp;
  temp = *px;
  *px = *py;
  *py = temp;
}


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

x86 assembly (clang, -O2):
<swap2>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @swap2(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
void chaz_ConfWriterRuby_add_global_typedef(const char *type,
                                            const char *alias) {
  (void)type;
  (void)alias;
}


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

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

LLVM IR (-O0):
define void @chaz_ConfWriterRuby_add_global_typedef(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
ret void
}

LLVM IR (-O2):
define void @chaz_ConfWriterRuby_add_global_typedef(i8* nocapture %0, i8* nocapture %1) {
ret void
}
int test_imm_16int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x16 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_16int64_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, 22
%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_16int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 1441792
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
size_t ceil(size_t const);
size_t decoded_dest_size(const size_t src_len) {
  size_t blocks = ceil(src_len / 4.0);
  return blocks * 3;
}


x86 assembly (clang, -O0):
<decoded_dest_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movaps 0xedd(%rip),%xmm1
movq   -0x8(%rbp),%xmm0
punpckldq %xmm1,%xmm0
movapd 0xedc(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0xed5(%rip),%xmm1
divsd  %xmm1,%xmm0
movaps %xmm0,%xmm1
cvttsd2si %xmm1,%rdi
mov    %rdi,%rcx
sar    $0x3f,%rcx
movsd  0xec2(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
and    %rcx,%rax
or     %rax,%rdi
call   1030 <ceil@plt>
mov    %rax,-0x10(%rbp)
imul   $0x3,-0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decoded_dest_size>:
push   %rax
movq   %rdi,%xmm0
punpckldq 0xee2(%rip),%xmm0
subpd  0xeea(%rip),%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
addsd  %xmm0,%xmm1
mulsd  0xee6(%rip),%xmm1
cvttsd2si %xmm1,%rax
mov    %rax,%rcx
sar    $0x3f,%rcx
subsd  0xeda(%rip),%xmm1
cvttsd2si %xmm1,%rdi
and    %rcx,%rdi
or     %rax,%rdi
call   1030 <ceil@plt>
lea    (%rax,%rax,2),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @decoded_dest_size(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = uitofp i64 %4 to double
%6 = fdiv double %5, 4.000000e+00
%7 = fptoui double %6 to i64
%8 = call i64 @ceil(i64 %7)
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = mul i64 %9, 3
ret i64 %10
}

LLVM IR (-O2):
define i64 @decoded_dest_size(i64 %0) {
%2 = uitofp i64 %0 to double
%3 = fmul double %2, 2.500000e-01
%4 = fptoui double %3 to i64
%5 = tail call i64 @ceil(i64 %4)
%6 = mul i64 %5, 3
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
void abort(void) { _exit(1); }


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<abort>:
push   %rax
mov    $0x1,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define void @abort() {
%1 = call i32 @_exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @abort() {
%1 = tail call i32 @_exit(i32 1)
unreachable
}
int test_imm_3Auint16_reg(unsigned short val) {
  return ((val) & (0x3A << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_3Auint16_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, 58
%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_3Auint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 58
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint64_t;

/* Variables and functions */
int read_little_endian32(int /*<<< orphan*/ *, int);
int read_little_endian64(int /*<<< orphan*/ *, int);
uint64_t read_addr(uint8_t *hashtable, uint64_t pos, int address_size) {
  switch (address_size) {
  case 4:
    return read_little_endian32(hashtable, pos);
  case 8:
    return read_little_endian64(hashtable, pos);
  }
  return -1;
}


x86 assembly (clang, -O0):
<read_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x4,%eax
je     1157 <read_addr+0x37>
jmp    1146 <read_addr+0x26>
mov    -0x1c(%rbp),%eax
sub    $0x8,%eax
je     116b <read_addr+0x4b>
jmp    117f <read_addr+0x5f>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <read_little_endian32@plt>
mov    %eax,-0x4(%rbp)
jmp    1186 <read_addr+0x66>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <read_little_endian64@plt>
mov    %eax,-0x4(%rbp)
jmp    1186 <read_addr+0x66>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_addr>:
cmp    $0x8,%edx
je     112f <read_addr+0xf>
cmp    $0x4,%edx
jne    1134 <read_addr+0x14>
jmp    1030 <read_little_endian32@plt>
jmp    1040 <read_little_endian64@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @read_addr(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* %7
switch i32 %8, label %17 [
i32 4, label %9
i32 8, label %13
]
9: ; preds = %3
%10 = load i32*, i32** %5
%11 = load i32, i32* %6
%12 = call i32 @read_little_endian32(i32* %10, i32 %11)
store i32 %12, i32* %4
br label %18
13: ; preds = %3
%14 = load i32*, i32** %5
%15 = load i32, i32* %6
%16 = call i32 @read_little_endian64(i32* %14, i32 %15)
store i32 %16, i32* %4
br label %18
17: ; preds = %3
store i32 -1, i32* %4
br label %18
18: ; preds = %17, %13, %9
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
define i32 @read_addr(i32* %0, i32 %1, i32 %2) {
switch i32 %2, label %8 [
i32 4, label %4
i32 8, label %6
]
4: ; preds = %3
%5 = tail call i32 @read_little_endian32(i32* %0, i32 %1)
br label %8
6: ; preds = %3
%7 = tail call i32 @read_little_endian64(i32* %0, i32 %1)
br label %8
8: ; preds = %3, %6, %4
%9 = phi i32 [ %7, %6 ], [ %5, %4 ], [ -1, %3 ]
ret i32 %9
}
/* Variables and functions */
int console_main(int, char **);
int main(int ac, char **av) { return console_main(ac, av); }


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <console_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <console_main@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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @console_main(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @console_main(i32 %0, i8** %1)
ret i32 %3
}
void swap(unsigned long *a, unsigned long *b) {
  unsigned long temp;
  if (a && b)
    temp = *a, *a = *b, *b = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1146 <swap+0x46>
cmpq   $0x0,-0x10(%rbp)
je     1146 <swap+0x46>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
test   %rdi,%rdi
je     1116 <swap+0x16>
test   %rsi,%rsi
je     1116 <swap+0x16>
mov    (%rdi),%rax
mov    (%rsi),%rcx
mov    %rcx,(%rdi)
mov    %rax,(%rsi)
ret

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

LLVM IR (-O2):
define void @swap(i64* %0, i64* %1) {
%3 = icmp ne i64* %0, null
%4 = icmp ne i64* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = load i64, i64* %0
%8 = load i64, i64* %1
store i64 %8, i64* %0
store i64 %7, i64* %1
br label %9
9: ; preds = %6, %2
ret void
}
void clear_dvector(double *m, int nl, int nh) {
  int i;
  for (i = nl; i <= nh; i++)
    m[i] = 0.0;
}


x86 assembly (clang, -O0):
<clear_dvector>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     113e <clear_dvector+0x3e>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1114 <clear_dvector+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_dvector>:
sub    %esi,%edx
jl     112f <clear_dvector+0x1f>
push   %rax
movslq %esi,%rax
lea    (%rdi,%rax,8),%rdi
lea    0x8(,%rdx,8),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @clear_dvector(double* %0, i32 %1, i32 %2) {
%4 = alloca double*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store double* %0, double** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
store i32 %8, i32* %7
br label %9
9: ; preds = %18, %3
%10 = load i32, i32* %7
%11 = load i32, i32* %6
%12 = icmp sle i32 %10, %11
br i1 %12, label %13, label %21
13: ; preds = %9
%14 = load double*, double** %4
%15 = load i32, i32* %7
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds double, double* %14, i64 %16
store double 0.000000e+00, double* %17
br label %18
18: ; preds = %13
%19 = load i32, i32* %7
%20 = add nsw i32 %19, 1
store i32 %20, i32* %7
br label %9
21: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @clear_dvector(double* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %2, %1
br i1 %4, label %13, label %5
5: ; preds = %3
%6 = sext i32 %1 to i64
%7 = getelementptr double, double* %0, i64 %6
%8 = bitcast double* %7 to i8*
%9 = sub i32 %2, %1
%10 = zext i32 %9 to i64
%11 = shl nuw nsw i64 %10, 3
%12 = add nuw nsw i64 %11, 8
br label %13
13: ; preds = %5, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char const *, char const *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
FILE *efopen(const char *p, const char *m) {
  FILE *f;
  f = fopen(p, m);
  if (f == NULL) {
    fprintf(stderr, "ply2off: fail to open %s\n", p);
    exit(2);
  }
  return f;
}


x86 assembly (clang, -O0):
<efopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117f <efopen+0x4f>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe90(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<efopen>:
push   %rbx
mov    %rdi,%rbx
call   1040 <fopen@plt>
test   %rax,%rax
je     1140 <efopen+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"ply2off: fail to open %s\0A\00"
define i32* @efopen(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i8*, i8** %3
%14 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = call i32 @exit(i32 2)
unreachable
16: ; preds = %2
%17 = load i32*, i32** %5
ret i32* %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"ply2off: fail to open %s\0A\00"
define noalias i32* @efopen(i8* %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0)
%8 = tail call i32 @exit(i32 2)
unreachable
9: ; preds = %2
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ errExit(char *);
int fcntl(int, int /*<<< orphan*/);
int fileGetFlags(int fd) {
  int ret = fcntl(fd, F_GETFL);
  if (ret == -1)
    errExit("fcntl: getting file status flags");
  return ret;
}


x86 assembly (clang, -O0):
<fileGetFlags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1155 <fileGetFlags+0x35>
lea    0xeb0(%rip),%rdi
call   1040 <errExit@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileGetFlags>:
push   %rbx
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
call   1030 <fcntl@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
jne    1142 <fileGetFlags+0x22>
lea    0xec3(%rip),%rdi
call   1040 <errExit@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@F_GETFL = global i32 0
@.str = [33 x i8] c"fcntl: getting file status flags\00"
define i32 @fileGetFlags(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFL
%6 = call i32 @fcntl(i32 %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @errExit(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@.str = [33 x i8] c"fcntl: getting file status flags\00"
define i32 @fileGetFlags(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 @fcntl(i32 %0, i32 %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @errExit(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int execle(const char *path, const char *arg, ...) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<execle>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed5(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebc(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<execle>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @execle(i8* %0, i8* %1, ...) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @execle(i8* nocapture readnone %0, i8* nocapture readnone %1, ...) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
/* Type definitions */
struct cpu_map {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct cpu_map *);
void cpu_map__delete(struct cpu_map *map) { free(map); }


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

x86 assembly (clang, -O2):
<cpu_map__delete>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.cpu_map = type { i32 }
define void @cpu_map__delete(%struct.cpu_map* nocapture %0) {
%2 = tail call i32 @free(%struct.cpu_map* %0)
ret void
}
void ularith_sub_2ul_2ul(unsigned long *r1, unsigned long *r2,
                         const unsigned long a1, const unsigned long a2) {
  unsigned long u = *r1;
  *r1 -= a1;
  *r2 -= a2;
  if (*r1 > u)
    (*r2)--;
}


x86 assembly (clang, -O0):
<ularith_sub_2ul_2ul>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
sub    %rdx,%rcx
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rdx
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
sub    %rdx,%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
cmp    -0x28(%rbp),%rax
jbe    1160 <ularith_sub_2ul_2ul+0x60>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ularith_sub_2ul_2ul>:
mov    (%rdi),%r8
mov    %r8,%rax
sub    %rdx,%rax
mov    %rax,(%rdi)
mov    (%rsi),%rax
sub    %rcx,%rax
mov    %rax,(%rsi)
cmp    %r8,(%rdi)
jbe    1121 <ularith_sub_2ul_2ul+0x21>
add    $0xffffffffffffffff,%rax
mov    %rax,(%rsi)
ret

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

LLVM IR (-O2):
define void @ularith_sub_2ul_2ul(i64* nocapture %0, i64* nocapture %1, i64 %2, i64 %3) {
%5 = load i64, i64* %0
%6 = sub i64 %5, %2
store i64 %6, i64* %0
%7 = load i64, i64* %1
%8 = sub i64 %7, %3
store i64 %8, i64* %1
%9 = load i64, i64* %0
%10 = icmp ugt i64 %9, %5
br i1 %10, label %11, label %13
11: ; preds = %4
%12 = add i64 %8, -1
store i64 %12, i64* %1
br label %13
13: ; preds = %11, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ kputc(int /*<<< orphan*/);
void kprint(char *s) {
  while (*s)
    kputc(*s++);
}


x86 assembly (clang, -O0):
<kprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <kprint+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <kputc@plt>
jmp    111c <kprint+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kprint>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <kprint+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <kputc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <kprint+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @kprint(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %2
%10 = load i8, i8* %8
%11 = sext i8 %10 to i32
%12 = call i32 @kputc(i32 %11)
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @kprint(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @kputc(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Type definitions */
struct pico_mqtt_packet {
  int dummy;
};
struct pico_mqtt {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ destroy_packet(struct pico_mqtt_packet *);
int handle_connack(struct pico_mqtt *mqtt, struct pico_mqtt_packet *packet) {
  do {
  } while (0);
  do {
  } while (0);
  destroy_packet(packet);
  return 0;
}


x86 assembly (clang, -O0):
<handle_connack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
jmp    1125 <handle_connack+0x15>
jmp    112a <handle_connack+0x1a>
jmp    112f <handle_connack+0x1f>
mov    -0x10(%rbp),%rdi
call   1030 <destroy_packet@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_connack>:
push   %rax
mov    %rsi,%rdi
call   1030 <destroy_packet@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.pico_mqtt = type { i32 }
%struct.pico_mqtt_packet = type { i32 }
define i32 @handle_connack(%struct.pico_mqtt* %0, %struct.pico_mqtt_packet* %1) {
%3 = alloca %struct.pico_mqtt*
%4 = alloca %struct.pico_mqtt_packet*
store %struct.pico_mqtt* %0, %struct.pico_mqtt** %3
store %struct.pico_mqtt_packet* %1, %struct.pico_mqtt_packet** %4
br label %5
5: ; preds = %2
br label %6
6: ; preds = %5
br label %7
7: ; preds = %6
br label %8
8: ; preds = %7
%9 = load %struct.pico_mqtt_packet*, %struct.pico_mqtt_packet** %4
%10 = call i32 @destroy_packet(%struct.pico_mqtt_packet* %9)
ret i32 0
}

LLVM IR (-O2):
%struct.pico_mqtt = type { i32 }
%struct.pico_mqtt_packet = type { i32 }
define i32 @handle_connack(%struct.pico_mqtt* nocapture readnone %0, %struct.pico_mqtt_packet* %1) {
%3 = tail call i32 @destroy_packet(%struct.pico_mqtt_packet* %1)
ret i32 0
}
char *hash_plugin_detailed(void) {
  return ("privkey - SSH/SSL private key passphrase plugin\n"
          "------------------------------------------------\n"
          "Use this module to crack private key passphrases\n"
          "Input should be a RSA/DSA private key file specified with -f\n"
          "Known software that uses this password hashing method:\n"
          "Apache-SSL, OpenSSH, OpenVPN, etc.\n"
          "\nAuthor: Milen Rangelov <gat3way@gat3way.eu>\n");
}


x86 assembly (clang, -O0):
<hash_plugin_detailed>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_plugin_detailed>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [343 x i8] c"privkey - SSH/SSL private key passphrase plugin\0A------------------------------------------------\0AUse this module to crack private key passphrases\0AInput should be a RSA/DSA private key file specified with -f\0AKnown software that uses this password hashing method:\0AApache-SSL, OpenSSH, OpenVPN, etc.\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([343 x i8], [343 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [343 x i8] c"privkey - SSH/SSL private key passphrase plugin\0A------------------------------------------------\0AUse this module to crack private key passphrases\0AInput should be a RSA/DSA private key file specified with -f\0AKnown software that uses this password hashing method:\0AApache-SSL, OpenSSH, OpenVPN, etc.\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([343 x i8], [343 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct XorrisO {
  int dummy;
};

/* Variables and functions */
int Xorriso_pvd_info(struct XorrisO *, int /*<<< orphan*/);
int Xorriso_option_pvd_info(struct XorrisO *xorriso, int flag) {
  return (Xorriso_pvd_info(xorriso, 0));
}


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

x86 assembly (clang, -O2):
<Xorriso_option_pvd_info>:
xor    %esi,%esi
jmp    1030 <Xorriso_pvd_info@plt>

LLVM IR (-O0):
%struct.XorrisO = type { i32 }
define i32 @Xorriso_option_pvd_info(%struct.XorrisO* %0, i32 %1) {
%3 = alloca %struct.XorrisO*
%4 = alloca i32
store %struct.XorrisO* %0, %struct.XorrisO** %3
store i32 %1, i32* %4
%5 = load %struct.XorrisO*, %struct.XorrisO** %3
%6 = call i32 @Xorriso_pvd_info(%struct.XorrisO* %5, i32 0)
ret i32 %6
}

LLVM IR (-O2):
%struct.XorrisO = type { i32 }
define i32 @Xorriso_option_pvd_info(%struct.XorrisO* %0, i32 %1) {
%3 = tail call i32 @Xorriso_pvd_info(%struct.XorrisO* %0, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int whatIsThis(int *, int);
int main(void) {
  int x;
  int a[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
  x = whatIsThis(a, 10);
  printf("Result is %d\n", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1050 <whatIsThis@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xa,%esi
call   1040 <whatIsThis@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
@__const.main.a = [10 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10]
@.str = [14 x i8] c"Result is %d\0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @whatIsThis(i32* %3, i32 10)
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
scalar_t__ isupper(char);
char tolower(char);
char tolowercase(char ch) {
  if (isupper(ch)) {
    ch = tolower(ch);
  }
  return ch;
}


x86 assembly (clang, -O0):
<tolowercase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <isupper@plt>
cmp    $0x0,%rax
je     114d <tolowercase+0x2d>
movsbl -0x1(%rbp),%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolowercase>:
push   %rbx
mov    %edi,%ebx
call   1040 <isupper@plt>
test   %rax,%rax
je     1136 <tolowercase+0x16>
movsbl %bl,%edi
pop    %rbx
jmp    1030 <tolower@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @tolowercase(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isupper(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call signext i8 @tolower(i8 signext %7)
store i8 %8, i8* %2
br label %9
9: ; preds = %6, %1
%10 = load i8, i8* %2
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @tolowercase(i8 signext %0) {
%2 = tail call i64 @isupper(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call signext i8 @tolower(i8 signext %0)
br label %6
6: ; preds = %4, %1
%7 = phi i8 [ %5, %4 ], [ %0, %1 ]
ret i8 %7
}
double logic_ge(double a, double b) { return a >= b; }


x86 assembly (clang, -O0):
<logic_ge>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<logic_ge>:
cmplesd %xmm0,%xmm1
movsd  0xef3(%rip),%xmm0
andpd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @logic_ge(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp oge double %5, %6
%8 = zext i1 %7 to i32
%9 = sitofp i32 %8 to double
ret double %9
}

LLVM IR (-O2):
define double @logic_ge(double %0, double %1) {
%3 = fcmp oge double %0, %1
%4 = uitofp i1 %3 to double
ret double %4
}
int somma(int a, int b) { return a + b; }


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

x86 assembly (clang, -O2):
<somma>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @somma(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @somma(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
void ff_hevc_put_hevc_bi_w_pel_pixels32_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_pel_pixels32_8_sse4() {
ret void
}
/* Variables and functions */
int areaOfRectangle(int, int);
int areaOfSquare(int length) {
  int area;
  area = areaOfRectangle(length, length);
  return area;
}


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

x86 assembly (clang, -O2):
<areaOfSquare>:
mov    %edi,%esi
jmp    1030 <areaOfRectangle@plt>

LLVM IR (-O0):
define i32 @areaOfSquare(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @areaOfRectangle(i32 %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @areaOfSquare(i32 %0) {
%2 = tail call i32 @areaOfRectangle(i32 %0, i32 %0)
ret i32 %2
}
/* Variables and functions */
int i2c_send_byte_2(int, int, char);
int LCD_AQM_wrdat(char dat) { return i2c_send_byte_2(0x3E, 0x40, dat); }


x86 assembly (clang, -O0):
<LCD_AQM_wrdat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x3e,%edi
mov    $0x40,%esi
movsbl -0x1(%rbp),%edx
call   1030 <i2c_send_byte_2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD_AQM_wrdat>:
mov    %edi,%edx
mov    $0x3e,%edi
mov    $0x40,%esi
jmp    1030 <i2c_send_byte_2@plt>

LLVM IR (-O0):
define i32 @LCD_AQM_wrdat(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @i2c_send_byte_2(i32 62, i32 64, i8 signext %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @LCD_AQM_wrdat(i8 signext %0) {
%2 = tail call i32 @i2c_send_byte_2(i32 62, i32 64, i8 signext %0)
ret i32 %2
}