xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const);
int strlen(char const *);
void print_reverse(const char *str) {
  const char *ptr;
  ptr = str + strlen(str);
  do {
    --ptr;
    printf("%c", *ptr);
  } while (ptr > str);
}


x86 assembly (clang, -O0):
<print_reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
lea    0xe9c(%rip),%rdi
movsbl (%rax),%esi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
ja     114d <print_reverse+0x2d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_reverse>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
call   1030 <strlen@plt>
movslq %eax,%rbx
add    %r15,%rbx
lea    0xec6(%rip),%r14
nopw   0x0(%rax,%rax,1)
movsbl -0x1(%rbx),%esi
add    $0xffffffffffffffff,%rbx
mov    %r14,%rdi
call   1040 <printf@plt>
cmp    %r15,%rbx
ja     1140 <print_reverse+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @print_reverse(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
br label %5
5: ; preds = %5, %1
%6 = phi i8* [ %4, %1 ], [ %7, %5 ]
%7 = getelementptr inbounds i8, i8* %6, i64 -1
%8 = load i8, i8* %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %8)
%10 = icmp ugt i8* %7, %0
br i1 %10, label %5, label %11
11: ; preds = %5
ret void
}
/* Variables and functions */
int rand();
int getSpeed(int speed) {
  int r = speed + (rand() % 40);
  return r;
}


x86 assembly (clang, -O0):
<getSpeed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x28,%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSpeed>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x24,%rcx
add    %edx,%ecx
shl    $0x3,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getSpeed(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 (...) @rand()
%6 = srem i32 %5, 40
%7 = add nsw i32 %4, %6
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @getSpeed(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, 40
%4 = add nsw i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int getint();
int /*<<< orphan*/ printf(char *, int);
int main() {
  while (1) {
    printf("%d\n", getint());
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getint@plt>
mov    %eax,%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getint@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 (...) @getint()
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
br label %2
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @getint()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3_file;

/* Variables and functions */
int unixDeviceCharacteristics(sqlite3_file *NotUsed) {
  (void)(NotUsed);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @unixDeviceCharacteristics(i32* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void irqRemap() {
  outb(0x20, 0x11);
  outb(0xA0, 0x11);
  outb(0x21, 0x20);
  outb(0xA1, 0x28);
  outb(0x21, 0x04);
  outb(0xA1, 0x02);
  outb(0x21, 0x05);
  outb(0xA1, 0x01);
}


x86 assembly (clang, -O0):
<irqRemap>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
mov    $0x11,%esi
call   1030 <outb@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x5,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1030 <outb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<irqRemap>:
push   %rax
mov    $0x20,%edi
mov    $0x11,%esi
call   1030 <outb@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x5,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
pop    %rax
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @irqRemap() {
%1 = call i32 @outb(i32 32, i32 17)
%2 = call i32 @outb(i32 160, i32 17)
%3 = call i32 @outb(i32 33, i32 32)
%4 = call i32 @outb(i32 161, i32 40)
%5 = call i32 @outb(i32 33, i32 4)
%6 = call i32 @outb(i32 161, i32 2)
%7 = call i32 @outb(i32 33, i32 5)
%8 = call i32 @outb(i32 161, i32 1)
ret void
}

LLVM IR (-O2):
define void @irqRemap() {
%1 = tail call i32 @outb(i32 32, i32 17)
%2 = tail call i32 @outb(i32 160, i32 17)
%3 = tail call i32 @outb(i32 33, i32 32)
%4 = tail call i32 @outb(i32 161, i32 40)
%5 = tail call i32 @outb(i32 33, i32 4)
%6 = tail call i32 @outb(i32 161, i32 2)
%7 = tail call i32 @outb(i32 33, i32 5)
%8 = tail call i32 @outb(i32 161, i32 1)
ret void
}
/* Type definitions */
struct irc {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sendStr(struct irc *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
void sendMsg(struct irc *bot, char *msg) {
  char msgbuf[1024];
  snprintf(msgbuf, 1024 - 1, "PRIVMSG %s", msg);
  sendStr(bot, msgbuf);
}


x86 assembly (clang, -O0):
<sendMsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x3ff,%esi
lea    0xeb6(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x410(%rbp),%rsi
call   1030 <sendStr@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendMsg>:
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %rsi,%rcx
mov    %rdi,%rbx
lea    0xec9(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x3ff,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <sendStr@plt>
add    $0x408,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.irc = type { i32 }
@.str = [11 x i8] c"PRIVMSG %s\00"
define void @sendMsg(%struct.irc* %0, i8* %1) {
%3 = alloca %struct.irc*
%4 = alloca i8*
%5 = alloca [1024 x i8]
store %struct.irc* %0, %struct.irc** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %4
%8 = call i32 @snprintf(i8* %6, i32 1023, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load %struct.irc*, %struct.irc** %3
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%11 = call i32 @sendStr(%struct.irc* %9, i8* %10)
ret void
}

LLVM IR (-O2):
%struct.irc = type { i32 }
@.str = [11 x i8] c"PRIVMSG %s\00"
define void @sendMsg(%struct.irc* %0, i8* %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 1023, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %1)
%6 = call i32 @sendStr(%struct.irc* %0, i8* %4)
ret void
}
unsigned long long div64_u64(unsigned long long dividend,
                             unsigned long long divisor) {
  return dividend / divisor;
}


x86 assembly (clang, -O0):
<div64_u64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<div64_u64>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1115 <div64_u64+0x15>
xor    %edx,%edx
div    %rsi
ret
xor    %edx,%edx
div    %esi
ret

LLVM IR (-O0):
define i64 @div64_u64(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = udiv i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @div64_u64(i64 %0, i64 %1) {
%3 = udiv i64 %0, %1
ret i64 %3
}
/* Variables and functions */
double s_PolyGamma(double, int /*<<< orphan*/);
double s_LnGamma(double x) { return s_PolyGamma(x, 0); }


x86 assembly (clang, -O0):
<s_LnGamma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xor    %edi,%edi
call   1030 <s_PolyGamma@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_LnGamma>:
xor    %edi,%edi
jmp    1030 <s_PolyGamma@plt>

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

LLVM IR (-O2):
define double @s_LnGamma(double %0) {
%2 = tail call double @s_PolyGamma(double %0, i32 0)
ret double %2
}
void _infix_operator_mod_i16_i16(signed short lhs, signed short rhs,
                                 signed short *__rval_1) {
  *__rval_1 = lhs % rhs;
}


x86 assembly (clang, -O0):
<_infix_operator_mod_i16_i16>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    %rdx,-0x10(%rbp)
movswl -0x2(%rbp),%eax
movswl -0x4(%rbp),%ecx
cltd
idiv   %ecx
mov    %dx,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_infix_operator_mod_i16_i16>:
mov    %rdx,%rcx
mov    %edi,%eax
cltd
idiv   %esi
mov    %dx,(%rcx)
ret

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

LLVM IR (-O2):
define void @_infix_operator_mod_i16_i16(i16 signext %0, i16 signext %1, i16* nocapture writeonly %2) {
%4 = sext i16 %0 to i32
%5 = sext i16 %1 to i32
%6 = srem i32 %4, %5
%7 = trunc i32 %6 to i16
store i16 %7, i16* %2
ret void
}
int xmlUCSIsAegeanNumbers(int code) {
  return (((code >= 0x10100) && (code <= 0x1013F)));
}


x86 assembly (clang, -O0):
<xmlUCSIsAegeanNumbers>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x10100,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsAegeanNumbers+0x26>
cmpl   $0x1013f,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsAegeanNumbers>:
and    $0xffffffc0,%edi
xor    %eax,%eax
cmp    $0x10100,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @xmlUCSIsAegeanNumbers(i32 %0) {
%2 = and i32 %0, -64
%3 = icmp eq i32 %2, 65792
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
double fabs(double);
double elliott_symmetric_activation(const double x) {
  double temp = x * 1.0;
  return (temp / (1.0 + fabs(temp)));
}


x86 assembly (clang, -O0):
<elliott_symmetric_activation>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movaps 0xee4(%rip),%xmm1
pand   %xmm1,%xmm2
movsd  0xec8(%rip),%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<elliott_symmetric_activation>:
movapd 0xef8(%rip),%xmm1
andpd  %xmm0,%xmm1
addsd  0xefc(%rip),%xmm1
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @elliott_symmetric_activation(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fmul double %4, 1.000000e+00
store double %5, double* %3
%6 = load double, double* %3
%7 = load double, double* %3
%8 = call double @llvm.fabs.f64(double %7)
%9 = fadd double 1.000000e+00, %8
%10 = fdiv double %6, %9
ret double %10
}

LLVM IR (-O2):
define double @elliott_symmetric_activation(double %0) {
%2 = tail call double @llvm.fabs.f64(double %0)
%3 = fadd double %2, 1.000000e+00
%4 = fdiv double %0, %3
ret double %4
}
int main1() {
  int *remoteArr = (int *)0x00000000;
  *(remoteArr + 1) = 0;
  for (int i = 0; i < 20; i++) {
    *(remoteArr + 1) += 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main1>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,0x4(%rax)
movl   $0x0,-0xc(%rbp)
cmpl   $0x14,-0xc(%rbp)
jge    1143 <main1+0x43>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
add    $0x1,%ecx
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111e <main1+0x1e>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main1>:
movl   $0x14,0x4
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @main1() {
store i32 20, i32* inttoptr (i64 4 to i32*)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ wcstoimax(int /*<<< orphan*/ const *, int /*<<< orphan*/ **,
                             int);
int /*<<< orphan*/ wcstoumax(int /*<<< orphan*/ const *, int /*<<< orphan*/ **,
                             int);
void uninivar_wcstoimax(void) {
  const wchar_t *s;
  wchar_t **endp;
  int base;
  (void)wcstoimax(s, endp, base);
  (void)wcstoumax(s, endp, base);
}


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

x86 assembly (clang, -O2):
<uninivar_wcstoimax>:
push   %rax
call   1030 <wcstoimax@plt>
pop    %rax
jmp    1040 <wcstoumax@plt>

LLVM IR (-O0):
define void @uninivar_wcstoimax() {
%1 = alloca i32*
%2 = alloca i32**
%3 = alloca i32
%4 = load i32*, i32** %1
%5 = load i32**, i32*** %2
%6 = load i32, i32* %3
%7 = call i32 @wcstoimax(i32* %4, i32** %5, i32 %6)
%8 = load i32*, i32** %1
%9 = load i32**, i32*** %2
%10 = load i32, i32* %3
%11 = call i32 @wcstoumax(i32* %8, i32** %9, i32 %10)
ret void
}

LLVM IR (-O2):
define void @uninivar_wcstoimax() {
%1 = tail call i32 @wcstoimax(i32* undef, i32** undef, i32 undef)
%2 = tail call i32 @wcstoumax(i32* undef, i32** undef, i32 undef)
ret void
}
int Factorial(int n) {
  int fact = 1;
  int m = 1;
  do {
    fact *= m;
    m++;
  } while (m < n);
  return m;
}


x86 assembly (clang, -O0):
<Factorial>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jl     1115 <Factorial+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Factorial>:
cmp    $0x3,%edi
mov    $0x2,%eax
cmovge %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @Factorial(i32 %0) {
%2 = call i32 @llvm.smax.i32(i32 %0, i32 2)
ret i32 %2
}
float convert_to_celsius(float fahr) { return (5.0 / 9.0) * (fahr - 32.0); }


x86 assembly (clang, -O0):
<convert_to_celsius>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeee(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xeda(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_to_celsius>:
cvtss2sd %xmm0,%xmm0
addsd  0xef4(%rip),%xmm0
mulsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @convert_to_celsius(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fsub double %4, 3.200000e+01
%6 = fmul double 0x3FE1C71C71C71C72, %5
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @convert_to_celsius(float %0) {
%2 = fpext float %0 to double
%3 = fadd double %2, -3.200000e+01
%4 = fmul double %3, 0x3FE1C71C71C71C72
%5 = fptrunc double %4 to float
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, int);
void StrLeft(char *dest, char *src, int num) { strncpy(dest, src, num); }


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

x86 assembly (clang, -O2):
<StrLeft>:
jmp    1030 <strncpy@plt>

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

LLVM IR (-O2):
define void @StrLeft(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @strncpy(i8* %0, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xac() {
  Assert_real((isodigit(172) == 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_isodigit.c",
              865, ("isodigit should be 0 for 0xac"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0xac>:
push   %rax
mov    $0xac,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x361,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xac\00"
define void @t_isodigit_0xac() {
%1 = call i64 @isodigit(i32 172)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 865, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xac\00"
define void @t_isodigit_0xac() {
%1 = tail call i64 @isodigit(i32 172)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 865, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int);
void cgdefp(int v) { ngen("%s\t%d", "dw", v); }


x86 assembly (clang, -O0):
<cgdefp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xedb(%rip),%rdi
lea    0xeda(%rip),%rsi
call   1030 <ngen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgdefp>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xee6(%rip),%rsi
jmp    1030 <ngen@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%s\09%d\00"
@.str.1 = [3 x i8] c"dw\00"
define void @cgdefp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ngen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s\09%d\00"
@.str.1 = [3 x i8] c"dw\00"
define void @cgdefp(i32 %0) {
%2 = tail call i32 @ngen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long icon_window;
};
typedef TYPE_1__ XWMHints;

/* Variables and functions */
void set_XWMHints_icon_window(void *_p, unsigned long _v) {
  ((XWMHints *)_p)->icon_window = (unsigned long)_v;
}


x86 assembly (clang, -O0):
<set_XWMHints_icon_window>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XWMHints_icon_window>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XWMHints_icon_window(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 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XWMHints_icon_window(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int t();
int q(void) { return t(); }


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

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

LLVM IR (-O0):
define i32 @q() {
%1 = call i32 (...) @t()
ret i32 %1
}

LLVM IR (-O2):
define i32 @q() {
%1 = tail call i32 (...) @t()
ret i32 %1
}
int acc_i2c_init(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @acc_i2c_init() {
ret i32 0
}
const char *skipWhitespace(const char *s) {
  while (*s == ' ' || *s == '\t') {
    ++s;
  }
  return s;
}


x86 assembly (clang, -O0):
<skipWhitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     112d <skipWhitespace+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <skipWhitespace+0x3d>
jmp    114e <skipWhitespace+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skipWhitespace+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipWhitespace>:
mov    %rdi,%rax
jmp    1114 <skipWhitespace+0x14>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x20,%cl
je     1110 <skipWhitespace+0x10>
cmp    $0x9,%cl
je     1110 <skipWhitespace+0x10>
ret

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

LLVM IR (-O2):
define i8* @skipWhitespace(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 32, label %5
i8 9, label %5
]
5: ; preds = %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
unsigned int bit_group_ends_uint(unsigned int val) {
  return ((val) & ((val) ^ ((val) << 1)));
}


x86 assembly (clang, -O0):
<bit_group_ends_uint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
mov    -0x4(%rbp),%edx
shl    $0x1,%edx
xor    %edx,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_group_ends_uint>:
lea    (%rdi,%rdi,1),%eax
not    %eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @bit_group_ends_uint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = shl i32 %5, 1
%7 = xor i32 %4, %6
%8 = and i32 %3, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @bit_group_ends_uint(i32 %0) {
%2 = shl i32 %0, 1
%3 = xor i32 %2, -1
%4 = and i32 %3, %0
ret i32 %4
}
unsigned char hash(char *str) {
  int res = 0, i = 0;
  while (str[i++] != '\0')
    res += str[i - 1];
  return (unsigned char)(res / (i - 1));
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1151 <hash+0x51>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <hash+0x16>
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
cltd
idiv   %ecx
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%dl
test   %dl,%dl
je     1126 <hash+0x26>
xor    %ecx,%ecx
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
movsbl %dl,%edx
add    %edx,%eax
movzbl 0x1(%rdi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <hash+0x10>
cltd
idiv   %ecx
ret
ret

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

LLVM IR (-O2):
define zeroext i8 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %18, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = phi i8 [ %12, %4 ], [ %2, %1 ]
%7 = phi i32 [ %10, %4 ], [ 0, %1 ]
%8 = sext i8 %6 to i32
%9 = add nuw nsw i64 %5, 1
%10 = add nsw i32 %7, %8
%11 = getelementptr inbounds i8, i8* %0, i64 %9
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = trunc i64 %9 to i32
%16 = sdiv i32 %10, %15
%17 = trunc i32 %16 to i8
br label %18
18: ; preds = %14, %1
%19 = phi i8 [ %17, %14 ], [ poison, %1 ]
ret i8 %19
}
/* Variables and functions */
int htoi(char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", htoi("0xFF"));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [5 x i8] c"0xFF\00"
define i32 @main() {
%1 = tail call i32 @htoi(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ heapify(void *, size_t, size_t,
                           int (*)(void const *, void const *));
int /*<<< orphan*/ heapsort(void *, size_t, size_t,
                            int (*)(void const *, void const *));
void qsort(void *base, size_t nitems, size_t size,
           int (*compar)(const void *, const void *)) {
  heapify(base, nitems, size, compar);
  heapsort(base, nitems, size, compar);
}


x86 assembly (clang, -O0):
<qsort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1040 <heapify@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <heapsort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsort>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
call   1040 <heapify@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <heapsort@plt>

LLVM IR (-O0):
define void @qsort(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*)* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32 (i8*, i8*)*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32 (i8*, i8*)* %3, i32 (i8*, i8*)** %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = load i32 (i8*, i8*)*, i32 (i8*, i8*)** %8
%13 = call i32 @heapify(i8* %9, i64 %10, i64 %11, i32 (i8*, i8*)* %12)
%14 = load i8*, i8** %5
%15 = load i64, i64* %6
%16 = load i64, i64* %7
%17 = load i32 (i8*, i8*)*, i32 (i8*, i8*)** %8
%18 = call i32 @heapsort(i8* %14, i64 %15, i64 %16, i32 (i8*, i8*)* %17)
ret void
}

LLVM IR (-O2):
define void @qsort(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*)* %3) {
%5 = tail call i32 @heapify(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*)* %3)
%6 = tail call i32 @heapsort(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*)* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, size_t);
size_t j64_null_encode(char *buf, size_t len) {
  len = ((len) < (4) ? (len) : (4));
  memcpy(buf, "null", len);
  return len;
}


x86 assembly (clang, -O0):
<j64_null_encode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x4,-0x10(%rbp)
jae    1138 <j64_null_encode+0x28>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1146 <j64_null_encode+0x36>
mov    $0x4,%eax
mov    %rax,-0x18(%rbp)
jmp    1146 <j64_null_encode+0x36>
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xea3(%rip),%rsi
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j64_null_encode>:
push   %rbx
cmp    $0x4,%rsi
mov    $0x4,%ebx
cmovb  %rsi,%rbx
lea    0xedb(%rip),%rsi
mov    %rbx,%rdx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"null\00"
define i64 @j64_null_encode(i8* %0, i64 %1) {
%3 = icmp ult i64 %1, 4
%4 = select i1 %3, i64 %1, i64 4
%5 = tail call i32 @memcpy(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %4)
ret i64 %4
}
double xd(void) { return 3.1415926535; }


x86 assembly (clang, -O0):
<xd>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<xd>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @xd() {
ret double 0x400921FB54411744
}

LLVM IR (-O2):
define double @xd() {
ret double 0x400921FB54411744
}
int c(void) {
  auto int x;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @c() {
%1 = alloca i32
ret i32 0
}

LLVM IR (-O2):
define i32 @c() {
ret i32 0
}
int cpuid_sup() {
  unsigned long eax = 0;
  unsigned long ecx = 0;
  __asm__ __volatile__("pushf\n\t"
                       "pop %0\n\t"
                       "mov %0, %1\n\t"
                       "xor $0x200000, %0\n\t"
                       "push %0\n\t"
                       "popf\n\t"
                       "pushf\n\t"
                       "pop %0\n\t"
                       : "=a"(eax), "=c"(ecx)
                       :
                       : "cc");
  return ((eax ^ ecx) & 0x200000);
}


x86 assembly (clang, -O0):
<cpuid_sup>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
pushf
pop    %rax
mov    %rax,%rcx
xor    $0x200000,%rax
push   %rax
popf
pushf
pop    %rax
mov    %rax,-0x8(%rbp)
mov    %rcx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
xor    -0x10(%rbp),%rax
and    $0x200000,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_sup>:
pushf
pop    %rax
mov    %rax,%rcx
xor    $0x200000,%rax
push   %rax
popf
pushf
pop    %rax
xor    %ecx,%eax
and    $0x200000,%eax
ret

LLVM IR (-O0):
define i32 @cpuid_sup() {
%1 = alloca i64
%2 = alloca i64
store i64 0, i64* %1
store i64 0, i64* %2
%3 = call { i64, i64 } asm sideeffect "pushf\0A\09pop $0\0A\09mov $0, $1\0A\09xor $$0x200000, $0\0A\09push $0\0A\09popf\0A\09pushf\0A\09pop $0\0A\09", "={ax},={cx},~{cc},~{dirflag},~{fpsr},~{flags}"()
%4 = extractvalue { i64, i64 } %3, 0
%5 = extractvalue { i64, i64 } %3, 1
store i64 %4, i64* %1
store i64 %5, i64* %2
%6 = load i64, i64* %1
%7 = load i64, i64* %2
%8 = xor i64 %6, %7
%9 = and i64 %8, 2097152
%10 = trunc i64 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @cpuid_sup() {
%1 = tail call { i64, i64 } asm sideeffect "pushf\0A\09pop $0\0A\09mov $0, $1\0A\09xor $$0x200000, $0\0A\09push $0\0A\09popf\0A\09pushf\0A\09pop $0\0A\09", "={ax},={cx},~{cc},~{dirflag},~{fpsr},~{flags}"()
%2 = extractvalue { i64, i64 } %1, 0
%3 = extractvalue { i64, i64 } %1, 1
%4 = xor i64 %2, %3
%5 = trunc i64 %4 to i32
%6 = and i32 %5, 2097152
ret i32 %6
}
/* Variables and functions */
int d86f_valid_bit_rate(int);
int d86f_format_conditions(int drive) { return d86f_valid_bit_rate(drive); }


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

x86 assembly (clang, -O2):
<d86f_format_conditions>:
jmp    1030 <d86f_valid_bit_rate@plt>

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

LLVM IR (-O2):
define i32 @d86f_format_conditions(i32 %0) {
%2 = tail call i32 @d86f_valid_bit_rate(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ mystr;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int, int *);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
int main(int argc, char **argv) {
  char mystr[80];
  int x;
  x = 0xdeadbeef;
  snprintf(mystr, sizeof(mystr), "x=%d &x=%p\n", x, &x);
  write(1, mystr, strlen(mystr));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xdeadbeef,-0x64(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x64(%rbp),%ecx
mov    $0x50,%esi
lea    0xea0(%rip),%rdx
lea    -0x64(%rbp),%r8
call   1050 <snprintf@plt>
lea    -0x60(%rbp),%rax
mov    %rax,-0x70(%rbp)
lea    -0x60(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x70(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x60,%rsp
movl   $0xdeadbeef,0xc(%rsp)
de
lea    0xebc(%rip),%rdx
lea    0x10(%rsp),%rbx
lea    0xc(%rsp),%r8
mov    %rbx,%rdi
mov    $0x50,%esi
mov    $0xdeadbeef,%ecx
call   1050 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"x=%d &x=%p\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [80 x i8]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 -559038737, i32* %7
%8 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%9 = load i32, i32* %7
%10 = call i32 @snprintf(i8* %8, i32 80, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %9, i32* %7)
%11 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%12 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%13 = call i32 @strlen(i8* %12)
%14 = call i32 @write(i32 1, i8* %11, i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"x=%d &x=%p\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [80 x i8]
%4 = alloca i32
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%6 = bitcast i32* %4 to i8*
store i32 -559038737, i32* %4
%7 = call i32 @snprintf(i8* %5, i32 80, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 -559038737, i32* %4)
%8 = call i32 @strlen(i8* %5)
%9 = call i32 @write(i32 1, i8* %5, i32 %8)
ret i32 0
}
int leapyear(long int year) {
  return ((year & 3) == 0 &&
          (year % 100 != 0 || ((year / 100) & 3) == (-(1900 / 100) & 3)));
}


x86 assembly (clang, -O0):
<leapyear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
and    $0x3,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    115e <leapyear+0x5e>
mov    -0x8(%rbp),%rax
mov    $0x64,%ecx
cqto
idiv   %rcx
mov    $0x1,%al
cmp    $0x0,%rdx
mov    %al,-0xa(%rbp)
jne    1158 <leapyear+0x58>
mov    -0x8(%rbp),%rax
mov    $0x64,%ecx
cqto
idiv   %rcx
and    $0x3,%rax
cmp    $0x1,%rax
sete   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<leapyear>:
xor    %eax,%eax
test   $0x3,%dil
je     1109 <leapyear+0x9>
ret
movabs $0xa3d70a3d70a3d70b,%rcx
0a d7 a3
mov    %rdi,%rax
imul   %rcx
movabs $0x8f5c28f5c28f5c29,%rax
28 5c 8f
imul   %rdi,%rax
movabs $0x51eb851eb851eb8,%rcx
b8 1e 05
add    %rax,%rcx
ror    $0x2,%rcx
mov    $0x1,%eax
movabs $0x28f5c28f5c28f5c,%rsi
5c 8f 02
cmp    %rsi,%rcx
ja     1108 <leapyear+0x8>
add    %rdi,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x6,%rdx
add    %rax,%rdx
and    $0x3,%edx
xor    %eax,%eax
cmp    $0x1,%edx
sete   %al
ret

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

LLVM IR (-O2):
define i32 @leapyear(i64 %0) {
%2 = and i64 %0, 3
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %12
4: ; preds = %1
%5 = srem i64 %0, 100
%6 = sdiv i64 %0, 100
%7 = icmp eq i64 %5, 0
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = and i64 %6, 3
%10 = icmp eq i64 %9, 1
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %4, %8, %1
%13 = phi i32 [ 0, %1 ], [ 1, %4 ], [ %11, %8 ]
ret i32 %13
}
/* Variables and functions */
bool new_bool(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @new_bool() {
ret i32 0
}
int count_ones_fast(int n) {
  int ones = 0;
  while (n != 0) {
    n = n & (n - 1);
    ones++;
  }
  return ones;
}


x86 assembly (clang, -O0):
<count_ones_fast>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1134 <count_ones_fast+0x34>
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <count_ones_fast+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_ones_fast>:
xor    %eax,%eax
test   %edi,%edi
je     111c <count_ones_fast+0x1c>
cs nopw 0x0(%rax,%rax,1)
lea    -0x1(%rdi),%ecx
add    $0x1,%eax
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <count_ones_fast+0x10>
ret

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

LLVM IR (-O2):
define i32 @count_ones_fast(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nsw i32 %5, -1
%7 = and i32 %6, %5
%8 = add nuw nsw i32 %4, 1
%9 = icmp eq i32 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %11
}
int clamp252(int y) { return ((y < 8) ? 8 : ((y > 243) ? 243 : y)); }


x86 assembly (clang, -O0):
<clamp252>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x8,-0x4(%rbp)
jge    111e <clamp252+0x1e>
mov    $0x8,%eax
mov    %eax,-0x8(%rbp)
jmp    1144 <clamp252+0x44>
cmpl   $0xf3,-0x4(%rbp)
jle    1138 <clamp252+0x38>
mov    $0xf3,%eax
mov    %eax,-0xc(%rbp)
jmp    113e <clamp252+0x3e>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp252>:
cmp    $0xf3,%edi
mov    $0xf3,%ecx
cmovl  %edi,%ecx
cmp    $0x9,%ecx
mov    $0x8,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @clamp252(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 8
br i1 %4, label %5, label %6
5: ; preds = %1
br label %14
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 243
br i1 %8, label %9, label %10
9: ; preds = %6
br label %12
10: ; preds = %6
%11 = load i32, i32* %2
br label %12
12: ; preds = %10, %9
%13 = phi i32 [ 243, %9 ], [ %11, %10 ]
br label %14
14: ; preds = %12, %5
%15 = phi i32 [ 8, %5 ], [ %13, %12 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @clamp252(i32 %0) {
%2 = icmp slt i32 %0, 243
%3 = select i1 %2, i32 %0, i32 243
%4 = icmp sgt i32 %3, 8
%5 = select i1 %4, i32 %3, i32 8
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void pthread_exit(void *__retval) {
  ;
  abort();
}


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

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

LLVM IR (-O0):
define void @pthread_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @pthread_exit(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @abort()
unreachable
}