xunge/DecIR huggingface dataset:
void wmr_emit(const char *key, const char *val) {
  printf("%s%c%s\n", key, '\t', val);
}


x86 assembly (clang, -O0):
<wmr_emit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rcx
lea    0xed1(%rip),%rdi
mov    $0x9,%edx
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wmr_emit>:
mov    %rsi,%rcx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
mov    $0x9,%edx
xor    %eax,%eax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"%s%c%s\0A\00"
define void @wmr_emit(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i32 9, i8* %1)
ret void
}
void rop3_10_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = ~T;
  stk1 = *D & stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


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

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

LLVM IR (-O0):
define void @rop3_10_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = xor i32 %10, -1
%12 = trunc i32 %11 to i8
store i8 %12, i8* %8
%13 = load i8*, i8** %4
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = load i8, i8* %8
%17 = zext i8 %16 to i32
%18 = and i32 %15, %17
%19 = trunc i32 %18 to i8
store i8 %19, i8* %7
%20 = load i8, i8* %7
%21 = zext i8 %20 to i32
%22 = load i8, i8* %5
%23 = zext i8 %22 to i32
%24 = xor i32 %23, -1
%25 = and i32 %21, %24
%26 = load i8, i8* %6
%27 = zext i8 %26 to i32
%28 = xor i32 %27, -1
%29 = and i32 %25, %28
%30 = load i8*, i8** %4
%31 = load i8, i8* %30
%32 = zext i8 %31 to i32
%33 = load i8, i8* %5
%34 = zext i8 %33 to i32
%35 = and i32 %32, %34
%36 = or i32 %29, %35
%37 = load i8*, i8** %4
%38 = load i8, i8* %37
%39 = zext i8 %38 to i32
%40 = load i8, i8* %6
%41 = zext i8 %40 to i32
%42 = and i32 %39, %41
%43 = or i32 %36, %42
%44 = trunc i32 %43 to i8
%45 = load i8*, i8** %4
store i8 %44, i8* %45
ret void
}

LLVM IR (-O2):
define void @rop3_10_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void bitmap_free(uint64_t *map) { free(map); }


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

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

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

LLVM IR (-O2):
define void @bitmap_free(i32* nocapture %0) {
%2 = tail call i32 @free(i32* %0)
ret void
}
long mat_Nint(const double a) {
  if (a < 0.0)
    return (long)(a - 0.5);
  else
    return (long)(a + 0.5);
}


x86 assembly (clang, -O0):
<mat_Nint>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1136 <mat_Nint+0x36>
movsd  -0x10(%rbp),%xmm0
movsd  0xedc(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
mov    %rax,-0x8(%rbp)
jmp    114c <mat_Nint+0x4c>
movsd  0xec2(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat_Nint>:
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
lea    0xeec(%rip),%rcx
addsd  (%rcx,%rax,8),%xmm0
cvttsd2si %xmm0,%rax
ret

LLVM IR (-O0):
define i64 @mat_Nint(double %0) {
%2 = alloca i64
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load double, double* %3
%8 = fsub double %7, 5.000000e-01
%9 = fptosi double %8 to i64
store i64 %9, i64* %2
br label %14
10: ; preds = %1
%11 = load double, double* %3
%12 = fadd double %11, 5.000000e-01
%13 = fptosi double %12 to i64
store i64 %13, i64* %2
br label %14
14: ; preds = %10, %6
%15 = load i64, i64* %2
ret i64 %15
}

LLVM IR (-O2):
define i64 @mat_Nint(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = select i1 %2, double -5.000000e-01, double 5.000000e-01
%4 = fadd double %3, %0
%5 = fptosi double %4 to i64
ret i64 %5
}
/* Variables and functions */
double RAND_MAX;
scalar_t__ rand();
int randr(int min, int max) {
  double scaled = (double)rand() / RAND_MAX;
  return (max - min + 1) * scaled + min;
}


x86 assembly (clang, -O0):
<randr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2eb7(%rip),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  -0x10(%rbp),%xmm2
cvtsi2sdl -0x4(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randr>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ebe(%rip),%rax
divsd  (%rax),%xmm0
sub    %ebp,%ebx
add    $0x1,%ebx
cvtsi2sd %ebx,%xmm1
cvtsi2sd %ebp,%xmm2
mulsd  %xmm0,%xmm1
addsd  %xmm1,%xmm2
cvttsd2si %xmm2,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define i32 @randr(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i64 (...) @rand()
%7 = sitofp i64 %6 to double
%8 = load double, double* @RAND_MAX
%9 = fdiv double %7, %8
store double %9, double* %5
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = sub nsw i32 %10, %11
%13 = add nsw i32 %12, 1
%14 = sitofp i32 %13 to double
%15 = load double, double* %5
%16 = load i32, i32* %3
%17 = sitofp i32 %16 to double
%18 = call double @llvm.fmuladd.f64(double %14, double %15, double %17)
%19 = fptosi double %18 to i32
ret i32 %19
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define i32 @randr(i32 %0, i32 %1) {
%3 = tail call i64 (...) @rand()
%4 = sitofp i64 %3 to double
%5 = load double, double* @RAND_MAX
%6 = fdiv double %4, %5
%7 = sub i32 1, %0
%8 = add i32 %7, %1
%9 = sitofp i32 %8 to double
%10 = sitofp i32 %0 to double
%11 = tail call double @llvm.fmuladd.f64(double %9, double %6, double %10)
%12 = fptosi double %11 to i32
ret i32 %12
}
int main() {
  char c = 1;
  signed char sc = 2;
  unsigned char uc = 3;
  short s = 4;
  unsigned short us = 5;
  int i = 6;
  unsigned u = 7;
  long l = 8;
  unsigned long lu = 9;
  long long ll = 10;
  unsigned long long ull = 10;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movb   $0x1,-0x1(%rbp)
movb   $0x2,-0x2(%rbp)
movb   $0x3,-0x3(%rbp)
movw   $0x4,-0x6(%rbp)
movw   $0x5,-0x8(%rbp)
movl   $0x6,-0xc(%rbp)
movl   $0x7,-0x10(%rbp)
movq   $0x8,-0x18(%rbp)
movq   $0x9,-0x20(%rbp)
movq   $0xa,-0x28(%rbp)
movq   $0xa,-0x30(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int soma(char *, char *);
int main(int argc, char *argv[]) { printf("Soma: %d", soma(argv[1], argv[2])); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1040 <soma@plt>
mov    %eax,%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
call   1040 <soma@plt>
lea    0xecb(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"Soma: %d\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8*, i8** %1, i64 2
%6 = load i8*, i8** %5
%7 = tail call i32 @soma(i8* %4, i8* %6)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ return_struct_vl5();
int /*<<< orphan*/ take_struct_vl5(int /*<<< orphan*/);
void test_struct_vl5() { take_struct_vl5(return_struct_vl5()); }


x86 assembly (clang, -O0):
<test_struct_vl5>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <return_struct_vl5@plt>
mov    %eax,%edi
call   1030 <take_struct_vl5@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_struct_vl5>:
push   %rax
xor    %eax,%eax
call   1040 <return_struct_vl5@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <take_struct_vl5@plt>

LLVM IR (-O0):
define void @test_struct_vl5() {
%1 = call i32 (...) @return_struct_vl5()
%2 = call i32 @take_struct_vl5(i32 %1)
ret void
}

LLVM IR (-O2):
define void @test_struct_vl5() {
%1 = tail call i32 (...) @return_struct_vl5()
%2 = tail call i32 @take_struct_vl5(i32 %1)
ret void
}
trargs(ap) char **ap;
{}


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

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

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

LLVM IR (-O2):
define i32 @trargs(i8** nocapture readnone %0) {
ret i32 undef
}
void set_bit(void *data, const unsigned int i) {
  ((unsigned int *)data)[i >> 5] |= 1 << (i & 31);
}


x86 assembly (clang, -O0):
<set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
and    $0x1f,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shr    $0x5,%ecx
mov    %ecx,%ecx
or     (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bit>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
shr    $0x5,%ecx
or     %eax,(%rdi,%rcx,4)
ret

LLVM IR (-O0):
define void @set_bit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 31
%7 = shl i32 1, %6
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %4
%11 = lshr i32 %10, 5
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %9, i64 %12
%14 = load i32, i32* %13
%15 = or i32 %14, %7
store i32 %15, i32* %13
ret void
}

LLVM IR (-O2):
define void @set_bit(i8* nocapture %0, i32 %1) {
%3 = and i32 %1, 31
%4 = shl nuw i32 1, %3
%5 = bitcast i8* %0 to i32*
%6 = lshr i32 %1, 5
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
%10 = or i32 %9, %4
store i32 %10, i32* %8
ret void
}
strcmp(s1, s2) register char *s1, *s2;
{
  while (*s1 == *s2++)
    if (*s1++ == '\0')
      return (0);
  return ((unsigned)(*s1) - (unsigned)(*--s2));
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1159 <strcmp+0x59>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1154 <strcmp+0x54>
movl   $0x0,-0x4(%rbp)
jmp    1178 <strcmp+0x78>
jmp    110c <strcmp+0xc>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x18(%rbp)
movsbl -0x1(%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%rdi,%rcx,1),%eax
movsbl (%rsi,%rcx,1),%edx
cmp    %dl,%al
jne    1127 <strcmp+0x27>
add    $0x1,%rcx
test   %al,%al
jne    1110 <strcmp+0x10>
xor    %eax,%eax
ret
sub    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %9, %2
%4 = phi i8* [ %0, %2 ], [ %11, %9 ]
%5 = phi i8* [ %1, %2 ], [ %10, %9 ]
%6 = load i8, i8* %4
%7 = load i8, i8* %5
%8 = icmp eq i8 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = getelementptr inbounds i8, i8* %5, i64 1
%11 = getelementptr inbounds i8, i8* %4, i64 1
%12 = icmp eq i8 %6, 0
br i1 %12, label %17, label %3
13: ; preds = %3
%14 = sext i8 %6 to i32
%15 = sext i8 %7 to i32
%16 = sub nsw i32 %14, %15
br label %17
17: ; preds = %9, %13
%18 = phi i32 [ %16, %13 ], [ 0, %9 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int main(int argc, char **argv) {
  sleep(5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x5,%edi
call   1030 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1030 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @sleep(i32 5)
ret i32 0
}
void _delay_ms(int delay) {}


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

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

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

LLVM IR (-O2):
define void @_delay_ms(i32 %0) {
ret void
}
int toupper(int c) {
  if ((c >= 'a') && (c <= 'z')) {
    c += ('A' - 'a');
  }
  return c;
}


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     1124 <toupper+0x24>
cmpl   $0x7a,-0x4(%rbp)
jg     1124 <toupper+0x24>
mov    -0x4(%rbp),%eax
add    $0xffffffe0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = add nsw i32 %9, -32
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %5, %1
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int U_PMR_NODATAREC_print(char const *);
int U_PMR_MULTIFORMATSTART_print(const char *contents) {
  return (U_PMR_NODATAREC_print(contents));
}


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

x86 assembly (clang, -O2):
<U_PMR_MULTIFORMATSTART_print>:
jmp    1030 <U_PMR_NODATAREC_print@plt>

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

LLVM IR (-O2):
define i32 @U_PMR_MULTIFORMATSTART_print(i8* %0) {
%2 = tail call i32 @U_PMR_NODATAREC_print(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
int putchar(char letter) {
  write(1, &letter, 1);
  return letter;
}


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

x86 assembly (clang, -O2):
<putchar>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    %bl,0xf(%rsp)
lea    0xf(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @putchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @write(i32 1, i8* %2, i32 1)
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @putchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @write(i32 1, i8* %2, i32 1)
%4 = sext i8 %0 to i32
ret i32 %4
}
int main(void) {
  int i;
  void auto_static(void);
  for (i = 0; i < 5; ++i)
    auto_static();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1143 <main+0x33>
call   1030 <auto_static@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
tail call void @auto_static()
tail call void @auto_static()
tail call void @auto_static()
tail call void @auto_static()
tail call void @auto_static()
ret i32 0
}
int my_add(int para_x, int para_y) { return para_x + para_y; }


x86 assembly (clang, -O0):
<my_add>:
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):
<my_add>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @my_add(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 @my_add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int _open_serial(int, char **);
int _open_tcp(int, char **);
scalar_t__ strncmp(char *, char *, int);
int _open_stream(int argc, char **argv) {
  if (strncmp(argv[0], "tcp:", sizeof("tcp:") - 1) == 0) {
    return _open_tcp(argc, argv);
  } else {
    return _open_serial(argc, argv);
  }
}


x86 assembly (clang, -O0):
<_open_stream>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xeb3(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1175 <_open_stream+0x45>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <_open_tcp@plt>
mov    %eax,-0x4(%rbp)
jmp    1184 <_open_stream+0x54>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <_open_serial@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_open_stream>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    (%rsi),%rdi
lea    0xebe(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
test   %rax,%rax
je     1161 <_open_stream+0x31>
pop    %rbx
pop    %rbp
jmp    1050 <_open_serial@plt>
pop    %rbx
pop    %rbp
jmp    1040 <_open_tcp@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"tcp:\00"
define i32 @_open_stream(i32 %0, i8** %1) {
%3 = load i8*, i8** %1
%4 = tail call i64 @strncmp(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @_open_tcp(i32 %0, i8** %1)
br label %10
8: ; preds = %2
%9 = tail call i32 @_open_serial(i32 %0, i8** %1)
br label %10
10: ; preds = %8, %6
%11 = phi i32 [ %7, %6 ], [ %9, %8 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void inverse(int on) { printf(on ? "\x1b[7m" : "\x1b[m"); }


x86 assembly (clang, -O0):
<inverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
lea    0xee0(%rip),%rdi
lea    0xed4(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inverse>:
test   %edi,%edi
lea    0xeec(%rip),%rax
lea    0xee0(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[7m\00"
@.str.1 = [4 x i8] c"\1B[m\00"
define void @inverse(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%7 = call i32 @printf(i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[7m\00"
@.str.1 = [4 x i8] c"\1B[m\00"
define void @inverse(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
%4 = tail call i32 @printf(i8* dereferenceable(1) %3)
ret void
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ cli_addr;

/* Variables and functions */
int accept(int, struct sockaddr *, int *);
int acceptNewConnections(int socket_fd) {
  struct sockaddr_in cli_addr;
  int clilen = sizeof(cli_addr);
  int acceptedsockfd = accept(socket_fd, (struct sockaddr *)&cli_addr, &clilen);
  return acceptedsockfd;
}


x86 assembly (clang, -O0):
<acceptNewConnections>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <accept@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acceptNewConnections>:
sub    $0x18,%rsp
movl   $0x4,0xc(%rsp)
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1030 <accept@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @acceptNewConnections(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.sockaddr_in
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 4, i32* %4
%6 = load i32, i32* %2
%7 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%8 = call i32 @accept(i32 %6, %struct.sockaddr* %7, i32* %4)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @acceptNewConnections(i32 %0) {
%2 = alloca %struct.sockaddr_in
%3 = alloca i32
%4 = bitcast %struct.sockaddr_in* %2 to i8*
%5 = bitcast i32* %3 to i8*
store i32 4, i32* %3
%6 = bitcast %struct.sockaddr_in* %2 to %struct.sockaddr*
%7 = call i32 @accept(i32 %0, %struct.sockaddr* %6, i32* %3)
ret i32 %7
}
/* Variables and functions */
char *strpbrk(char *, char *);
char *xxstrdup(char *);
char *sanitize_path_name(char *name) {
  char *new = xxstrdup(name);
  char *next = new;
  while ((next = strpbrk(next, " /.\n")))
    *next = '_';
  return new;
}


x86 assembly (clang, -O0):
<sanitize_path_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <xxstrdup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xeb4(%rip),%rsi
call   1030 <strpbrk@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     116b <sanitize_path_name+0x4b>
mov    -0x18(%rbp),%rax
movb   $0x5f,(%rax)
jmp    1141 <sanitize_path_name+0x21>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sanitize_path_name>:
push   %r14
push   %rbx
push   %rax
call   1040 <xxstrdup@plt>
mov    %rax,%r14
lea    0xecd(%rip),%rsi
mov    %rax,%rdi
call   1030 <strpbrk@plt>
test   %rax,%rax
je     1163 <sanitize_path_name+0x43>
lea    0xeb9(%rip),%rbx
nopw   0x0(%rax,%rax,1)
movb   $0x5f,(%rax)
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strpbrk@plt>
test   %rax,%rax
jne    1150 <sanitize_path_name+0x30>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c" /.\0A\00"
define i8* @sanitize_path_name(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @xxstrdup(i8* %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
store i8* %7, i8** %4
br label %8
8: ; preds = %12, %1
%9 = load i8*, i8** %4
%10 = call i8* @strpbrk(i8* %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %10, i8** %4
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = load i8*, i8** %4
store i8 95, i8* %13
br label %8
14: ; preds = %8
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@.str = [5 x i8] c" /.\0A\00"
define i8* @sanitize_path_name(i8* %0) {
%2 = tail call i8* @xxstrdup(i8* %0)
%3 = tail call i8* @strpbrk(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i8* %3, null
br i1 %4, label %9, label %5
5: ; preds = %1, %5
%6 = phi i8* [ %7, %5 ], [ %3, %1 ]
store i8 95, i8* %6
%7 = tail call i8* @strpbrk(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %5
9: ; preds = %5, %1
ret i8* %2
}
void testClosureFLLrV(void (*closure)(float, long long), float a1,
                      long long a2) {
  (*closure)(a1, a2);
}


x86 assembly (clang, -O0):
<testClosureFLLrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  -0xc(%rbp),%xmm0
mov    -0x18(%rbp),%rdi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureFLLrV>:
mov    %rdi,%rax
mov    %rsi,%rdi
jmp    *%rax

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

LLVM IR (-O2):
define void @testClosureFLLrV(void (float, i64)* nocapture %0, float %1, i64 %2) {
tail call void %0(float %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void gdbserver_usage(void) {
  printf("Usage:\tgdbserver [OPTIONS] COMM PROG [ARGS ...]\n"
         "\tgdbserver [OPTIONS] --attach COMM PID\n"
         "\tgdbserver [OPTIONS] --multi COMM\n"
         "\n"
         "COMM may either be a tty device (for serial debugging), or \n"
         "HOST:PORT to listen for a TCP connection.\n"
         "\n"
         "Options:\n"
         "  --debug\t\tEnable debugging output.\n");
}


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

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

LLVM IR (-O0):
@.str = [271 x i8] c"Usage:\09gdbserver [OPTIONS] COMM PROG [ARGS ...]\0A\09gdbserver [OPTIONS] --attach COMM PID\0A\09gdbserver [OPTIONS] --multi COMM\0A\0ACOMM may either be a tty device (for serial debugging), or \0AHOST:PORT to listen for a TCP connection.\0A\0AOptions:\0A --debug\09\09Enable debugging output.\0A\00"
define void @gdbserver_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([271 x i8], [271 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [270 x i8] c"Usage:\09gdbserver [OPTIONS] COMM PROG [ARGS ...]\0A\09gdbserver [OPTIONS] --attach COMM PID\0A\09gdbserver [OPTIONS] --multi COMM\0A\0ACOMM may either be a tty device (for serial debugging), or \0AHOST:PORT to listen for a TCP connection.\0A\0AOptions:\0A --debug\09\09Enable debugging output.\00"
define void @gdbserver_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([270 x i8], [270 x i8]* @str, i64 0, i64 0))
ret void
}
void av_parser_iterate() {}


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

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

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

LLVM IR (-O2):
define void @av_parser_iterate() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ redecl2();
void use113() { redecl2(); }


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

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

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

LLVM IR (-O2):
define void @use113() {
%1 = tail call i32 (...) @redecl2()
ret void
}
/* Variables and functions */
scalar_t__ is_circular_prime(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i, count = 1;
  for (i = 3; i < 1000000; i += 2) {
    if (is_circular_prime(i))
      ++count;
  }
  printf("%d\n", count);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x3,-0x8(%rbp)
cmpl   $0xf4240,-0x8(%rbp)
jge    1178 <main+0x58>
mov    -0x8(%rbp),%edi
call   1040 <is_circular_prime@plt>
cmp    $0x0,%rax
je     1165 <main+0x45>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    116a <main+0x4a>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
mov    $0x1,%ebx
nopl   (%rax)
add    $0x2,%ebp
mov    %ebp,%edi
call   1040 <is_circular_prime@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%ebx
cmp    $0xf423e,%ebp
jb     1130 <main+0x10>
lea    0xeb0(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %7, %1 ]
%3 = phi i32 [ 3, %0 ], [ %8, %1 ]
%4 = tail call i64 @is_circular_prime(i32 %3)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
%7 = add nuw nsw i32 %2, %6
%8 = add nuw nsw i32 %3, 2
%9 = icmp ult i32 %3, 999998
br i1 %9, label %1, label %10
10: ; preds = %1
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
void fc199(int n) {
  {
    typedef int(*b)[n];
    {
      typedef int(*c)[n];
      0;
    }
    {
      typedef int(*d)[n];
      0;
    };
    typedef int(*e)[n];
    0;
  };
  {
    typedef int(*f)[n];
    {
      typedef int(*g)[n];
      0;
    };
    {
      typedef int(*h)[n];
      goto a;
      0;
    };
  a:;
    typedef int(*i)[n];
    0;
  };
  ;
  typedef int(*j)[n];
  0;
}


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

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

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

LLVM IR (-O2):
define void @fc199(i32 %0) {
ret void
}
/* Variables and functions */
int f(int, int, int /*<<< orphan*/);
int main(void) { return f(5, 6, 0); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
mov    $0x6,%esi
xor    %edx,%edx
call   1030 <f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x5,%edi
mov    $0x6,%esi
xor    %edx,%edx
jmp    1030 <f@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f(i32 5, i32 6, i32 0)
ret i32 %2
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 5, i32 6, i32 0)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ get_pin(int /*<<< orphan*/, int, int);
uint8_t io_get_pin_direction(uint8_t pin) { return get_pin(pin, 0x00, 0x01); }


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

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

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

LLVM IR (-O2):
define i32 @io_get_pin_direction(i32 %0) {
%2 = tail call i32 @get_pin(i32 %0, i32 0, i32 1)
ret i32 %2
}
int f4(int d) { return (12 - (d & 15)) & 7; }


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
and    $0xf,%ecx
mov    $0xc,%eax
sub    %ecx,%eax
and    $0x7,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
mov    $0x4,%eax
sub    %edi,%eax
and    $0x7,%eax
ret

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

LLVM IR (-O2):
define i32 @f4(i32 %0) {
%2 = sub i32 4, %0
%3 = and i32 %2, 7
ret i32 %3
}
void AKSC_DirectionS3(void) {}


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

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

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

LLVM IR (-O2):
define void @AKSC_DirectionS3() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello, wordl!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, wordl!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"Hello, wordl!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
size_t qsim_lock_idx(uint64_t addr) {
  return ((addr / 64 * 64) & 0xffff) ^ ((addr >> 16) & 0xffff) ^
         (((addr >> 32) & 0xffff) ^ ((addr >> 40) & 0xffff));
}


x86 assembly (clang, -O0):
<qsim_lock_idx>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x40,%ecx
cltd
idiv   %ecx
shl    $0x6,%eax
and    $0xffff,%eax
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
and    $0xffff,%ecx
xor    %ecx,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sar    %cl,%edx
mov    %edx,%ecx
and    $0xffff,%ecx
mov    %ecx,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x28,%ecx
sar    %cl,%edx
mov    -0x8(%rbp),%ecx
and    $0xffff,%edx
xor    %edx,%ecx
xor    %ecx,%eax
cltq
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @qsim_lock_idx(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 64
%5 = mul nsw i32 %4, 64
%6 = and i32 %5, 65535
%7 = load i32, i32* %2
%8 = ashr i32 %7, 16
%9 = and i32 %8, 65535
%10 = xor i32 %6, %9
%11 = load i32, i32* %2
%12 = ashr i32 %11, 32
%13 = and i32 %12, 65535
%14 = load i32, i32* %2
%15 = ashr i32 %14, 40
%16 = and i32 %15, 65535
%17 = xor i32 %13, %16
%18 = xor i32 %10, %17
%19 = sext i32 %18 to i64
ret i64 %19
}

LLVM IR (-O2):
define i64 @qsim_lock_idx(i32 %0) {
ret i64 poison
}
/* Variables and functions */
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ printw(char *, char *);
int /*<<< orphan*/ refresh();
void greetings(char *version) {
  initscr();
  printw("*** LIME, The versatile line modeling engine, version %s\n", version);
  refresh();
}


x86 assembly (clang, -O0):
<greetings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <initscr@plt>
mov    -0x8(%rbp),%rsi
lea    0xeb2(%rip),%rdi
call   1040 <printw@plt>
mov    $0x0,%al
call   1050 <refresh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<greetings>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <initscr@plt>
lea    0xebe(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printw@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <refresh@plt>

LLVM IR (-O0):
@.str = [58 x i8] c"*** LIME, The versatile line modeling engine, version %s\0A\00"
define void @greetings(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @initscr()
%4 = load i8*, i8** %2
%5 = call i32 @printw(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @refresh()
ret void
}

LLVM IR (-O2):
@.str = [58 x i8] c"*** LIME, The versatile line modeling engine, version %s\0A\00"
define void @greetings(i8* %0) {
%2 = tail call i32 (...) @initscr()
%3 = tail call i32 @printw(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @refresh()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dread(char *, int, int);
unsigned int getUnsignedInt(char *);
unsigned int getRecordsStored() {
  char buffer[2];
  dread(buffer, (0x01B), 2);
  return getUnsignedInt(buffer);
}


x86 assembly (clang, -O0):
<getRecordsStored>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x2(%rbp),%rdi
mov    $0x1b,%esi
mov    $0x2,%edx
call   1040 <dread@plt>
lea    -0x2(%rbp),%rdi
call   1030 <getUnsignedInt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRecordsStored>:
push   %rbx
sub    $0x10,%rsp
lea    0xe(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x1b,%esi
mov    $0x2,%edx
call   1040 <dread@plt>
mov    %rbx,%rdi
call   1030 <getUnsignedInt@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getRecordsStored() {
%1 = alloca [2 x i8]
%2 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%3 = call i32 @dread(i8* %2, i32 27, i32 2)
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%5 = call i32 @getUnsignedInt(i8* %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @getRecordsStored() {
%1 = alloca [2 x i8]
%2 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%3 = call i32 @dread(i8* %2, i32 27, i32 2)
%4 = call i32 @getUnsignedInt(i8* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char const *, char *);
void gru_cli_general_usage(const char *appname) {
  printf("%s%sUsage:%s\n%s <program> <options>\n\nValid programs:\n\n",
         "\x1B[00m", "\x1B[01;37m", appname, "\x1B[00m");
}


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

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

LLVM IR (-O0):
@.str = [55 x i8] c"%s%sUsage:%s\0A%s <program> <options>\0A\0AValid programs:\0A\0A\00"
@.str.1 = [6 x i8] c"\1B[00m\00"
@.str.2 = [9 x i8] c"\1B[01;37m\00"
define void @gru_cli_general_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [55 x i8] c"%s%sUsage:%s\0A%s <program> <options>\0A\0AValid programs:\0A\0A\00"
@.str.1 = [6 x i8] c"\1B[00m\00"
@.str.2 = [9 x i8] c"\1B[01;37m\00"
define void @gru_cli_general_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void foo3() {}


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

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

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

LLVM IR (-O2):
define void @foo3() {
ret void
}
signed int _divuschar(unsigned char x, unsigned char y) {
  return ((int)((signed char)x) / (int)y);
}


x86 assembly (clang, -O0):
<_divuschar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<_divuschar>:
movsbl %dil,%eax
cwtd
idiv   %si
cwtl
ret

LLVM IR (-O0):
define i32 @_divuschar(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = sdiv i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @_divuschar(i8 zeroext %0, i8 zeroext %1) {
%3 = sext i8 %0 to i16
%4 = zext i8 %1 to i16
%5 = sdiv i16 %3, %4
%6 = sext i16 %5 to i32
ret i32 %6
}