xunge/DecIR huggingface dataset:
int ft_len_word(char *str) {
  int i;
  i = 0;
  while (str[i] && str[i] != ' ' && str[i] != '\t')
    i++;
  return (i);
}


x86 assembly (clang, -O0):
<ft_len_word>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
je     1158 <ft_len_word+0x58>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0xd(%rbp)
je     1158 <ft_len_word+0x58>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x9,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1168 <ft_len_word+0x68>
jmp    1176 <ft_len_word+0x76>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <ft_len_word+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_len_word>:
xor    %eax,%eax
movabs $0x100000201,%rcx
jmp    1114 <ft_len_word+0x14>
xchg   %ax,%ax
add    $0x1,%rax
movzbl (%rdi,%rax,1),%edx
cmp    $0x20,%rdx
ja     1110 <ft_len_word+0x10>
bt     %rdx,%rcx
jae    1110 <ft_len_word+0x10>
ret

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

LLVM IR (-O2):
define i32 @ft_len_word(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i64 [ %7, %6 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 0, label %8
i8 32, label %8
i8 9, label %8
]
6: ; preds = %2
%7 = add nuw i64 %3, 1
br label %2
8: ; preds = %2, %2, %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
int test_imm_BFuint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xBF << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_BFuint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 191
%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_BFuint64_highword_reg(i64 %0) {
%2 = and i64 %0, 820338753536
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int f10(float a, float b) { return a == b || b == 0.0f; }


x86 assembly (clang, -O0):
<f10>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mov    $0x1,%al
ucomiss -0x8(%rbp),%xmm0
mov    %al,-0x9(%rbp)
jne    112d <f10+0x2d>
jp     112d <f10+0x2d>
jmp    1143 <f10+0x43>
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f10>:
ucomiss %xmm1,%xmm0
setnp  %al
sete   %cl
and    %al,%cl
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm1
setnp  %al
sete   %dl
and    %al,%dl
or     %cl,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @f10(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 = fcmp oeq float %5, %6
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load float, float* %4
%10 = fcmp oeq float %9, 0.000000e+00
br label %11
11: ; preds = %8, %2
%12 = phi i1 [ true, %2 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @f10(float %0, float %1) {
%3 = fcmp oeq float %0, %1
%4 = fcmp oeq float %1, 0.000000e+00
%5 = or i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int dcloadsyscall(int, char const *, short);
int chmod(const char *path, short mode) {
  if (*(unsigned int *)0x8c004004 == 0xdeadbeef)
    return dcloadsyscall(8, path, mode);
  else
    return -1;
}


x86 assembly (clang, -O0):
<chmod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %rdi,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
mov    $0x8c004004,%eax
cmpl   $0xdeadbeef,(%rax)
jne    114e <chmod+0x3e>
mov    -0x10(%rbp),%rsi
mov    $0x8,%edi
movswl -0x12(%rbp),%edx
call   1030 <dcloadsyscall@plt>
mov    %eax,-0x4(%rbp)
jmp    1155 <chmod+0x45>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chmod>:
mov    $0x8c004004,%ecx
cmpl   $0xdeadbeef,(%rcx)
jne    1130 <chmod+0x20>
mov    %rdi,%rax
movswl %si,%edx
mov    $0x8,%edi
mov    %rax,%rsi
jmp    1030 <dcloadsyscall@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @chmod(i8* %0, i16 signext %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i16
store i8* %0, i8** %4
store i16 %1, i16* %5
%6 = load i32, i32* inttoptr (i64 2348826628 to i32*)
%7 = icmp eq i32 %6, -559038737
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = load i16, i16* %5
%11 = call i32 @dcloadsyscall(i32 8, i8* %9, i16 signext %10)
store i32 %11, i32* %3
br label %13
12: ; preds = %2
store i32 -1, i32* %3
br label %13
13: ; preds = %12, %8
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @chmod(i8* %0, i16 signext %1) {
%3 = load i32, i32* inttoptr (i64 2348826628 to i32*)
%4 = icmp eq i32 %3, -559038737
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @dcloadsyscall(i32 8, i8* %0, i16 signext %1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ -1, %2 ]
ret i32 %8
}
/* Type definitions */
struct command_opts {
  int dummy;
};

/* Variables and functions */
scalar_t__ check_draw(struct command_opts *);
scalar_t__ check_limits(struct command_opts *);
int cmd_check(struct command_opts *opts) {
  int ret = 0;
  if (check_limits(opts) < 0)
    ret = -1;
  if (check_draw(opts) < 0)
    ret = -1;
  return ret;
}


x86 assembly (clang, -O0):
<cmd_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <check_limits@plt>
cmp    $0x0,%rax
jge    114d <cmd_check+0x2d>
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <check_draw@plt>
cmp    $0x0,%rax
jge    1167 <cmd_check+0x47>
movl   $0xffffffff,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_check>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <check_limits@plt>
mov    %rax,%rbx
sar    $0x3f,%rbx
mov    %r14,%rdi
call   1040 <check_draw@plt>
test   %rax,%rax
mov    $0xffffffff,%eax
cmovns %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.command_opts = type { i32 }
define i32 @cmd_check(%struct.command_opts* %0) {
%2 = alloca %struct.command_opts*
%3 = alloca i32
store %struct.command_opts* %0, %struct.command_opts** %2
store i32 0, i32* %3
%4 = load %struct.command_opts*, %struct.command_opts** %2
%5 = call i64 @check_limits(%struct.command_opts* %4)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %3
br label %8
8: ; preds = %7, %1
%9 = load %struct.command_opts*, %struct.command_opts** %2
%10 = call i64 @check_draw(%struct.command_opts* %9)
%11 = icmp slt i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 -1, i32* %3
br label %13
13: ; preds = %12, %8
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
%struct.command_opts = type { i32 }
define i32 @cmd_check(%struct.command_opts* %0) {
%2 = tail call i64 @check_limits(%struct.command_opts* %0)
%3 = ashr i64 %2, 63
%4 = trunc i64 %3 to i32
%5 = tail call i64 @check_draw(%struct.command_opts* %0)
%6 = icmp slt i64 %5, 0
%7 = select i1 %6, i32 -1, i32 %4
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ ebbrt_newlib_free(void *);
void free(void *ptr) { ebbrt_newlib_free(ptr); }


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

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

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

LLVM IR (-O2):
define void @free(i8* %0) {
%2 = tail call i32 @ebbrt_newlib_free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ circle_rotate(int **, int, int);
void rotate(int **array, int dimension) {
  int half = dimension / 2;
  for (int round = 0; round < half; round++) {
    circle_rotate(array, dimension, round);
  }
}


x86 assembly (clang, -O0):
<rotate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    115d <rotate+0x4d>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <circle_rotate@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1134 <rotate+0x24>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    $0x2,%esi
jl     1144 <rotate+0x34>
mov    %esi,%r15d
mov    %rdi,%r14
mov    %esi,%ebx
shr    $0x1f,%ebx
add    %esi,%ebx
sar    %ebx
xor    %ebp,%ebp
nopl   (%rax)
mov    %r14,%rdi
mov    %r15d,%esi
mov    %ebp,%edx
call   1030 <circle_rotate@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1130 <rotate+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @rotate(i32** %0, i32 %1) {
%3 = sdiv i32 %1, 2
%4 = icmp sgt i32 %1, 1
br i1 %4, label %6, label %5
5: ; preds = %6, %2
ret void
6: ; preds = %2, %6
%7 = phi i32 [ %9, %6 ], [ 0, %2 ]
%8 = tail call i32 @circle_rotate(i32** %0, i32 %1, i32 %7)
%9 = add nuw nsw i32 %7, 1
%10 = icmp eq i32 %9, %3
br i1 %10, label %5, label %6
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
long hash(char *word) {
  long result = 42;
  int counter = 0;
  while (counter++ < strlen(word)) {
    result += word[counter - 1] * (counter);
  }
  return result;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x2a,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cmp    %ecx,%eax
jge    1171 <hash+0x61>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
imul   -0x14(%rbp),%eax
cltq
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112b <hash+0x1b>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    $0x2a,%r15d
test   %eax,%eax
jle    1150 <hash+0x40>
xor    %ebx,%ebx
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%eax
add    $0x1,%rbx
imul   %ebx,%eax
cltq
add    %rax,%r15
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1130 <hash+0x20>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i64 @hash(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %20
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i64 [ %16, %4 ], [ 1, %1 ]
%7 = phi i64 [ %15, %4 ], [ 42, %1 ]
%8 = add nuw nsw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %5
%10 = load i8, i8* %9
%11 = sext i8 %10 to i64
%12 = mul i64 %6, %11
%13 = shl i64 %12, 32
%14 = ashr exact i64 %13, 32
%15 = add nsw i64 %7, %14
%16 = add nuw nsw i64 %6, 1
%17 = tail call i32 @strlen(i8* %0)
%18 = sext i32 %17 to i64
%19 = icmp slt i64 %6, %18
br i1 %19, label %4, label %20
20: ; preds = %4, %1
%21 = phi i64 [ 42, %1 ], [ %15, %4 ]
ret i64 %21
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_tanf();
scalar_t__ tanf(float);
void test_tanf(float f) {
  if (tanf(f) != tanf(f))
    link_failure_tanf();
}


x86 assembly (clang, -O0):
<test_tanf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <tanf@plt>
mov    %rax,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <tanf@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_tanf+0x3c>
mov    $0x0,%al
call   1040 <link_failure_tanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_tanf>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
call   1030 <tanf@plt>
mov    %rax,%rbx
movss  0xc(%rsp),%xmm0
call   1030 <tanf@plt>
cmp    %rax,%rbx
jne    1149 <test_tanf+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <link_failure_tanf@plt>

LLVM IR (-O0):
define void @test_tanf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @tanf(float %3)
%5 = load float, float* %2
%6 = call i64 @tanf(float %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_tanf()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_tanf(float %0) {
%2 = tail call i64 @tanf(float %0)
%3 = tail call i64 @tanf(float %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_tanf()
br label %7
7: ; preds = %5, %1
ret void
}
int json_isspace(int c) {
  switch (c) {
  case 0x09:
  case 0x0a:
  case 0x0d:
  case 0x20:
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<json_isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xfffffff7,%eax
sub    $0x2,%eax
jb     1140 <json_isspace+0x40>
jmp    111e <json_isspace+0x1e>
mov    -0xc(%rbp),%eax
sub    $0xd,%eax
je     1140 <json_isspace+0x40>
jmp    112f <json_isspace+0x2f>
mov    -0xc(%rbp),%eax
sub    $0x20,%eax
jne    114c <json_isspace+0x4c>
jmp    1140 <json_isspace+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1153 <json_isspace+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<json_isspace>:
cmp    $0x20,%edi
ja     111d <json_isspace+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x100002600,%rdx
bt     %rcx,%rdx
jae    111d <json_isspace+0x1d>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @json_isspace(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 9, label %5
i32 10, label %5
i32 13, label %5
i32 32, label %5
]
5: ; preds = %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @json_isspace(i32 %0) {
switch i32 %0, label %2 [
i32 9, label %3
i32 10, label %3
i32 13, label %3
i32 32, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ serial_interrupt(int);
int /*<<< orphan*/ setbuf(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ stdin;
int main(int argc, char **argv) {
  setbuf(stdin, NULL);
  while (true) {
    int in = getchar();
    if (in == EOF)
      return 0;
    serial_interrupt(in);
  }
}


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    0x2e9b(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <setbuf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2e74(%rip),%rcx
cmp    (%rcx),%eax
jne    117c <main+0x4c>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret
mov    -0x14(%rbp),%edi
call   1040 <serial_interrupt@plt>
jmp    1158 <main+0x28>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1030 <setbuf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2e91(%rip),%rbx
cmp    (%rbx),%eax
je     1172 <main+0x42>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%edi
call   1040 <serial_interrupt@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%rbx),%eax
jne    1160 <main+0x30>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
@EOF = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* @stdin
%8 = call i32 @setbuf(i32 %7, i32* null)
br label %9
9: ; preds = %2, %15
%10 = call i32 (...) @getchar()
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = load i32, i32* @EOF
%13 = icmp eq i32 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %9
ret i32 0
15: ; preds = %9
%16 = load i32, i32* %6
%17 = call i32 @serial_interrupt(i32 %16)
br label %9
}

LLVM IR (-O2):
@stdin = global i32 0
@EOF = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stdin
%4 = tail call i32 @setbuf(i32 %3, i32* null)
%5 = tail call i32 (...) @getchar()
%6 = load i32, i32* @EOF
%7 = icmp eq i32 %5, %6
br i1 %7, label %14, label %8
8: ; preds = %2, %8
%9 = phi i32 [ %11, %8 ], [ %5, %2 ]
%10 = tail call i32 @serial_interrupt(i32 %9)
%11 = tail call i32 (...) @getchar()
%12 = load i32, i32* @EOF
%13 = icmp eq i32 %11, %12
br i1 %13, label %14, label %8
14: ; preds = %8, %2
ret i32 0
}
int main_() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @main_() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Com_Printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ FS_ReferencedPakNames();
void CL_ReferencedPK3List_f(void) {
  Com_Printf("Referenced PK3 Names: %s\n", FS_ReferencedPakNames());
}


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

x86 assembly (clang, -O2):
<CL_ReferencedPK3List_f>:
push   %rax
xor    %eax,%eax
call   1040 <FS_ReferencedPakNames@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <Com_Printf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Referenced PK3 Names: %s\0A\00"
define void @CL_ReferencedPK3List_f() {
%1 = call i32 (...) @FS_ReferencedPakNames()
%2 = call i32 @Com_Printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Referenced PK3 Names: %s\0A\00"
define void @CL_ReferencedPK3List_f() {
%1 = tail call i32 (...) @FS_ReferencedPakNames()
%2 = tail call i32 @Com_Printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int antoi(const char *str, size_t num) {
  unsigned int res = 0;
  for (unsigned int i = 0; i < num; ++i)
    res = res * 10 + str[i] - '0';
  return res;
}


x86 assembly (clang, -O0):
<antoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%rax
jae    114c <antoi+0x4c>
imul   $0xa,-0x14(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%edx
movsbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
sub    $0x30,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    111a <antoi+0x1a>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<antoi>:
test   %rsi,%rsi
je     1126 <antoi+0x26>
xor    %ecx,%ecx
xor    %eax,%eax
nopl   0x0(%rax)
lea    (%rax,%rax,4),%eax
movsbl (%rdi,%rcx,1),%edx
lea    (%rdx,%rax,2),%eax
add    $0xffffffd0,%eax
add    $0x1,%ecx
cmp    %rsi,%rcx
jb     1110 <antoi+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @antoi(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %6, %2
%5 = phi i32 [ 0, %2 ], [ %14, %6 ]
ret i32 %5
6: ; preds = %2, %6
%7 = phi i64 [ %16, %6 ], [ 0, %2 ]
%8 = phi i32 [ %14, %6 ], [ 0, %2 ]
%9 = mul i32 %8, 10
%10 = getelementptr inbounds i8, i8* %0, i64 %7
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = add i32 %9, -48
%14 = add i32 %13, %12
%15 = add nuw nsw i64 %7, 1
%16 = and i64 %15, 4294967295
%17 = icmp ult i64 %16, %1
br i1 %17, label %6, label %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void help(const char *program) {
  printf("Usage: %s <address of MAX! cube> <port of MAX! cube> <command> "
         "<params>\n",
         program);
  printf("       %s discover\n", program);
  printf("\tCommands  Params\n"
         "\tget       status\n"
         "\tset       mode <auto|comfort|eco> all|<device_id> [config_file]\n"
         "\tset       program all|<device_id> [config_file]\n"
         "\tlog       <logfile> <freq(mins)>\n");
}


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

x86 assembly (clang, -O2):
<help>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf0d(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf10(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [73 x i8] c"Usage: %s <address of MAX! cube> <port of MAX! cube> <command> <params>\0A\00"
@.str.1 = [20 x i8] c" %s discover\0A\00"
@.str.2 = [185 x i8] c"\09Commands Params\0A\09get status\0A\09set mode <auto|comfort|eco> all|<device_id> [config_file]\0A\09set program all|<device_id> [config_file]\0A\09log <logfile> <freq(mins)>\0A\00"
define void @help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [73 x i8] c"Usage: %s <address of MAX! cube> <port of MAX! cube> <command> <params>\0A\00"
@.str.1 = [20 x i8] c" %s discover\0A\00"
@str = [184 x i8] c"\09Commands Params\0A\09get status\0A\09set mode <auto|comfort|eco> all|<device_id> [config_file]\0A\09set program all|<device_id> [config_file]\0A\09log <logfile> <freq(mins)>\00"
define void @help(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([184 x i8], [184 x i8]* @str, i64 0, i64 0))
ret void
}
int test_imm_4Bint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x4B << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_4Bint64_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, 75
%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_4Bint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 4915200
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int SPI_LOOP;
int SPI_getMode(int);
int SPI_setMode(int, int);
int SPI_enableLoopback(int spidev_fd) {
  int mode = SPI_getMode(spidev_fd);
  if (mode < 0)
    return -1;
  return SPI_setMode(spidev_fd, mode | SPI_LOOP);
}


x86 assembly (clang, -O0):
<SPI_enableLoopback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <SPI_getMode@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    114c <SPI_enableLoopback+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <SPI_enableLoopback+0x43>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    0x2e7f(%rip),%rax
or     (%rax),%esi
call   1030 <SPI_setMode@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SPI_enableLoopback>:
push   %rbx
mov    %edi,%ebx
call   1040 <SPI_getMode@plt>
test   %eax,%eax
js     113f <SPI_enableLoopback+0x1f>
mov    0x2ea5(%rip),%rcx
or     (%rcx),%eax
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <SPI_setMode@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@SPI_LOOP = global i32 0
define i32 @SPI_enableLoopback(i32 %0) {
%2 = tail call i32 @SPI_getMode(i32 %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = load i32, i32* @SPI_LOOP
%6 = or i32 %5, %2
%7 = tail call i32 @SPI_setMode(i32 %0, i32 %6)
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ -1, %1 ]
ret i32 %9
}
void __gccmain(void) {}


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

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

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

LLVM IR (-O2):
define void @__gccmain() {
ret void
}
int main() {
  char *screen;
  screen = (char *)0xB8000;
  *screen = 'Z';
  while (1)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0xb8000,%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x5a,(%rax)
jmp    111b <main+0x1b>

x86 assembly (clang, -O2):
<main>:
movb   $0x5a,0xb8000
5a
nopl   0x0(%rax,%rax,1)
jmp    1110 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* inttoptr (i64 753664 to i8*), i8** %2
%3 = load i8*, i8** %2
store i8 90, i8* %3
br label %4
4: ; preds = %0, %4
br label %4
}

LLVM IR (-O2):
define i32 @main() {
store i8 90, i8* inttoptr (i64 753664 to i8*)
br label %1
1: ; preds = %1, %0
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ writeData(int /*<<< orphan*/);
void LCDIntf_WriteData(int32_t data) { writeData(data); }


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

x86 assembly (clang, -O2):
<LCDIntf_WriteData>:
jmp    1030 <writeData@plt>

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

LLVM IR (-O2):
define void @LCDIntf_WriteData(i32 %0) {
%2 = tail call i32 @writeData(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void test_params(int a, int b) { printf("%d %d\n", a, b); }


x86 assembly (clang, -O0):
<test_params>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_params>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%d %d\0A\00"
define void @test_params(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 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
define void @test_params(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
/* Variables and functions */
scalar_t__ strtol(char const *, char **, int);
long atol(const char *s) { return (long)strtol(s, (char **)NULL, 10); }


x86 assembly (clang, -O0):
<atol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atol>:
xor    %esi,%esi
mov    $0xa,%edx
jmp    1030 <strtol@plt>

LLVM IR (-O0):
define i64 @atol(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strtol(i8* %3, i8** null, i32 10)
ret i64 %4
}

LLVM IR (-O2):
define i64 @atol(i8* nocapture %0) {
%2 = tail call i64 @strtol(i8* nocapture %0, i8** null, i32 10)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 5;
  int b = 4;
  int c = 3;
  int d;
  d = (b * b) - (4 * a * c);
  printf("( b * b ) - ( 4 * a * c ) = %i\n", d);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
movl   $0x3,-0x10(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x2,%ecx
imul   -0x10(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [32 x i8] c"( b * b ) - ( 4 * a * c ) = %i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 -44)
ret i32 0
}
int main() {
  int a;
  a = 3;
  if (a < 1)
    return 1;
  else
    return 2;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    1128 <main+0x28>
movl   $0x1,-0x4(%rbp)
jmp    112f <main+0x2f>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 1
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 1, i32* %1
br label %7
6: ; preds = %0
store i32 2, i32* %1
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ gets(char *);
char *malloc(int);
int main(int argc, char **argv) {
  char *p, *q;
  p = malloc(256);
  q = malloc(256);
  gets(p);
  free(q);
  free(p);
  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    $0x100,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    $0x100,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <gets@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x100,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    $0x100,%edi
call   1050 <malloc@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1040 <gets@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i8* @malloc(i32 256)
store i8* %8, i8** %6
%9 = call i8* @malloc(i32 256)
store i8* %9, i8** %7
%10 = load i8*, i8** %6
%11 = call i32 @gets(i8* %10)
%12 = load i8*, i8** %7
%13 = call i32 @free(i8* %12)
%14 = load i8*, i8** %6
%15 = call i32 @free(i8* %14)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call dereferenceable_or_null(256) i8* @malloc(i32 256)
%4 = tail call dereferenceable_or_null(256) i8* @malloc(i32 256)
%5 = tail call i32 @gets(i8* %3)
%6 = tail call i32 @free(i8* %4)
%7 = tail call i32 @free(i8* %3)
ret i32 0
}
/* Variables and functions */
int scanf(char *, int *);
int read_int(void) {
  int x;
  if (scanf("%d", &x) != 1)
    return 0;
  return x;
}


x86 assembly (clang, -O0):
<read_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <scanf@plt>
cmp    $0x1,%eax
je     113d <read_int+0x2d>
movl   $0x0,-0x4(%rbp)
jmp    1143 <read_int+0x33>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_int>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <scanf@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
jne    112f <read_int+0x1f>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @read_int() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = icmp ne i32 %3, 1
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 0, i32* %1
br label %8
6: ; preds = %0
%7 = load i32, i32* %2
store i32 %7, i32* %1
br label %8
8: ; preds = %6, %5
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @read_int() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = icmp eq i32 %3, 1
%5 = load i32, i32* %1
%6 = select i1 %4, i32 %5, i32 0
ret i32 %6
}
double calcDense(float mass, float volume) { return mass / volume; }


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

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

LLVM IR (-O0):
define double @calcDense(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
%8 = fpext float %7 to double
ret double %8
}

LLVM IR (-O2):
define double @calcDense(float %0, float %1) {
%3 = fdiv float %0, %1
%4 = fpext float %3 to double
ret double %4
}
/* Variables and functions */
unsigned int rgb_to_pixel8(unsigned int, unsigned int, unsigned int);
unsigned int rgb_to_pixel8_dup(unsigned int r, unsigned int g, unsigned int b) {
  unsigned int col;
  col = rgb_to_pixel8(r, g, b);
  col |= col << 8;
  col |= col << 16;
  return col;
}


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

x86 assembly (clang, -O2):
<rgb_to_pixel8_dup>:
push   %rax
call   1030 <rgb_to_pixel8@plt>
mov    %eax,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,%ecx
shl    $0x10,%ecx
or     %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rgb_to_pixel8_dup(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @rgb_to_pixel8(i32 %8, i32 %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = shl i32 %12, 8
%14 = load i32, i32* %7
%15 = or i32 %14, %13
store i32 %15, i32* %7
%16 = load i32, i32* %7
%17 = shl i32 %16, 16
%18 = load i32, i32* %7
%19 = or i32 %18, %17
store i32 %19, i32* %7
%20 = load i32, i32* %7
ret i32 %20
}

LLVM IR (-O2):
define i32 @rgb_to_pixel8_dup(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @rgb_to_pixel8(i32 %0, i32 %1, i32 %2)
%5 = shl i32 %4, 8
%6 = or i32 %5, %4
%7 = shl i32 %6, 16
%8 = or i32 %7, %6
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ _SC_NPROCESSORS_ONLN;
int sysconf(int /*<<< orphan*/);
int GetNumCPUs() { return sysconf(_SC_NPROCESSORS_ONLN); }


x86 assembly (clang, -O0):
<GetNumCPUs>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetNumCPUs>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <sysconf@plt>

LLVM IR (-O0):
@_SC_NPROCESSORS_ONLN = global i32 0
define i32 @GetNumCPUs() {
%1 = load i32, i32* @_SC_NPROCESSORS_ONLN
%2 = call i32 @sysconf(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@_SC_NPROCESSORS_ONLN = global i32 0
define i32 @GetNumCPUs() {
%1 = load i32, i32* @_SC_NPROCESSORS_ONLN
%2 = tail call i32 @sysconf(i32 %1)
ret i32 %2
}
void UARTRegConfModeRestore(unsigned int baseAdd, unsigned int lcrRegValue) {
  (*((volatile unsigned int *)(baseAdd + (0xC)))) = lcrRegValue;
}


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

x86 assembly (clang, -O2):
<UARTRegConfModeRestore>:
add    $0xc,%edi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @UARTRegConfModeRestore(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = add i32 %6, 12
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store volatile i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @UARTRegConfModeRestore(i32 %0, i32 %1) {
%3 = add i32 %0, 12
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
store volatile i32 %1, i32* %5
ret void
}
void ccount1() {}


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

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

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

LLVM IR (-O2):
define void @ccount1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *);
scalar_t__ unlink(char const *);
int main(int argc, const char *argv[]) {
  if (argc != 2) {
    printf("wrong argument");
    exit(-1);
  }
  if (unlink(argv[1]) < 0) {
    perror("unlink");
  }
  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)
cmpl   $0x2,-0x8(%rbp)
je     1176 <main+0x36>
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <unlink@plt>
cmp    $0x0,%rax
jge    1199 <main+0x59>
lea    0xe7b(%rip),%rdi
call   1050 <perror@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1166 <main+0x26>
mov    0x8(%rsi),%rdi
call   1030 <unlink@plt>
test   %rax,%rax
js     1158 <main+0x18>
xor    %eax,%eax
pop    %rcx
ret
lea    0xeb0(%rip),%rdi
call   1050 <perror@plt>
jmp    1154 <main+0x14>
lea    0xe93(%rip),%rdi
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"wrong argument\00"
@.str.1 = [7 x i8] c"unlink\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 = load i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 -1)
unreachable
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i64 @unlink(i8* %14)
%16 = icmp slt i64 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %11
%18 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %19
19: ; preds = %17, %11
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"wrong argument\00"
@.str.1 = [7 x i8] c"unlink\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i64 @unlink(i8* %9)
%11 = icmp slt i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %7
%13 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %7
ret i32 0
}
/* Variables and functions */
int memcmp(char *, char *, size_t);
int bwcmp(const void *p, const void *q, void *sp) {
  return memcmp(*(char **)p, *(char **)q, *(size_t *)sp);
}


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

x86 assembly (clang, -O2):
<bwcmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
mov    (%rdx),%rdx
jmp    1030 <memcmp@plt>

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

LLVM IR (-O2):
define i32 @bwcmp(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
%4 = bitcast i8* %0 to i8**
%5 = load i8*, i8** %4
%6 = bitcast i8* %1 to i8**
%7 = load i8*, i8** %6
%8 = bitcast i8* %2 to i64*
%9 = load i64, i64* %8
%10 = tail call i32 @memcmp(i8* %5, i8* %7, i64 %9)
ret i32 %10
}