xunge/DecIR huggingface dataset:
/* Type definitions */
struct timespec {
  long tv_sec;
  long tv_nsec;
};

/* Variables and functions */
long int timespec_to_nsec(struct timespec temp) {
  return temp.tv_sec * 1000000000L + temp.tv_nsec;
}


x86 assembly (clang, -O0):
<timespec_to_nsec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
imul   $0x3b9aca00,-0x10(%rbp),%rax
3b
add    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespec_to_nsec>:
imul   $0x3b9aca00,%rdi,%rax
add    %rsi,%rax
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define i64 @timespec_to_nsec(i64 %0, i64 %1) {
%3 = alloca %struct.timespec
%4 = bitcast %struct.timespec* %3 to { i64, i64 }*
%5 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %4, i32 0, i32 0
store i64 %0, i64* %5
%6 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %4, i32 0, i32 1
store i64 %1, i64* %6
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%8 = load i64, i64* %7
%9 = mul nsw i64 %8, 1000000000
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%11 = load i64, i64* %10
%12 = add nsw i64 %9, %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @timespec_to_nsec(i64 %0, i64 %1) {
%3 = mul nsw i64 %0, 1000000000
%4 = add nsw i64 %3, %1
ret i64 %4
}
void lstore(long long value, unsigned char *to) {
  int index = 5;
  to[index] = value;
  while (index--)
    to[index] = (value = value >> 8);
}


x86 assembly (clang, -O0):
<lstore>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x5,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %al,%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
je     1156 <lstore+0x56>
mov    -0x8(%rbp),%rax
sar    $0x8,%rax
mov    %rax,-0x8(%rbp)
mov    %al,%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
jmp    1124 <lstore+0x24>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lstore>:
mov    %edi,%eax
bswap  %eax
mov    %eax,0x2(%rsi)
mov    %rdi,%rax
shr    $0x20,%rax
mov    %al,0x1(%rsi)
shr    $0x28,%rdi
mov    %dil,(%rsi)
ret

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

LLVM IR (-O2):
define void @lstore(i64 %0, i8* nocapture writeonly %1) {
%3 = trunc i64 %0 to i8
%4 = getelementptr inbounds i8, i8* %1, i64 5
store i8 %3, i8* %4
%5 = lshr i64 %0, 8
%6 = trunc i64 %5 to i8
%7 = getelementptr inbounds i8, i8* %1, i64 4
store i8 %6, i8* %7
%8 = lshr i64 %0, 16
%9 = trunc i64 %8 to i8
%10 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %9, i8* %10
%11 = lshr i64 %0, 24
%12 = trunc i64 %11 to i8
%13 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %12, i8* %13
%14 = lshr i64 %0, 32
%15 = trunc i64 %14 to i8
%16 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %15, i8* %16
%17 = lshr i64 %0, 40
%18 = trunc i64 %17 to i8
store i8 %18, i8* %1
ret void
}
void set_PMUX_A(unsigned char pinnum, unsigned char value) {
  value &= 0x08;
  unsigned char pmux_n =
      *(unsigned char volatile *)(0x41004400 + 0x30 + (pinnum / 2));
  unsigned char offset = pinnum % 2;
  unsigned char buf = pmux_n;
  buf &= (0xF0 >> (offset * 4));
  buf |= (value << (offset * 4));
  pmux_n = buf;
}


x86 assembly (clang, -O0):
<set_PMUX_A>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
and    $0x8,%eax
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x41004430,%eax
cltq
mov    (%rax),%al
mov    %al,-0x3(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %dl,%al
mov    %al,-0x4(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x5(%rbp)
movzbl -0x4(%rbp),%ecx
shl    $0x2,%ecx
mov    $0xf0,%eax
sar    %cl,%eax
mov    %eax,%ecx
movzbl -0x5(%rbp),%eax
and    %ecx,%eax
mov    %al,-0x5(%rbp)
movzbl -0x2(%rbp),%eax
movzbl -0x4(%rbp),%ecx
shl    $0x2,%ecx
shl    %cl,%eax
mov    %eax,%ecx
movzbl -0x5(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
mov    %al,-0x3(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_PMUX_A>:
mov    %edi,%eax
shr    %rax
mov    0x41004430(%rax),%al
ret

LLVM IR (-O0):
define void @set_PMUX_A(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%8 = load i8, i8* %4
%9 = zext i8 %8 to i32
%10 = and i32 %9, 8
%11 = trunc i32 %10 to i8
store i8 %11, i8* %4
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = sdiv i32 %13, 2
%15 = add nsw i32 1090536496, %14
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i8*
%18 = load volatile i8, i8* %17
store i8 %18, i8* %5
%19 = load i8, i8* %3
%20 = zext i8 %19 to i32
%21 = srem i32 %20, 2
%22 = trunc i32 %21 to i8
store i8 %22, i8* %6
%23 = load i8, i8* %5
store i8 %23, i8* %7
%24 = load i8, i8* %6
%25 = zext i8 %24 to i32
%26 = mul nsw i32 %25, 4
%27 = ashr i32 240, %26
%28 = load i8, i8* %7
%29 = zext i8 %28 to i32
%30 = and i32 %29, %27
%31 = trunc i32 %30 to i8
store i8 %31, i8* %7
%32 = load i8, i8* %4
%33 = zext i8 %32 to i32
%34 = load i8, i8* %6
%35 = zext i8 %34 to i32
%36 = mul nsw i32 %35, 4
%37 = shl i32 %33, %36
%38 = load i8, i8* %7
%39 = zext i8 %38 to i32
%40 = or i32 %39, %37
%41 = trunc i32 %40 to i8
store i8 %41, i8* %7
%42 = load i8, i8* %7
store i8 %42, i8* %5
ret void
}

LLVM IR (-O2):
define void @set_PMUX_A(i8 zeroext %0, i8 zeroext %1) {
%3 = lshr i8 %0, 1
%4 = zext i8 %3 to i64
%5 = add nuw nsw i64 %4, 1090536496
%6 = inttoptr i64 %5 to i8*
%7 = load volatile i8, i8* %6
ret void
}
/* Type definitions */
struct castle_norm_key {
  int dummy;
};

/* Variables and functions */
size_t castle_norm_key_len_get(struct castle_norm_key const *,
                               unsigned char const **);
const unsigned char *castle_norm_key_end(const struct castle_norm_key *key,
                                         const unsigned char **data) {
  size_t length = castle_norm_key_len_get(key, data);
  return *data + length;
}


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

x86 assembly (clang, -O2):
<castle_norm_key_end>:
push   %rbx
mov    %rsi,%rbx
call   1030 <castle_norm_key_len_get@plt>
add    (%rbx),%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.castle_norm_key = type { i32 }
define i8* @castle_norm_key_end(%struct.castle_norm_key* %0, i8** %1) {
%3 = alloca %struct.castle_norm_key*
%4 = alloca i8**
%5 = alloca i64
store %struct.castle_norm_key* %0, %struct.castle_norm_key** %3
store i8** %1, i8*** %4
%6 = load %struct.castle_norm_key*, %struct.castle_norm_key** %3
%7 = load i8**, i8*** %4
%8 = call i64 @castle_norm_key_len_get(%struct.castle_norm_key* %6, i8** %7)
store i64 %8, i64* %5
%9 = load i8**, i8*** %4
%10 = load i8*, i8** %9
%11 = load i64, i64* %5
%12 = getelementptr inbounds i8, i8* %10, i64 %11
ret i8* %12
}

LLVM IR (-O2):
%struct.castle_norm_key = type { i32 }
define i8* @castle_norm_key_end(%struct.castle_norm_key* %0, i8** %1) {
%3 = tail call i64 @castle_norm_key_len_get(%struct.castle_norm_key* %0, i8** %1)
%4 = load i8*, i8** %1
%5 = getelementptr inbounds i8, i8* %4, i64 %3
ret i8* %5
}
/* Variables and functions */
double sla_airmas_(double *);
double slaAirmas(double zd) {
  double ZD;
  double result;
  ZD = zd;
  result = sla_airmas_(&ZD);
  return result;
}


x86 assembly (clang, -O0):
<slaAirmas>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <sla_airmas_@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slaAirmas>:
push   %rax
movsd  %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <sla_airmas_@plt>
pop    %rax
ret

LLVM IR (-O0):
define double @slaAirmas(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
store double %5, double* %3
%6 = call double @sla_airmas_(double* %3)
store double %6, double* %4
%7 = load double, double* %4
ret double %7
}

LLVM IR (-O2):
define double @slaAirmas(double %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
store double %0, double* %2
%4 = call double @sla_airmas_(double* %2)
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
long fwrite(void const *, long, long, int /*<<< orphan*/ *);
long _sys_fwrite(const void *buffer, long size, long count, FILE *file) {
  return (fwrite(buffer, size, count, file));
}


x86 assembly (clang, -O0):
<_sys_fwrite>:
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   1030 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sys_fwrite>:
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
define i64 @_sys_fwrite(i8* %0, i64 %1, i64 %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32* %3, i32** %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = load i32*, i32** %8
%13 = call i64 @fwrite(i8* %9, i64 %10, i64 %11, i32* %12)
ret i64 %13
}

LLVM IR (-O2):
define i64 @_sys_fwrite(i8* nocapture %0, i64 %1, i64 %2, i32* nocapture %3) {
%5 = tail call i64 @fwrite(i8* %0, i64 %1, i64 %2, i32* %3)
ret i64 %5
}
void bitmap_zero(unsigned long *bitmap, int bits) {
  for (int i = 0; i < (((bits) + 64 - 1) / 64); i++)
    bitmap[i] = 0;
}


x86 assembly (clang, -O0):
<bitmap_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    $0x40,%eax
sub    $0x1,%eax
mov    $0x40,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
jge    1154 <bitmap_zero+0x54>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <bitmap_zero+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_zero>:
test   %esi,%esi
jle    112b <bitmap_zero+0x1b>
push   %rax
mov    %esi,%edx
add    $0x3f,%edx
shr    $0x3,%edx
and    $0xfffffff8,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @bitmap_zero(i64* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = add nuw nsw i32 %1, 63
%6 = bitcast i64* %0 to i8*
%7 = lshr i32 %5, 3
%8 = and i32 %7, 536870904
%9 = zext i32 %8 to i64
br label %10
10: ; preds = %4, %2
ret void
}
int test_imm_E1int16_mem(short *val) {
  return ((*val) & (0xE1 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E1int16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xe1,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_E1int16_mem>:
testb  $0xe1,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_E1int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 225
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
__attribute__((weak)) void __core_init(void) {}


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

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

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

LLVM IR (-O2):
define weak void @__core_init() {
ret void
}
int mvaddstr(int y, int x, const char *str) {
  (void)y;
  (void)x;
  (void)str;
  return (0);
}


x86 assembly (clang, -O0):
<mvaddstr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @mvaddstr(i32 %0, i32 %1, i8* nocapture readnone %2) {
ret i32 0
}
void *strdup(char *str) {
  char *p = malloc(strlen(str) + 1);
  strcpy(p, str);
  return p;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i8* @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @strdup(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i8* @strcpy(i8* dereferenceable(1) %4, i8* dereferenceable(1) %0)
ret i8* %4
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_size;
};
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ stat(char *, struct stat *);
off_t get_filesize(char *n) {
  struct stat sb;
  stat(n, &sb);
  return sb.st_size;
}


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

x86 assembly (clang, -O2):
<get_filesize>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @get_filesize(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @stat(i8* %4, %struct.stat* %3)
%6 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @get_filesize(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ _IOLBF;
int /*<<< orphan*/ gpio_cfg_input(int, int);
int /*<<< orphan*/ gpio_init();
int /*<<< orphan*/ setvbuf(int /*<<< orphan*/, int /*<<< orphan*/ *,
                           int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void setup() {
  setvbuf(stdout, NULL, _IOLBF, 0);
  gpio_init();
  gpio_cfg_input((3 * 0x24), (3));
  gpio_cfg_input((3 * 0x24), (4));
}


x86 assembly (clang, -O0):
<setup>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    0x2e9c(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
xor    %ecx,%ecx
call   1040 <setvbuf@plt>
mov    $0x0,%al
call   1050 <gpio_init@plt>
mov    $0x6c,%edi
mov    $0x3,%esi
call   1030 <gpio_cfg_input@plt>
mov    $0x6c,%edi
mov    $0x4,%esi
call   1030 <gpio_cfg_input@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup>:
push   %rax
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
mov    0x2e9f(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
xor    %ecx,%ecx
call   1040 <setvbuf@plt>
xor    %eax,%eax
call   1050 <gpio_init@plt>
mov    $0x6c,%edi
mov    $0x3,%esi
call   1030 <gpio_cfg_input@plt>
mov    $0x6c,%edi
mov    $0x4,%esi
pop    %rax
jmp    1030 <gpio_cfg_input@plt>

LLVM IR (-O0):
@stdout = global i32 0
@_IOLBF = global i32 0
define void @setup() {
%1 = load i32, i32* @stdout
%2 = load i32, i32* @_IOLBF
%3 = call i32 @setvbuf(i32 %1, i32* null, i32 %2, i32 0)
%4 = call i32 (...) @gpio_init()
%5 = call i32 @gpio_cfg_input(i32 108, i32 3)
%6 = call i32 @gpio_cfg_input(i32 108, i32 4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@_IOLBF = global i32 0
define void @setup() {
%1 = load i32, i32* @stdout
%2 = load i32, i32* @_IOLBF
%3 = tail call i32 @setvbuf(i32 %1, i32* null, i32 %2, i32 0)
%4 = tail call i32 (...) @gpio_init()
%5 = tail call i32 @gpio_cfg_input(i32 108, i32 3)
%6 = tail call i32 @gpio_cfg_input(i32 108, i32 4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ _vdo(int /*<<< orphan*/, int /*<<< orphan*/, char const *,
                        int /*<<< orphan*/);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
void verrx(int eval, const char *fmt, va_list args) {
  _vdo(errno, 0, fmt, args);
  exit(eval);
}


x86 assembly (clang, -O0):
<verrx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
xor    %esi,%esi
call   1030 <_vdo@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<verrx>:
push   %rbx
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%ebx
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1030 <_vdo@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@errno = global i32 0
define void @verrx(i32 %0, i8* %1, i32 %2) {
%4 = load i32, i32* @errno
%5 = tail call i32 @_vdo(i32 %4, i32 0, i8* %1, i32 %2)
%6 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
size_t lmc_max(size_t a, size_t b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<lmc_max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    1127 <lmc_max+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <lmc_max+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lmc_max>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmova  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @lmc_max(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 = icmp ugt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @lmc_max(i64 %0, i64 %1) {
%3 = icmp ugt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
int __VERIFIER_nondet_int(void) {
  int i;
  { return (i); }
}


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

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

LLVM IR (-O0):
define i32 @__VERIFIER_nondet_int() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @__VERIFIER_nondet_int() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0xd4() {
  Assert_real((isascii(212) == 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_isascii.c",
              1065, ("isascii should be 0 for 0xd4"));
}


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

x86 assembly (clang, -O2):
<t_isascii_0xd4>:
push   %rax
mov    $0xd4,%edi
call   1030 <isascii@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x429,%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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xd4\00"
define void @t_isascii_0xd4() {
%1 = call i64 @isascii(i32 212)
%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 1065, 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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xd4\00"
define void @t_isascii_0xd4() {
%1 = tail call i64 @isascii(i32 212)
%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 1065, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct vmbuf {
  int dummy;
};

/* Variables and functions */
scalar_t__ vmbuf_mem2(struct vmbuf *, size_t);
char *vmbuf_data_ofs(struct vmbuf *vmbuf, size_t ofs) {
  return (char *)vmbuf_mem2(vmbuf, ofs);
}


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

x86 assembly (clang, -O2):
<vmbuf_data_ofs>:
jmp    1030 <vmbuf_mem2@plt>

LLVM IR (-O0):
%struct.vmbuf = type { i32 }
define i8* @vmbuf_data_ofs(%struct.vmbuf* %0, i64 %1) {
%3 = alloca %struct.vmbuf*
%4 = alloca i64
store %struct.vmbuf* %0, %struct.vmbuf** %3
store i64 %1, i64* %4
%5 = load %struct.vmbuf*, %struct.vmbuf** %3
%6 = load i64, i64* %4
%7 = call i64 @vmbuf_mem2(%struct.vmbuf* %5, i64 %6)
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}

LLVM IR (-O2):
%struct.vmbuf = type { i32 }
define i8* @vmbuf_data_ofs(%struct.vmbuf* %0, i64 %1) {
%3 = tail call i64 @vmbuf_mem2(%struct.vmbuf* %0, i64 %1)
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void linenoiseBeep(void) { fprintf(stdout, "\x7"); }


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

x86 assembly (clang, -O2):
<linenoiseBeep>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [2 x i8] c"\07\00"
define void @linenoiseBeep() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [2 x i8] c"\07\00"
define void @linenoiseBeep() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double effective_sample_size(double const *, int const);
double ln_evaluate_exact_parametrised(double, double, double const);
double weighted_log_std(double const *, double const *, int const);
double ln_evaluate_exact(const double *data, const double *weight, const int n,
                         const double bandwidth) {
  double Sigma = weighted_log_std(data, weight, n);
  double neff = effective_sample_size(weight, n);
  return ln_evaluate_exact_parametrised(Sigma, neff, bandwidth);
}


x86 assembly (clang, -O0):
<ln_evaluate_exact>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <weighted_log_std@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1050 <effective_sample_size@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
call   1040 <ln_evaluate_exact_parametrised@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ln_evaluate_exact>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
mov    %edx,%ebp
mov    %rsi,%rbx
call   1030 <weighted_log_std@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <effective_sample_size@plt>
movaps %xmm0,%xmm1
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm2
add    $0x18,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <ln_evaluate_exact_parametrised@plt>

LLVM IR (-O0):
define double @ln_evaluate_exact(double* %0, double* %1, i32 %2, double %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double* %0, double** %5
store double* %1, double** %6
store i32 %2, i32* %7
store double %3, double* %8
%11 = load double*, double** %5
%12 = load double*, double** %6
%13 = load i32, i32* %7
%14 = call double @weighted_log_std(double* %11, double* %12, i32 %13)
store double %14, double* %9
%15 = load double*, double** %6
%16 = load i32, i32* %7
%17 = call double @effective_sample_size(double* %15, i32 %16)
store double %17, double* %10
%18 = load double, double* %9
%19 = load double, double* %10
%20 = load double, double* %8
%21 = call double @ln_evaluate_exact_parametrised(double %18, double %19, double %20)
ret double %21
}

LLVM IR (-O2):
define double @ln_evaluate_exact(double* %0, double* %1, i32 %2, double %3) {
%5 = tail call double @weighted_log_std(double* %0, double* %1, i32 %2)
%6 = tail call double @effective_sample_size(double* %1, i32 %2)
%7 = tail call double @ln_evaluate_exact_parametrised(double %5, double %6, double %3)
ret double %7
}
void cpuid(int *info, int x) {
  int ax, bx, cx, dx;
  __asm__ __volatile__("cpuid"
                       : "=a"(ax), "=b"(bx), "=c"(cx), "=d"(dx)
                       : "a"(x));
  info[0] = ax;
  info[1] = bx;
  info[2] = cx;
  info[3] = dx;
}


x86 assembly (clang, -O0):
<cpuid>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cpuid
mov    %eax,-0x18(%rbp)
mov    %ebx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    %edx,-0x24(%rbp)
mov    -0x18(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x20(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x24(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid>:
push   %rbx
mov    %esi,%eax
cpuid
mov    %eax,(%rdi)
mov    %ebx,0x4(%rdi)
mov    %ecx,0x8(%rdi)
mov    %edx,0xc(%rdi)
pop    %rbx
ret

LLVM IR (-O0):
define void @cpuid(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%9 = load i32, i32* %4
%10 = call { i32, i32, i32, i32 } asm sideeffect "cpuid", "={ax},={bx},={cx},={dx},{ax},~{dirflag},~{fpsr},~{flags}"(i32 %9)
%11 = extractvalue { i32, i32, i32, i32 } %10, 0
%12 = extractvalue { i32, i32, i32, i32 } %10, 1
%13 = extractvalue { i32, i32, i32, i32 } %10, 2
%14 = extractvalue { i32, i32, i32, i32 } %10, 3
store i32 %11, i32* %5
store i32 %12, i32* %6
store i32 %13, i32* %7
store i32 %14, i32* %8
%15 = load i32, i32* %5
%16 = load i32*, i32** %3
%17 = getelementptr inbounds i32, i32* %16, i64 0
store i32 %15, i32* %17
%18 = load i32, i32* %6
%19 = load i32*, i32** %3
%20 = getelementptr inbounds i32, i32* %19, i64 1
store i32 %18, i32* %20
%21 = load i32, i32* %7
%22 = load i32*, i32** %3
%23 = getelementptr inbounds i32, i32* %22, i64 2
store i32 %21, i32* %23
%24 = load i32, i32* %8
%25 = load i32*, i32** %3
%26 = getelementptr inbounds i32, i32* %25, i64 3
store i32 %24, i32* %26
ret void
}

LLVM IR (-O2):
define void @cpuid(i32* nocapture writeonly %0, i32 %1) {
%3 = tail call { i32, i32, i32, i32 } asm sideeffect "cpuid", "={ax},={bx},={cx},={dx},{ax},~{dirflag},~{fpsr},~{flags}"(i32 %1)
%4 = extractvalue { i32, i32, i32, i32 } %3, 0
%5 = extractvalue { i32, i32, i32, i32 } %3, 1
%6 = extractvalue { i32, i32, i32, i32 } %3, 2
%7 = extractvalue { i32, i32, i32, i32 } %3, 3
store i32 %4, i32* %0
%8 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %5, i32* %8
%9 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %6, i32* %9
%10 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %7, i32* %10
ret void
}
/* Variables and functions */
char EOF;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
char getchar();
int /*<<< orphan*/ putchar(char);
int main() {
  char c;
  while ((c = getchar()) != EOF) {
    putchar(c);
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
mov    0x2e95(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     116c <main+0x3c>
movsbl -0x5(%rbp),%edi
call   1030 <putchar@plt>
jmp    113f <main+0xf>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2ea9(%rip),%rbx
cmp    (%rbx),%al
je     1163 <main+0x33>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %al,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%al
jne    1150 <main+0x20>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@EOF = global i8 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
br label %3
3: ; preds = %9, %0
%4 = call signext i8 (...) @getchar()
store i8 %4, i8* %2
%5 = sext i8 %4 to i32
%6 = load i8, i8* @EOF
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %5, %7
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i8, i8* %2
%11 = call i32 @putchar(i8 signext %10)
br label %3
12: ; preds = %3
%13 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@EOF = global i8 0
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = load i8, i8* @EOF
%3 = icmp eq i8 %1, %2
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = phi i8 [ %7, %4 ], [ %1, %0 ]
%6 = tail call i32 @putchar(i8 signext %5)
%7 = tail call signext i8 (...) @getchar()
%8 = load i8, i8* @EOF
%9 = icmp eq i8 %7, %8
br i1 %9, label %10, label %4
10: ; preds = %4, %0
%11 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(int, int, int);
void proc5() {
  memcpy(0x80625cd, 0x804dfa0, 0x8000);
  memcpy(0x806a5cd, 0x80725e0, 0x7fff);
  return;
}


x86 assembly (clang, -O0):
<proc5>:
push   %rbp
mov    %rsp,%rbp
mov    $0x80625cd,%edi
mov    $0x804dfa0,%esi
mov    $0x8000,%edx
call   1030 <memcpy@plt>
mov    $0x806a5cd,%edi
mov    $0x80725e0,%esi
mov    $0x7fff,%edx
call   1030 <memcpy@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<proc5>:
push   %rax
mov    $0x80625cd,%edi
mov    $0x804dfa0,%esi
mov    $0x8000,%edx
call   1030 <memcpy@plt>
mov    $0x806a5cd,%edi
mov    $0x80725e0,%esi
mov    $0x7fff,%edx
pop    %rax
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @proc5() {
%1 = call i32 @memcpy(i32 134620621, i32 134537120, i32 32768)
%2 = call i32 @memcpy(i32 134653389, i32 134686176, i32 32767)
ret void
}

LLVM IR (-O2):
define void @proc5() {
%1 = tail call i32 @memcpy(i32 134620621, i32 134537120, i32 32768)
%2 = tail call i32 @memcpy(i32 134653389, i32 134686176, i32 32767)
ret void
}
/* Variables and functions */
int sad(int *, int *, int);
int main() {
  int image_size = 9;
  int left_image[9] = {5, 16, 7, 1, 1, 13, 2, 8, 10};
  int right_image[9] = {4, 15, 8, 0, 2, 12, 3, 7, 11};
  return sad(left_image, right_image, image_size);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x9,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xebf(%rip),%rsi
mov    $0x24,%edx
call   1030 <memcpy@plt>
lea    -0x60(%rbp),%rdi
lea    0xeda(%rip),%rsi
mov    $0x24,%edx
call   1030 <memcpy@plt>
lea    -0x30(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    -0x8(%rbp),%edx
call   1040 <sad@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
mov    0xf06(%rip),%eax
mov    %eax,0x50(%rsp)
movaps 0xeeb(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xecf(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
mov    0xf14(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x30(%rsp),%rdi
mov    %rsp,%rsi
mov    $0x9,%edx
call   1030 <sad@plt>
add    $0x58,%rsp
ret

LLVM IR (-O0):
@__const.main.left_image = [9 x i32] [i32 5, i32 16, i32 7, i32 1, i32 1, i32 13, i32 2, i32 8, i32 10]
@__const.main.right_image = [9 x i32] [i32 4, i32 15, i32 8, i32 0, i32 2, i32 12, i32 3, i32 7, i32 11]
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [9 x i32]
%4 = alloca [9 x i32]
store i32 0, i32* %1
store i32 9, i32* %2
%5 = bitcast [9 x i32]* %3 to i8*
%6 = bitcast [9 x i32]* %4 to i8*
%7 = getelementptr inbounds [9 x i32], [9 x i32]* %3, i64 0, i64 0
%8 = getelementptr inbounds [9 x i32], [9 x i32]* %4, i64 0, i64 0
%9 = load i32, i32* %2
%10 = call i32 @sad(i32* %7, i32* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
@__const.main.left_image = [9 x i32] [i32 5, i32 16, i32 7, i32 1, i32 1, i32 13, i32 2, i32 8, i32 10]
@__const.main.right_image = [9 x i32] [i32 4, i32 15, i32 8, i32 0, i32 2, i32 12, i32 3, i32 7, i32 11]
define i32 @main() {
%1 = alloca [9 x i32]
%2 = alloca [9 x i32]
%3 = bitcast [9 x i32]* %1 to i8*
%4 = bitcast [9 x i32]* %2 to i8*
%5 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 0
%7 = call i32 @sad(i32* %5, i32* %6, i32 9)
ret i32 %7
}
/* Variables and functions */
int distanciaCorrida(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int kminicial = 200000;
  int kmfinal = 207349;
  int distancia = distanciaCorrida(kminicial, kmfinal);
  printf("A distancia percorrida pelo carro foi de %d km", distancia);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x30d40,-0x4(%rbp)
movl   $0x329f5,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <distanciaCorrida@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x30d40,%edi
mov    $0x329f5,%esi
call   1040 <distanciaCorrida@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"A distancia percorrida pelo carro foi de %d km\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 200000, i32* %1
store i32 207349, i32* %2
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = call i32 @distanciaCorrida(i32 %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [47 x i8] c"A distancia percorrida pelo carro foi de %d km\00"
define i32 @main() {
%1 = tail call i32 @distanciaCorrida(i32 200000, i32 207349)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
double mix(double x, double y, double a) { return x + (x - y) * a; }


x86 assembly (clang, -O0):
<mix>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mix>:
movapd %xmm0,%xmm3
subsd  %xmm1,%xmm3
mulsd  %xmm2,%xmm3
addsd  %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @mix(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 = load double, double* %4
%9 = load double, double* %5
%10 = fsub double %8, %9
%11 = load double, double* %6
%12 = call double @llvm.fmuladd.f64(double %10, double %11, double %7)
ret double %12
}

LLVM IR (-O2):
define double @mix(double %0, double %1, double %2) {
%4 = fsub double %0, %1
%5 = tail call double @llvm.fmuladd.f64(double %4, double %2, double %0)
ret double %5
}
/* Type definitions */
struct TreeNode {
  int dummy;
};

/* Variables and functions */
int count(struct TreeNode *);
int /*<<< orphan*/ helper(struct TreeNode *, int *, int *);
scalar_t__ malloc(int);
int *postorderTraversal(struct TreeNode *root, int *returnSize) {
  *returnSize = count(root);
  int *vals = (int *)malloc((*returnSize) * sizeof(int));
  int index = 0;
  helper(root, vals, &index);
  return vals;
}


x86 assembly (clang, -O0):
<postorderTraversal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <count@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
movslq (%rax),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1050 <helper@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<postorderTraversal>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <count@plt>
mov    %eax,(%r14)
lea    0x0(,%rax,4),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rdx
mov    %r15,%rdi
mov    %rax,%rsi
call   1050 <helper@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.TreeNode = type { i32 }
define i32* @postorderTraversal(%struct.TreeNode* %0, i32* %1) {
%3 = alloca %struct.TreeNode*
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
store %struct.TreeNode* %0, %struct.TreeNode** %3
store i32* %1, i32** %4
%7 = load %struct.TreeNode*, %struct.TreeNode** %3
%8 = call i32 @count(%struct.TreeNode* %7)
%9 = load i32*, i32** %4
store i32 %8, i32* %9
%10 = load i32*, i32** %4
%11 = load i32, i32* %10
%12 = sext i32 %11 to i64
%13 = mul i64 %12, 4
%14 = trunc i64 %13 to i32
%15 = call i64 @malloc(i32 %14)
%16 = inttoptr i64 %15 to i32*
store i32* %16, i32** %5
store i32 0, i32* %6
%17 = load %struct.TreeNode*, %struct.TreeNode** %3
%18 = load i32*, i32** %5
%19 = call i32 @helper(%struct.TreeNode* %17, i32* %18, i32* %6)
%20 = load i32*, i32** %5
ret i32* %20
}

LLVM IR (-O2):
%struct.TreeNode = type { i32 }
define i32* @postorderTraversal(%struct.TreeNode* %0, i32* nocapture writeonly %1) {
%3 = alloca i32
%4 = tail call i32 @count(%struct.TreeNode* %0)
store i32 %4, i32* %1
%5 = shl i32 %4, 2
%6 = tail call i64 @malloc(i32 %5)
%7 = inttoptr i64 %6 to i32*
%8 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%9 = call i32 @helper(%struct.TreeNode* %0, i32* %7, i32* %3)
ret i32* %7
}
/* Variables and functions */
bool test_dis() { return true; }


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

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

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

LLVM IR (-O2):
define i32 @test_dis() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
void cgpush(void) { gen("pushl\t%eax"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"pushl\09%eax\00"
define void @cgpush() {
%1 = call i32 @gen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"pushl\09%eax\00"
define void @cgpush() {
%1 = tail call i32 @gen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
int fn6(int x, int y) {
  int tem1 = ~x ^ y;
  int tem2 = y | x;
  return tem1 & tem2;
}


x86 assembly (clang, -O0):
<fn6>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn6>:
mov    %edi,%eax
and    %esi,%eax
ret

LLVM IR (-O0):
define i32 @fn6(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = xor i32 %7, -1
%9 = load i32, i32* %4
%10 = xor i32 %8, %9
store i32 %10, i32* %5
%11 = load i32, i32* %4
%12 = load i32, i32* %3
%13 = or i32 %11, %12
store i32 %13, i32* %6
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = and i32 %14, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @fn6(i32 %0, i32 %1) {
%3 = and i32 %1, %0
ret i32 %3
}
float normal_scale(int value, int offset, int steps) {
  return ((value + offset) % steps) / (float)steps;
}


x86 assembly (clang, -O0):
<normal_scale>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cvtsi2ss %edx,%xmm0
cvtsi2ssl -0xc(%rbp),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<normal_scale>:
mov    %edx,%ecx
lea    (%rdi,%rsi,1),%eax
cltd
idiv   %ecx
cvtsi2ss %edx,%xmm0
cvtsi2ss %ecx,%xmm1
divss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @normal_scale(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %6
%11 = srem i32 %9, %10
%12 = sitofp i32 %11 to float
%13 = load i32, i32* %6
%14 = sitofp i32 %13 to float
%15 = fdiv float %12, %14
ret float %15
}

LLVM IR (-O2):
define float @normal_scale(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
%5 = srem i32 %4, %2
%6 = sitofp i32 %5 to float
%7 = sitofp i32 %2 to float
%8 = fdiv float %6, %7
ret float %8
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_sqrt_pd(int /*<<< orphan*/);
__m128d test_mm_sqrt_pd(__m128d A) { return _mm_sqrt_pd(A); }


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

x86 assembly (clang, -O2):
<test_mm_sqrt_pd>:
jmp    1030 <_mm_sqrt_pd@plt>

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

LLVM IR (-O2):
define i32 @test_mm_sqrt_pd(i32 %0) {
%2 = tail call i32 @_mm_sqrt_pd(i32 %0)
ret i32 %2
}
int sumOfRange(int m, int n) {
  if (m > n) {
    int t = m;
    m = n;
    n = t;
  }
  return (n * (n + 1) - m * (m - 1)) / 2;
}


x86 assembly (clang, -O0):
<sumOfRange>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1128 <sumOfRange+0x28>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    -0x4(%rbp),%ecx
mov    -0x4(%rbp),%edx
sub    $0x1,%edx
imul   %edx,%ecx
sub    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<sumOfRange>:
cmp    %esi,%edi
mov    %esi,%eax
cmovg  %edi,%eax
cmovg  %esi,%edi
lea    0x1(%rax),%ecx
imul   %eax,%ecx
lea    -0x1(%rdi),%eax
imul   %edi,%eax
sub    %eax,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
ret

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

LLVM IR (-O2):
define i32 @sumOfRange(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
%5 = select i1 %3, i32 %1, i32 %0
%6 = add nsw i32 %4, 1
%7 = mul nsw i32 %6, %4
%8 = add nsw i32 %5, -1
%9 = mul nsw i32 %8, %5
%10 = sub nsw i32 %7, %9
%11 = sdiv i32 %10, 2
ret i32 %11
}