xunge/DecIR huggingface dataset:
/* Variables and functions */
char *strchr(char *, char);
char *stripPathFromFile(const char *file) {
  char *pos = (char *)file;
  char *newpos = strchr(pos, '/');
  while (newpos) {
    pos = newpos + 1;
    newpos = strchr(pos, '/');
  }
  return pos;
}


x86 assembly (clang, -O0):
<stripPathFromFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1164 <stripPathFromFile+0x54>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
jmp    1136 <stripPathFromFile+0x26>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stripPathFromFile>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x2f,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     113b <stripPathFromFile+0x2b>
mov    %rax,%rbx
add    $0x1,%rbx
mov    %rbx,%rdi
jmp    1120 <stripPathFromFile+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @stripPathFromFile(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i8* @strchr(i8* %6, i8 signext 47)
store i8* %7, i8** %4
br label %8
8: ; preds = %11, %1
%9 = load i8*, i8** %4
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %16
11: ; preds = %8
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 1
store i8* %13, i8** %3
%14 = load i8*, i8** %3
%15 = call i8* @strchr(i8* %14, i8 signext 47)
store i8* %15, i8** %4
br label %8
16: ; preds = %8
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
define i8* @stripPathFromFile(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %7, %4 ], [ %2, %1 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = tail call i8* @strchr(i8* %6, i8 signext 47)
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %4
9: ; preds = %4, %1
%10 = phi i8* [ %0, %1 ], [ %6, %4 ]
ret i8* %10
}
__attribute((always_)) float glm_percent(float from, float to, float current) {
  float t;
  if ((t = to - from) == 0.0f)
    return 1.0f;
  return (current - from) / t;
}


x86 assembly (clang, -O0):
<glm_percent>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1146 <glm_percent+0x46>
jp     1146 <glm_percent+0x46>
movss  0xec4(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115a <glm_percent+0x5a>
movss  -0x10(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
divss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<glm_percent>:
subss  %xmm0,%xmm1
xorps  %xmm3,%xmm3
ucomiss %xmm3,%xmm1
jne    1117 <glm_percent+0x17>
jp     1117 <glm_percent+0x17>
movss  0xeea(%rip),%xmm0
ret
subss  %xmm0,%xmm2
divss  %xmm1,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @glm_percent(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
%9 = load float, float* %6
%10 = load float, float* %5
%11 = fsub float %9, %10
store float %11, float* %8
%12 = fcmp oeq float %11, 0.000000e+00
br i1 %12, label %13, label %14
13: ; preds = %3
store float 1.000000e+00, float* %4
br label %20
14: ; preds = %3
%15 = load float, float* %7
%16 = load float, float* %5
%17 = fsub float %15, %16
%18 = load float, float* %8
%19 = fdiv float %17, %18
store float %19, float* %4
br label %20
20: ; preds = %14, %13
%21 = load float, float* %4
ret float %21
}

LLVM IR (-O2):
define float @glm_percent(float %0, float %1, float %2) {
%4 = fsub float %1, %0
%5 = fcmp oeq float %4, 0.000000e+00
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = fsub float %2, %0
%8 = fdiv float %7, %4
br label %9
9: ; preds = %3, %6
%10 = phi float [ %8, %6 ], [ 1.000000e+00, %3 ]
ret float %10
}
void copy(char from[], char to[]) {
  int i;
  for (i = 0; (to[i] = from[i]) != '\0'; ++i)
    ;
}


x86 assembly (clang, -O0):
<copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
mov    %al,(%rcx,%rdx,1)
movsbl %al,%eax
cmp    $0x0,%eax
je     1148 <copy+0x48>
jmp    113a <copy+0x3a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <copy+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
mov    %cl,(%rsi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <copy+0x10>
ret

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

LLVM IR (-O2):
define void @copy(i8* nocapture %0, i8* nocapture writeonly %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %9, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %1, i64 %4
store i8 %6, i8* %7
%8 = icmp eq i8 %6, 0
%9 = add nuw i64 %4, 1
br i1 %8, label %10, label %3
10: ; preds = %3
ret void
}
void ARGBSetRow_Any_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ARGBSetRow_Any_NEON() {
ret void
}
unsigned int nb_blocks(long long filesize, unsigned long blocksize) {
  unsigned int nb;
  nb = (long long)(filesize / blocksize);
  if ((long long)(filesize % blocksize))
    nb++;
  return nb;
}


x86 assembly (clang, -O0):
<nb_blocks>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
cmp    $0x0,%rdx
je     113a <nb_blocks+0x3a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nb_blocks>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1116 <nb_blocks+0x16>
xor    %edx,%edx
div    %rsi
jmp    111a <nb_blocks+0x1a>
xor    %edx,%edx
div    %esi
cmp    $0x1,%rdx
sbb    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @nb_blocks(i64 %0, i64 %1) {
%3 = udiv i64 %0, %1
%4 = trunc i64 %3 to i32
%5 = urem i64 %0, %1
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
%8 = add i32 %7, %4
ret i32 %8
}
/* Variables and functions */
void ft_bzero(void *s, size_t n) {
  while (n-- > 0)
    *(char *)s++ = 0;
}


x86 assembly (clang, -O0):
<ft_bzero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
jbe    113c <ft_bzero+0x3c>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x0,(%rax)
jmp    110c <ft_bzero+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_bzero>:
test   %rsi,%rsi
je     1124 <ft_bzero+0x14>
push   %rax
mov    %rsi,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @ft_bzero(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
br label %5
5: ; preds = %9, %2
%6 = load i64, i64* %4
%7 = add i64 %6, -1
store i64 %7, i64* %4
%8 = icmp ugt i64 %6, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %3
store i8 0, i8* %10
br label %5
12: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @ft_bzero(i8* nocapture writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %5, label %4
4: ; preds = %2
br label %5
5: ; preds = %4, %2
ret void
}
/* Type definitions */
struct socketlist_struct {
  int dummy;
};
struct elasticarray {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ elasticarray_free(struct elasticarray *);
void socketlist_free(struct socketlist_struct *EA) {
  elasticarray_free((struct elasticarray *)EA);
}


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

x86 assembly (clang, -O2):
<socketlist_free>:
jmp    1030 <elasticarray_free@plt>

LLVM IR (-O0):
%struct.socketlist_struct = type { i32 }
%struct.elasticarray = type { i32 }
define void @socketlist_free(%struct.socketlist_struct* %0) {
%2 = alloca %struct.socketlist_struct*
store %struct.socketlist_struct* %0, %struct.socketlist_struct** %2
%3 = load %struct.socketlist_struct*, %struct.socketlist_struct** %2
%4 = bitcast %struct.socketlist_struct* %3 to %struct.elasticarray*
%5 = call i32 @elasticarray_free(%struct.elasticarray* %4)
ret void
}

LLVM IR (-O2):
%struct.socketlist_struct = type { i32 }
%struct.elasticarray = type { i32 }
define void @socketlist_free(%struct.socketlist_struct* %0) {
%2 = bitcast %struct.socketlist_struct* %0 to %struct.elasticarray*
%3 = tail call i32 @elasticarray_free(%struct.elasticarray* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ create_command(int, int, int /*<<< orphan*/, int, int);
int /*<<< orphan*/ send_command();
void send_ack(int command, int package_id) {
  create_command(0x0E, command, 0, (package_id & 0xff), (package_id >> 8));
  send_command();
}


x86 assembly (clang, -O0):
<send_ack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%r8d
sar    $0x8,%r8d
mov    $0xe,%edi
xor    %edx,%edx
call   1040 <create_command@plt>
mov    $0x0,%al
call   1030 <send_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_ack>:
push   %rax
mov    %esi,%r8d
mov    %edi,%esi
movzbl %r8b,%ecx
sar    $0x8,%r8d
mov    $0xe,%edi
xor    %edx,%edx
call   1040 <create_command@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <send_command@plt>

LLVM IR (-O0):
define void @send_ack(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 = and i32 %6, 255
%8 = load i32, i32* %4
%9 = ashr i32 %8, 8
%10 = call i32 @create_command(i32 14, i32 %5, i32 0, i32 %7, i32 %9)
%11 = call i32 (...) @send_command()
ret void
}

LLVM IR (-O2):
define void @send_ack(i32 %0, i32 %1) {
%3 = and i32 %1, 255
%4 = ashr i32 %1, 8
%5 = tail call i32 @create_command(i32 14, i32 %0, i32 0, i32 %3, i32 %4)
%6 = tail call i32 (...) @send_command()
ret void
}
int getkey_serial0(void) {
  if ((*(volatile unsigned long *)(0xE000C000 + 0x14)) & 0x01) {
    return ((*(volatile unsigned long *)(0xE000C000 + 0x00)));
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<getkey_serial0>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe000c014,%eax
mov    (%rax),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     112a <getkey_serial0+0x2a>
mov    $0xe000c000,%eax
mov    (%rax),%rax
mov    %eax,-0x4(%rbp)
jmp    1131 <getkey_serial0+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getkey_serial0>:
mov    $0xe000c000,%ecx
xor    %eax,%eax
testq  $0x1,0x14(%rcx)
je     1114 <getkey_serial0+0x14>
mov    (%rcx),%rax
ret

LLVM IR (-O0):
define i32 @getkey_serial0() {
%1 = alloca i32
%2 = load volatile i64, i64* inttoptr (i64 3758145556 to i64*)
%3 = and i64 %2, 1
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load volatile i64, i64* inttoptr (i64 3758145536 to i64*)
%7 = trunc i64 %6 to i32
store i32 %7, i32* %1
br label %9
8: ; preds = %0
store i32 0, i32* %1
br label %9
9: ; preds = %8, %5
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @getkey_serial0() {
%1 = load volatile i64, i64* inttoptr (i64 3758145556 to i64*)
%2 = and i64 %1, 1
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = load volatile i64, i64* inttoptr (i64 3758145536 to i64*)
%6 = trunc i64 %5 to i32
br label %7
7: ; preds = %0, %4
%8 = phi i32 [ %6, %4 ], [ 0, %0 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ pf(char *, ...);
int main(int argc, char **argv) {
  pf("abcde%d\n", 45);
  pf("abcde%s-%x\n", "LKJ", 45);
  pf("abcde%c-%x\n", 'L', 45);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
mov    $0x2d,%esi
mov    $0x0,%al
call   1030 <pf@plt>
lea    0xec9(%rip),%rdi
lea    0xece(%rip),%rsi
mov    $0x2d,%edx
mov    $0x0,%al
call   1030 <pf@plt>
lea    0xebf(%rip),%rdi
mov    $0x4c,%esi
mov    $0x2d,%edx
mov    $0x0,%al
call   1030 <pf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x2d,%esi
xor    %eax,%eax
call   1030 <pf@plt>
lea    0xede(%rip),%rdi
lea    0xee3(%rip),%rsi
mov    $0x2d,%edx
xor    %eax,%eax
call   1030 <pf@plt>
lea    0xed4(%rip),%rdi
mov    $0x4c,%esi
mov    $0x2d,%edx
xor    %eax,%eax
call   1030 <pf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"abcde%d\0A\00"
@.str.1 = [12 x i8] c"abcde%s-%x\0A\00"
@.str.2 = [4 x i8] c"LKJ\00"
@.str.3 = [12 x i8] c"abcde%c-%x\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (i8*, ...) @pf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 45)
%7 = call i32 (i8*, ...) @pf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 45)
%8 = call i32 (i8*, ...) @pf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 76, i32 45)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"abcde%d\0A\00"
@.str.1 = [12 x i8] c"abcde%s-%x\0A\00"
@.str.2 = [4 x i8] c"LKJ\00"
@.str.3 = [12 x i8] c"abcde%c-%x\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) @pf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 45)
%4 = tail call i32 (i8*, ...) @pf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 45)
%5 = tail call i32 (i8*, ...) @pf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 76, i32 45)
ret i32 0
}
/* Variables and functions */
float fabs(float);
float sqrt(float);
float calculateDistance(float x1, float z1, float x2, float z2) {
  float x = fabs(x1 - x2);
  float z = fabs(z1 - z2);
  return sqrt(x * x + z * z);
}


x86 assembly (clang, -O0):
<calculateDistance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
call   1030 <fabs@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x10(%rbp),%xmm0
call   1030 <fabs@plt>
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
movss  -0x14(%rbp),%xmm2
movss  -0x18(%rbp),%xmm1
mulss  -0x18(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1040 <sqrt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculateDistance>:
subss  %xmm2,%xmm0
subss  %xmm3,%xmm1
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1131 <calculateDistance+0x21>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define float @calculateDistance(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%11 = load float, float* %5
%12 = load float, float* %7
%13 = fsub float %11, %12
%14 = call float @fabs(float %13)
store float %14, float* %9
%15 = load float, float* %6
%16 = load float, float* %8
%17 = fsub float %15, %16
%18 = call float @fabs(float %17)
store float %18, float* %10
%19 = load float, float* %9
%20 = load float, float* %9
%21 = load float, float* %10
%22 = load float, float* %10
%23 = fmul float %21, %22
%24 = call float @llvm.fmuladd.f32(float %19, float %20, float %23)
%25 = call float @sqrt(float %24)
ret float %25
}

LLVM IR (-O2):
define float @calculateDistance(float %0, float %1, float %2, float %3) {
%5 = fsub float %0, %2
%6 = fsub float %1, %3
%7 = fmul float %6, %6
%8 = tail call float @llvm.fmuladd.f32(float %5, float %5, float %7)
%9 = tail call float @sqrt(float %8)
ret float %9
}
double sc(double x, double smin, double smax) {
  return smin + x * (smax - smin);
}


x86 assembly (clang, -O0):
<sc>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
subsd  -0x10(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sc>:
subsd  %xmm1,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @sc(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %5
%8 = load double, double* %4
%9 = load double, double* %6
%10 = load double, double* %5
%11 = fsub double %9, %10
%12 = call double @llvm.fmuladd.f64(double %8, double %11, double %7)
ret double %12
}

LLVM IR (-O2):
define double @sc(double %0, double %1, double %2) {
%4 = fsub double %2, %1
%5 = tail call double @llvm.fmuladd.f64(double %0, double %4, double %1)
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
bool is_big_endian(void) {
  union {
    uint32_t i;
    char c[4];
  } u = {0x01020304};
  return u.c[0] == 1;
}


x86 assembly (clang, -O0):
<is_big_endian>:
push   %rbp
mov    %rsp,%rbp
mov    0xef6(%rip),%eax
mov    %eax,-0x8(%rbp)
movsbl -0x8(%rbp),%eax
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { i32 }
@__const.is_big_endian.u = %union.anon { i32 16909060 }
define i32 @is_big_endian() {
%1 = alloca %union.anon
%2 = bitcast %union.anon* %1 to i8*
%3 = bitcast %union.anon* %1 to [4 x i8]*
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_big_endian() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
int /*<<< orphan*/ stderr;
void *malloc_or_exit(size_t size) {
  void *p = NULL;
  p = malloc(size);
  if (p == NULL) {
    fprintf(stderr, "Out of memory.\n");
    exit(1);
  }
  memset(p, 0, size);
  return (p);
}


x86 assembly (clang, -O0):
<malloc_or_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    118b <malloc_or_exit+0x4b>
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
lea    0xe84(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_or_exit>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <malloc@plt>
test   %rax,%rax
je     116c <malloc_or_exit+0x2c>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
lea    0xe84(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"Out of memory.\0A\00"
define i8* @malloc_or_exit(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
%9 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ _Error(long, char *);
void Error_ContextSyntaxArgumentMustBindToInParameter(long p_position) {
  _Error(p_position, "'context' syntax argument must bind to in parameter");
}


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

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

LLVM IR (-O0):
@.str = [52 x i8] c"'context' syntax argument must bind to in parameter\00"
define void @Error_ContextSyntaxArgumentMustBindToInParameter(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @_Error(i64 %3, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [52 x i8] c"'context' syntax argument must bind to in parameter\00"
define void @Error_ContextSyntaxArgumentMustBindToInParameter(i64 %0) {
%2 = tail call i32 @_Error(i64 %0, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
ret void
}
int main(void) {
  int *a;
  float b;
  int c;
  a = (b = 2.0f, ++b, c = 0, &c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movss  0xef1(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xee0(%rip),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca float
%4 = alloca i32
store i32 0, i32* %1
store float 2.000000e+00, float* %3
%5 = load float, float* %3
%6 = fadd float %5, 1.000000e+00
store float %6, float* %3
store i32 0, i32* %4
store i32* %4, i32** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int test_imm_3Bint16_mem(short *val) {
  return ((*val) & (-0x3B << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_3Bint16_mem>:
movzwl (%rdi),%eax
test   $0xffc5,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_3Bint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -59
%7 = icmp ne i32 %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_3Bint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -59
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
char randomShape(int i) {
  if (i % 3 == 0)
    return 'c';
  if (i % 3 == 1)
    return 'r';
  if (i % 3 == 2)
    return 't';
  return 'r';
}


x86 assembly (clang, -O0):
<randomShape>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1124 <randomShape+0x24>
movb   $0x63,-0x1(%rbp)
jmp    1162 <randomShape+0x62>
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    1141 <randomShape+0x41>
movb   $0x72,-0x1(%rbp)
jmp    1162 <randomShape+0x62>
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x2,%edx
jne    115e <randomShape+0x5e>
movb   $0x74,-0x1(%rbp)
jmp    1162 <randomShape+0x62>
movb   $0x72,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomShape>:
movslq %edi,%rax
imul   $0x55555556,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
lea    0x0(,%rax,8),%ecx
mov    $0x747263,%edx
shr    %cl,%edx
cmp    $0x3,%eax
mov    $0x72,%eax
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define signext i8 @randomShape(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = srem i32 %4, 3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 99, i8* %2
br label %19
8: ; preds = %1
%9 = load i32, i32* %3
%10 = srem i32 %9, 3
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %13
12: ; preds = %8
store i8 114, i8* %2
br label %19
13: ; preds = %8
%14 = load i32, i32* %3
%15 = srem i32 %14, 3
%16 = icmp eq i32 %15, 2
br i1 %16, label %17, label %18
17: ; preds = %13
store i8 116, i8* %2
br label %19
18: ; preds = %13
store i8 114, i8* %2
br label %19
19: ; preds = %18, %17, %12, %7
%20 = load i8, i8* %2
ret i8 %20
}

LLVM IR (-O2):
define signext i8 @randomShape(i32 %0) {
%2 = srem i32 %0, 3
%3 = icmp ult i32 %2, 3
%4 = trunc i32 %2 to i24
%5 = shl i24 %4, 3
%6 = lshr i24 7631459, %5
%7 = trunc i24 %6 to i8
%8 = select i1 %3, i8 %7, i8 114
ret i8 %8
}
/* Variables and functions */
scalar_t__ INT_MIN;
unsigned int test3u(unsigned int x) {
  return (x + (unsigned int)INT_MIN) ^ 0x1234;
}


x86 assembly (clang, -O0):
<test3u>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ed7(%rip),%rcx
mov    (%rcx),%rcx
add    %ecx,%eax
xor    $0x1234,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3u>:
mov    %edi,%eax
mov    0x2edf(%rip),%rcx
add    (%rcx),%eax
xor    $0x1234,%eax
ret

LLVM IR (-O0):
@INT_MIN = global i64 0
define i32 @test3u(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i64, i64* @INT_MIN
%5 = trunc i64 %4 to i32
%6 = add i32 %3, %5
%7 = xor i32 %6, 4660
ret i32 %7
}

LLVM IR (-O2):
@INT_MIN = global i64 0
define i32 @test3u(i32 %0) {
%2 = load i64, i64* @INT_MIN
%3 = trunc i64 %2 to i32
%4 = add i32 %3, %0
%5 = xor i32 %4, 4660
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M98_f(char *s) {
  debug("M98_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M98_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M98_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf05(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"M98_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M98_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [46 x i8] c"M98_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M98_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
void RSA_verify(void) {}


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

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

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

LLVM IR (-O2):
define void @RSA_verify() {
ret void
}
/* Variables and functions */
double bp_sw_ExtremeValueP(float, float, float);
double bp_sw_ExtremeValueE(float x, float mu, float lambda, int N) {
  return (double)N * bp_sw_ExtremeValueP(x, mu, lambda);
}


x86 assembly (clang, -O0):
<bp_sw_ExtremeValueE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
cvtsi2sdl -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1030 <bp_sw_ExtremeValueP@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bp_sw_ExtremeValueE>:
push   %rax
cvtsi2sd %edi,%xmm3
movsd  %xmm3,(%rsp)
call   1030 <bp_sw_ExtremeValueP@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @bp_sw_ExtremeValueE(float %0, float %1, float %2, i32 %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca i32
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = sitofp i32 %9 to double
%11 = load float, float* %5
%12 = load float, float* %6
%13 = load float, float* %7
%14 = call double @bp_sw_ExtremeValueP(float %11, float %12, float %13)
%15 = fmul double %10, %14
ret double %15
}

LLVM IR (-O2):
define double @bp_sw_ExtremeValueE(float %0, float %1, float %2, i32 %3) {
%5 = sitofp i32 %3 to double
%6 = tail call double @bp_sw_ExtremeValueP(float %0, float %1, float %2)
%7 = fmul double %6, %5
ret double %7
}
void RTMsgInfo(void) {}


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

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

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

LLVM IR (-O2):
define void @RTMsgInfo() {
ret void
}
int d_blg_mr2(double *a1, double a2) {
  return !(__builtin_islessgreater(*a1, a2));
}


x86 assembly (clang, -O0):
<d_blg_mr2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd -0x10(%rbp),%xmm0
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_blg_mr2>:
xor    %eax,%eax
ucomisd (%rdi),%xmm0
sete   %al
ret

LLVM IR (-O0):
define i32 @d_blg_mr2(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* %5
%7 = load double, double* %4
%8 = fcmp one double %6, %7
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @d_blg_mr2(double* nocapture %0, double %1) {
%3 = load double, double* %0
%4 = fcmp ueq double %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
float div(float c, float d) { return c / d; }


x86 assembly (clang, -O0):
<div>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<div>:
divss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @div(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 = load float, float* %4
%7 = fdiv float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @div(float %0, float %1) {
%3 = fdiv float %0, %1
ret float %3
}
int test_imm_66int64_highword_reg(long long val) {
  return ((val >> 32) & (0x66 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_66int64_highword_reg>:
movabs $0x6600000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_66int64_highword_reg(i64 %0) {
%2 = and i64 %0, 438086664192
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void line_begin(void) { printf("["); }


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

x86 assembly (clang, -O2):
<line_begin>:
mov    $0x5b,%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @line_begin() {
%1 = tail call i32 @putchar(i32 91)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _sys_int_enable();
void wlibc_int_enable(void) { _sys_int_enable(); }


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

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

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

LLVM IR (-O2):
define void @wlibc_int_enable() {
%1 = tail call i32 (...) @_sys_int_enable()
ret void
}
void USBHostPwrEnable(unsigned long ulBase) {
  ;
  (*((volatile unsigned short *)(ulBase + 0x00000400))) |= 0x00000004;
}


x86 assembly (clang, -O0):
<USBHostPwrEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x400(%rax),%cx
movzwl %cx,%ecx
or     $0x4,%ecx
mov    %cx,0x400(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBHostPwrEnable>:
orw    $0x4,0x400(%rdi)
04
ret

LLVM IR (-O0):
define void @USBHostPwrEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 1024
%5 = inttoptr i64 %4 to i16*
%6 = load volatile i16, i16* %5
%7 = zext i16 %6 to i32
%8 = or i32 %7, 4
%9 = trunc i32 %8 to i16
store volatile i16 %9, i16* %5
ret void
}

LLVM IR (-O2):
define void @USBHostPwrEnable(i64 %0) {
%2 = add i64 %0, 1024
%3 = inttoptr i64 %2 to i16*
%4 = load volatile i16, i16* %3
%5 = or i16 %4, 4
store volatile i16 %5, i16* %3
ret void
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int socketcall(int (*)(int, struct sockaddr *, int /*<<< orphan*/ *), int,
               struct sockaddr *, int /*<<< orphan*/ *, int /*<<< orphan*/,
               int /*<<< orphan*/, int /*<<< orphan*/);
int getpeername(int fd, struct sockaddr *restrict addr,
                socklen_t *restrict len) {
  return socketcall(getpeername, fd, addr, len, 0, 0, 0);
}


x86 assembly (clang, -O0):
<getpeername>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    0x2ec3(%rip),%rdi
xor    %r9d,%r9d
mov    %r9d,%r8d
movl   $0x0,(%rsp)
call   1030 <socketcall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpeername>:
push   %rax
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
movl   $0x0,(%rsp)
mov    0x2ed1(%rip),%rdi
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <socketcall@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @getpeername(i32 %0, %struct.sockaddr* noalias %1, i32* noalias %2) {
%4 = tail call i32 @socketcall(i32 (i32, %struct.sockaddr*, i32*)* @getpeername, i32 %0, %struct.sockaddr* %1, i32* %2, i32 0, i32 0, i32 0)
ret i32 %4
}
/* Type definitions */
typedef int int_least32_t;

/* Variables and functions */
__attribute__((no)) int_least32_t f2(int_least32_t n) { return n / 77; }


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4d,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
movslq %edi,%rax
imul   $0x3531dec1,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x24,%rax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @f2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 77
ret i32 %4
}

LLVM IR (-O2):
define i32 @f2(i32 %0) {
%2 = sdiv i32 %0, 77
ret i32 %2
}
/* Variables and functions */
int dfym_fun();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Welcome to DFYM\n");
  return dfym_fun();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <dfym_fun@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [16 x i8] c"Welcome to DFYM\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @dfym_fun()
ret i32 %2
}
/* Variables and functions */
long INT_MAX;
float __ocml_scalb_f32(float, long);
float __ocml_scalbn_f32(float, long);
float scalblnf(float x, long int n) {
  return (n < INT_MAX) ? __ocml_scalbn_f32(x, n) : __ocml_scalb_f32(x, n);
}


x86 assembly (clang, -O0):
<scalblnf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2eac(%rip),%rcx
cmp    (%rcx),%rax
jge    115d <scalblnf+0x3d>
movss  -0x4(%rbp),%xmm0
mov    -0x10(%rbp),%rdi
call   1030 <__ocml_scalbn_f32@plt>
movss  %xmm0,-0x14(%rbp)
jmp    1170 <scalblnf+0x50>
movss  -0x4(%rbp),%xmm0
mov    -0x10(%rbp),%rdi
call   1040 <__ocml_scalb_f32@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scalblnf>:
mov    0x2ec1(%rip),%rax
cmp    %rdi,(%rax)
jle    1131 <scalblnf+0x11>
jmp    1030 <__ocml_scalbn_f32@plt>
jmp    1040 <__ocml_scalb_f32@plt>

LLVM IR (-O0):
@INT_MAX = global i64 0
define float @scalblnf(float %0, i64 %1) {
%3 = alloca float
%4 = alloca i64
store float %0, float* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* @INT_MAX
%7 = icmp slt i64 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load float, float* %3
%10 = load i64, i64* %4
%11 = call float @__ocml_scalbn_f32(float %9, i64 %10)
br label %16
12: ; preds = %2
%13 = load float, float* %3
%14 = load i64, i64* %4
%15 = call float @__ocml_scalb_f32(float %13, i64 %14)
br label %16
16: ; preds = %12, %8
%17 = phi float [ %11, %8 ], [ %15, %12 ]
ret float %17
}

LLVM IR (-O2):
@INT_MAX = global i64 0
define float @scalblnf(float %0, i64 %1) {
%3 = load i64, i64* @INT_MAX
%4 = icmp sgt i64 %3, %1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call float @__ocml_scalbn_f32(float %0, i64 %1)
br label %9
7: ; preds = %2
%8 = tail call float @__ocml_scalb_f32(float %0, i64 %1)
br label %9
9: ; preds = %7, %5
%10 = phi float [ %6, %5 ], [ %8, %7 ]
ret float %10
}
/* Variables and functions */
int /*<<< orphan*/ prt_afraid();
int /*<<< orphan*/ prt_amnesia();
int /*<<< orphan*/ prt_blind();
int /*<<< orphan*/ prt_confused();
int /*<<< orphan*/ prt_cursed();
int /*<<< orphan*/ prt_cut();
int /*<<< orphan*/ prt_petrify();
int /*<<< orphan*/ prt_poisoned();
int /*<<< orphan*/ prt_stun();
void prt_various(void) {
  prt_cursed();
  prt_afraid();
  prt_cut();
  prt_stun();
  prt_poisoned();
  prt_amnesia();
  prt_petrify();
  prt_confused();
  prt_blind();
}


x86 assembly (clang, -O0):
<prt_various>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <prt_cursed@plt>
mov    $0x0,%al
call   1050 <prt_afraid@plt>
mov    $0x0,%al
call   10b0 <prt_cut@plt>
mov    $0x0,%al
call   10a0 <prt_stun@plt>
mov    $0x0,%al
call   1080 <prt_poisoned@plt>
mov    $0x0,%al
call   1060 <prt_amnesia@plt>
mov    $0x0,%al
call   1090 <prt_petrify@plt>
mov    $0x0,%al
call   1030 <prt_confused@plt>
mov    $0x0,%al
call   1070 <prt_blind@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<prt_various>:
push   %rax
xor    %eax,%eax
call   1040 <prt_cursed@plt>
xor    %eax,%eax
call   1050 <prt_afraid@plt>
xor    %eax,%eax
call   10b0 <prt_cut@plt>
xor    %eax,%eax
call   10a0 <prt_stun@plt>
xor    %eax,%eax
call   1080 <prt_poisoned@plt>
xor    %eax,%eax
call   1060 <prt_amnesia@plt>
xor    %eax,%eax
call   1090 <prt_petrify@plt>
xor    %eax,%eax
call   1030 <prt_confused@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <prt_blind@plt>

LLVM IR (-O0):
define void @prt_various() {
%1 = call i32 (...) @prt_cursed()
%2 = call i32 (...) @prt_afraid()
%3 = call i32 (...) @prt_cut()
%4 = call i32 (...) @prt_stun()
%5 = call i32 (...) @prt_poisoned()
%6 = call i32 (...) @prt_amnesia()
%7 = call i32 (...) @prt_petrify()
%8 = call i32 (...) @prt_confused()
%9 = call i32 (...) @prt_blind()
ret void
}

LLVM IR (-O2):
define void @prt_various() {
%1 = tail call i32 (...) @prt_cursed()
%2 = tail call i32 (...) @prt_afraid()
%3 = tail call i32 (...) @prt_cut()
%4 = tail call i32 (...) @prt_stun()
%5 = tail call i32 (...) @prt_poisoned()
%6 = tail call i32 (...) @prt_amnesia()
%7 = tail call i32 (...) @prt_petrify()
%8 = tail call i32 (...) @prt_confused()
%9 = tail call i32 (...) @prt_blind()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void motdhook(char *s) { printf("MOTD: %s\n", s); }


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

x86 assembly (clang, -O2):
<motdhook>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"MOTD: %s\0A\00"
define void @motdhook(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"MOTD: %s\0A\00"
define void @motdhook(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRC7_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRC7_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRC7_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
double cos(double);
double tosReal_cos(double x) { return cos(x); }


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

x86 assembly (clang, -O2):
<tosReal_cos>:
jmp    1030 <cos@plt>

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

LLVM IR (-O2):
define double @tosReal_cos(double %0) {
%2 = tail call double @cos(double %0)
ret double %2
}