xunge/DecIR huggingface dataset:
/* Variables and functions */
int global_fd_log();
int write(int, char *, int);
int print_yellow(int fd_out, char *str, unsigned long size) {
  write(fd_out, "\033[33m", 5);
  write(fd_out, str, size);
  write(global_fd_log(), str, size);
  return (write(fd_out, "\033[0m", 5));
}


x86 assembly (clang, -O0):
<print_yellow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
lea    0xec3(%rip),%rsi
mov    $0x5,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    %eax,%edx
call   1030 <write@plt>
mov    $0x0,%al
call   1040 <global_fd_log@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    %eax,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
lea    0xe8b(%rip),%rsi
mov    $0x5,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_yellow>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xecd(%rip),%rsi
mov    $0x5,%edx
call   1030 <write@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <write@plt>
xor    %eax,%eax
call   1040 <global_fd_log@plt>
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <write@plt>
lea    0xea1(%rip),%rsi
mov    %ebp,%edi
mov    $0x5,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[33m\00"
@.str.1 = [5 x i8] c"\1B[0m\00"
define i32 @print_yellow(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 = call i32 @write(i32 %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%9 = load i32, i32* %4
%10 = load i8*, i8** %5
%11 = load i64, i64* %6
%12 = trunc i64 %11 to i32
%13 = call i32 @write(i32 %9, i8* %10, i32 %12)
%14 = call i32 (...) @global_fd_log()
%15 = load i8*, i8** %5
%16 = load i64, i64* %6
%17 = trunc i64 %16 to i32
%18 = call i32 @write(i32 %14, i8* %15, i32 %17)
%19 = load i32, i32* %4
%20 = call i32 @write(i32 %19, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 5)
ret i32 %20
}

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[33m\00"
@.str.1 = [5 x i8] c"\1B[0m\00"
define i32 @print_yellow(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%5 = trunc i64 %2 to i32
%6 = tail call i32 @write(i32 %0, i8* %1, i32 %5)
%7 = tail call i32 (...) @global_fd_log()
%8 = tail call i32 @write(i32 %7, i8* %1, i32 %5)
%9 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 5)
ret i32 %9
}
/* Variables and functions */
char *strrchr(char const *, char);
char const *file_name(char const *path) {
  char const *name;
  name = strrchr(path, '/');
  if (!name) {
    name = strrchr(path, '\\');
  }
  if (!name) {
    name = path;
  } else {
    name++;
  }
  return name;
}


x86 assembly (clang, -O0):
<file_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <file_name+0x3b>
mov    -0x8(%rbp),%rdi
mov    $0x5c,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1163 <file_name+0x53>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    116f <file_name+0x5f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_name>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
jne    1130 <file_name+0x20>
mov    %rbx,%rdi
mov    $0x5c,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @file_name(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 92)
br label %6
6: ; preds = %4, %1
%7 = phi i8* [ %2, %1 ], [ %5, %4 ]
%8 = icmp eq i8* %7, null
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = select i1 %8, i8* %0, i8* %9
ret i8* %10
}
/* Variables and functions */
long random();
long int nrand48(unsigned short xsub[3]) { return random(); }


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

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

LLVM IR (-O0):
define i64 @nrand48(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = call i64 (...) @random()
ret i64 %3
}

LLVM IR (-O2):
define i64 @nrand48(i16* nocapture readnone %0) {
%2 = tail call i64 (...) @random()
ret i64 %2
}
int validate_range(float a) {
  if (a >= 40.816 || a <= 0.) {
    return 0;
  } else
    return 1;
}


x86 assembly (clang, -O0):
<validate_range>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jae    113a <validate_range+0x3a>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jb     1146 <validate_range+0x46>
movl   $0x0,-0x4(%rbp)
jmp    114d <validate_range+0x4d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<validate_range>:
cvtss2sd %xmm0,%xmm1
ucomisd 0xef4(%rip),%xmm1
setb   %al
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
setb   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @validate_range(float %0) {
%2 = alloca i32
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fcmp oge double %5, 4.081600e+01
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load float, float* %3
%9 = fpext float %8 to double
%10 = fcmp ole double %9, 0.000000e+00
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i32 0, i32* %2
br label %13
12: ; preds = %7
store i32 1, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @validate_range(float %0) {
%2 = fpext float %0 to double
%3 = fcmp ult double %2, 4.081600e+01
%4 = fcmp ugt float %0, 0.000000e+00
%5 = and i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
float pow(double, float);
float f(float x) { return (pow(2.718281828, x) - 4 * x * x); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm1
movsd  0xede(%rip),%xmm0
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movss  0xec6(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
movaps %xmm0,%xmm1
movss  %xmm0,0x4(%rsp)
movsd  0xede(%rip),%xmm0
call   1030 <pow@plt>
movss  0xed9(%rip),%xmm1
movss  0x4(%rsp),%xmm2
mulss  %xmm2,%xmm1
mulss  %xmm2,%xmm1
addss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @pow(double 0x4005BF0A8B04919B, float %3)
%5 = load float, float* %2
%6 = fmul float 4.000000e+00, %5
%7 = load float, float* %2
%8 = fneg float %6
%9 = call float @llvm.fmuladd.f32(float %8, float %7, float %4)
ret float %9
}

LLVM IR (-O2):
define float @f(float %0) {
%2 = tail call float @pow(double 0x4005BF0A8B04919B, float %0)
%3 = fmul float %0, -4.000000e+00
%4 = tail call float @llvm.fmuladd.f32(float %3, float %0, float %2)
ret float %4
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void GPIO_clearMultiDio(uint32_t dioMask) {
  ;
  (*((volatile unsigned long *)(0x40022000 + 0x000000A0))) = dioMask;
}


x86 assembly (clang, -O0):
<GPIO_clearMultiDio>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x400220a0,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIO_clearMultiDio>:
mov    %rdi,0x400220a0
40
ret

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

LLVM IR (-O2):
define void @GPIO_clearMultiDio(i64 %0) {
store volatile i64 %0, i64* inttoptr (i64 1073881248 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
int /*<<< orphan*/ ft_putnbr(int);
int main(void) {
  ft_putnbr(-573);
  ft_putchar('\n');
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xfffffdc3,%edi
call   1040 <ft_putnbr@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @ft_putnbr(i32 -573)
%3 = call i32 @ft_putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @ft_putnbr(i32 -573)
%2 = tail call i32 @ft_putchar(i8 signext 10)
ret i32 0
}
/* Type definitions */
struct dirent {
  int /*<<< orphan*/ d_name;
};

/* Variables and functions */
scalar_t__ fnmatch(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int pathlist_select(struct dirent *dirent) {
  if (fnmatch("*.conf", dirent->d_name, 0) == 0) {
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<pathlist_select>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xed7(%rip),%rdi
xor    %edx,%edx
call   1030 <fnmatch@plt>
cmp    $0x0,%rax
jne    1146 <pathlist_select+0x36>
movl   $0x1,-0x4(%rbp)
jmp    114d <pathlist_select+0x3d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathlist_select>:
push   %rax
mov    (%rdi),%esi
lea    0xee6(%rip),%rdi
xor    %edx,%edx
call   1030 <fnmatch@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.dirent = type { i32 }
@.str = [7 x i8] c"*.conf\00"
define i32 @pathlist_select(%struct.dirent* nocapture %0) {
%2 = getelementptr inbounds %struct.dirent, %struct.dirent* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i64 @fnmatch(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3, i32 0)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void get_subdirname(void) { printf("zarch"); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"zarch\00"
define void @get_subdirname() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double cos(double);
double log(double);
double rand_uniform();
double rand_uniopen();
double sqrt(double);
double rand_gaussian(void) {
  double a, b;
  a = rand_uniform();
  b = rand_uniopen();
  return cos(2.0 * 3.141592654 * a) * sqrt(-2.0 * log(b));
}


x86 assembly (clang, -O0):
<rand_gaussian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1060 <rand_uniform@plt>
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand_uniopen@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  0xe90(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1050 <log@plt>
movaps %xmm0,%xmm1
movsd  0xe64(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1070 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_gaussian>:
sub    $0x18,%rsp
xor    %eax,%eax
call   1060 <rand_uniform@plt>
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand_uniopen@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
mulsd  0xe84(%rip),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1050 <log@plt>
mulsd  0xe6e(%rip),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     11aa <rand_gaussian+0x5a>
sqrtsd %xmm0,%xmm0
jmp    11af <rand_gaussian+0x5f>
call   1070 <sqrt@plt>
movsd  0x8(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @rand_gaussian() {
%1 = alloca double
%2 = alloca double
%3 = call double (...) @rand_uniform()
store double %3, double* %1
%4 = call double (...) @rand_uniopen()
store double %4, double* %2
%5 = load double, double* %1
%6 = fmul double 0x401921FB54524550, %5
%7 = call double @cos(double %6)
%8 = load double, double* %2
%9 = call double @log(double %8)
%10 = fmul double -2.000000e+00, %9
%11 = call double @sqrt(double %10)
%12 = fmul double %7, %11
ret double %12
}

LLVM IR (-O2):
define double @rand_gaussian() {
%1 = tail call double (...) @rand_uniform()
%2 = tail call double (...) @rand_uniopen()
%3 = fmul double %1, 0x401921FB54524550
%4 = tail call double @cos(double %3)
%5 = tail call double @log(double %2)
%6 = fmul double %5, -2.000000e+00
%7 = tail call double @sqrt(double %6)
%8 = fmul double %4, %7
ret double %8
}
unsigned short isa_read16(unsigned short port) {
  return *(short *)((void *)(0xfe000000 | (port)));
}


x86 assembly (clang, -O0):
<isa_read16>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
or     $0xfe000000,%eax
mov    %eax,%eax
movzwl (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isa_read16>:
mov    %edi,%eax
mov    $0xfe000000,%ecx
movzwl (%rax,%rcx,1),%eax
ret

LLVM IR (-O0):
define zeroext i16 @isa_read16(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = or i32 -33554432, %4
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
%8 = bitcast i8* %7 to i16*
%9 = load i16, i16* %8
ret i16 %9
}

LLVM IR (-O2):
define zeroext i16 @isa_read16(i16 zeroext %0) {
%2 = zext i16 %0 to i64
%3 = or i64 %2, 4261412864
%4 = inttoptr i64 %3 to i16*
%5 = load i16, i16* %4
ret i16 %5
}
void G_RemapTeamShaders(void) {}


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

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

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

LLVM IR (-O2):
define void @G_RemapTeamShaders() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, char *);
void print_kml_string(FILE *f, char *name, char *val) {
  if (name)
    fprintf(f, "\t%s \"%s\"\n", name, val);
}


x86 assembly (clang, -O0):
<print_kml_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1147 <print_kml_string+0x37>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xebe(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_kml_string>:
test   %rsi,%rsi
je     1127 <print_kml_string+0x17>
mov    %rdx,%rcx
mov    %rsi,%rdx
lea    0xede(%rip),%rsi
jmp    1030 <fprintf@plt>
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"\09%s \22%s\22\0A\00"
define void @print_kml_string(i32* nocapture %0, i8* %1, i8* %2) {
%4 = icmp eq i8* %1, null
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
scalar_t__ const_time_select(char, unsigned int, unsigned int);
char const_time_select_s8(char mask, char true_val, char false_val) {
  return (char)const_time_select(mask, (unsigned int)true_val,
                                 (unsigned int)false_val);
}


x86 assembly (clang, -O0):
<const_time_select_s8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    -0x1(%rbp),%al
movsbl -0x2(%rbp),%esi
movsbl -0x3(%rbp),%edx
movsbl %al,%edi
call   1030 <const_time_select@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<const_time_select_s8>:
push   %rax
call   1030 <const_time_select@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define signext i8 @const_time_select_s8(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = sext i8 %1 to i32
%5 = sext i8 %2 to i32
%6 = tail call i64 @const_time_select(i8 signext %0, i32 %4, i32 %5)
%7 = trunc i64 %6 to i8
ret i8 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
int /*<<< orphan*/ fwrite_base32hex(char *, int, int /*<<< orphan*/ *);
int list_val(void *ctx, char *val, int vallen) {
  FILE *fp = ctx;
  fwrite_base32hex(val, vallen, fp);
  fputc(',', fp);
  return 0;
}


x86 assembly (clang, -O0):
<list_val>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1040 <fwrite_base32hex@plt>
mov    -0x20(%rbp),%rsi
mov    $0x2c,%edi
call   1030 <fputc@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_val>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %edx,%esi
mov    %rbx,%rdx
call   1040 <fwrite_base32hex@plt>
mov    $0x2c,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @list_val(i8* %0, i8* %1, i32 %2) {
%4 = bitcast i8* %0 to i32*
%5 = tail call i32 @fwrite_base32hex(i8* %1, i32 %2, i32* %4)
%6 = tail call i32 @fputc(i8 signext 44, i32* %4)
ret i32 0
}
/* Variables and functions */
char const *dlerror();
const char *grt_dynload_error(void) { return dlerror(); }


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

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

LLVM IR (-O0):
define i8* @grt_dynload_error() {
%1 = call i8* (...) @dlerror()
ret i8* %1
}

LLVM IR (-O2):
define i8* @grt_dynload_error() {
%1 = tail call i8* (...) @dlerror()
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
void label_printLong(void *e) {
  long *l = e;
  printf("%li", *l);
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%li\00"
define void @label_printLong(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %3)
ret void
}
/* Variables and functions */
double exp(double);
double log(double);
double pow(double x, double y) { return exp(y * log(x)); }


x86 assembly (clang, -O0):
<pow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow>:
push   %rax
movsd  %xmm1,(%rsp)
call   1040 <log@plt>
mulsd  (%rsp),%xmm0
pop    %rax
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @pow(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %3
%7 = call double @log(double %6)
%8 = fmul double %5, %7
%9 = call double @exp(double %8)
ret double %9
}

LLVM IR (-O2):
define double @pow(double %0, double %1) {
%3 = tail call double @log(double %0)
%4 = fmul double %3, %1
%5 = tail call double @exp(double %4)
ret double %5
}
/* Variables and functions */
char *stdimpl_lltoa(int, char *, int);
char *stdimpl_itoa(int v, char *string, int r) {
  return stdimpl_lltoa(v, string, r);
}


x86 assembly (clang, -O0):
<stdimpl_itoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <stdimpl_lltoa@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdimpl_itoa>:
jmp    1030 <stdimpl_lltoa@plt>

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

LLVM IR (-O2):
define i8* @stdimpl_itoa(i32 %0, i8* %1, i32 %2) {
%4 = tail call i8* @stdimpl_lltoa(i32 %0, i8* %1, i32 %2)
ret i8* %4
}
/* Variables and functions */
scalar_t__ isspace(int);
char *Str_TrimLeftQ(char *s) {
  char *q = s;
  while (*q && isspace((int)*q))
    q++;
  return q;
}


x86 assembly (clang, -O0):
<Str_TrimLeftQ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     114f <Str_TrimLeftQ+0x3f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    115f <Str_TrimLeftQ+0x4f>
jmp    1170 <Str_TrimLeftQ+0x60>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <Str_TrimLeftQ+0x14>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Str_TrimLeftQ>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1139 <Str_TrimLeftQ+0x29>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     1139 <Str_TrimLeftQ+0x29>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <Str_TrimLeftQ+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @Str_TrimLeftQ(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %10
%5 = phi i8 [ %12, %10 ], [ %2, %1 ]
%6 = phi i8* [ %11, %10 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = tail call i64 @isspace(i32 %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %4
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %10, %1
%15 = phi i8* [ %0, %1 ], [ %11, %10 ], [ %6, %4 ]
ret i8* %15
}
/* Variables and functions */
scalar_t__ extern_const(int);
int __attribute__((no)) foo2b(int n) {
  int ret = 0;
  int i;
  for (i = 0; i < n; i++)
    ret += extern_const(i);
  return ret;
}


x86 assembly (clang, -O0):
<foo2b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1158 <foo2b+0x48>
mov    -0xc(%rbp),%edi
call   1030 <extern_const@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <foo2b+0x19>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo2b>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    1133 <foo2b+0x23>
mov    %edi,%r14d
xor    %ebx,%ebx
xor    %ebp,%ebp
nop
mov    %ebx,%edi
call   1030 <extern_const@plt>
add    %eax,%ebp
add    $0x1,%ebx
cmp    %ebx,%r14d
jne    1120 <foo2b+0x10>
jmp    1135 <foo2b+0x25>
xor    %ebp,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @foo2b(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ 0, %1 ]
%6 = tail call i64 @extern_const(i32 %4)
%7 = trunc i64 %6 to i32
%8 = add i32 %5, %7
%9 = add nuw nsw i32 %4, 1
%10 = icmp eq i32 %9, %0
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ log_msg(char *);
int /*<<< orphan*/ sprintf(char *, char *, int, int);
void log_duplicateFrameReceived(int packet, int frame) {
  char buffer[70];
  sprintf(buffer, "DAT: duplicate of frame %d of packet %d received", frame,
          packet);
  log_msg(buffer);
}


x86 assembly (clang, -O0):
<log_duplicateFrameReceived>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%ecx
lea    0xec1(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x50(%rbp),%rdi
call   1030 <log_msg@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_duplicateFrameReceived>:
push   %rbx
sub    $0x50,%rsp
mov    %esi,%edx
mov    %edi,%ecx
lea    0xed0(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <log_msg@plt>
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [49 x i8] c"DAT: duplicate of frame %d of packet %d received\00"
define void @log_duplicateFrameReceived(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [70 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [70 x i8], [70 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
%10 = getelementptr inbounds [70 x i8], [70 x i8]* %5, i64 0, i64 0
%11 = call i32 @log_msg(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [49 x i8] c"DAT: duplicate of frame %d of packet %d received\00"
define void @log_duplicateFrameReceived(i32 %0, i32 %1) {
%3 = alloca [70 x i8]
%4 = getelementptr inbounds [70 x i8], [70 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
%6 = call i32 @log_msg(i8* %4)
ret void
}
int is_alpha(ch)
int ch;
{ return ((ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z')); }


x86 assembly (clang, -O0):
<is_alpha>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     1120 <is_alpha+0x20>
mov    $0x1,%al
cmpl   $0x5a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    113f <is_alpha+0x3f>
xor    %eax,%eax
cmpl   $0x61,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1139 <is_alpha+0x39>
cmpl   $0x7a,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_alpha>:
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @is_alpha(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %16, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 97
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 122
br label %14
14: ; preds = %11, %8
%15 = phi i1 [ false, %8 ], [ %13, %11 ]
br label %16
16: ; preds = %14, %5
%17 = phi i1 [ true, %5 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @is_alpha(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void setOutputForDigitalPin(int aState, int fd) {
  if (aState == 1) {
    write(fd, "1", 1);
  } else {
    write(fd, "0", 1);
  }
}


x86 assembly (clang, -O0):
<setOutputForDigitalPin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1141 <setOutputForDigitalPin+0x31>
mov    -0x8(%rbp),%edi
lea    0xece(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
jmp    1155 <setOutputForDigitalPin+0x45>
mov    -0x8(%rbp),%edi
lea    0xeb7(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setOutputForDigitalPin>:
mov    %esi,%eax
cmp    $0x1,%edi
lea    0xee4(%rip),%rcx
lea    0xedf(%rip),%rsi
cmove  %rcx,%rsi
mov    %eax,%edi
mov    $0x1,%edx
jmp    1030 <write@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"1\00"
@.str.1 = [2 x i8] c"0\00"
define void @setOutputForDigitalPin(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1
%4 = select i1 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
%5 = tail call i32 @write(i32 %1, i8* %4, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ angry_prof(int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int T;
  scanf("%d", &T);
  angry_prof(T);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <angry_prof@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = call i32 @angry_prof(i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @angry_prof(i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ dup2(int, int);
int /*<<< orphan*/ pipe(int *);
void create_closed_read_on(int dest) {
  int p[2];
  pipe(p);
  close(p[1]);
  dup2(p[0], dest);
  if (p[0] != dest)
    close(p[0]);
}


x86 assembly (clang, -O0):
<create_closed_read_on>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <pipe@plt>
mov    -0x8(%rbp),%edi
call   1040 <close@plt>
mov    -0xc(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <dup2@plt>
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
je     116b <create_closed_read_on+0x3b>
mov    -0xc(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_closed_read_on>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0x8(%rsp),%rdi
call   1050 <pipe@plt>
mov    0xc(%rsp),%edi
call   1040 <close@plt>
mov    0x8(%rsp),%edi
mov    %ebx,%esi
call   1030 <dup2@plt>
mov    0x8(%rsp),%edi
cmp    %ebx,%edi
je     1162 <create_closed_read_on+0x32>
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @create_closed_read_on(i32 %0) {
%2 = alloca i32
%3 = alloca [2 x i32]
store i32 %0, i32* %2
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%5 = call i32 @pipe(i32* %4)
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
%7 = load i32, i32* %6
%8 = call i32 @close(i32 %7)
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%10 = load i32, i32* %9
%11 = load i32, i32* %2
%12 = call i32 @dup2(i32 %10, i32 %11)
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%14 = load i32, i32* %13
%15 = load i32, i32* %2
%16 = icmp ne i32 %14, %15
br i1 %16, label %17, label %21
17: ; preds = %1
%18 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%19 = load i32, i32* %18
%20 = call i32 @close(i32 %19)
br label %21
21: ; preds = %17, %1
ret void
}

LLVM IR (-O2):
define void @create_closed_read_on(i32 %0) {
%2 = alloca [2 x i32]
%3 = bitcast [2 x i32]* %2 to i8*
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%5 = call i32 @pipe(i32* %4)
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
%7 = load i32, i32* %6
%8 = call i32 @close(i32 %7)
%9 = load i32, i32* %4
%10 = call i32 @dup2(i32 %9, i32 %0)
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, %0
br i1 %12, label %15, label %13
13: ; preds = %1
%14 = call i32 @close(i32 %11)
br label %15
15: ; preds = %13, %1
ret void
}
char *errorstr(int errnum) {
  extern char *strerror();
  return strerror(errnum);
}


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

x86 assembly (clang, -O2):
<errorstr>:
jmp    1030 <strerror@plt>

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

LLVM IR (-O2):
define i8* @errorstr(i32 %0) {
%2 = tail call i8* @strerror(i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ TOSH_SET_GIO3_PIN();
void HUMIDITY_SET_DATA() { TOSH_SET_GIO3_PIN(); }


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

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

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

LLVM IR (-O2):
define void @HUMIDITY_SET_DATA() {
%1 = tail call i32 (...) @TOSH_SET_GIO3_PIN()
ret void
}
void wx11ri() {}


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

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

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

LLVM IR (-O2):
define void @wx11ri() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FadeMusic();
int /*<<< orphan*/ FadeSounds();
void FadeSoundsAndMusic() {
  FadeSounds();
  FadeMusic();
}


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

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

LLVM IR (-O0):
define void @FadeSoundsAndMusic() {
%1 = call i32 (...) @FadeSounds()
%2 = call i32 (...) @FadeMusic()
ret void
}

LLVM IR (-O2):
define void @FadeSoundsAndMusic() {
%1 = tail call i32 (...) @FadeSounds()
%2 = tail call i32 (...) @FadeMusic()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ val;

/* Variables and functions */
int /*<<< orphan*/ memcpy(size_t *, void const *, int);
__attribute__((unused)) size_t MEM_readST(const void *memPtr) {
  size_t val;
  memcpy(&val, memPtr, sizeof(val));
  return val;
}


x86 assembly (clang, -O0):
<MEM_readST>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdi
mov    $0x8,%edx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MEM_readST>:
push   %rax
mov    %rdi,%rsi
mov    %rsp,%rdi
mov    $0x8,%edx
call   1030 <memcpy@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @MEM_readST(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @memcpy(i64* %3, i8* %4, i32 8)
%6 = load i64, i64* %3
ret i64 %6
}

LLVM IR (-O2):
define i64 @MEM_readST(i8* %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = call i32 @memcpy(i64* %2, i8* %0, i32 8)
%5 = load i64, i64* %2
ret i64 %5
}
void sigint(int a) {}


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

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

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

LLVM IR (-O2):
define void @sigint(i32 %0) {
ret void
}
int isodigit(int c) { return c >= '0' && c <= '7'; }


x86 assembly (clang, -O0):
<isodigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isodigit+0x20>
cmpl   $0x37,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isodigit>:
and    $0xfffffff8,%edi
xor    %eax,%eax
cmp    $0x30,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isodigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 55
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isodigit(i32 %0) {
%2 = and i32 %0, -8
%3 = icmp eq i32 %2, 48
%4 = zext i1 %3 to i32
ret i32 %4
}
void insl(int port, void *addr, int cnt) {
  asm volatile("rep insl"
               : "=D"(addr), "=c"(cnt)
               : "d"(port), "0"(addr), "1"(cnt)
               : "memory", "cc");
}


x86 assembly (clang, -O0):
<insl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%ecx
rep insl (%dx),%es:(%rdi)
mov    %rdi,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<insl>:
mov    %edx,%ecx
mov    %edi,%edx
mov    %rsi,%rdi
rep insl (%dx),%es:(%rdi)
ret

LLVM IR (-O0):
define void @insl(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call { i8*, i32 } asm sideeffect "rep insl", "={di},={cx},{dx},0,1,~{memory},~{cc},~{dirflag},~{fpsr},~{flags}"(i32 %7, i8* %8, i32 %9)
%11 = extractvalue { i8*, i32 } %10, 0
%12 = extractvalue { i8*, i32 } %10, 1
store i8* %11, i8** %5
store i32 %12, i32* %6
ret void
}

LLVM IR (-O2):
define void @insl(i32 %0, i8* %1, i32 %2) {
%4 = tail call { i8*, i32 } asm sideeffect "rep insl", "={di},={cx},{dx},0,1,~{memory},~{cc},~{dirflag},~{fpsr},~{flags}"(i32 %0, i8* %1, i32 %2)
ret void
}
int inrsize(int size) { return size - 2; }


x86 assembly (clang, -O0):
<inrsize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inrsize>:
lea    -0x2(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @inrsize(i32 %0) {
%2 = add nsw i32 %0, -2
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_usage(void) {
  fprintf(stderr, "correctPesHeader <rec-file> [<rec-file> ...]\n");
  fprintf(stderr, "Example: correctPesHeader 001.vdr 002.vdr\n");
}


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

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeff(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [46 x i8] c"correctPesHeader <rec-file> [<rec-file> ...]\0A\00"
@.str.1 = [43 x i8] c"Example: correctPesHeader 001.vdr 002.vdr\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [46 x i8] c"correctPesHeader <rec-file> [<rec-file> ...]\0A\00"
@.str.1 = [43 x i8] c"Example: correctPesHeader 001.vdr 002.vdr\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct eapol_sm {
  int dummy;
};

/* Variables and functions */
int eapol_sm_get_mib(struct eapol_sm *sm, char *buf, size_t buflen) {
  return 0;
}


x86 assembly (clang, -O0):
<eapol_sm_get_mib>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.eapol_sm = type { i32 }
define i32 @eapol_sm_get_mib(%struct.eapol_sm* %0, i8* %1, i64 %2) {
%4 = alloca %struct.eapol_sm*
%5 = alloca i8*
%6 = alloca i64
store %struct.eapol_sm* %0, %struct.eapol_sm** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
ret i32 0
}

LLVM IR (-O2):
%struct.eapol_sm = type { i32 }
define i32 @eapol_sm_get_mib(%struct.eapol_sm* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
ret i32 0
}