xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ strncmp(char *, char *, int);
int line_isstmt(char *line) {
  int rc;
  rc = 0;
  if (strncmp(line, ">>", 2) == 0)
    rc = 1;
  else if (strncmp(line, "+>", 2) == 0)
    rc = 1;
  return rc;
}


x86 assembly (clang, -O0):
<line_isstmt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed2(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    114e <line_isstmt+0x3e>
movl   $0x1,-0xc(%rbp)
jmp    1179 <line_isstmt+0x69>
mov    -0x8(%rbp),%rdi
lea    0xeaa(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1174 <line_isstmt+0x64>
movl   $0x1,-0xc(%rbp)
jmp    1179 <line_isstmt+0x69>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<line_isstmt>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     114b <line_isstmt+0x3b>
lea    0xed2(%rip),%rsi
mov    %rbx,%rdi
mov    $0x2,%edx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c">>\00"
@.str.1 = [3 x i8] c"+>\00"
define i32 @line_isstmt(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = load i8*, i8** %2
%5 = call i64 @strncmp(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %3
br label %14
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i64 @strncmp(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 2)
%11 = icmp eq 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
br label %14
14: ; preds = %13, %7
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@.str = [3 x i8] c">>\00"
@.str.1 = [3 x i8] c"+>\00"
define i32 @line_isstmt(i8* %0) {
%2 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 2)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
void ff_hevc_put_hevc_epel_h64_8_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_epel_h64_8_avx2() {
ret void
}
double test4(double x) { return __builtin_pow(x, 7. / 3.); }


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

x86 assembly (clang, -O2):
<test4>:
movsd  0xee8(%rip),%xmm1
jmp    1030 <pow@plt>

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

LLVM IR (-O2):
define double @test4(double %0) {
%2 = tail call double @pow(double %0, double 0x4002AAAAAAAAAAAB)
ret double %2
}
/* Variables and functions */
void *memscan(void *addr, unsigned char c, size_t size) {
  unsigned char *p = (unsigned char *)addr;
  while (size) {
    if (*p == c)
      return (void *)p;
    p++;
    size--;
  }
  return (void *)p;
}


x86 assembly (clang, -O0):
<memscan>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1162 <memscan+0x62>
mov    -0x28(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    1145 <memscan+0x45>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116a <memscan+0x6a>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
jmp    111a <memscan+0x1a>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memscan>:
mov    %rdi,%rax
test   %rdx,%rdx
je     1122 <memscan+0x22>
lea    (%rax,%rdx,1),%rcx
nopl   0x0(%rax)
cmp    %sil,(%rax)
je     1122 <memscan+0x22>
add    $0x1,%rax
add    $0xffffffffffffffff,%rdx
jne    1110 <memscan+0x10>
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i8* @memscan(i8* %0, i8 zeroext %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %16, label %5
5: ; preds = %3
%6 = getelementptr i8, i8* %0, i64 %2
br label %7
7: ; preds = %5, %12
%8 = phi i8* [ %13, %12 ], [ %0, %5 ]
%9 = phi i64 [ %14, %12 ], [ %2, %5 ]
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, %1
br i1 %11, label %16, label %12
12: ; preds = %7
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = add i64 %9, -1
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %7
16: ; preds = %7, %12, %3
%17 = phi i8* [ %0, %3 ], [ %6, %12 ], [ %8, %7 ]
ret i8* %17
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
ssize_t write(int fildes, const void *buf, size_t nbyte) {
  (void)fildes;
  (void)buf;
  (void)nbyte;
  return -1;
}


x86 assembly (clang, -O0):
<write>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @write(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
ret i32 -1
}

LLVM IR (-O2):
define i32 @write(i32 %0, i8* nocapture readnone %1, i64 %2) {
ret i32 -1
}
void TOSH_MAKE_PW5_OUTPUT() { ; }


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

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

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

LLVM IR (-O2):
define void @TOSH_MAKE_PW5_OUTPUT() {
ret void
}
int isblankline(line)
char *line;
{
  for (; *line != '\0'; line++)
    if (!isspace(*line))
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<isblankline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1163 <isblankline+0x53>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
jne    114d <isblankline+0x3d>
movl   $0x0,-0x4(%rbp)
jmp    116a <isblankline+0x5a>
jmp    1152 <isblankline+0x42>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <isblankline+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isblankline>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
mov    $0x1,%ebp
test   %al,%al
je     114b <isblankline+0x3b>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edi
call   1030 <isspace@plt>
test   %eax,%eax
je     1149 <isblankline+0x39>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <isblankline+0x20>
jmp    114b <isblankline+0x3b>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @isblankline(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %7
4: ; preds = %7
%5 = load i8, i8* %13
%6 = icmp eq i8 %5, 0
br i1 %6, label %14, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %13, %4 ], [ %0, %1 ]
%10 = sext i8 %8 to i32
%11 = tail call i32 @isspace(i32 %10)
%12 = icmp eq i32 %11, 0
%13 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %12, label %14, label %4
14: ; preds = %7, %4, %1
%15 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %15
}
float pow2f(float x) { return x * x; }


x86 assembly (clang, -O0):
<pow2f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow2f>:
mulss  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @pow2f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fmul float %3, %4
ret float %5
}

LLVM IR (-O2):
define float @pow2f(float %0) {
%2 = fmul float %0, %0
ret float %2
}
void EVP_md5(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_md5() {
ret void
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *calloc(size_t size, size_t n) {
  int x[16];
  x[0] = size;
  void *res = malloc(size * n);
  memset(res, 0, size * n);
  return res;
}


x86 assembly (clang, -O0):
<calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0x50(%rbp)
mov    -0x8(%rbp),%rdi
imul   -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rdi
mov    -0x8(%rbp),%rdx
imul   -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x58(%rbp),%rax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca [16 x i32]
%6 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %3
%8 = trunc i64 %7 to i32
%9 = getelementptr inbounds [16 x i32], [16 x i32]* %5, i64 0, i64 0
store i32 %8, i32* %9
%10 = load i64, i64* %3
%11 = load i64, i64* %4
%12 = mul i64 %10, %11
%13 = call i8* @malloc(i64 %12)
store i8* %13, i8** %6
%14 = load i8*, i8** %6
%15 = load i64, i64* %3
%16 = load i64, i64* %4
%17 = mul i64 %15, %16
%18 = call i32 @memset(i8* %14, i32 0, i64 %17)
%19 = load i8*, i8** %6
ret i8* %19
}

LLVM IR (-O2):
define i8* @calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @memset(i8* %4, i32 0, i64 %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ outnop1str(char *);
void ctoi() { outnop1str("CLRA"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"CLRA\00"
define void @ctoi() {
%1 = tail call i32 @outnop1str(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
void rop3_75_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~S;
  stk2 = *D | stk3;
  stk1 = T ^ stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_75_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_75_0_0>:
not    %sil
or     (%rdi),%sil
xor    %dl,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_75_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = xor i32 %11, -1
%13 = trunc i32 %12 to i8
store i8 %13, i8* %9
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = load i8, i8* %9
%18 = zext i8 %17 to i32
%19 = or i32 %16, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %8
%21 = load i8, i8* %6
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = xor i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = load i8*, i8** %4
store i8 %27, i8* %28
ret void
}

LLVM IR (-O2):
define void @rop3_75_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %1, -1
%5 = load i8, i8* %0
%6 = or i8 %5, %4
%7 = xor i8 %6, %2
store i8 %7, i8* %0
ret void
}
unsigned long ALIGN_POWER2(unsigned long u) {
  if (u == 1)
    return 1;
  if (__builtin_clzl(u - 1UL) < 1)
    return 0;
  return 1UL << (sizeof(u) * 8 - __builtin_clzl(u - 1UL));
}


x86 assembly (clang, -O0):
<ALIGN_POWER2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x1,-0x10(%rbp)
jne    1120 <ALIGN_POWER2+0x20>
movq   $0x1,-0x8(%rbp)
jmp    116c <ALIGN_POWER2+0x6c>
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
bsr    %rax,%rax
xor    $0x3f,%rax
cmp    $0x1,%eax
jge    1146 <ALIGN_POWER2+0x46>
movq   $0x0,-0x8(%rbp)
jmp    116c <ALIGN_POWER2+0x6c>
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
bsr    %rax,%rax
xor    $0x3f,%rax
cltq
mov    $0x40,%ecx
sub    %rax,%rcx
mov    $0x1,%eax
shl    %cl,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ALIGN_POWER2>:
mov    $0x1,%eax
cmp    $0x1,%rdi
je     1123 <ALIGN_POWER2+0x23>
add    $0xffffffffffffffff,%rdi
bsr    %rdi,%rcx
xor    $0x3f,%rcx
je     1124 <ALIGN_POWER2+0x24>
neg    %cl
mov    $0x1,%eax
shl    %cl,%rax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @ALIGN_POWER2(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp eq i64 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %1
store i64 1, i64* %2
br label %22
7: ; preds = %1
%8 = load i64, i64* %3
%9 = sub i64 %8, 1
%10 = call i64 @llvm.ctlz.i64(i64 %9, i1 true)
%11 = trunc i64 %10 to i32
%12 = icmp slt i32 %11, 1
br i1 %12, label %13, label %14
13: ; preds = %7
store i64 0, i64* %2
br label %22
14: ; preds = %7
%15 = load i64, i64* %3
%16 = sub i64 %15, 1
%17 = call i64 @llvm.ctlz.i64(i64 %16, i1 true)
%18 = trunc i64 %17 to i32
%19 = sext i32 %18 to i64
%20 = sub i64 64, %19
%21 = shl i64 1, %20
store i64 %21, i64* %2
br label %22
22: ; preds = %14, %13, %6
%23 = load i64, i64* %2
ret i64 %23
}

LLVM IR (-O2):
define i64 @ALIGN_POWER2(i64 %0) {
%2 = icmp eq i64 %0, 1
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = add i64 %0, -1
%5 = tail call i64 @llvm.ctlz.i64(i64 %4, i1 true)
%6 = icmp eq i64 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = sub nuw nsw i64 64, %5
%9 = shl nuw i64 1, %8
br label %10
10: ; preds = %3, %1, %7
%11 = phi i64 [ %9, %7 ], [ 1, %1 ], [ 0, %3 ]
ret i64 %11
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t ROL64_56(uint64_t x) {
  __asm__("rolq $56, %0" : "=r"(x) : "0"(x));
  return x;
}


x86 assembly (clang, -O0):
<ROL64_56>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
rol    $0x38,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ROL64_56>:
mov    %rdi,%rax
rol    $0x38,%rax
ret

LLVM IR (-O0):
define i8* @ROL64_56(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* asm "rolq $$56, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @ROL64_56(i8* readnone %0) {
%2 = tail call i8* asm "rolq $$56, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
int test_imm_65int8_mem(signed char *val) {
  return ((*val) & (0x65 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_65int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, 101
%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_65int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 101
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t mul2(uint8_t a) { return (a & 0x80) ? ((a << 1) ^ 0x1b) : (a << 1); }


x86 assembly (clang, -O0):
<mul2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1129 <mul2+0x29>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
xor    $0x1b,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <mul2+0x32>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul2>:
lea    (%rdi,%rdi,1),%ecx
mov    %ecx,%eax
xor    $0x1b,%eax
test   $0x80,%dil
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @mul2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 128
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = shl i32 %7, 1
%9 = xor i32 %8, 27
br label %13
10: ; preds = %1
%11 = load i32, i32* %2
%12 = shl i32 %11, 1
br label %13
13: ; preds = %10, %6
%14 = phi i32 [ %9, %6 ], [ %12, %10 ]
ret i32 %14
}

LLVM IR (-O2):
define i32 @mul2(i32 %0) {
%2 = and i32 %0, 128
%3 = icmp eq i32 %2, 0
%4 = shl i32 %0, 1
%5 = xor i32 %4, 27
%6 = select i1 %3, i32 %4, i32 %5
ret i32 %6
}
int sub_fun2(int x, int y) { return x + y; }


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

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

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

LLVM IR (-O2):
define i32 @sub_fun2(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ daxpy_(int *, double *, double *, int *, double *, int *);
void DAXPY(int ntot, double coeff, double *copy_from, int inc1, double *copy_to,
           int inc2) {
  daxpy_(&ntot, &coeff, copy_from, &inc1, copy_to, &inc2);
}


x86 assembly (clang, -O0):
<DAXPY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
mov    -0x18(%rbp),%rdx
mov    -0x28(%rbp),%r8
lea    -0x4(%rbp),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x1c(%rbp),%rcx
lea    -0x2c(%rbp),%r9
call   1030 <daxpy_@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DAXPY>:
sub    $0x18,%rsp
mov    %rcx,%r10
mov    %rsi,%rax
mov    %edi,0xc(%rsp)
movsd  %xmm0,0x10(%rsp)
mov    %edx,0x8(%rsp)
mov    %r8d,0x4(%rsp)
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rcx
lea    0x4(%rsp),%r9
mov    %rax,%rdx
mov    %r10,%r8
call   1030 <daxpy_@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @DAXPY(i32 %0, double %1, double* %2, i32 %3, double* %4, i32 %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca double*
%10 = alloca i32
%11 = alloca double*
%12 = alloca i32
store i32 %0, i32* %7
store double %1, double* %8
store double* %2, double** %9
store i32 %3, i32* %10
store double* %4, double** %11
store i32 %5, i32* %12
%13 = load double*, double** %9
%14 = load double*, double** %11
%15 = call i32 @daxpy_(i32* %7, double* %8, double* %13, i32* %10, double* %14, i32* %12)
ret void
}

LLVM IR (-O2):
define void @DAXPY(i32 %0, double %1, double* %2, i32 %3, double* %4, i32 %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %7
store double %1, double* %8
store i32 %3, i32* %9
store i32 %5, i32* %10
%11 = call i32 @daxpy_(i32* %7, double* %8, double* %2, i32* %9, double* %4, i32* %10)
ret void
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
char *create_memory() {
  char *x = malloc(10);
  if (x == NULL) {
    return NULL;
  }
  strcpy(x, "a string");
  return x;
}


x86 assembly (clang, -O0):
<create_memory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114e <create_memory+0x2e>
movq   $0x0,-0x8(%rbp)
jmp    1166 <create_memory+0x46>
mov    -0x10(%rbp),%rdi
lea    0xea7(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_memory>:
push   %rbx
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1142 <create_memory+0x22>
lea    0xec6(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"a string\00"
define i8* @create_memory() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* @malloc(i32 10)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %0
store i8* null, i8** %1
br label %11
7: ; preds = %0
%8 = load i8*, i8** %2
%9 = call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%10 = load i8*, i8** %2
store i8* %10, i8** %1
br label %11
11: ; preds = %7, %6
%12 = load i8*, i8** %1
ret i8* %12
}

LLVM IR (-O2):
@.str = [9 x i8] c"a string\00"
define i8* @create_memory() {
%1 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%2 = icmp eq i8* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %0, %3
ret i8* %1
}
int test() {
  int a, b, c, i = 10;
  a = b = c = 100 + i;
  { int q = 10; }
  int x[] = {1, 2};
  return 0;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
movl   $0xa,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x64,%eax
mov    %eax,-0xc(%rbp)
mov    %eax,-0x8(%rbp)
mov    %eax,-0x4(%rbp)
movl   $0xa,-0x14(%rbp)
mov    0xed8(%rip),%rax
mov    %rax,-0x1c(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.test.x = [2 x i32] [i32 1, i32 2]
define i32 @test() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [2 x i32]
store i32 10, i32* %4
%7 = load i32, i32* %4
%8 = add nsw i32 100, %7
store i32 %8, i32* %3
store i32 %8, i32* %2
store i32 %8, i32* %1
store i32 10, i32* %5
%9 = bitcast [2 x i32]* %6 to i8*
ret i32 0
}

LLVM IR (-O2):
define i32 @test() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
scalar_t__ strlen(char const *);
int check_cachename(const char *str) {
  assert(str != NULL);
  return ((strlen(str) > 0) ? 0 : -1);
}


x86 assembly (clang, -O0):
<check_cachename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rdx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovg  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_cachename>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
xor    %ecx,%ecx
test   %rax,%rax
setle  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @check_cachename(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i8*, i8** %2
%8 = call i64 @strlen(i8* %7)
%9 = icmp sgt i64 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 0, i32 -1
ret i32 %11
}

LLVM IR (-O2):
define i32 @check_cachename(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%6 = icmp slt i64 %5, 1
%7 = sext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ ADC_SOC_RestoreConfig();
void ADC_SOC_Wakeup(void) { ADC_SOC_RestoreConfig(); }


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

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

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

LLVM IR (-O2):
define void @ADC_SOC_Wakeup() {
%1 = tail call i32 (...) @ADC_SOC_RestoreConfig()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bucket_sort_test();
int /*<<< orphan*/ count_sort_test();
int /*<<< orphan*/ radix_sort_test();
int main() {
  count_sort_test();
  radix_sort_test();
  bucket_sort_test();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <count_sort_test@plt>
mov    $0x0,%al
call   1030 <radix_sort_test@plt>
mov    $0x0,%al
call   1050 <bucket_sort_test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <count_sort_test@plt>
xor    %eax,%eax
call   1030 <radix_sort_test@plt>
xor    %eax,%eax
call   1050 <bucket_sort_test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @count_sort_test()
%3 = call i32 (...) @radix_sort_test()
%4 = call i32 (...) @bucket_sort_test()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @count_sort_test()
%2 = tail call i32 (...) @radix_sort_test()
%3 = tail call i32 (...) @bucket_sort_test()
ret i32 0
}
int same_ch(int a, int b) { return a == b; }


x86 assembly (clang, -O0):
<same_ch>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<same_ch>:
xor    %eax,%eax
cmp    %esi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @same_ch(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 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @same_ch(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void include_file_html(char *g) {
  printf("<A HREF=\"file:/usr/include/%s\">%s</A>&gt;", g, g);
}


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

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

LLVM IR (-O0):
@.str = [42 x i8] c"<A HREF=\22file:/usr/include/%s\22>%s</A>&gt;\00"
define void @include_file_html(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"<A HREF=\22file:/usr/include/%s\22>%s</A>&gt;\00"
define void @include_file_html(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0)
ret void
}
int dd(int x, int d) { return x / d; }


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

x86 assembly (clang, -O2):
<dd>:
mov    %edi,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @dd(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 = sdiv i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @dd(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
void quantifier2ZEROONE() {}


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

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

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

LLVM IR (-O2):
define void @quantifier2ZEROONE() {
ret void
}
/* Type definitions */
struct timeval {
  int tv_usec;
  int tv_sec;
};

/* Variables and functions */
int timeval_subtract(struct timeval *a, struct timeval *b) {
  return (int)((a->tv_usec - b->tv_usec) / 1000 +
               (a->tv_sec - b->tv_sec) * 1000);
}


x86 assembly (clang, -O0):
<timeval_subtract>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
mov    -0x10(%rbp),%rdx
sub    0x4(%rdx),%ecx
imul   $0x3e8,%ecx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timeval_subtract>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
sub    (%rsi),%eax
cltq
imul   $0x10624dd3,%rax,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x26,%rdx
add    %eax,%edx
sub    0x4(%rsi),%ecx
imul   $0x3e8,%ecx,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @timeval_subtract(%struct.timeval* %0, %struct.timeval* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load %struct.timeval*, %struct.timeval** %3
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = load %struct.timeval*, %struct.timeval** %4
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 0
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
%12 = sdiv i32 %11, 1000
%13 = load %struct.timeval*, %struct.timeval** %3
%14 = getelementptr inbounds %struct.timeval, %struct.timeval* %13, i32 0, i32 1
%15 = load i32, i32* %14
%16 = load %struct.timeval*, %struct.timeval** %4
%17 = getelementptr inbounds %struct.timeval, %struct.timeval* %16, i32 0, i32 1
%18 = load i32, i32* %17
%19 = sub nsw i32 %15, %18
%20 = mul nsw i32 %19, 1000
%21 = add nsw i32 %12, %20
ret i32 %21
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @timeval_subtract(%struct.timeval* nocapture %0, %struct.timeval* nocapture %1) {
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
%8 = sdiv i32 %7, 1000
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%10 = load i32, i32* %9
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%12 = load i32, i32* %11
%13 = sub nsw i32 %10, %12
%14 = mul nsw i32 %13, 1000
%15 = add nsw i32 %14, %8
ret i32 %15
}
void GenIsrProlog(void) {}


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

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

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

LLVM IR (-O2):
define void @GenIsrProlog() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ expression();
int /*<<< orphan*/ null();
int yyselect();
root() {
  switch (yyselect()) {
  case 1: {
    expression();
  } break;
  case 2: {
    null();
  } break;
  }
}


x86 assembly (clang, -O0):
<root>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1030 <yyselect@plt>
mov    %eax,%ecx
mov    %ecx,-0x8(%rbp)
sub    $0x1,%eax
je     1163 <root+0x33>
jmp    1152 <root+0x22>
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
je     116f <root+0x3f>
jmp    1176 <root+0x46>
mov    $0x0,%al
call   1050 <expression@plt>
jmp    1176 <root+0x46>
mov    $0x0,%al
call   1040 <null@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<root>:
push   %rax
xor    %eax,%eax
call   1030 <yyselect@plt>
cmp    $0x2,%eax
je     114b <root+0x1b>
cmp    $0x1,%eax
jne    1152 <root+0x22>
xor    %eax,%eax
call   1050 <expression@plt>
pop    %rcx
ret
xor    %eax,%eax
call   1040 <null@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @root() {
%1 = alloca i32
%2 = call i32 (...) @yyselect()
switch i32 %2, label %7 [
i32 1, label %3
i32 2, label %5
]
3: ; preds = %0
%4 = call i32 (...) @expression()
br label %7
5: ; preds = %0
%6 = call i32 (...) @null()
br label %7
7: ; preds = %0, %5, %3
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @root() {
%1 = tail call i32 (...) @yyselect()
switch i32 %1, label %6 [
i32 1, label %2
i32 2, label %4
]
2: ; preds = %0
%3 = tail call i32 (...) @expression()
br label %6
4: ; preds = %0
%5 = tail call i32 (...) @null()
br label %6
6: ; preds = %0, %4, %2
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ getstr(char **, size_t *, int /*<<< orphan*/ *, char,
                          int /*<<< orphan*/, int /*<<< orphan*/);
ssize_t getline(char **lineptr, size_t *n, FILE *stream) {
  return getstr(lineptr, n, stream, '\n', 0, 0);
}


x86 assembly (clang, -O0):
<getline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0xa,%ecx
xor    %r9d,%r9d
mov    %r9d,%r8d
call   1030 <getstr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getline>:
mov    $0xa,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <getstr@plt>

LLVM IR (-O0):
define i32 @getline(i8** %0, i64* %1, i32* %2) {
%4 = alloca i8**
%5 = alloca i64*
%6 = alloca i32*
store i8** %0, i8*** %4
store i64* %1, i64** %5
store i32* %2, i32** %6
%7 = load i8**, i8*** %4
%8 = load i64*, i64** %5
%9 = load i32*, i32** %6
%10 = call i32 @getstr(i8** %7, i64* %8, i32* %9, i8 signext 10, i32 0, i32 0)
ret i32 %10
}

LLVM IR (-O2):
define i32 @getline(i8** %0, i64* %1, i32* %2) {
%4 = tail call i32 @getstr(i8** %0, i64* %1, i32* %2, i8 signext 10, i32 0, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ isalnum(int);
scalar_t__ isgraph(int);
int ispunct(int c) { return isgraph(c) && (!isalnum(c)); }


x86 assembly (clang, -O0):
<ispunct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <isgraph@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
je     1158 <ispunct+0x38>
mov    -0x4(%rbp),%edi
call   1030 <isalnum@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ispunct>:
push   %rbx
mov    %edi,%ebx
call   1040 <isgraph@plt>
test   %rax,%rax
je     113f <ispunct+0x1f>
mov    %ebx,%edi
call   1030 <isalnum@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ispunct(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isgraph(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @isalnum(i32 %7)
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
br label %11
11: ; preds = %6, %1
%12 = phi i1 [ false, %1 ], [ %10, %6 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @ispunct(i32 %0) {
%2 = tail call i64 @isgraph(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @isalnum(i32 %0)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void passed() { fprintf(stderr, "TEST PASSED!\n\n"); }


x86 assembly (clang, -O0):
<passed>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<passed>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"TEST PASSED!\0A\0A\00"
define void @passed() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"TEST PASSED!\0A\0A\00"
define void @passed() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, unsigned char *, int);
void SerialPutchar(int fd, unsigned char c) { write(fd, &c, 1); }


x86 assembly (clang, -O0):
<SerialPutchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SerialPutchar>:
push   %rax
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @SerialPutchar(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = load i32, i32* %3
%6 = call i32 @write(i32 %5, i8* %4, i32 1)
ret void
}

LLVM IR (-O2):
define void @SerialPutchar(i32 %0, i8 zeroext %1) {
%3 = alloca i8
store i8 %1, i8* %3
%4 = call i32 @write(i32 %0, i8* %3, i32 1)
ret void
}
void hl_thread_yield() {}


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

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

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

LLVM IR (-O2):
define void @hl_thread_yield() {
ret void
}
void omap1_usb_init(struct omap_usb_config *pdata) {}


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

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

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

LLVM IR (-O2):
%struct.omap_usb_config = type opaque
define void @omap1_usb_init(%struct.omap_usb_config* nocapture %0) {
ret void
}
int svalue(int arg1, int arg2) {
  if (arg1 > 0 && arg2 > 0) {
    return (arg1 + arg2);
  }
  return -1;
}


x86 assembly (clang, -O0):
<svalue>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    112c <svalue+0x2c>
cmpl   $0x0,-0xc(%rbp)
jle    112c <svalue+0x2c>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1133 <svalue+0x33>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<svalue>:
lea    (%rsi,%rdi,1),%eax
test   %esi,%esi
mov    $0xffffffff,%ecx
cmovle %ecx,%eax
test   %edi,%edi
cmovle %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @svalue(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 0
%4 = icmp sgt i32 %1, 0
%5 = and i1 %3, %4
%6 = add nsw i32 %1, %0
%7 = select i1 %5, i32 %6, i32 -1
ret i32 %7
}
void bn_expand2(void) {}


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

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

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

LLVM IR (-O2):
define void @bn_expand2() {
ret void
}
/* Type definitions */
struct SN_env {
  int dummy;
};

/* Variables and functions */
struct SN_env *SN_create_env(int /*<<< orphan*/, int, int);
extern struct SN_env *turkish_UTF_8_create_env(void) {
  return SN_create_env(0, 1, 1);
}


x86 assembly (clang, -O0):
<turkish_UTF_8_create_env>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <SN_create_env@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<turkish_UTF_8_create_env>:
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x1,%edx
jmp    1030 <SN_create_env@plt>

LLVM IR (-O0):
%struct.SN_env = type { i32 }
define %struct.SN_env* @turkish_UTF_8_create_env() {
%1 = call %struct.SN_env* @SN_create_env(i32 0, i32 1, i32 1)
ret %struct.SN_env* %1
}

LLVM IR (-O2):
%struct.SN_env = type { i32 }
define %struct.SN_env* @turkish_UTF_8_create_env() {
%1 = tail call %struct.SN_env* @SN_create_env(i32 0, i32 1, i32 1)
ret %struct.SN_env* %1
}
/* Variables and functions */
int parseNparams(char const *, int, int, unsigned int **);
int parse2params(const char *params, int required, unsigned int *p1,
                 unsigned int *p2) {
  unsigned int *p[] = {p1, p2};
  return parseNparams(params, required, 2, p);
}


x86 assembly (clang, -O0):
<parse2params>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x30(%rbp),%rcx
mov    $0x2,%edx
call   1030 <parseNparams@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse2params>:
sub    $0x18,%rsp
mov    %rdx,(%rsp)
mov    %rcx,0x8(%rsp)
mov    %rsp,%rcx
mov    $0x2,%edx
call   1030 <parseNparams@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @parse2params(i8* %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca [2 x i32*]
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%10 = getelementptr inbounds [2 x i32*], [2 x i32*]* %9, i64 0, i64 0
%11 = load i32*, i32** %7
store i32* %11, i32** %10
%12 = getelementptr inbounds i32*, i32** %10, i64 1
%13 = load i32*, i32** %8
store i32* %13, i32** %12
%14 = load i8*, i8** %5
%15 = load i32, i32* %6
%16 = getelementptr inbounds [2 x i32*], [2 x i32*]* %9, i64 0, i64 0
%17 = call i32 @parseNparams(i8* %14, i32 %15, i32 2, i32** %16)
ret i32 %17
}

LLVM IR (-O2):
define i32 @parse2params(i8* %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca [2 x i32*]
%6 = bitcast [2 x i32*]* %5 to i8*
%7 = getelementptr inbounds [2 x i32*], [2 x i32*]* %5, i64 0, i64 0
store i32* %2, i32** %7
%8 = getelementptr inbounds [2 x i32*], [2 x i32*]* %5, i64 0, i64 1
store i32* %3, i32** %8
%9 = call i32 @parseNparams(i8* %0, i32 %1, i32 2, i32** %7)
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ namcoSetN163(int /*<<< orphan*/);
int /*<<< orphan*/ namco_setParamsC8XX_N163(int /*<<< orphan*/,
                                            int /*<<< orphan*/);
void namco_setParamsC8XX_SetN163(uint16_t addr, uint8_t val) {
  namcoSetN163(addr);
  namco_setParamsC8XX_N163(addr, val);
}


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

x86 assembly (clang, -O2):
<namco_setParamsC8XX_SetN163>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <namcoSetN163@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <namco_setParamsC8XX_N163@plt>

LLVM IR (-O0):
define void @namco_setParamsC8XX_SetN163(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 = call i32 @namcoSetN163(i32 %5)
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @namco_setParamsC8XX_N163(i32 %7, i32 %8)
ret void
}

LLVM IR (-O2):
define void @namco_setParamsC8XX_SetN163(i32 %0, i32 %1) {
%3 = tail call i32 @namcoSetN163(i32 %0)
%4 = tail call i32 @namco_setParamsC8XX_N163(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ buildWindows();
int /*<<< orphan*/ killAllWindows();
void rebuildWindows() {
  killAllWindows();
  buildWindows();
}


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

x86 assembly (clang, -O2):
<rebuildWindows>:
push   %rax
xor    %eax,%eax
call   1040 <killAllWindows@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <buildWindows@plt>

LLVM IR (-O0):
define void @rebuildWindows() {
%1 = call i32 (...) @killAllWindows()
%2 = call i32 (...) @buildWindows()
ret void
}

LLVM IR (-O2):
define void @rebuildWindows() {
%1 = tail call i32 (...) @killAllWindows()
%2 = tail call i32 (...) @buildWindows()
ret void
}