xunge/DecIR huggingface dataset:
signed int second_order_IIR_direct_form_II_fixed(const signed int *coefficients,
                                                 signed int input,
                                                 const signed int *gain) {
  long temp;
  static short int delay[3] = {0};
  temp = (long)input;
  return ((short int)temp);
}


x86 assembly (clang, -O0):
<second_order_IIR_direct_form_II_fixed>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movslq -0xc(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<second_order_IIR_direct_form_II_fixed>:
movswl %si,%eax
ret

LLVM IR (-O0):
@second_order_IIR_direct_form_II_fixed.delay = internal global [3 x i16] zeroinitializer
define i32 @second_order_IIR_direct_form_II_fixed(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i64
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
store i64 %9, i64* %7
%10 = load i64, i64* %7
%11 = trunc i64 %10 to i16
%12 = sext i16 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @second_order_IIR_direct_form_II_fixed(i32* nocapture readnone %0, i32 %1, i32* nocapture readnone %2) {
%4 = shl i32 %1, 16
%5 = ashr exact i32 %4, 16
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t endianSwapU32(uint32_t u) {
  uint32_t tmp = 0;
  tmp |= ((u >> 24) & (0xff << 0));
  tmp |= ((u >> 8) & (0xff << 8));
  tmp |= ((u << 8) & (0xff << 16));
  tmp |= ((u << 24) & (0xff << 24));
  return tmp;
}


x86 assembly (clang, -O0):
<endianSwapU32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff00,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
and    $0xff0000,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x18,%eax
and    $0xff000000,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @endianSwapU32(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = ashr i32 %4, 24
%6 = and i32 %5, 255
%7 = load i32, i32* %3
%8 = or i32 %7, %6
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = ashr i32 %9, 8
%11 = and i32 %10, 65280
%12 = load i32, i32* %3
%13 = or i32 %12, %11
store i32 %13, i32* %3
%14 = load i32, i32* %2
%15 = shl i32 %14, 8
%16 = and i32 %15, 16711680
%17 = load i32, i32* %3
%18 = or i32 %17, %16
store i32 %18, i32* %3
%19 = load i32, i32* %2
%20 = shl i32 %19, 24
%21 = and i32 %20, -16777216
%22 = load i32, i32* %3
%23 = or i32 %22, %21
store i32 %23, i32* %3
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @endianSwapU32(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
int mswin_minorver() { return (1); }


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

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

LLVM IR (-O0):
define i32 @mswin_minorver() {
ret i32 1
}

LLVM IR (-O2):
define i32 @mswin_minorver() {
ret i32 1
}
/* Variables and functions */
int bitcount(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("%d\n", bitcount(~0));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xffffffff,%edi
call   1040 <bitcount@plt>
lea    0xece(%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"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @bitcount(i32 -1)
%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"
define i32 @main() {
%1 = tail call i32 @bitcount(i32 -1)
%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*/ ansi_out(char *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void beep2(int duration, int frequency) {
  ansi_out("\a");
  if (!0)
    fflush(stdout);
}


x86 assembly (clang, -O0):
<beep2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xecb(%rip),%rdi
call   1040 <ansi_out@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<beep2>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <ansi_out@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1030 <fflush@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\07\00"
@stdout = global i32 0
define void @beep2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @ansi_out(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @stdout
%7 = call i32 @fflush(i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\07\00"
@stdout = global i32 0
define void @beep2(i32 %0, i32 %1) {
%3 = tail call i32 @ansi_out(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
ret void
}
unsigned char *inv_int32_to_big8(long x, unsigned char *big8) {
  big8[0] = (unsigned char)((x >> 24) & 0xff);
  big8[1] = (unsigned char)((x >> 16) & 0xff);
  big8[2] = (unsigned char)((x >> 8) & 0xff);
  big8[3] = (unsigned char)(x & 0xff);
  return big8;
}


x86 assembly (clang, -O0):
<inv_int32_to_big8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x18,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
sar    $0x10,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%rax
sar    $0x8,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x8(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inv_int32_to_big8>:
mov    %rsi,%rax
bswap  %edi
mov    %edi,(%rsi)
ret

LLVM IR (-O0):
define i8* @inv_int32_to_big8(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%5 = load i64, i64* %3
%6 = ashr i64 %5, 24
%7 = and i64 %6, 255
%8 = trunc i64 %7 to i8
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i64, i64* %3
%12 = ashr i64 %11, 16
%13 = and i64 %12, 255
%14 = trunc i64 %13 to i8
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
%17 = load i64, i64* %3
%18 = ashr i64 %17, 8
%19 = and i64 %18, 255
%20 = trunc i64 %19 to i8
%21 = load i8*, i8** %4
%22 = getelementptr inbounds i8, i8* %21, i64 2
store i8 %20, i8* %22
%23 = load i64, i64* %3
%24 = and i64 %23, 255
%25 = trunc i64 %24 to i8
%26 = load i8*, i8** %4
%27 = getelementptr inbounds i8, i8* %26, i64 3
store i8 %25, i8* %27
%28 = load i8*, i8** %4
ret i8* %28
}

LLVM IR (-O2):
define i8* @inv_int32_to_big8(i64 %0, i8* returned writeonly %1) {
%3 = lshr i64 %0, 24
%4 = trunc i64 %3 to i8
store i8 %4, i8* %1
%5 = lshr i64 %0, 16
%6 = trunc i64 %5 to i8
%7 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %6, i8* %7
%8 = lshr i64 %0, 8
%9 = trunc i64 %8 to i8
%10 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %9, i8* %10
%11 = trunc i64 %0 to i8
%12 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %11, i8* %12
ret i8* %1
}
void prefetchnta(void *p) { asm volatile("prefetchnta (%0)\n\t" : : "r"(p)); }


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

x86 assembly (clang, -O2):
<prefetchnta>:
prefetchnta (%rdi)
ret

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

LLVM IR (-O2):
define void @prefetchnta(i8* %0) {
tail call void asm sideeffect "prefetchnta ($0)\0A\09", "r,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret void
}
void i2s_ASN1_ENUMERATED(void) {}


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

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

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

LLVM IR (-O2):
define void @i2s_ASN1_ENUMERATED() {
ret void
}
double h(double rohair, double dTair, double rah) {
  return (rohair * 1004 * dTair / rah);
}


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  0xee5(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<h>:
mulsd  0xef8(%rip),%xmm0
mulsd  %xmm1,%xmm0
divsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @h(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = fmul double %7, 1.004000e+03
%9 = load double, double* %5
%10 = fmul double %8, %9
%11 = load double, double* %6
%12 = fdiv double %10, %11
ret double %12
}

LLVM IR (-O2):
define double @h(double %0, double %1, double %2) {
%4 = fmul double %0, 1.004000e+03
%5 = fmul double %4, %1
%6 = fdiv double %5, %2
ret double %6
}
void *clrmem5(void *s) { return __builtin_memset(s, 0, 512); }


x86 assembly (clang, -O0):
<clrmem5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    %rdi,-0x10(%rbp)
xor    %esi,%esi
mov    $0x200,%edx
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clrmem5>:
mov    $0x200,%edx
xor    %esi,%esi
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define i8* @clrmem5(i8* returned writeonly %0) {
tail call void @llvm.memset.p0i8.i64(i8* align 1 dereferenceable(512) %0, i8 0, i64 512, i1 false)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("Hello git \n"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
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 = [12 x i8] c"Hello git \0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [11 x i8] c"Hello git \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct addrinfo {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct addrinfo *);
void proxy_freeaddrinfo(struct addrinfo *res) { free(res); }


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

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

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

LLVM IR (-O2):
%struct.addrinfo = type { i32 }
define void @proxy_freeaddrinfo(%struct.addrinfo* nocapture %0) {
%2 = tail call i32 @free(%struct.addrinfo* %0)
ret void
}
int my_isspace(int c) { return c == ' ' || (unsigned)c - '\t' < 5; }


x86 assembly (clang, -O0):
<my_isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1125 <my_isspace+0x25>
mov    -0x4(%rbp),%eax
sub    $0x9,%eax
cmp    $0x5,%eax
setb   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_isspace>:
cmp    $0x20,%edi
sete   %al
add    $0xfffffff7,%edi
cmp    $0x5,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @my_isspace(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 32
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub i32 %6, 9
%8 = icmp ult i32 %7, 5
br label %9
9: ; preds = %5, %1
%10 = phi i1 [ true, %1 ], [ %8, %5 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @my_isspace(i32 %0) {
%2 = icmp eq i32 %0, 32
%3 = add i32 %0, -9
%4 = icmp ult i32 %3, 5
%5 = or i1 %2, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ _vdo(int, int, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ exit(int);
void verrc(int err, int eval, const char *fmt, va_list args) {
  _vdo(err, 1, fmt, args);
  exit(eval);
}


x86 assembly (clang, -O0):
<verrc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x1,%esi
call   1030 <_vdo@plt>
mov    -0x8(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<verrc>:
push   %rbx
mov    %esi,%ebx
mov    $0x1,%esi
call   1030 <_vdo@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @verrc(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %7
%11 = load i32, i32* %8
%12 = call i32 @_vdo(i32 %9, i32 1, i8* %10, i32 %11)
%13 = load i32, i32* %6
%14 = call i32 @exit(i32 %13)
unreachable
}

LLVM IR (-O2):
define void @verrc(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @_vdo(i32 %0, i32 1, i8* %2, i32 %3)
%6 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
char isnan(double);
char futhark_isnan64(double x) { return isnan(x); }


x86 assembly (clang, -O0):
<futhark_isnan64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <isnan@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<futhark_isnan64>:
jmp    1030 <isnan@plt>

LLVM IR (-O0):
define signext i8 @futhark_isnan64(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call signext i8 @isnan(double %3)
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @futhark_isnan64(double %0) {
%2 = tail call signext i8 @isnan(double %0)
ret i8 %2
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOTSUP;
int /*<<< orphan*/ errno;
pid_t _fork() {
  errno = ENOTSUP;
  return -1;
}


x86 assembly (clang, -O0):
<_fork>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec4(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@ENOTSUP = global i32 0
@errno = global i32 0
define i32 @_fork() {
%1 = load i32, i32* @ENOTSUP
store i32 %1, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOTSUP = global i32 0
@errno = global i32 0
define i32 @_fork() {
%1 = load i32, i32* @ENOTSUP
store i32 %1, i32* @errno
ret i32 -1
}
/* Variables and functions */
int most_significant_bit_pos_uchar(unsigned char);
int most_significant_bit_pos_char(char num) {
  return most_significant_bit_pos_uchar((unsigned char)(int)num);
}


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

x86 assembly (clang, -O2):
<most_significant_bit_pos_char>:
movzbl %dil,%edi
jmp    1030 <most_significant_bit_pos_uchar@plt>

LLVM IR (-O0):
define i32 @most_significant_bit_pos_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = trunc i32 %4 to i8
%6 = call i32 @most_significant_bit_pos_uchar(i8 zeroext %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @most_significant_bit_pos_char(i8 signext %0) {
%2 = tail call i32 @most_significant_bit_pos_uchar(i8 zeroext %0)
ret i32 %2
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ S_ISFIFO(int /*<<< orphan*/);
int fileno(int /*<<< orphan*/ *);
int fstat(int, struct stat *);
int ispipe(FILE *fp) {
  int fd = fileno(fp);
  struct stat st;
  int r = fstat(fd, &st);
  return (fd <= 0 && S_ISFIFO(st.st_mode));
}


x86 assembly (clang, -O0):
<ispipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fileno@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1050 <fstat@plt>
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0x15(%rbp)
jg     1178 <ispipe+0x48>
mov    -0x10(%rbp),%edi
call   1030 <S_ISFIFO@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ispipe>:
push   %rbx
sub    $0x10,%rsp
call   1040 <fileno@plt>
mov    %eax,%ebx
lea    0x8(%rsp),%rsi
mov    %eax,%edi
call   1050 <fstat@plt>
xor    %eax,%eax
test   %ebx,%ebx
jg     1162 <ispipe+0x32>
mov    0x8(%rsp),%edi
call   1030 <S_ISFIFO@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @ispipe(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca %struct.stat
%5 = alloca i32
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = call i32 @fileno(i32* %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i32 @fstat(i32 %8, %struct.stat* %4)
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = icmp sle i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %1
%13 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%14 = load i32, i32* %13
%15 = call i64 @S_ISFIFO(i32 %14)
%16 = icmp ne i64 %15, 0
br label %17
17: ; preds = %12, %1
%18 = phi i1 [ false, %1 ], [ %16, %12 ]
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @ispipe(i32* nocapture %0) {
%2 = alloca %struct.stat
%3 = tail call i32 @fileno(i32* %0)
%4 = bitcast %struct.stat* %2 to i8*
%5 = call i32 @fstat(i32 %3, %struct.stat* %2)
%6 = icmp slt i32 %3, 1
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%9 = load i32, i32* %8
%10 = tail call i64 @S_ISFIFO(i32 %9)
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %7, %1
%14 = phi i32 [ 0, %1 ], [ %12, %7 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *s) { fprintf(stderr, "%s <n>\n", s); }


x86 assembly (clang, -O0):
<usage>:
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 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [8 x i8] c"%s <n>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"%s <n>\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISREG(int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
int isFile(const char *file) {
  struct stat info;
  if (stat(file, &info) != 0)
    return 0;
  else if (S_ISREG(info.st_mode))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
je     114f <isFile+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1174 <isFile+0x54>
mov    -0x18(%rbp),%edi
call   1040 <S_ISREG@plt>
cmp    $0x0,%rax
je     116d <isFile+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    1174 <isFile+0x54>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isFile>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1135 <isFile+0x15>
pop    %rcx
ret
mov    (%rsp),%edi
call   1040 <S_ISREG@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @isFile(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %16
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i64 @S_ISREG(i32 %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %9
store i32 1, i32* %2
br label %16
15: ; preds = %9
store i32 0, i32* %2
br label %16
16: ; preds = %15, %14, %8
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @isFile(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i64 @S_ISREG(i32 %8)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ 0, %1 ], [ %11, %6 ]
ret i32 %13
}
/* Variables and functions */
unsigned int const rand();
unsigned int random(const unsigned int min, const unsigned int max) {
  return rand() % (max - min + 1) + min;
}


x86 assembly (clang, -O0):
<random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
xor    %edx,%edx
div    %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @random(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @rand()
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub i32 %6, %7
%9 = add i32 %8, 1
%10 = urem i32 %5, %9
%11 = load i32, i32* %3
%12 = add i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @random(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = urem i32 %3, %5
%7 = add i32 %6, %0
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ Depth;

/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ malloc(int);
void *alloc_Depth(void) {
  Depth *_p = (Depth *)malloc(sizeof(Depth));
  if (_p == NULL)
    abort();
  return (void *)_p;
}


x86 assembly (clang, -O0):
<alloc_Depth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <alloc_Depth+0x28>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_Depth>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1132 <alloc_Depth+0x12>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @alloc_Depth() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = load i32*, i32** %1
%10 = bitcast i32* %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
define i8* @alloc_Depth() {
%1 = tail call i64 @malloc(i32 4)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = inttoptr i64 %1 to i8*
ret i8* %6
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int memcmp(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
int long_memcmp(int64_t *x, int64_t *y) {
  return memcmp(x, y, sizeof(int64_t));
}


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

x86 assembly (clang, -O2):
<long_memcmp>:
mov    $0x4,%edx
jmp    1030 <memcmp@plt>

LLVM IR (-O0):
define i32 @long_memcmp(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 @memcmp(i32* %5, i32* %6, i32 4)
ret i32 %7
}

LLVM IR (-O2):
define i32 @long_memcmp(i32* %0, i32* %1) {
%3 = tail call i32 @memcmp(i32* %0, i32* %1, i32 4)
ret i32 %3
}
void convolution_deriv_2d(double *fld1, double *fld2, double *res, double *fac,
                          int jstart, int ncols, int ntrans) {
  return;
}


x86 assembly (clang, -O0):
<convolution_deriv_2d>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @convolution_deriv_2d(double* %0, double* %1, double* %2, double* %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
%11 = alloca double*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store double* %0, double** %8
store double* %1, double** %9
store double* %2, double** %10
store double* %3, double** %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
ret void
}

LLVM IR (-O2):
define void @convolution_deriv_2d(double* nocapture %0, double* nocapture %1, double* nocapture %2, double* nocapture %3, i32 %4, i32 %5, i32 %6) {
ret void
}
int show_usage(void) { return -1; }


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

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

LLVM IR (-O0):
define i32 @show_usage() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @show_usage() {
ret i32 -1
}
int fib(int input) {
  if (input == 0) {
    return 0;
  } else if (input == 1) {
    return 1;
  }
  return fib(input - 1) + fib(input - 2);
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <fib+0x21>
movl   $0x0,-0x4(%rbp)
jmp    116f <fib+0x5f>
cmpl   $0x1,-0x8(%rbp)
jne    1147 <fib+0x37>
movl   $0x1,-0x4(%rbp)
jmp    116f <fib+0x5f>
jmp    114c <fib+0x3c>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%ebx
jb     1132 <fib+0x22>
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <fib@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x2,%ebx
jae    1120 <fib+0x10>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i32 [ 0, %1 ], [ %10, %6 ]
%4 = phi i32 [ %0, %1 ], [ %9, %6 ]
%5 = icmp ult i32 %4, 2
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = add nsw i32 %4, -1
%8 = tail call i32 @fib(i32 %7)
%9 = add nsw i32 %4, -2
%10 = add nsw i32 %8, %3
br label %2
11: ; preds = %2
%12 = add nsw i32 %4, %3
ret i32 %12
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *name(const char *pszPath) {
  const char *psz = strrchr(pszPath, '/');
  return psz ? psz + 1 : pszPath;
}


x86 assembly (clang, -O0):
<name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <name+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <name+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @name(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
br label %13
11: ; preds = %1
%12 = load i8*, i8** %2
br label %13
13: ; preds = %11, %8
%14 = phi i8* [ %10, %8 ], [ %12, %11 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @name(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void strcatMia(char *dst, char *src1, char *src2) {
  strcpy(dst, "");
  strcpy(dst, src1);
  strcat(dst, src2);
}


x86 assembly (clang, -O0):
<strcatMia>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec1(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcatMia>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0xecb(%rip),%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <strcat@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @strcatMia(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** %4
%8 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%9 = load i8*, i8** %4
%10 = load i8*, i8** %5
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %4
%13 = load i8*, i8** %6
%14 = call i32 @strcat(i8* %12, i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @strcatMia(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @strcpy(i8* %0, i8* %1)
%6 = tail call i32 @strcat(i8* %0, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_status() { printf("called after atexit()...bye, cruel world!\n"); }


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

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

LLVM IR (-O0):
@.str = [43 x i8] c"called after atexit()...bye, cruel world!\0A\00"
define void @print_status() {
%1 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [42 x i8] c"called after atexit()...bye, cruel world!\00"
define void @print_status() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double errorDiv(double, double, double, double);
double *uncertainDiv(double A, double errorA, double B, double errorB) {
  static double retorno[2];
  retorno[0] = A / B;
  retorno[1] = errorDiv(A, errorA, B, errorB);
  return retorno;
}


x86 assembly (clang, -O0):
<uncertainDiv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,0x2f02(%rip)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
call   1030 <errorDiv@plt>
movsd  %xmm0,0x2ee9(%rip)
lea    0x2eda(%rip),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uncertainDiv>:
push   %rbx
movapd %xmm0,%xmm4
divsd  %xmm2,%xmm4
movsd  %xmm4,0x2f1f(%rip)
lea    0x2f18(%rip),%rbx
call   1030 <errorDiv@plt>
movsd  %xmm0,0x2f13(%rip)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@uncertainDiv.retorno = internal global [2 x double] zeroinitializer
define double* @uncertainDiv(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %7
%11 = fdiv double %9, %10
store double %11, double* getelementptr inbounds ([2 x double], [2 x double]* @uncertainDiv.retorno, i64 0, i64 0)
%12 = load double, double* %5
%13 = load double, double* %6
%14 = load double, double* %7
%15 = load double, double* %8
%16 = call double @errorDiv(double %12, double %13, double %14, double %15)
store double %16, double* getelementptr inbounds ([2 x double], [2 x double]* @uncertainDiv.retorno, i64 0, i64 1)
ret double* getelementptr inbounds ([2 x double], [2 x double]* @uncertainDiv.retorno, i64 0, i64 0)
}

LLVM IR (-O2):
@uncertainDiv.retorno = internal global [2 x double] zeroinitializer
define double* @uncertainDiv(double %0, double %1, double %2, double %3) {
%5 = fdiv double %0, %2
store double %5, double* getelementptr inbounds ([2 x double], [2 x double]* @uncertainDiv.retorno, i64 0, i64 0)
%6 = tail call double @errorDiv(double %0, double %1, double %2, double %3)
store double %6, double* getelementptr inbounds ([2 x double], [2 x double]* @uncertainDiv.retorno, i64 0, i64 1)
ret double* getelementptr inbounds ([2 x double], [2 x double]* @uncertainDiv.retorno, i64 0, i64 0)
}
char *benchmark_result() {
  static char result = '\0';
  ;
  return (&result);
}


x86 assembly (clang, -O0):
<benchmark_result>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f16(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<benchmark_result>:
lea    0x2f1a(%rip),%rax
ret

LLVM IR (-O0):
@benchmark_result.result = internal global i8 0
define i8* @benchmark_result() {
ret i8* @benchmark_result.result
}

LLVM IR (-O2):
@benchmark_result.result = internal global i8 0
define i8* @benchmark_result() {
ret i8* @benchmark_result.result
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_usage(void) {
  fprintf(stderr, "Usage: send_pkt -i <iface> -n <mac_num>\n\n"
                  "\t-i <iface>\tinterface for packet sending\n"
                  "\t-n <mac_num>\tnumber of MAC's\n"
                  "\t-s \t\twork in slow mode\n"
                  "\t-r \t\tgenerate random Src MAC for each new packet\n"
                  "\t-a \t\tAll field of MAC set as random\n\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [225 x i8] c"Usage: send_pkt -i <iface> -n <mac_num>\0A\0A\09-i <iface>\09interface for packet sending\0A\09-n <mac_num>\09number of MAC's\0A\09-s \09\09work in slow mode\0A\09-r \09\09generate random Src MAC for each new packet\0A\09-a \09\09All field of MAC set as random\0A\0A\00"
@EXIT_FAILURE = global i32 0
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([225 x i8], [225 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [225 x i8] c"Usage: send_pkt -i <iface> -n <mac_num>\0A\0A\09-i <iface>\09interface for packet sending\0A\09-n <mac_num>\09number of MAC's\0A\09-s \09\09work in slow mode\0A\09-r \09\09generate random Src MAC for each new packet\0A\09-a \09\09All field of MAC set as random\0A\0A\00"
@EXIT_FAILURE = global i32 0
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([225 x i8], [225 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int rl_ding();
int ding() { return rl_ding(); }


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

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

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

LLVM IR (-O2):
define i32 @ding() {
%1 = tail call i32 (...) @rl_ding()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ entry_test();
int main() {
  entry_test();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @entry_test()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x7f() {
  Assert_real((islower(127) == 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_islower.c",
              640, ("islower should be 0 for 0x7f"));
}


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

x86 assembly (clang, -O2):
<t_islower_0x7f>:
push   %rax
mov    $0x7f,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x280,%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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0x7f\00"
define void @t_islower_0x7f() {
%1 = call i64 @islower(i32 127)
%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 640, 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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0x7f\00"
define void @t_islower_0x7f() {
%1 = tail call i64 @islower(i32 127)
%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 640, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *strndup(const char *s, size_t n) {
  char *str = malloc(n + 1);
  if (str) {
    strncpy(str, s, n);
    str[n] = '\0';
  }
  return str;
}


x86 assembly (clang, -O0):
<strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1169 <strndup+0x49>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strndup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
lea    0x1(%rsi),%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     114f <strndup+0x2f>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <strncpy@plt>
movb   $0x0,(%rbx,%r14,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @strndup(i8* %0, i64 %1) {
%3 = add i64 %1, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = tail call i32 @strncpy(i8* %4, i8* %0, i64 %1)
%8 = getelementptr inbounds i8, i8* %4, i64 %1
store i8 0, i8* %8
br label %9
9: ; preds = %6, %2
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ init_KNP_attacks();
int /*<<< orphan*/ init_rays();
void init_bitboard() {
  init_KNP_attacks();
  init_rays();
}


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

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

LLVM IR (-O0):
define void @init_bitboard() {
%1 = call i32 (...) @init_KNP_attacks()
%2 = call i32 (...) @init_rays()
ret void
}

LLVM IR (-O2):
define void @init_bitboard() {
%1 = tail call i32 (...) @init_KNP_attacks()
%2 = tail call i32 (...) @init_rays()
ret void
}
/* Variables and functions */
float *malloc(int);
float *malloc_float(float f) {
  float *float_ptr;
  float_ptr = malloc(sizeof(float));
  *(float *)float_ptr = f;
  return float_ptr;
}


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

x86 assembly (clang, -O2):
<malloc_float>:
push   %rax
movss  %xmm0,0x4(%rsp)
mov    $0x4,%edi
call   1030 <malloc@plt>
movss  0x4(%rsp),%xmm0
movss  %xmm0,(%rax)
pop    %rcx
ret

LLVM IR (-O0):
define float* @malloc_float(float %0) {
%2 = alloca float
%3 = alloca float*
store float %0, float* %2
%4 = call float* @malloc(i32 4)
store float* %4, float** %3
%5 = load float, float* %2
%6 = load float*, float** %3
store float %5, float* %6
%7 = load float*, float** %3
ret float* %7
}

LLVM IR (-O2):
define noalias float* @malloc_float(float %0) {
%2 = tail call float* @malloc(i32 4)
store float %0, float* %2
ret float* %2
}
/* Variables and functions */
int /*<<< orphan*/ generate_dsa_keypair_interactive();
int main(int argc, char *argv[]) { generate_dsa_keypair_interactive(); }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @generate_dsa_keypair_interactive()
ret i32 0
}