xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, char *, char *,
                           char *, char *);
int /*<<< orphan*/ system(char *);
void make_plain_archive(char *user_name) {
  char make_tar_and_zip[200];
  sprintf(make_tar_and_zip,
          "tar -c %s > %s.tar; rm -Rf %s; zip %s.zip %s.tar; rm -f %s.tar",
          user_name, user_name, user_name, user_name, user_name, user_name);
  system(make_tar_and_zip);
}


x86 assembly (clang, -O0):
<make_plain_archive>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xd0(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    -0x8(%rbp),%r8
mov    -0x8(%rbp),%r9
mov    -0x8(%rbp),%r10
mov    -0x8(%rbp),%rax
lea    0xeab(%rip),%rsi
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1040 <sprintf@plt>
lea    -0xd0(%rbp),%rdi
call   1030 <system@plt>
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_plain_archive>:
push   %rbx
sub    $0xd0,%rsp
mov    %rdi,%rcx
lea    0xece(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %rcx,%rdx
mov    %rcx,%r8
mov    %rcx,%r9
push   %rcx
push   %rcx
call   1040 <sprintf@plt>
add    $0x10,%rsp
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0xd0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [63 x i8] c"tar -c %s > %s.tar; rm -Rf %s; zip %s.zip %s.tar; rm -f %s.tar\00"
define void @make_plain_archive(i8* %0) {
%2 = alloca i8*
%3 = alloca [200 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = load i8*, i8** %2
%7 = load i8*, i8** %2
%8 = load i8*, i8** %2
%9 = load i8*, i8** %2
%10 = load i8*, i8** %2
%11 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6, i8* %7, i8* %8, i8* %9, i8* %10)
%12 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%13 = call i32 @system(i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [63 x i8] c"tar -c %s > %s.tar; rm -Rf %s; zip %s.zip %s.tar; rm -f %s.tar\00"
define void @make_plain_archive(i8* %0) {
%2 = alloca [200 x i8]
%3 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0, i8* %0, i8* %0, i8* %0, i8* %0)
%5 = call i32 @system(i8* %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fwrite(void *, int, int, int /*<<< orphan*/ *);
void StoreFile(char *name, void *buf, int sz) {
  FILE *fd;
  fd = fopen(name, "wb");
  if (!fd)
    return;
  fwrite(buf, 1, sz, fd);
  fclose(fd);
}


x86 assembly (clang, -O0):
<StoreFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1167 <StoreFile+0x37>
jmp    1185 <StoreFile+0x55>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    $0x1,%esi
call   1050 <fwrite@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StoreFile>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
lea    0xebf(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     116d <StoreFile+0x3d>
mov    %rax,%rbp
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %r14d,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbp,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fclose@plt>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"wb\00"
define void @StoreFile(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 = call i32* @fopen(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %9, i32** %7
%10 = load i32*, i32** %7
%11 = icmp ne i32* %10, null
br i1 %11, label %13, label %12
12: ; preds = %3
br label %20
13: ; preds = %3
%14 = load i8*, i8** %5
%15 = load i32, i32* %6
%16 = load i32*, i32** %7
%17 = call i32 @fwrite(i8* %14, i32 1, i32 %15, i32* %16)
%18 = load i32*, i32** %7
%19 = call i32 @fclose(i32* %18)
br label %20
20: ; preds = %13, %12
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"wb\00"
define void @StoreFile(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32* %4, null
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i32 @fwrite(i8* %1, i32 1, i32 %2, i32* %4)
%8 = tail call i32 @fclose(i32* %4)
br label %9
9: ; preds = %3, %6
ret void
}
double neg(z)
double z;
{ return (-z); }


x86 assembly (clang, -O0):
<neg>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<neg>:
xorps  0xef9(%rip),%xmm0
ret

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

LLVM IR (-O2):
define double @neg(double %0) {
%2 = fneg double %0
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int pipe(int *);
void safe_pipe(int fildes[2]) {
  if (pipe(fildes) == -1) {
    perror("safe_pipe - Failed to open pipe");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<safe_pipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pipe@plt>
cmp    $0xffffffff,%eax
jne    1168 <safe_pipe+0x38>
lea    0xeab(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_pipe>:
push   %rax
call   1030 <pipe@plt>
cmp    $0xffffffff,%eax
je     113d <safe_pipe+0xd>
pop    %rax
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"safe_pipe - Failed to open pipe\00"
@EXIT_FAILURE = global i32 0
define void @safe_pipe(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @pipe(i32* %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = call i32 @perror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"safe_pipe - Failed to open pipe\00"
@EXIT_FAILURE = global i32 0
define void @safe_pipe(i32* %0) {
%2 = tail call i32 @pipe(i32* %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret void
}
/* Variables and functions */
int rest_digits(char *);
int rest_pmdigits(char *s) {
  int i;
  i = 0;
  if (s[i] == '+' || s[i] == '-')
    i++;
  return (rest_digits(&s[i]));
}


x86 assembly (clang, -O0):
<rest_pmdigits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2b,%eax
je     114d <rest_pmdigits+0x3d>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2d,%eax
jne    1156 <rest_pmdigits+0x46>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
add    %rax,%rdi
call   1030 <rest_digits@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rest_pmdigits>:
mov    (%rdi),%al
add    $0xd5,%al
and    $0xfd,%al
cmp    $0x1,%al
adc    $0x0,%rdi
jmp    1030 <rest_digits@plt>

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

LLVM IR (-O2):
define i32 @rest_pmdigits(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 43
%4 = icmp eq i8 %2, 45
%5 = or i1 %3, %4
%6 = zext i1 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = tail call i32 @rest_digits(i8* %7)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printsh(char name[], signed long min, unsigned long max) {
  printf("\t%s:\n", name);
  printf("\t\tSigned minimum = %ld\n", min);
  printf("\t\tUnsigned maximum = %lu\n", max);
}


x86 assembly (clang, -O0):
<printsh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printsh>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0xedc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"\09%s:\0A\00"
@.str.1 = [24 x i8] c"\09\09Signed minimum = %ld\0A\00"
@.str.2 = [26 x i8] c"\09\09Unsigned maximum = %lu\0A\00"
define void @printsh(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i64, i64* %5
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i64 %9)
%11 = load i64, i64* %6
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i64 %11)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\09%s:\0A\00"
@.str.1 = [24 x i8] c"\09\09Signed minimum = %ld\0A\00"
@.str.2 = [26 x i8] c"\09\09Unsigned maximum = %lu\0A\00"
define void @printsh(i8* %0, i64 %1, i64 %2) {
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i64 %1)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i64 %2)
ret void
}
/* Variables and functions */
double exp(double);
double Es(double tempc) {
  double Es = 6.1078 * exp((17.27 * tempc) / (237.3 + tempc));
  return Es;
}


x86 assembly (clang, -O0):
<Es>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeeb(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
addsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  0xeb5(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Es>:
push   %rax
movsd  0xee7(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xee3(%rip),%xmm0
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <exp@plt>
mulsd  0xed6(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @Es(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fmul double 1.727000e+01, %4
%6 = load double, double* %2
%7 = fadd double 2.373000e+02, %6
%8 = fdiv double %5, %7
%9 = call double @exp(double %8)
%10 = fmul double 6.107800e+00, %9
store double %10, double* %3
%11 = load double, double* %3
ret double %11
}

LLVM IR (-O2):
define double @Es(double %0) {
%2 = fmul double %0, 1.727000e+01
%3 = fadd double %0, 2.373000e+02
%4 = fdiv double %2, %3
%5 = tail call double @exp(double %4)
%6 = fmul double %5, 6.107800e+00
ret double %6
}
int get_middle_pivot(int low, int high) { return (low + high) / 2; }


x86 assembly (clang, -O0):
<get_middle_pivot>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_middle_pivot>:
lea    (%rdi,%rsi,1),%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @get_middle_pivot(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
%8 = sdiv i32 %7, 2
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_middle_pivot(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = sdiv i32 %3, 2
ret i32 %4
}
/* Variables and functions */
void *malloc(size_t);
void *yajl_internal_malloc(void *ctx, size_t sz) { return malloc(sz); }


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

x86 assembly (clang, -O2):
<yajl_internal_malloc>:
mov    %rsi,%rdi
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @yajl_internal_malloc(i8* nocapture readnone %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
ret i8* %3
}
/* Variables and functions */
double funcAngCor_alpha0_2plus_0plus_11520_L2(double *, double *);
double sin(double);
double fitAngDist_alpha0_2plus_0plus_11520_L2(double *x, double *par) {
  double result;
  result = funcAngCor_alpha0_2plus_0plus_11520_L2(x, &par[0]) *
           sin(x[0] * 0.0174533);
  return result;
}


x86 assembly (clang, -O0):
<fitAngDist_alpha0_2plus_0plus_11520_L2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <funcAngCor_alpha0_2plus_0plus_11520_L2@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xeb2(%rip),%xmm0
mulsd  (%rax),%xmm0
call   1040 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fitAngDist_alpha0_2plus_0plus_11520_L2>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1030 <funcAngCor_alpha0_2plus_0plus_11520_L2@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rbx),%xmm0
mulsd  0xec1(%rip),%xmm0
call   1040 <sin@plt>
mulsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @fitAngDist_alpha0_2plus_0plus_11520_L2(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %3
%7 = load double*, double** %4
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = call double @funcAngCor_alpha0_2plus_0plus_11520_L2(double* %6, double* %8)
%10 = load double*, double** %3
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = fmul double %12, 1.745330e-02
%14 = call double @sin(double %13)
%15 = fmul double %9, %14
store double %15, double* %5
%16 = load double, double* %5
ret double %16
}

LLVM IR (-O2):
define double @fitAngDist_alpha0_2plus_0plus_11520_L2(double* %0, double* %1) {
%3 = tail call double @funcAngCor_alpha0_2plus_0plus_11520_L2(double* %0, double* %1)
%4 = load double, double* %0
%5 = fmul double %4, 1.745330e-02
%6 = tail call double @sin(double %5)
%7 = fmul double %3, %6
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ b(int);
int main() {
  int a;
  b(a + 2);
  return a;
}


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <b@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @b(i32 undef)
ret i32 undef
}
void smacUartDebug_event(char byte) {}


x86 assembly (clang, -O0):
<smacUartDebug_event>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @smacUartDebug_event(i8 signext %0) {
ret void
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
pid_t waitpid(pid_t pid, int *status, int options) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<waitpid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ed3(%rip),%rax
mov    (%rax),%ecx
mov    0x2eba(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitpid>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @waitpid(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32, i32* @ENOSYS
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @waitpid(i32 %0, i32* nocapture readnone %1, i32 %2) {
%4 = load i32, i32* @ENOSYS
store i32 %4, i32* @errno
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/
nnb_upsample_n_convert_10bit_y_uv_vectors_to_8bit_rgb_vectors_bt601_sse2_ssse3(
    int /*<<< orphan*/ *, int /*<<< orphan*/ *);
extern void
nnb_upsample_n_convert_10bit_y_uv_vectors_to_8bit_rgb_vectors_bt601_sse2_ssse3_sse41(
    __m128i *in, __m128i *out) {
  nnb_upsample_n_convert_10bit_y_uv_vectors_to_8bit_rgb_vectors_bt601_sse2_ssse3(
      in, out);
}


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

x86 assembly (clang, -O2):
<nnb_upsample_n_convert_10bit_y_uv_vectors_to_8bit_rgb_vectors_bt601_sse2_ssse3_sse41>:
jmp    1030 <nnb_upsample_n_convert_10bit_y_uv_vectors_to_8bit_rgb_vectors_bt601_sse2_ssse3@plt>

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

LLVM IR (-O2):
define void @nnb_upsample_n_convert_10bit_y_uv_vectors_to_8bit_rgb_vectors_bt601_sse2_ssse3_sse41(i32* %0, i32* %1) {
%3 = tail call i32 @nnb_upsample_n_convert_10bit_y_uv_vectors_to_8bit_rgb_vectors_bt601_sse2_ssse3(i32* %0, i32* %1)
ret void
}
float glmDeterminant2f(const float m[4]) { return m[0] * m[3] - m[2] * m[1]; }


x86 assembly (clang, -O0):
<glmDeterminant2f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  0xc(%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
mulss  0x4(%rax),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmDeterminant2f>:
movss  0x4(%rdi),%xmm1
mulss  0x8(%rdi),%xmm1
movss  (%rdi),%xmm0
mulss  0xc(%rdi),%xmm0
subss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @glmDeterminant2f(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
%5 = load float, float* %4
%6 = load float*, float** %2
%7 = getelementptr inbounds float, float* %6, i64 3
%8 = load float, float* %7
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 2
%11 = load float, float* %10
%12 = load float*, float** %2
%13 = getelementptr inbounds float, float* %12, i64 1
%14 = load float, float* %13
%15 = fmul float %11, %14
%16 = fneg float %15
%17 = call float @llvm.fmuladd.f32(float %5, float %8, float %16)
ret float %17
}

LLVM IR (-O2):
define float @glmDeterminant2f(float* nocapture %0) {
%2 = load float, float* %0
%3 = getelementptr inbounds float, float* %0, i64 3
%4 = load float, float* %3
%5 = getelementptr inbounds float, float* %0, i64 2
%6 = load float, float* %5
%7 = getelementptr inbounds float, float* %0, i64 1
%8 = load float, float* %7
%9 = fneg float %6
%10 = fmul float %8, %9
%11 = tail call float @llvm.fmuladd.f32(float %2, float %4, float %10)
ret float %11
}
/* Variables and functions */
int /*<<< orphan*/ make(int ***, int **);
void modU(void *a) {
  int *pa;
  int **p1;
  int *p2;
  pa = a;
  make(&p1, &p2);
  (*p1) = pa;
  (*p2)++;
  return;
}


x86 assembly (clang, -O0):
<modU>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <make@plt>
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modU>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <make@plt>
mov    0x8(%rsp),%rax
mov    %rbx,(%rax)
mov    (%rsp),%rax
addl   $0x1,(%rax)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @modU(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i32**
%5 = alloca i32*
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %3
%8 = call i32 @make(i32*** %4, i32** %5)
%9 = load i32*, i32** %3
%10 = load i32**, i32*** %4
store i32* %9, i32** %10
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = add nsw i32 %12, 1
store i32 %13, i32* %11
ret void
}

LLVM IR (-O2):
define void @modU(i8* %0) {
%2 = alloca i32**
%3 = alloca i32*
%4 = bitcast i32*** %2 to i8*
%5 = bitcast i32** %3 to i8*
%6 = call i32 @make(i32*** %2, i32** %3)
%7 = bitcast i32*** %2 to i8***
%8 = load i8**, i8*** %7
store i8* %0, i8** %8
%9 = load i32*, i32** %3
%10 = load i32, i32* %9
%11 = add nsw i32 %10, 1
store i32 %11, i32* %9
ret void
}
void GLUE_SET_PX_FROM_WTP(void *b, int wv) {
  *(unsigned int *)b = 0xe1a00005 + (wv << 12);
}


x86 assembly (clang, -O0):
<GLUE_SET_PX_FROM_WTP>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
shl    $0xc,%ecx
add    $0xe1a00005,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @GLUE_SET_PX_FROM_WTP(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 = shl i32 %5, 12
%7 = add i32 -509607931, %6
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i32*
store i32 %7, i32* %9
ret void
}

LLVM IR (-O2):
define void @GLUE_SET_PX_FROM_WTP(i8* nocapture writeonly %0, i32 %1) {
%3 = shl i32 %1, 12
%4 = add i32 %3, -509607931
%5 = bitcast i8* %0 to i32*
store i32 %4, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
int triad(int len, double xx, double *a, double *b, double *c) {
  int i, bytes = 16;
  memcpy((void *)b, (void *)a, len * sizeof(double));
  return bytes;
}


x86 assembly (clang, -O0):
<triad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movl   $0x10,-0x30(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
mov    -0x30(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<triad>:
push   %rax
mov    %rdx,%rax
lea    0x0(,%rdi,8),%edx
mov    %rax,%rdi
call   1030 <memcpy@plt>
mov    $0x10,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @triad(i32 %0, double %1, double* %2, double* %3, double* %4) {
%6 = alloca i32
%7 = alloca double
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %6
store double %1, double* %7
store double* %2, double** %8
store double* %3, double** %9
store double* %4, double** %10
store i32 16, i32* %12
%13 = load double*, double** %9
%14 = bitcast double* %13 to i8*
%15 = load double*, double** %8
%16 = bitcast double* %15 to i8*
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = mul i64 %18, 8
%20 = trunc i64 %19 to i32
%21 = call i32 @memcpy(i8* %14, i8* %16, i32 %20)
%22 = load i32, i32* %12
ret i32 %22
}

LLVM IR (-O2):
define i32 @triad(i32 %0, double %1, double* %2, double* %3, double* nocapture readnone %4) {
%6 = bitcast double* %3 to i8*
%7 = bitcast double* %2 to i8*
%8 = shl i32 %0, 3
%9 = tail call i32 @memcpy(i8* %6, i8* %7, i32 %8)
ret i32 16
}
/* Variables and functions */
int mixer_get(int);
int mixer_get_left(int i) { return mixer_get(i) >> 8; }


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

x86 assembly (clang, -O2):
<mixer_get_left>:
push   %rax
call   1030 <mixer_get@plt>
sar    $0x8,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mixer_get_left(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @mixer_get(i32 %3)
%5 = ashr i32 %4, 8
ret i32 %5
}

LLVM IR (-O2):
define i32 @mixer_get_left(i32 %0) {
%2 = tail call i32 @mixer_get(i32 %0)
%3 = ashr i32 %2, 8
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(unsigned char *, int, int, int /*<<< orphan*/ *);
void write_int16(FILE *out, signed short value) {
  unsigned char buffer[2];
  buffer[0] = (unsigned char)((value >> 8) & 0xFF);
  buffer[1] = (unsigned char)(value & 0xFF);
  fwrite(buffer, 1, 2, out);
}


x86 assembly (clang, -O0):
<write_int16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movswl -0xa(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,-0xc(%rbp)
movswl -0xa(%rbp),%eax
and    $0xff,%eax
mov    %al,-0xb(%rbp)
lea    -0xc(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_int16>:
push   %rax
mov    %rdi,%rcx
rol    $0x8,%si
mov    %si,0x6(%rsp)
lea    0x6(%rsp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <fwrite@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @write_int16(i32* %0, i16 signext %1) {
%3 = alloca i32*
%4 = alloca i16
%5 = alloca [2 x i8]
store i32* %0, i32** %3
store i16 %1, i16* %4
%6 = load i16, i16* %4
%7 = sext i16 %6 to i32
%8 = ashr i32 %7, 8
%9 = and i32 %8, 255
%10 = trunc i32 %9 to i8
%11 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
store i8 %10, i8* %11
%12 = load i16, i16* %4
%13 = sext i16 %12 to i32
%14 = and i32 %13, 255
%15 = trunc i32 %14 to i8
%16 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 1
store i8 %15, i8* %16
%17 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%18 = load i32*, i32** %3
%19 = call i32 @fwrite(i8* %17, i32 1, i32 2, i32* %18)
ret void
}

LLVM IR (-O2):
define void @write_int16(i32* nocapture %0, i16 signext %1) {
%3 = alloca [2 x i8]
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%5 = lshr i16 %1, 8
%6 = trunc i16 %5 to i8
store i8 %6, i8* %4
%7 = trunc i16 %1 to i8
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 %7, i8* %8
%9 = call i32 @fwrite(i8* %4, i32 1, i32 2, i32* %0)
ret void
}
/* Type definitions */
typedef char uint8_t;
struct umqtt_connection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void message_callback(struct umqtt_connection *uc, char *topic, uint8_t *data,
                      int len) {
  printf("%s %s\n", topic, data);
}


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

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

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

LLVM IR (-O2):
%struct.umqtt_connection = type { i32 }
@.str = [7 x i8] c"%s %s\0A\00"
define void @message_callback(%struct.umqtt_connection* nocapture readnone %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
ret void
}
void nc_error(char *where) {}


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

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

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

LLVM IR (-O2):
define void @nc_error(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void va_overload3(int p1, int p2, int p3) {
  printf("va_overload3 %d %d %d\n", p1, p2, p3);
}


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

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

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

LLVM IR (-O2):
@.str = [23 x i8] c"va_overload3 %d %d %d\0A\00"
define void @va_overload3(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ write(int, char *, int);
void close_watchdog(int fd) {
  write(fd, "V", 1);
  close(fd);
}


x86 assembly (clang, -O0):
<close_watchdog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xecb(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_watchdog>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <close@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"V\00"
define void @close_watchdog(i32 %0) {
%2 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = tail call i32 @close(i32 %0)
ret void
}
void exit(int n) {
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <exit+0x7>

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

LLVM IR (-O0):
define void @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
br label %3
}

LLVM IR (-O2):
define void @exit(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_error();
int id(int);
int main(void) {
  int input = 10;
  int result = id(input);
  if (result == 10) {
  ERROR:
    __VERIFIER_error();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <id@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jne    1157 <main+0x37>
jmp    1150 <main+0x30>
mov    $0x0,%al
call   1030 <__VERIFIER_error@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1040 <id@plt>
cmp    $0xa,%eax
jne    1137 <main+0x17>
xor    %eax,%eax
call   1030 <__VERIFIER_error@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @id(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 10
br i1 %7, label %8, label %11
8: ; preds = %0
br label %9
9: ; preds = %8
%10 = call i32 (...) @__VERIFIER_error()
br label %11
11: ; preds = %9, %0
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @id(i32 10)
%2 = icmp eq i32 %1, 10
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @__VERIFIER_error()
br label %5
5: ; preds = %3, %0
ret i32 0
}
unsigned int rgb_to_pixel32bgr(unsigned int r, unsigned int g, unsigned int b) {
  return (b << 16) | (g << 8) | r;
}


x86 assembly (clang, -O0):
<rgb_to_pixel32bgr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x10,%eax
mov    -0x8(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
or     -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgb_to_pixel32bgr>:
mov    %esi,%eax
shl    $0x10,%edx
shl    $0x8,%eax
or     %edi,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @rgb_to_pixel32bgr(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = shl i32 %7, 16
%9 = load i32, i32* %5
%10 = shl i32 %9, 8
%11 = or i32 %8, %10
%12 = load i32, i32* %4
%13 = or i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @rgb_to_pixel32bgr(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %2, 16
%5 = shl i32 %1, 8
%6 = or i32 %5, %0
%7 = or i32 %6, %4
ret i32 %7
}
void gf8mul_00000000(void) {
  __asm__ __volatile__("\tpxor    %xmm0, %xmm0\n"
                       "\tpxor    %xmm1, %xmm1\n"
                       "\tpxor    %xmm2, %xmm2\n"
                       "\tpxor    %xmm3, %xmm3\n"
                       "\tpxor    %xmm4, %xmm4\n"
                       "\tpxor    %xmm5, %xmm5\n"
                       "\tpxor    %xmm6, %xmm6\n"
                       "\tpxor    %xmm7, %xmm7\n");
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
pxor   %xmm0,%xmm0
pxor   %xmm1,%xmm1
pxor   %xmm2,%xmm2
pxor   %xmm3,%xmm3
pxor   %xmm4,%xmm4
pxor   %xmm5,%xmm5
pxor   %xmm6,%xmm6
pxor   %xmm7,%xmm7
pop    %rbp
ret

x86 assembly (clang, -O2):
pxor   %xmm0,%xmm0
pxor   %xmm1,%xmm1
pxor   %xmm2,%xmm2
pxor   %xmm3,%xmm3
pxor   %xmm4,%xmm4
pxor   %xmm5,%xmm5
pxor   %xmm6,%xmm6
pxor   %xmm7,%xmm7
ret

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

LLVM IR (-O2):
define void @gf8mul_00000000() {
tail call void asm sideeffect "\09pxor %xmm0, %xmm0\0A\09pxor %xmm1, %xmm1\0A\09pxor %xmm2, %xmm2\0A\09pxor %xmm3, %xmm3\0A\09pxor %xmm4, %xmm4\0A\09pxor %xmm5, %xmm5\0A\09pxor %xmm6, %xmm6\0A\09pxor %xmm7, %xmm7\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
char chomp_at(char *str, int position) {
  if (str[position] == '\n' || str[position] == '\r') {
    char new_line = str[position];
    str[position] = '\0';
    return new_line;
  } else {
    return '\0';
  }
}


x86 assembly (clang, -O0):
<chomp_at>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
je     1135 <chomp_at+0x35>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xd,%eax
jne    115a <chomp_at+0x5a>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x15(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x15(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    115e <chomp_at+0x5e>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chomp_at>:
movslq %esi,%rcx
mov    (%rdi,%rcx,1),%al
cmp    $0xd,%al
je     110e <chomp_at+0xe>
cmp    $0xa,%al
jne    1113 <chomp_at+0x13>
movb   $0x0,(%rdi,%rcx,1)
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define signext i8 @chomp_at(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %7 [
i8 10, label %6
i8 13, label %6
]
6: ; preds = %2, %2
store i8 0, i8* %4
br label %7
7: ; preds = %2, %6
%8 = phi i8 [ %5, %6 ], [ 0, %2 ]
ret i8 %8
}
/* Variables and functions */
int /*<<< orphan*/ my_strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
int my_putstr(char *str) {
  if (str == NULL)
    return (0);
  write(1, str, my_strlen(str));
  return (0);
}


x86 assembly (clang, -O0):
<my_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1143 <my_putstr+0x23>
movl   $0x0,-0x4(%rbp)
jmp    116b <my_putstr+0x4b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <my_strlen@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1040 <write@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_putstr>:
test   %rdi,%rdi
je     113e <my_putstr+0x1e>
push   %rbx
mov    %rdi,%rbx
call   1030 <my_strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <write@plt>
pop    %rbx
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @my_putstr(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %12
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = load i8*, i8** %3
%10 = call i32 @my_strlen(i8* %9)
%11 = call i32 @write(i32 1, i8* %8, i32 %10)
store i32 0, i32* %2
br label %12
12: ; preds = %7, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @my_putstr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @my_strlen(i8* %0)
%5 = tail call i32 @write(i32 1, i8* %0, i32 %4)
br label %6
6: ; preds = %1, %3
ret i32 0
}
void GotoSquare(x, y) int x, y;
{ move(19 + 2 - y, 1 + x * 2); }


x86 assembly (clang, -O0):
<GotoSquare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x15,%edi
sub    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
shl    $0x1,%esi
add    $0x1,%esi
mov    $0x0,%al
call   1030 <move@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GotoSquare>:
mov    $0x15,%eax
sub    %esi,%eax
lea    (%rdi,%rdi,1),%esi
add    $0x1,%esi
mov    %eax,%edi
xor    %eax,%eax
jmp    1030 <move@plt>

LLVM IR (-O0):
define void @GotoSquare(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sub nsw i32 21, %5
%7 = load i32, i32* %3
%8 = mul nsw i32 %7, 2
%9 = add nsw i32 1, %8
%10 = call i32 (i32, i32, ...) bitcast (i32 (...)* @move to i32 (i32, i32, ...)*)(i32 %6, i32 %9)
ret void
}

LLVM IR (-O2):
define void @GotoSquare(i32 %0, i32 %1) {
%3 = sub nsw i32 21, %1
%4 = shl nsw i32 %0, 1
%5 = or i32 %4, 1
%6 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @move to i32 (i32, i32, ...)*)(i32 %3, i32 %5)
ret void
}
int fun385() { return 385; }


x86 assembly (clang, -O0):
<fun385>:
push   %rbp
mov    %rsp,%rbp
mov    $0x181,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fun385() {
ret i32 385
}

LLVM IR (-O2):
define i32 @fun385() {
ret i32 385
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ test(int /*<<< orphan*/);
void test_command(uint32_t cluster) { test(cluster); }


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

x86 assembly (clang, -O2):
<test_command>:
jmp    1030 <test@plt>

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

LLVM IR (-O2):
define void @test_command(i32 %0) {
%2 = tail call i32 @test(i32 %0)
ret void
}
int mkstemp(as)
char *as;
{
  int fd;
  return (_gettemp(as, &fd) ? fd : -1);
}


x86 assembly (clang, -O0):
<mkstemp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1030 <_gettemp@plt>
cmp    $0x0,%eax
je     113f <mkstemp+0x2f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    114c <mkstemp+0x3c>
mov    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    114c <mkstemp+0x3c>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkstemp>:
push   %rax
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1030 <_gettemp@plt>
cmp    $0x1,%eax
sbb    %eax,%eax
or     0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mkstemp(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 (i8*, i32*, ...) bitcast (i32 (...)* @_gettemp to i32 (i8*, i32*, ...)*)(i8* %4, i32* %3)
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i32, i32* %3
br label %10
9: ; preds = %1
br label %10
10: ; preds = %9, %7
%11 = phi i32 [ %8, %7 ], [ -1, %9 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @mkstemp(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 (i8*, i32*, ...) bitcast (i32 (...)* @_gettemp to i32 (i8*, i32*, ...)*)(i8* %0, i32* %2)
%5 = icmp eq i32 %4, 0
%6 = load i32, i32* %2
%7 = select i1 %5, i32 -1, i32 %6
ret i32 %7
}
/* Type definitions */
struct hc {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ hc_free(struct hc *);
void hfs_do_chunked_close(struct hc *hc) { hc_free(hc); }


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

x86 assembly (clang, -O2):
<hfs_do_chunked_close>:
jmp    1030 <hc_free@plt>

LLVM IR (-O0):
%struct.hc = type { i32 }
define void @hfs_do_chunked_close(%struct.hc* %0) {
%2 = alloca %struct.hc*
store %struct.hc* %0, %struct.hc** %2
%3 = load %struct.hc*, %struct.hc** %2
%4 = call i32 @hc_free(%struct.hc* %3)
ret void
}

LLVM IR (-O2):
%struct.hc = type { i32 }
define void @hfs_do_chunked_close(%struct.hc* %0) {
%2 = tail call i32 @hc_free(%struct.hc* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
unsigned char *sha1_file(unsigned char *, int /*<<< orphan*/ *);
unsigned char *hash_file_sha1(unsigned char *out, FILE *fp) {
  return sha1_file(out, fp);
}


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

x86 assembly (clang, -O2):
<hash_file_sha1>:
jmp    1030 <sha1_file@plt>

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

LLVM IR (-O2):
define i8* @hash_file_sha1(i8* %0, i32* %1) {
%3 = tail call i8* @sha1_file(i8* %0, i32* %1)
ret i8* %3
}