xunge/DecIR huggingface dataset:
/* Variables and functions */
float cos(float);
float sin(float);
float tcot(float a) { return (cos(a) / sin(a)); }


x86 assembly (clang, -O0):
<tcot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <cos@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcot>:
push   %rax
movss  %xmm0,(%rsp)
call   1040 <cos@plt>
movss  %xmm0,0x4(%rsp)
movss  (%rsp),%xmm0
call   1030 <sin@plt>
movss  0x4(%rsp),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @tcot(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @cos(float %3)
%5 = load float, float* %2
%6 = call float @sin(float %5)
%7 = fdiv float %4, %6
ret float %7
}

LLVM IR (-O2):
define float @tcot(float %0) {
%2 = tail call float @cos(float %0)
%3 = tail call float @sin(float %0)
%4 = fdiv float %2, %3
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int strlen(char *);
scalar_t__ write(int, char *, int);
void writeline(int fd, char *str) {
  if (write(fd, str, strlen(str)) < 0) {
    printf("write error %s\n", str);
  }
  write(fd, "\n", 1);
}


x86 assembly (clang, -O0):
<writeline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
cmp    $0x0,%rax
jge    117e <writeline+0x4e>
mov    -0x10(%rbp),%rsi
lea    0xe87(%rip),%rdi
call   1050 <printf@plt>
mov    -0x4(%rbp),%edi
lea    0xe86(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeline>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
test   %rax,%rax
jns    1160 <writeline+0x30>
lea    0xea8(%rip),%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
lea    0xea7(%rip),%rsi
mov    %ebp,%edi
mov    $0x1,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"write error %s\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @writeline(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i64 @write(i32 %5, i8* %6, i32 %8)
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %11, %2
%15 = load i32, i32* %3
%16 = call i64 @write(i32 %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"write error %s\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @writeline(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i64 @write(i32 %0, i8* %1, i32 %3)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %8
8: ; preds = %6, %2
%9 = tail call i64 @write(i32 %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}
g(int n) {
  long buf[2 * n];
  __typeof(buf) buf2;
  if (sizeof(buf2) != sizeof(buf))
    abort();
  return sizeof buf;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    %rcx,-0x28(%rbp)
mov    %rsp,%rax
mov    %rax,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %rcx,%rax
shl    $0x3,%rax
shl    $0x3,%rcx
cmp    %rcx,%rax
je     1151 <g+0x41>
call   1030 <abort@plt>
mov    -0x28(%rbp),%rax
shl    $0x3,%rax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
mov    %edi,%eax
shl    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @g(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = mul nsw i32 2, %6
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %3
%10 = alloca i64, i64 %8
store i64 %8, i64* %4
%11 = alloca i64, i64 %8
store i64 %8, i64* %5
%12 = mul nuw i64 8, %8
%13 = mul nuw i64 8, %8
%14 = icmp ne i64 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %1
unreachable
16: ; preds = %1
%17 = mul nuw i64 8, %8
%18 = trunc i64 %17 to i32
%19 = load i8*, i8** %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @g(i32 %0) {
%2 = shl i32 %0, 4
ret i32 %2
}
/* Variables and functions */
int is_fs_bootable(const char *part_type, const char *fs) { return (1); }


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

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

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

LLVM IR (-O2):
define i32 @is_fs_bootable(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ done(int);
void onintr(int flag) { done(1); }


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

x86 assembly (clang, -O2):
<onintr>:
mov    $0x1,%edi
jmp    1030 <done@plt>

LLVM IR (-O0):
define void @onintr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @done(i32 1)
ret void
}

LLVM IR (-O2):
define void @onintr(i32 %0) {
%2 = tail call i32 @done(i32 1)
ret void
}
int sxt(ch)
int ch;
{ return (ch - ((ch & 0x80) << 1)); }


x86 assembly (clang, -O0):
<sxt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
and    $0x80,%ecx
shl    $0x1,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sxt>:
mov    %edi,%eax
lea    (%rax,%rax,1),%ecx
and    $0x100,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @sxt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 128
%6 = shl i32 %5, 1
%7 = sub nsw i32 %3, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @sxt(i32 %0) {
%2 = shl i32 %0, 1
%3 = and i32 %2, 256
%4 = sub nsw i32 %0, %3
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *expand(char, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void runStr(FILE *out, char *str, int mode) {
  for (char *p = str; *p; p++) {
    fprintf(out, "%s", expand(*p, mode));
  }
}


x86 assembly (clang, -O0):
<runStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     1185 <runStr+0x65>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%al
mov    -0x14(%rbp),%esi
movsbl %al,%edi
call   1040 <expand@plt>
mov    -0x28(%rbp),%rdi
mov    %rax,%rdx
lea    0xe91(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    113b <runStr+0x1b>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<runStr>:
push   %rbp
push   %r14
push   %rbx
mov    (%rsi),%al
test   %al,%al
je     1161 <runStr+0x41>
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
add    $0x1,%rbx
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
mov    %r14d,%esi
call   1040 <expand@plt>
mov    %rax,%rdi
mov    %rbp,%rsi
call   1030 <fputs@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1140 <runStr+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @runStr(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %5
store i8* %8, i8** %7
br label %9
9: ; preds = %20, %3
%10 = load i8*, i8** %7
%11 = load i8, i8* %10
%12 = icmp ne i8 %11, 0
br i1 %12, label %13, label %23
13: ; preds = %9
%14 = load i32*, i32** %4
%15 = load i8*, i8** %7
%16 = load i8, i8* %15
%17 = load i32, i32* %6
%18 = call i8* @expand(i8 signext %16, i32 %17)
%19 = call i32 @fprintf(i32* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %18)
br label %20
20: ; preds = %13
%21 = load i8*, i8** %7
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %7
br label %9
23: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @runStr(i32* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = load i8, i8* %1
%5 = icmp eq i8 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %7, %3
ret void
7: ; preds = %3, %7
%8 = phi i8 [ %13, %7 ], [ %4, %3 ]
%9 = phi i8* [ %12, %7 ], [ %1, %3 ]
%10 = tail call i8* @expand(i8 signext %8, i32 %2)
%11 = tail call i32 @fputs(i8* %10, i32* %0)
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %6, label %7
}
void cop_end() {
  (*(volatile unsigned int *)(0x40015020) =
       ((*(volatile unsigned int *)(0x40015020)) & ~(1 << 0)));
  (*(volatile unsigned int *)(0x40015020) =
       ((*(volatile unsigned int *)(0x40015020)) | (1 << 1)));
}


x86 assembly (clang, -O0):
<cop_end>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40015020,%eax
mov    (%rax),%ecx
and    $0xfffffffe,%ecx
mov    $0x40015020,%eax
mov    %ecx,(%rax)
mov    $0x40015020,%eax
mov    (%rax),%ecx
or     $0x2,%ecx
mov    $0x40015020,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cop_end>:
andl   $0xfffffffe,0x40015020
fe
orl    $0x2,0x40015020
02
ret

LLVM IR (-O0):
define void @cop_end() {
%1 = load volatile i32, i32* inttoptr (i64 1073827872 to i32*)
%2 = and i32 %1, -2
store volatile i32 %2, i32* inttoptr (i64 1073827872 to i32*)
%3 = load volatile i32, i32* inttoptr (i64 1073827872 to i32*)
%4 = or i32 %3, 2
store volatile i32 %4, i32* inttoptr (i64 1073827872 to i32*)
ret void
}

LLVM IR (-O2):
define void @cop_end() {
%1 = load volatile i32, i32* inttoptr (i64 1073827872 to i32*)
%2 = and i32 %1, -2
store volatile i32 %2, i32* inttoptr (i64 1073827872 to i32*)
%3 = load volatile i32, i32* inttoptr (i64 1073827872 to i32*)
%4 = or i32 %3, 2
store volatile i32 %4, i32* inttoptr (i64 1073827872 to i32*)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_loadu_si128(int /*<<< orphan*/ const *);
void iunpackscan32(__m128i *initOffset, const __m128i *in) {
  *initOffset = _mm_loadu_si128(in + 31);
}


x86 assembly (clang, -O0):
<iunpackscan32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x7c,%rdi
call   1030 <_mm_loadu_si128@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iunpackscan32>:
push   %rbx
mov    %rdi,%rbx
lea    0x7c(%rsi),%rdi
call   1030 <_mm_loadu_si128@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @iunpackscan32(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 = getelementptr inbounds i32, i32* %5, i64 31
%7 = call i32 @_mm_loadu_si128(i32* %6)
%8 = load i32*, i32** %3
store i32 %7, i32* %8
ret void
}

LLVM IR (-O2):
define void @iunpackscan32(i32* nocapture writeonly %0, i32* %1) {
%3 = getelementptr inbounds i32, i32* %1, i64 31
%4 = tail call i32 @_mm_loadu_si128(i32* %3)
store i32 %4, i32* %0
ret void
}
void set_bit(volatile unsigned long *addr, unsigned long bit) {
  __asm__ volatile("lock bts %1, %0" : "+m"(*addr) : "r"(bit) : "memory");
}


x86 assembly (clang, -O0):
<set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
lock bts %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bit>:
lock bts %rsi,(%rdi)
ret

LLVM IR (-O0):
define void @set_bit(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%5 = load i64*, i64** %3
%6 = load i64, i64* %4
ret void
}

LLVM IR (-O2):
define void @set_bit(i64* %0, i64 %1) {
tail call void asm sideeffect "lock bts $1, $0", "=*m,r,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %0, i64 %1, i64* elementtype(i64) %0)
ret void
}
int rho_ruby_is_NIL(unsigned long val) { return 0; }


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

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

LLVM IR (-O0):
define i32 @rho_ruby_is_NIL(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @rho_ruby_is_NIL(i64 %0) {
ret i32 0
}
char mapdn(c)
char c;
{
  if (c >= 'A' && c <= 'Z')
    return ((char)(c + 040));
  return (c);
}


x86 assembly (clang, -O0):
<mapdn>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jl     1133 <mapdn+0x33>
movsbl -0x2(%rbp),%eax
cmp    $0x5a,%eax
jg     1133 <mapdn+0x33>
movsbl -0x2(%rbp),%eax
add    $0x20,%eax
mov    %al,-0x1(%rbp)
jmp    1139 <mapdn+0x39>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mapdn>:
mov    %edi,%eax
shl    $0x18,%eax
add    $0xbfffffff,%eax
lea    0x20(%rdi),%ecx
cmp    $0x1affffff,%eax
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @mapdn(i32 %0) {
%2 = alloca i8
%3 = alloca i8
%4 = trunc i32 %0 to i8
store i8 %4, i8* %3
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = icmp sge i32 %6, 65
br i1 %7, label %8, label %17
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp sle i32 %10, 90
br i1 %11, label %12, label %17
12: ; preds = %8
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = add nsw i32 %14, 32
%16 = trunc i32 %15 to i8
store i8 %16, i8* %2
br label %19
17: ; preds = %8, %1
%18 = load i8, i8* %3
store i8 %18, i8* %2
br label %19
19: ; preds = %17, %12
%20 = load i8, i8* %2
ret i8 %20
}

LLVM IR (-O2):
define signext i8 @mapdn(i32 %0) {
%2 = shl i32 %0, 24
%3 = add i32 %2, -1073741825
%4 = icmp ult i32 %3, 452984831
%5 = add i32 %0, 32
%6 = select i1 %4, i32 %5, i32 %0
%7 = trunc i32 %6 to i8
ret i8 %7
}
int cJSONUtils_PointerEncodedstrlen(const char *s) {
  int l = 0;
  for (; *s; s++, l++)
    if (*s == '~' || *s == '/')
      l++;
  return l;
}


x86 assembly (clang, -O0):
<cJSONUtils_PointerEncodedstrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1164 <cJSONUtils_PointerEncodedstrlen+0x64>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7e,%eax
je     113c <cJSONUtils_PointerEncodedstrlen+0x3c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1145 <cJSONUtils_PointerEncodedstrlen+0x45>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114a <cJSONUtils_PointerEncodedstrlen+0x4a>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <cJSONUtils_PointerEncodedstrlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cJSONUtils_PointerEncodedstrlen>:
xor    %eax,%eax
jmp    111a <cJSONUtils_PointerEncodedstrlen+0x1a>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%eax
add    $0x1,%rdi
add    $0x1,%eax
movzbl (%rdi),%ecx
cmp    $0x2f,%cl
je     1110 <cJSONUtils_PointerEncodedstrlen+0x10>
cmp    $0x7e,%cl
je     1110 <cJSONUtils_PointerEncodedstrlen+0x10>
test   %cl,%cl
jne    1113 <cJSONUtils_PointerEncodedstrlen+0x13>
ret

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

LLVM IR (-O2):
define i32 @cJSONUtils_PointerEncodedstrlen(i8* nocapture %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %10, %8 ]
%4 = phi i32 [ 0, %1 ], [ %11, %8 ]
%5 = load i8, i8* %3
switch i8 %5, label %8 [
i8 0, label %12
i8 126, label %6
i8 47, label %6
]
6: ; preds = %2, %2
%7 = add nsw i32 %4, 1
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ %7, %6 ], [ %4, %2 ]
%10 = getelementptr inbounds i8, i8* %3, i64 1
%11 = add nsw i32 %9, 1
br label %2
12: ; preds = %2
ret i32 %4
}
void ResetMenu(void) { return; }


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

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

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

LLVM IR (-O2):
define void @ResetMenu() {
ret void
}
void sgx_get_ps_cap() {}


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

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

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

LLVM IR (-O2):
define void @sgx_get_ps_cap() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dotInstall();
int /*<<< orphan*/ fiInstall();
int /*<<< orphan*/ fmtInstall();
int /*<<< orphan*/ infoInstall();
int /*<<< orphan*/ packInstall();
int /*<<< orphan*/ profileInstall();
int /*<<< orphan*/ ssrInstall();
int /*<<< orphan*/ tInstall();
void esfInstall() {
  ssrInstall();
  fiInstall();
  fmtInstall();
  infoInstall();
  dotInstall();
  tInstall();
  packInstall();
  profileInstall();
}


x86 assembly (clang, -O0):
<esfInstall>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <ssrInstall@plt>
mov    $0x0,%al
call   10a0 <fiInstall@plt>
mov    $0x0,%al
call   1050 <fmtInstall@plt>
mov    $0x0,%al
call   1060 <infoInstall@plt>
mov    $0x0,%al
call   1030 <dotInstall@plt>
mov    $0x0,%al
call   1080 <tInstall@plt>
mov    $0x0,%al
call   1090 <packInstall@plt>
mov    $0x0,%al
call   1070 <profileInstall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<esfInstall>:
push   %rax
xor    %eax,%eax
call   1040 <ssrInstall@plt>
xor    %eax,%eax
call   10a0 <fiInstall@plt>
xor    %eax,%eax
call   1050 <fmtInstall@plt>
xor    %eax,%eax
call   1060 <infoInstall@plt>
xor    %eax,%eax
call   1030 <dotInstall@plt>
xor    %eax,%eax
call   1080 <tInstall@plt>
xor    %eax,%eax
call   1090 <packInstall@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <profileInstall@plt>

LLVM IR (-O0):
define void @esfInstall() {
%1 = call i32 (...) @ssrInstall()
%2 = call i32 (...) @fiInstall()
%3 = call i32 (...) @fmtInstall()
%4 = call i32 (...) @infoInstall()
%5 = call i32 (...) @dotInstall()
%6 = call i32 (...) @tInstall()
%7 = call i32 (...) @packInstall()
%8 = call i32 (...) @profileInstall()
ret void
}

LLVM IR (-O2):
define void @esfInstall() {
%1 = tail call i32 (...) @ssrInstall()
%2 = tail call i32 (...) @fiInstall()
%3 = tail call i32 (...) @fmtInstall()
%4 = tail call i32 (...) @infoInstall()
%5 = tail call i32 (...) @dotInstall()
%6 = tail call i32 (...) @tInstall()
%7 = tail call i32 (...) @packInstall()
%8 = tail call i32 (...) @profileInstall()
ret void
}
test(label) int label;
{
  needbrack("(");
  expression();
  needbrack(")");
  testjump(label);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1050 <needbrack@plt>
mov    $0x0,%al
call   1040 <expression@plt>
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1050 <needbrack@plt>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1030 <testjump@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1050 <needbrack@plt>
xor    %eax,%eax
call   1040 <expression@plt>
lea    0xeb3(%rip),%rdi
xor    %eax,%eax
call   1050 <needbrack@plt>
mov    %ebx,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <testjump@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"(\00"
@.str.1 = [2 x i8] c")\00"
define i32 @test(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @needbrack to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @expression()
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @needbrack to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* %3
%8 = call i32 (i32, ...) bitcast (i32 (...)* @testjump to i32 (i32, ...)*)(i32 %7)
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
@.str = [2 x i8] c"(\00"
@.str.1 = [2 x i8] c")\00"
define i32 @test(i32 %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @needbrack to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @expression()
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @needbrack to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @testjump to i32 (i32, ...)*)(i32 %0)
ret i32 undef
}
void init_input_buffer(int input[]) {
  for (int i = 0; i < 100000; ++i) {
    input[i] = '\0';
  }
}


x86 assembly (clang, -O0):
<init_input_buffer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x186a0,-0xc(%rbp)
jge    1139 <init_input_buffer+0x39>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <init_input_buffer+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_input_buffer>:
push   %rax
mov    $0x61a80,%edx
xor    %esi,%esi
call   1030 <memset@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @init_input_buffer(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 100000
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i32*, i32** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
store i32 0, i32* %11
br label %12
12: ; preds = %7
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @init_input_buffer(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to i8*
ret void
}
/* Variables and functions */
extern size_t hexEncodeLength(size_t byteArrayLen) {
  return 2 * byteArrayLen + 1;
}


x86 assembly (clang, -O0):
<hexEncodeLength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x1,%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexEncodeLength>:
lea    (%rdi,%rdi,1),%rax
add    $0x1,%rax
ret

LLVM IR (-O0):
define i64 @hexEncodeLength(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 2, %3
%5 = add i64 %4, 1
ret i64 %5
}

LLVM IR (-O2):
define i64 @hexEncodeLength(i64 %0) {
%2 = shl i64 %0, 1
%3 = or i64 %2, 1
ret i64 %3
}
void foo(int (*a)[5]) {
  int i;
  for (i = 1; i < 5; ++i) {
    (*a)[i] = i;
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    1135 <foo+0x35>
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <foo+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,0x4(%rdi)
ret

LLVM IR (-O0):
define void @foo([5 x i32]* %0) {
%2 = alloca [5 x i32]*
%3 = alloca i32
store [5 x i32]* %0, [5 x i32]** %2
store i32 1, i32* %3
br label %4
4: ; preds = %13, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 5
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = load i32, i32* %3
%9 = load [5 x i32]*, [5 x i32]** %2
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [5 x i32], [5 x i32]* %9, i64 0, i64 %11
store i32 %8, i32* %12
br label %13
13: ; preds = %7
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %4
16: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @foo([5 x i32]* nocapture writeonly %0) {
%2 = getelementptr inbounds [5 x i32], [5 x i32]* %0, i64 0, i64 1
%3 = bitcast i32* %2 to <4 x i32>*
store <4 x i32> <i32 1, i32 2, i32 3, i32 4>, <4 x i32>* %3
ret void
}
int b_twist_l2_on_edgeperm(eperm)
int eperm;
{
  int temp_arr[8];
  b_edgeperm_unpack(eperm, temp_arr);
  two_cycle(temp_arr, 3, 7);
  return b_edgeperm_pack(temp_arr);
}


x86 assembly (clang, -O0):
<b_twist_l2_on_edgeperm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    $0x0,%al
call   1040 <b_edgeperm_unpack@plt>
lea    -0x30(%rbp),%rdi
mov    $0x3,%esi
mov    $0x7,%edx
mov    $0x0,%al
call   1050 <two_cycle@plt>
lea    -0x30(%rbp),%rdi
mov    $0x0,%al
call   1030 <b_edgeperm_pack@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_twist_l2_on_edgeperm>:
push   %rbx
sub    $0x20,%rsp
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <b_edgeperm_unpack@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x7,%edx
xor    %eax,%eax
call   1050 <two_cycle@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <b_edgeperm_pack@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @b_twist_l2_on_edgeperm(i32 %0) {
%2 = alloca i32
%3 = alloca [8 x i32]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%6 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @b_edgeperm_unpack to i32 (i32, i32*, ...)*)(i32 %4, i32* %5)
%7 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%8 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @two_cycle to i32 (i32*, i32, i32, ...)*)(i32* %7, i32 3, i32 7)
%9 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%10 = call i32 (i32*, ...) bitcast (i32 (...)* @b_edgeperm_pack to i32 (i32*, ...)*)(i32* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @b_twist_l2_on_edgeperm(i32 %0) {
%2 = alloca [8 x i32]
%3 = bitcast [8 x i32]* %2 to i8*
%4 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%5 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @b_edgeperm_unpack to i32 (i32, i32*, ...)*)(i32 %0, i32* %4)
%6 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @two_cycle to i32 (i32*, i32, i32, ...)*)(i32* %4, i32 3, i32 7)
%7 = call i32 (i32*, ...) bitcast (i32 (...)* @b_edgeperm_pack to i32 (i32*, ...)*)(i32* %4)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ clr_key_wait();
long get_key_buf_char();
int /*<<< orphan*/ read_char(long *);
long get_key_no_wait(void) {
  long c;
  c = '\0';
  c = get_key_buf_char();
  if (c != '\0')
    return c;
  clr_key_wait();
  read_char(&c);
  return c;
}


x86 assembly (clang, -O0):
<get_key_no_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1050 <get_key_buf_char@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1163 <get_key_no_wait+0x33>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    117b <get_key_no_wait+0x4b>
mov    $0x0,%al
call   1030 <clr_key_wait@plt>
lea    -0x10(%rbp),%rdi
call   1040 <read_char@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_key_no_wait>:
push   %rax
xor    %eax,%eax
call   1050 <get_key_buf_char@plt>
mov    %rax,(%rsp)
test   %rax,%rax
je     1143 <get_key_no_wait+0x13>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <clr_key_wait@plt>
mov    %rsp,%rdi
call   1040 <read_char@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @get_key_no_wait() {
%1 = alloca i64
%2 = alloca i64
store i64 0, i64* %2
%3 = call i64 (...) @get_key_buf_char()
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = load i64, i64* %2
store i64 %7, i64* %1
br label %12
8: ; preds = %0
%9 = call i32 (...) @clr_key_wait()
%10 = call i32 @read_char(i64* %2)
%11 = load i64, i64* %2
store i64 %11, i64* %1
br label %12
12: ; preds = %8, %6
%13 = load i64, i64* %1
ret i64 %13
}

LLVM IR (-O2):
define i64 @get_key_no_wait() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = tail call i64 (...) @get_key_buf_char()
store i64 %3, i64* %1
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = tail call i32 (...) @clr_key_wait()
%7 = call i32 @read_char(i64* %1)
%8 = load i64, i64* %1
br label %9
9: ; preds = %0, %5
%10 = phi i64 [ %8, %5 ], [ %3, %0 ]
ret i64 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int syscall(int, int, unsigned int, int /*<<< orphan*/, int, char const *);
int fanotify_mark(int fanotify_fd, unsigned int flags, uint64_t mask, int dfd,
                  const char *pathname) {
  return syscall(301, fanotify_fd, flags, mask, dfd, pathname);
}


x86 assembly (clang, -O0):
<fanotify_mark>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0x18(%rbp),%r9
mov    $0x12d,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fanotify_mark>:
mov    %r8,%r9
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
mov    $0x12d,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @fanotify_mark(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i8*, i8** %10
%16 = call i32 @syscall(i32 301, i32 %11, i32 %12, i32 %13, i32 %14, i8* %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @fanotify_mark(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4) {
%6 = tail call i32 @syscall(i32 301, i32 %0, i32 %1, i32 %2, i32 %3, i8* %4)
ret i32 %6
}
void func1(void (*p)(void)) { p(); }


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func1>:
jmp    *%rdi

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

LLVM IR (-O2):
define void @func1(void ()* nocapture %0) {
tail call void %0()
ret void
}
int test_imm_33uint8_mem(unsigned char *val) {
  return ((*val) & (0x33 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_33uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 51
%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_33uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 51
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ CallBack1(int, void *);
int /*<<< orphan*/ CheckRunningInMainThread(char *);
void ArrowCursor(void) {
  if (!CheckRunningInMainThread("ArrowCursor"))
    return;
  CallBack1(33, (void *)1);
}


x86 assembly (clang, -O0):
<ArrowCursor>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <CheckRunningInMainThread@plt>
cmp    $0x0,%eax
jne    113e <ArrowCursor+0x1e>
jmp    114d <ArrowCursor+0x2d>
mov    $0x21,%edi
mov    $0x1,%esi
call   1030 <CallBack1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ArrowCursor>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <CheckRunningInMainThread@plt>
test   %eax,%eax
je     1141 <ArrowCursor+0x21>
mov    $0x1,%esi
mov    $0x21,%edi
pop    %rax
jmp    1030 <CallBack1@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [12 x i8] c"ArrowCursor\00"
define void @ArrowCursor() {
%1 = call i32 @CheckRunningInMainThread(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i32 %1, 0
br i1 %2, label %4, label %3
3: ; preds = %0
br label %6
4: ; preds = %0
%5 = call i32 @CallBack1(i32 33, i8* inttoptr (i64 1 to i8*))
br label %6
6: ; preds = %4, %3
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"ArrowCursor\00"
define void @ArrowCursor() {
%1 = tail call i32 @CheckRunningInMainThread(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @CallBack1(i32 33, i8* inttoptr (i64 1 to i8*))
br label %5
5: ; preds = %0, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void dot() { printf(". "); }


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

x86 assembly (clang, -O2):
<dot>:
lea    0xee9(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c". \00"
define void @dot() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned int pycann_is_threading_enabled(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pycann_is_threading_enabled() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sfree(void *);
void traceslang_rawnamenode_hook_free(void *hook) {
  if (hook) {
    sfree(hook);
  }
  return;
}


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

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

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

LLVM IR (-O2):
define void @traceslang_rawnamenode_hook_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @sfree(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
int init_authentication(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @init_authentication() {
ret i32 0
}
void SetLED(int value) { (*(volatile unsigned int *)(0x80000000)) = value; }


x86 assembly (clang, -O0):
<SetLED>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x80000000,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetLED>:
mov    $0x80000000,%eax
mov    %edi,(%rax)
ret

LLVM IR (-O0):
define void @SetLED(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store volatile i32 %3, i32* inttoptr (i64 2147483648 to i32*)
ret void
}

LLVM IR (-O2):
define void @SetLED(i32 %0) {
store volatile i32 %0, i32* inttoptr (i64 2147483648 to i32*)
ret void
}
int isgraph(int c) { return (((c > 32) && (c < 127)) ? (1) : (0)); }


x86 assembly (clang, -O0):
<isgraph>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1120 <isgraph+0x20>
cmpl   $0x7f,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isgraph>:
add    $0xffffffdf,%edi
xor    %eax,%eax
cmp    $0x5e,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isgraph(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 32
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 127
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 1, i32 0
ret i32 %11
}

LLVM IR (-O2):
define i32 @isgraph(i32 %0) {
%2 = add i32 %0, -33
%3 = icmp ult i32 %2, 94
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 3, b = 4, c = 5;
  printf("a+b>c&&b==c\t%d\n", (a + b > c && b == c));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
movl   $0x5,-0x10(%rbp)
mov    -0x8(%rbp),%ecx
add    -0xc(%rbp),%ecx
xor    %eax,%eax
cmp    -0x10(%rbp),%ecx
mov    %al,-0x11(%rbp)
jle    1154 <main+0x44>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%esi
lea    0xe9d(%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
xor    %esi,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"a+b>c&&b==c\09%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %2
store i32 4, i32* %3
store i32 5, i32* %4
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = add nsw i32 %5, %6
%8 = load i32, i32* %4
%9 = icmp sgt i32 %7, %8
br i1 %9, label %10, label %14
10: ; preds = %0
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = icmp eq i32 %11, %12
br label %14
14: ; preds = %10, %0
%15 = phi i1 [ false, %0 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
%17 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"a+b>c&&b==c\09%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
void sde_rotator_resync_timeline(struct sde_rot_timeline *tl) {}


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

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

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

LLVM IR (-O2):
%struct.sde_rot_timeline = type opaque
define void @sde_rotator_resync_timeline(%struct.sde_rot_timeline* nocapture %0) {
ret void
}
/* Type definitions */
struct huffman {
  int dummy;
};

/* Variables and functions */
int build_huffman_tree(struct huffman *);
int output_data(struct huffman *);
int output_huffman_tree(struct huffman *);
int reset_tree(struct huffman *);
int huffman_output_tree(struct huffman *huffman) {
  int rc;
  return 0;
  if ((rc = build_huffman_tree(huffman)))
    return rc;
  if ((rc = output_huffman_tree(huffman)))
    return rc;
  if ((rc = output_data(huffman)))
    return rc;
  if ((rc = reset_tree(huffman)))
    return rc;
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.huffman = type { i32 }
define i32 @huffman_output_tree(%struct.huffman* nocapture readnone %0) {
ret i32 0
}
void gtk_box_pack_end_defaults() {}


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

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

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

LLVM IR (-O2):
define void @gtk_box_pack_end_defaults() {
ret void
}
/* Variables and functions */
unsigned short csc_crc16_byte(unsigned short, int /*<<< orphan*/);
unsigned short csc_crc16(unsigned short crc, void *buf, size_t len) {
  unsigned char *p = buf;
  while (len--) {
    crc = csc_crc16_byte(crc, *p++);
  }
  return crc;
}


x86 assembly (clang, -O0):
<csc_crc16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
cmp    $0x0,%rax
je     116f <csc_crc16+0x5f>
mov    -0x2(%rbp),%ax
mov    -0x20(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
movzbl (%rcx),%esi
movzwl %ax,%edi
call   1030 <csc_crc16_byte@plt>
mov    %ax,-0x2(%rbp)
jmp    112f <csc_crc16+0x1f>
movzwl -0x2(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<csc_crc16>:
push   %r15
push   %r14
push   %rbx
mov    %edi,%eax
test   %rdx,%rdx
je     1146 <csc_crc16+0x36>
mov    %rdx,%r15
mov    %rsi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl (%r14,%rbx,1),%esi
movzwl %ax,%edi
call   1030 <csc_crc16_byte@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <csc_crc16+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define zeroext i16 @csc_crc16(i16 zeroext %0, i8* nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %15, label %5
5: ; preds = %3, %5
%6 = phi i8* [ %10, %5 ], [ %1, %3 ]
%7 = phi i64 [ %9, %5 ], [ %2, %3 ]
%8 = phi i16 [ %13, %5 ], [ %0, %3 ]
%9 = add i64 %7, -1
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %6
%12 = zext i8 %11 to i32
%13 = tail call zeroext i16 @csc_crc16_byte(i16 zeroext %8, i32 %12)
%14 = icmp eq i64 %9, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %3
%16 = phi i16 [ %0, %3 ], [ %13, %5 ]
ret i16 %16
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(float *, float const *, int const);
void vecNf_copy(float result[], const float a[], const int n) {
  memcpy(result, a, n * sizeof(float));
}


x86 assembly (clang, -O0):
<vecNf_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vecNf_copy>:
shl    $0x2,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @vecNf_copy(float* %0, float* %1, i32 %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca i32
store float* %0, float** %4
store float* %1, float** %5
store i32 %2, i32* %6
%7 = load float*, float** %4
%8 = load float*, float** %5
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = mul i64 %10, 4
%12 = trunc i64 %11 to i32
%13 = call i32 @memcpy(float* %7, float* %8, i32 %12)
ret void
}

LLVM IR (-O2):
define void @vecNf_copy(float* %0, float* %1, i32 %2) {
%4 = shl i32 %2, 2
%5 = tail call i32 @memcpy(float* %0, float* %1, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int x = 3;
  int z = 10;
  int cnt = 0;
  do {
    x++;
  } while (cnt < z);
  printf("%d\n", cnt);
}


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)
movl   $0x3,-0x14(%rbp)
movl   $0xa,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jl     113b <main+0x2b>
mov    -0x1c(%rbp),%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
br label %3
}