xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ GLfloat;
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
int /*<<< orphan*/ glPixelStoref(int /*<<< orphan*/, int /*<<< orphan*/);
void PixelStoref(GLenum pname, GLfloat param) { glPixelStoref(pname, param); }


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

x86 assembly (clang, -O2):
<PixelStoref>:
jmp    1030 <glPixelStoref@plt>

LLVM IR (-O0):
define void @PixelStoref(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 @glPixelStoref(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @PixelStoref(i32 %0, i32 %1) {
%3 = tail call i32 @glPixelStoref(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LOG_NOTICE;
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, char const *);
void logArgumentReSetIgnored(const char *argument) {
  syslog(LOG_NOTICE,
         "There was an attempt to set the command-line argument \"%s\" more "
         "than once. The new value has been ignored.",
         argument);
}


x86 assembly (clang, -O0):
<logArgumentReSetIgnored>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <syslog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logArgumentReSetIgnored>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <syslog@plt>

LLVM IR (-O0):
@LOG_NOTICE = global i32 0
@.str = [107 x i8] c"There was an attempt to set the command-line argument \22%s\22 more than once. The new value has been ignored.\00"
define void @logArgumentReSetIgnored(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @LOG_NOTICE
%4 = load i8*, i8** %2
%5 = call i32 @syslog(i32 %3, i8* getelementptr inbounds ([107 x i8], [107 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@LOG_NOTICE = global i32 0
@.str = [107 x i8] c"There was an attempt to set the command-line argument \22%s\22 more than once. The new value has been ignored.\00"
define void @logArgumentReSetIgnored(i8* %0) {
%2 = load i32, i32* @LOG_NOTICE
%3 = tail call i32 @syslog(i32 %2, i8* getelementptr inbounds ([107 x i8], [107 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
long proc8(long p1, int p2, short p3, char p4, long *p5, long p6, long p7,
           long p8) {
  *p5 = p1 + p2 + p3 - p4;
  return *p5 + p6 + p7 * p8;
}


x86 assembly (clang, -O0):
<proc8>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %dx,%cx
mov    0x18(%rbp),%rdx
mov    0x10(%rbp),%rdx
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %cx,-0xe(%rbp)
mov    %al,-0xf(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rax
add    %rax,%rcx
movswq -0xe(%rbp),%rax
add    %rax,%rcx
movsbq -0xf(%rbp),%rax
sub    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
add    -0x20(%rbp),%rax
mov    0x10(%rbp),%rcx
imul   0x18(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<proc8>:
mov    0x10(%rsp),%rax
movslq %esi,%rsi
add    %rdi,%rsi
movslq %edx,%rdx
add    %rsi,%rdx
movslq %ecx,%rcx
sub    %rcx,%rdx
mov    %rdx,(%r8)
add    %r9,%rdx
imul   0x8(%rsp),%rax
add    %rdx,%rax
ret

LLVM IR (-O0):
define i64 @proc8(i64 %0, i32 %1, i16 signext %2, i8 signext %3, i64* %4, i64 %5, i64 %6, i64 %7) {
%9 = alloca i64
%10 = alloca i32
%11 = alloca i16
%12 = alloca i8
%13 = alloca i64*
%14 = alloca i64
%15 = alloca i64
%16 = alloca i64
store i64 %0, i64* %9
store i32 %1, i32* %10
store i16 %2, i16* %11
store i8 %3, i8* %12
store i64* %4, i64** %13
store i64 %5, i64* %14
store i64 %6, i64* %15
store i64 %7, i64* %16
%17 = load i64, i64* %9
%18 = load i32, i32* %10
%19 = sext i32 %18 to i64
%20 = add nsw i64 %17, %19
%21 = load i16, i16* %11
%22 = sext i16 %21 to i64
%23 = add nsw i64 %20, %22
%24 = load i8, i8* %12
%25 = sext i8 %24 to i64
%26 = sub nsw i64 %23, %25
%27 = load i64*, i64** %13
store i64 %26, i64* %27
%28 = load i64*, i64** %13
%29 = load i64, i64* %28
%30 = load i64, i64* %14
%31 = add nsw i64 %29, %30
%32 = load i64, i64* %15
%33 = load i64, i64* %16
%34 = mul nsw i64 %32, %33
%35 = add nsw i64 %31, %34
ret i64 %35
}

LLVM IR (-O2):
define i64 @proc8(i64 %0, i32 %1, i16 signext %2, i8 signext %3, i64* nocapture writeonly %4, i64 %5, i64 %6, i64 %7) {
%9 = sext i32 %1 to i64
%10 = add nsw i64 %9, %0
%11 = sext i16 %2 to i64
%12 = add nsw i64 %10, %11
%13 = sext i8 %3 to i64
%14 = sub i64 %12, %13
store i64 %14, i64* %4
%15 = add nsw i64 %14, %5
%16 = mul nsw i64 %7, %6
%17 = add nsw i64 %15, %16
ret i64 %17
}
/* Type definitions */
typedef int socklen_t;
typedef int /*<<< orphan*/ bufsize;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_SNDBUF;
int /*<<< orphan*/ getsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/,
                              int *, int *);
int /*<<< orphan*/ rs_debug(char *, int, int);
void printsndbuf(int fd) {
  int bufsize;
  socklen_t solen = sizeof(bufsize);
  getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &bufsize, &solen);
  rs_debug("fd:%d socket snd bufsize %d\n", fd, bufsize);
}


x86 assembly (clang, -O0):
<printsndbuf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
mov    0x2e9b(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
lea    -0xc(%rbp),%r8
call   1030 <getsockopt@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe9f(%rip),%rdi
call   1040 <rs_debug@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printsndbuf>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movl   $0x4,0x8(%rsp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%esi
mov    0x2ea1(%rip),%rax
mov    (%rax),%edx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
call   1030 <getsockopt@plt>
mov    0xc(%rsp),%edx
lea    0xea5(%rip),%rdi
mov    %ebx,%esi
call   1040 <rs_debug@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_SNDBUF = global i32 0
@.str = [29 x i8] c"fd:%d socket snd bufsize %d\0A\00"
define void @printsndbuf(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 4, i32* %4
%5 = load i32, i32* %2
%6 = load i32, i32* @SOL_SOCKET
%7 = load i32, i32* @SO_SNDBUF
%8 = call i32 @getsockopt(i32 %5, i32 %6, i32 %7, i32* %3, i32* %4)
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = call i32 @rs_debug(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
ret void
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_SNDBUF = global i32 0
@.str = [29 x i8] c"fd:%d socket snd bufsize %d\0A\00"
define void @printsndbuf(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
store i32 4, i32* %3
%6 = load i32, i32* @SOL_SOCKET
%7 = load i32, i32* @SO_SNDBUF
%8 = call i32 @getsockopt(i32 %0, i32 %6, i32 %7, i32* %2, i32* %3)
%9 = load i32, i32* %2
%10 = call i32 @rs_debug(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %9)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int __sferror(int /*<<< orphan*/ *);
int ferror(FILE *fp) { return (__sferror(fp)); }


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

x86 assembly (clang, -O2):
<ferror>:
jmp    1030 <__sferror@plt>

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

LLVM IR (-O2):
define i32 @ferror(i32* %0) {
%2 = tail call i32 @__sferror(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Skipping test on non-mmu host!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"Skipping test on non-mmu host!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [31 x i8] c"Skipping test on non-mmu host!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int f3(int a) {
  int v1 = (a == 3);
  int v2 = (a == 1);
  return v1 || v2;
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
jne    113e <f3+0x3e>
cmpl   $0x0,-0xc(%rbp)
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
and    $0xfffffffd,%edi
xor    %eax,%eax
cmp    $0x1,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @f3(i32 %0) {
%2 = and i32 %0, -3
%3 = icmp eq i32 %2, 1
%4 = zext i1 %3 to i32
ret i32 %4
}
indreg0adrreg1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if ((*p0) <= (p1[1111111 / 4]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<indreg0adrreg1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x30(%rbp),%rax
movsd  0x21e888(%rax),%xmm0
ucomisd %xmm1,%xmm0
jb     1146 <indreg0adrreg1+0x46>
movl   $0x1,-0x4(%rbp)
jmp    114d <indreg0adrreg1+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<indreg0adrreg1>:
movsd  0x21e888(%rcx),%xmm0
xor    %eax,%eax
ucomisd (%rdx),%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @indreg0adrreg1(double %0, double %1, i32 %2, i32 %3, double* %4, double* %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
store double %0, double* %8
store double %1, double* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store double* %4, double** %12
store double* %5, double** %13
%14 = load double*, double** %12
%15 = load double, double* %14
%16 = load double*, double** %13
%17 = getelementptr inbounds double, double* %16, i64 277777
%18 = load double, double* %17
%19 = fcmp ole double %15, %18
br i1 %19, label %20, label %21
20: ; preds = %6
store i32 1, i32* %7
br label %22
21: ; preds = %6
store i32 0, i32* %7
br label %22
22: ; preds = %21, %20
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
define i32 @indreg0adrreg1(double %0, double %1, i32 %2, i32 %3, double* nocapture %4, double* nocapture %5) {
%7 = load double, double* %4
%8 = getelementptr inbounds double, double* %5, i64 277777
%9 = load double, double* %8
%10 = fcmp ole double %7, %9
%11 = zext i1 %10 to i32
ret i32 %11
}
int qsort_cmp__AHEAP_ID(const void *x, const void *y) {
  if (*((int *)x) > *((int *)y))
    return (-1);
  else
    return (*((int *)x) < *((int *)y));
}


x86 assembly (clang, -O0):
<qsort_cmp__AHEAP_ID>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jle    112a <qsort_cmp__AHEAP_ID+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1141 <qsort_cmp__AHEAP_ID+0x41>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsort_cmp__AHEAP_ID>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setl   %cl
mov    $0xffffffff,%eax
cmovle %ecx,%eax
ret

LLVM IR (-O0):
define i32 @qsort_cmp__AHEAP_ID(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
%12 = icmp sgt i32 %8, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 -1, i32* %3
br label %23
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = bitcast i8* %15 to i32*
%17 = load i32, i32* %16
%18 = load i8*, i8** %5
%19 = bitcast i8* %18 to i32*
%20 = load i32, i32* %19
%21 = icmp slt i32 %17, %20
%22 = zext i1 %21 to i32
store i32 %22, i32* %3
br label %23
23: ; preds = %14, %13
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @qsort_cmp__AHEAP_ID(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %4, %6
%8 = icmp slt i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
double floor(double);
double mods3600(double x) {
  double y;
  y = x - 1.296e6 * floor(x / 1.296e6);
  return y;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed4(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <floor@plt>
movsd  -0x18(%rbp),%xmm1
movsd  0xeb6(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
movsd  %xmm0,(%rsp)
divsd  0xee2(%rip),%xmm0
call   1030 <floor@plt>
mulsd  0xedd(%rip),%xmm0
addsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @mods3600(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = fdiv double %5, 1.296000e+06
%7 = call double @llvm.floor.f64(double %6)
%8 = call double @llvm.fmuladd.f64(double -1.296000e+06, double %7, double %4)
store double %8, double* %3
%9 = load double, double* %3
ret double %9
}

LLVM IR (-O2):
define double @mods3600(double %0) {
%2 = fdiv double %0, 1.296000e+06
%3 = tail call double @llvm.floor.f64(double %2)
%4 = tail call double @llvm.fmuladd.f64(double %3, double -1.296000e+06, double %0)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ ft_putendl_fd(char *, int);
void err_found(char *str) {
  ft_putendl_fd(str, 2);
  exit(3);
}


x86 assembly (clang, -O0):
<err_found>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
call   1040 <ft_putendl_fd@plt>
mov    $0x3,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<err_found>:
push   %rax
mov    $0x2,%esi
call   1040 <ft_putendl_fd@plt>
mov    $0x3,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @err_found(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @ft_putendl_fd(i8* %3, i32 2)
%5 = call i32 @exit(i32 3)
unreachable
}

LLVM IR (-O2):
define void @err_found(i8* %0) {
%2 = tail call i32 @ft_putendl_fd(i8* %0, i32 2)
%3 = tail call i32 @exit(i32 3)
unreachable
}
int main() {
  struct {
    int x;
  } *p = malloc(sizeof(*p));
  abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct.anon = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.anon*
store i32 0, i32* %1
%3 = call i8* @malloc(i64 4)
%4 = bitcast i8* %3 to %struct.anon*
store %struct.anon* %4, %struct.anon** %2
unreachable
}

LLVM IR (-O2):
define i32 @main() {
tail call void @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("/\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [2 x i8] c"/\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void uniphier_pxs2_sbc_init(void) {}


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

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

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

LLVM IR (-O2):
define void @uniphier_pxs2_sbc_init() {
ret void
}
/* Variables and functions */
int XTL_SubVars_GetValueInt(char *);
int XTL_SubVars_UpdateInt(char *, int);
int XTL_SubVars_DecrementValue(char *key) {
  int retval;
  retval = XTL_SubVars_GetValueInt(key);
  if (retval == -9999)
    return -1;
  --retval;
  return XTL_SubVars_UpdateInt(key, retval);
}


x86 assembly (clang, -O0):
<XTL_SubVars_DecrementValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <XTL_SubVars_GetValueInt@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffd8f1,-0x14(%rbp)
jne    1151 <XTL_SubVars_DecrementValue+0x31>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <XTL_SubVars_DecrementValue+0x49>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <XTL_SubVars_UpdateInt@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XTL_SubVars_DecrementValue>:
push   %rbx
mov    %rdi,%rbx
call   1040 <XTL_SubVars_GetValueInt@plt>
cmp    $0xffffd8f1,%eax
jne    1137 <XTL_SubVars_DecrementValue+0x17>
mov    $0xffffffff,%eax
pop    %rbx
ret
add    $0xffffffff,%eax
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <XTL_SubVars_UpdateInt@plt>

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

LLVM IR (-O2):
define i32 @XTL_SubVars_DecrementValue(i8* %0) {
%2 = tail call i32 @XTL_SubVars_GetValueInt(i8* %0)
%3 = icmp eq i32 %2, -9999
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = add nsw i32 %2, -1
%6 = tail call i32 @XTL_SubVars_UpdateInt(i8* %0, i32 %5)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ -1, %1 ]
ret i32 %8
}
/* Type definitions */
struct aeEventLoop {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int PrintTimer(struct aeEventLoop *eventLoop, long long id, void *clientData) {
  static int i = 0;
  printf("Test Output: %d\n", i++);
  return 10000;
}


x86 assembly (clang, -O0):
<PrintTimer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2f02(%rip),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,0x2ef7(%rip)
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2710,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintTimer>:
push   %rax
mov    0x2f15(%rip),%esi
lea    0x1(%rsi),%eax
mov    %eax,0x2f0c(%rip)
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2710,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.aeEventLoop = type { i32 }
@PrintTimer.i = internal global i32 0
@.str = [17 x i8] c"Test Output: %d\0A\00"
define i32 @PrintTimer(%struct.aeEventLoop* %0, i64 %1, i8* %2) {
%4 = alloca %struct.aeEventLoop*
%5 = alloca i64
%6 = alloca i8*
store %struct.aeEventLoop* %0, %struct.aeEventLoop** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load i32, i32* @PrintTimer.i
%8 = add nsw i32 %7, 1
store i32 %8, i32* @PrintTimer.i
%9 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 10000
}

LLVM IR (-O2):
%struct.aeEventLoop = type { i32 }
@PrintTimer.i = internal unnamed_addr global i32 0
@.str = [17 x i8] c"Test Output: %d\0A\00"
define i32 @PrintTimer(%struct.aeEventLoop* nocapture readnone %0, i64 %1, i8* nocapture readnone %2) {
%4 = load i32, i32* @PrintTimer.i
%5 = add nsw i32 %4, 1
store i32 %5, i32* @PrintTimer.i
%6 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 10000
}
void dummy_sysquotas_4A(void) {}


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

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

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

LLVM IR (-O2):
define void @dummy_sysquotas_4A() {
ret void
}
int mm_support() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @mm_support() {
ret i32 0
}
void foo076() {}


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

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

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

LLVM IR (-O2):
define void @foo076() {
ret void
}
void test68_Test_11_targetInit__I() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ BUG();
void prio_changed_stop(struct rq *rq, struct task_struct *p, int oldprio) {
  BUG();
}


x86 assembly (clang, -O0):
<prio_changed_stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x0,%al
call   1030 <BUG@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.rq = type { i32 }
%struct.task_struct = type { i32 }
define void @prio_changed_stop(%struct.rq* %0, %struct.task_struct* %1, i32 %2) {
%4 = alloca %struct.rq*
%5 = alloca %struct.task_struct*
%6 = alloca i32
store %struct.rq* %0, %struct.rq** %4
store %struct.task_struct* %1, %struct.task_struct** %5
store i32 %2, i32* %6
%7 = call i32 (...) @BUG()
ret void
}

LLVM IR (-O2):
%struct.rq = type { i32 }
%struct.task_struct = type { i32 }
define void @prio_changed_stop(%struct.rq* nocapture readnone %0, %struct.task_struct* nocapture readnone %1, i32 %2) {
%4 = tail call i32 (...) @BUG()
ret void
}
int find(void **keys, void *key, int size) {
  int i;
  for (i = 0; i < size; i++) {
    if (keys[i] == key) {
      return i;
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<find>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1156 <find+0x56>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
cmp    -0x18(%rbp),%rax
jne    1143 <find+0x43>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115d <find+0x5d>
jmp    1148 <find+0x48>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1116 <find+0x16>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find>:
mov    $0xffffffff,%eax
test   %edx,%edx
jle    111f <find+0x1f>
mov    %edx,%edx
xor    %ecx,%ecx
nopl   (%rax)
cmp    %rsi,(%rdi,%rcx,8)
je     1120 <find+0x20>
add    $0x1,%rcx
cmp    %rcx,%rdx
jne    1110 <find+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @find(i8** nocapture %0, i8* readnone %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i8*, i8** %0, i64 %8
%10 = load i8*, i8** %9
%11 = icmp eq i8* %10, %1
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
__typeof__(isalpha((void *)1)) test_isalpha_3(void) {
  return isalpha((void *)1);
}


x86 assembly (clang, -O0):
<test_isalpha_3>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
mov    %eax,%edi
call   1030 <isalpha@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_isalpha_3() {
%1 = call i32 @isalpha(i32 ptrtoint (i8* inttoptr (i64 1 to i8*) to i32))
ret i32 %1
}

LLVM IR (-O2):
define i32 @test_isalpha_3() {
%1 = tail call i32 @isalpha(i32 1)
ret i32 %1
}
/* Type definitions */
struct lfs2_config {
  int dummy;
};

/* Variables and functions */
int lfs2_testbd_rawsync(struct lfs2_config const *);
int lfs2_testbd_sync(const struct lfs2_config *cfg) {
  ;
  int err = lfs2_testbd_rawsync(cfg);
  ;
  return err;
}


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

x86 assembly (clang, -O2):
<lfs2_testbd_sync>:
jmp    1030 <lfs2_testbd_rawsync@plt>

LLVM IR (-O0):
%struct.lfs2_config = type { i32 }
define i32 @lfs2_testbd_sync(%struct.lfs2_config* %0) {
%2 = alloca %struct.lfs2_config*
%3 = alloca i32
store %struct.lfs2_config* %0, %struct.lfs2_config** %2
%4 = load %struct.lfs2_config*, %struct.lfs2_config** %2
%5 = call i32 @lfs2_testbd_rawsync(%struct.lfs2_config* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%struct.lfs2_config = type { i32 }
define i32 @lfs2_testbd_sync(%struct.lfs2_config* %0) {
%2 = tail call i32 @lfs2_testbd_rawsync(%struct.lfs2_config* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ compute(int);
double example_function1(double *array, int array_size) {
  compute(10);
  return 0;
}


x86 assembly (clang, -O0):
<example_function1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0xa,%edi
call   1030 <compute@plt>
xorps  %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<example_function1>:
push   %rax
mov    $0xa,%edi
call   1030 <compute@plt>
xorps  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @example_function1(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%5 = call i32 @compute(i32 10)
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @example_function1(double* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @compute(i32 10)
ret double 0.000000e+00
}
/* Variables and functions */
char *ctime(long *);
int /*<<< orphan*/ printf(char *, char *);
void show_time(long timeval) {
  char *cp;
  cp = ctime(&timeval);
  printf("%12.12s", cp + 4);
}


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

x86 assembly (clang, -O2):
<show_time>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
call   1030 <ctime@plt>
lea    0x4(%rax),%rsi
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%12.12s\00"
define void @show_time(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i8* @ctime(i64* %2)
%4 = getelementptr inbounds i8, i8* %3, i64 4
%5 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}
int test_imm_71uint8_reg(unsigned char val) {
  return ((val) & (-0x71 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_71uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff8f,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_71uint8_reg>:
test   $0x8f,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_71uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -113
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_71uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -113
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
eat(int c) {
  int i;
  while ((i = ((getch()) & 0x1FFFF)) != c && i != '\n')
    ;
  return (i);
}


x86 assembly (clang, -O0):
<eat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getch@plt>
mov    %eax,%ecx
and    $0x1ffff,%ecx
mov    %ecx,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x4(%rbp),%ecx
mov    %al,-0x9(%rbp)
je     1145 <eat+0x35>
cmpl   $0xa,-0x8(%rbp)
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1155 <eat+0x45>
jmp    115a <eat+0x4a>
jmp    111b <eat+0xb>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eat>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1030 <getch@plt>
and    $0x1ffff,%eax
cmp    %ebx,%eax
je     1135 <eat+0x25>
cmp    $0xa,%eax
jne    1120 <eat+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define i32 @eat(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
br label %4
4: ; preds = %14, %1
%5 = call i32 (...) @getch()
%6 = and i32 %5, 131071
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = icmp ne i32 %6, %7
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = load i32, i32* %3
%11 = icmp ne i32 %10, 10
br label %12
12: ; preds = %9, %4
%13 = phi i1 [ false, %4 ], [ %11, %9 ]
br i1 %13, label %14, label %15
14: ; preds = %12
br label %4
15: ; preds = %12
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @eat(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 (...) @getch()
%4 = and i32 %3, 131071
%5 = icmp ne i32 %4, %0
%6 = icmp ne i32 %4, 10
%7 = and i1 %5, %6
br i1 %7, label %2, label %8
8: ; preds = %2
ret i32 %4
}
void gtk_tool_button_get_icon_widget() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void midnam_header(FILE *f, char *model) {
  fprintf(f,
          "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
          "<!DOCTYPE MIDINameDocument PUBLIC \"-//MIDI Manufacturers "
          "Association//DTD MIDINameDocument 1.0//EN\" "
          "\"http://www.midi.org/dtds/MIDINameDocument10.dtd\">\n"
          "<MIDINameDocument>\n"
          "  <Author>setBfree -- Robin Gareus</Author>\n"
          "  <MasterDeviceNames>\n"
          "    <Manufacturer>Pather B Music</Manufacturer>\n"
          "    <Model>%s</Model>\n",
          model);
}


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

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

LLVM IR (-O0):
@.str = [346 x i8] c"<?xml version=\221.0\22 encoding=\22UTF-8\22?>\0A<!DOCTYPE MIDINameDocument PUBLIC \22-//MIDI Manufacturers Association//DTD MIDINameDocument 1.0//EN\22 \22http://www.midi.org/dtds/MIDINameDocument10.dtd\22>\0A<MIDINameDocument>\0A <Author>setBfree -- Robin Gareus</Author>\0A <MasterDeviceNames>\0A <Manufacturer>Pather B Music</Manufacturer>\0A <Model>%s</Model>\0A\00"
define void @midnam_header(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i8*, i8** %4
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([346 x i8], [346 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [346 x i8] c"<?xml version=\221.0\22 encoding=\22UTF-8\22?>\0A<!DOCTYPE MIDINameDocument PUBLIC \22-//MIDI Manufacturers Association//DTD MIDINameDocument 1.0//EN\22 \22http://www.midi.org/dtds/MIDINameDocument10.dtd\22>\0A<MIDINameDocument>\0A <Author>setBfree -- Robin Gareus</Author>\0A <MasterDeviceNames>\0A <Manufacturer>Pather B Music</Manufacturer>\0A <Model>%s</Model>\0A\00"
define void @midnam_header(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([346 x i8], [346 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0xec() {
  Assert_real((isprint(236) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              1185, ("isprint should be 0 for 0xec"));
}


x86 assembly (clang, -O0):
<t_isprint_0xec>:
push   %rbp
mov    %rsp,%rbp
mov    $0xec,%edi
call   1030 <isprint@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x4a1,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0xec>:
push   %rax
mov    $0xec,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4a1,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xec\00"
define void @t_isprint_0xec() {
%1 = call i64 @isprint(i32 236)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1185, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xec\00"
define void @t_isprint_0xec() {
%1 = tail call i64 @isprint(i32 236)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1185, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int cmpTwoBits32(unsigned aHi, unsigned aLo, unsigned bHi, unsigned bLo) {
  if (aHi < bHi)
    return 1;
  else if (aHi > bHi)
    return -1;
  else {
    if (aLo < bLo)
      return 1;
    else if (aLo > bLo)
      return -1;
    else
      return 0;
  }
}


x86 assembly (clang, -O0):
<cmpTwoBits32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jae    1128 <cmpTwoBits32+0x28>
movl   $0x1,-0x4(%rbp)
jmp    1177 <cmpTwoBits32+0x77>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jbe    1140 <cmpTwoBits32+0x40>
movl   $0xffffffff,-0x4(%rbp)
jmp    1177 <cmpTwoBits32+0x77>
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    1158 <cmpTwoBits32+0x58>
movl   $0x1,-0x4(%rbp)
jmp    1177 <cmpTwoBits32+0x77>
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jbe    1170 <cmpTwoBits32+0x70>
movl   $0xffffffff,-0x4(%rbp)
jmp    1177 <cmpTwoBits32+0x77>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmpTwoBits32>:
mov    $0x1,%eax
cmp    %edx,%edi
jb     111d <cmpTwoBits32+0x1d>
mov    $0xffffffff,%eax
ja     111d <cmpTwoBits32+0x1d>
mov    $0x1,%eax
cmp    %ecx,%esi
jb     111d <cmpTwoBits32+0x1d>
cmp    %esi,%ecx
sbb    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @cmpTwoBits32(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp ult i32 %0, %2
br i1 %5, label %13, label %6
6: ; preds = %4
%7 = icmp ugt i32 %0, %2
br i1 %7, label %13, label %8
8: ; preds = %6
%9 = icmp ult i32 %1, %3
br i1 %9, label %13, label %10
10: ; preds = %8
%11 = icmp ugt i32 %1, %3
%12 = sext i1 %11 to i32
br label %13
13: ; preds = %10, %8, %6, %4
%14 = phi i32 [ 1, %4 ], [ -1, %6 ], [ 1, %8 ], [ %12, %10 ]
ret i32 %14
}
/* Type definitions */
typedef unsigned int uint32_t;

/* Variables and functions */
uint32_t cigar_int_to_len(uint32_t cigar_int) { return cigar_int >> 4u; }


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

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

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

LLVM IR (-O2):
define i32 @cigar_int_to_len(i32 %0) {
%2 = lshr i32 %0, 4
ret i32 %2
}
void RTPathStartsWith(void) {}


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

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

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

LLVM IR (-O2):
define void @RTPathStartsWith() {
ret void
}
int teardown(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @teardown() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
void writes(const char *p) { write(1, p, strlen(p)); }


x86 assembly (clang, -O0):
<writes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writes>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define void @writes(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @write(i32 1, i8* %0, i32 %2)
ret void
}
void I422ToARGB1555Row_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @I422ToARGB1555Row_SSSE3() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ smbhash(unsigned char *, unsigned char *, unsigned char *);
void E_P24(unsigned char *p21, unsigned char *c8, unsigned char *p24) {
  smbhash(p24, c8, p21);
  smbhash(p24 + 8, c8, p21 + 7);
  smbhash(p24 + 16, c8, p21 + 14);
}


x86 assembly (clang, -O0):
<E_P24>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
call   1030 <smbhash@plt>
mov    -0x18(%rbp),%rdi
add    $0x8,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
add    $0x7,%rdx
call   1030 <smbhash@plt>
mov    -0x18(%rbp),%rdi
add    $0x10,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
add    $0xe,%rdx
call   1030 <smbhash@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<E_P24>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rdx,%rdi
mov    %r15,%rdx
call   1030 <smbhash@plt>
lea    0x8(%rbx),%rdi
lea    0x7(%r15),%rdx
mov    %r14,%rsi
call   1030 <smbhash@plt>
add    $0x10,%rbx
add    $0xe,%r15
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <smbhash@plt>

LLVM IR (-O0):
define void @E_P24(i8* %0, i8* %1, i8* %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** %6
%8 = load i8*, i8** %5
%9 = load i8*, i8** %4
%10 = call i32 @smbhash(i8* %7, i8* %8, i8* %9)
%11 = load i8*, i8** %6
%12 = getelementptr inbounds i8, i8* %11, i64 8
%13 = load i8*, i8** %5
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i64 7
%16 = call i32 @smbhash(i8* %12, i8* %13, i8* %15)
%17 = load i8*, i8** %6
%18 = getelementptr inbounds i8, i8* %17, i64 16
%19 = load i8*, i8** %5
%20 = load i8*, i8** %4
%21 = getelementptr inbounds i8, i8* %20, i64 14
%22 = call i32 @smbhash(i8* %18, i8* %19, i8* %21)
ret void
}

LLVM IR (-O2):
define void @E_P24(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @smbhash(i8* %2, i8* %1, i8* %0)
%5 = getelementptr inbounds i8, i8* %2, i64 8
%6 = getelementptr inbounds i8, i8* %0, i64 7
%7 = tail call i32 @smbhash(i8* %5, i8* %1, i8* %6)
%8 = getelementptr inbounds i8, i8* %2, i64 16
%9 = getelementptr inbounds i8, i8* %0, i64 14
%10 = tail call i32 @smbhash(i8* %8, i8* %1, i8* %9)
ret void
}
int solib_main(int arg) { return arg * arg; }


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

x86 assembly (clang, -O2):
<solib_main>:
mov    %edi,%eax
imul   %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @solib_main(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}