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

/* Variables and functions */
struct timespec sol_util_timespec_from_msec(const int msec) {
  struct timespec ts;
  ts.tv_sec = msec / 1000ULL;
  ts.tv_nsec = (msec % 1000ULL) * 1000000ULL;
  return ts;
}


x86 assembly (clang, -O0):
<sol_util_timespec_from_msec>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
movslq -0xc(%rbp),%rax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %rcx
mov    %eax,-0x8(%rbp)
movslq -0xc(%rbp),%rax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %rcx
imul   $0xf4240,%rdx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sol_util_timespec_from_msec>:
movslq %edi,%rcx
mov    %rcx,%rax
shr    $0x3,%rax
movabs $0x20c49ba5e353f7cf,%rdx
9b c4 20
mul    %rdx
shr    $0x4,%rdx
imul   $0x3e8,%rdx,%rax
sub    %rax,%rcx
movabs $0xf424000000000,%rsi
imul   %rcx,%rsi
mov    %edx,%eax
or     %rsi,%rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define i64 @sol_util_timespec_from_msec(i32 %0) {
%2 = alloca %struct.timespec
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = sext i32 %4 to i64
%6 = udiv i64 %5, 1000
%7 = trunc i64 %6 to i32
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
store i32 %7, i32* %8
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = urem i64 %10, 1000
%12 = mul i64 %11, 1000000
%13 = trunc i64 %12 to i32
%14 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 1
store i32 %13, i32* %14
%15 = bitcast %struct.timespec* %2 to i64*
%16 = load i64, i64* %15
ret i64 %16
}

LLVM IR (-O2):
define i64 @sol_util_timespec_from_msec(i32 %0) {
%2 = sext i32 %0 to i64
%3 = udiv i64 %2, 1000
%4 = urem i64 %2, 1000
%5 = mul nuw nsw i64 %4, 4294967296000000
%6 = and i64 %3, 4294967295
%7 = or i64 %5, %6
ret i64 %7
}
void exchangeValue2(int *x, int *y) {
  *x = (*x) + (*y);
  *y = (*x) - (*y);
  *x = (*x) - (*y);
}


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

x86 assembly (clang, -O2):
<exchangeValue2>:
mov    (%rsi),%eax
add    (%rdi),%eax
mov    %eax,(%rdi)
sub    (%rsi),%eax
mov    %eax,(%rsi)
sub    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @exchangeValue2(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* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32*, i32** %3
%12 = load i32, i32* %11
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = sub nsw i32 %12, %14
%16 = load i32*, i32** %4
store i32 %15, i32* %16
%17 = load i32*, i32** %3
%18 = load i32, i32* %17
%19 = load i32*, i32** %4
%20 = load i32, i32* %19
%21 = sub nsw i32 %18, %20
%22 = load i32*, i32** %3
store i32 %21, i32* %22
ret void
}

LLVM IR (-O2):
define void @exchangeValue2(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = add nsw i32 %4, %3
store i32 %5, i32* %0
%6 = load i32, i32* %1
%7 = sub nsw i32 %5, %6
store i32 %7, i32* %1
%8 = load i32, i32* %0
%9 = sub nsw i32 %8, %7
store i32 %9, i32* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fgetc(int /*<<< orphan*/ *);
void fgetc_256_bad(FILE *f) {
  int arr[256];
  int c = fgetc(f);
  arr[c + 1] = 42;
}


x86 assembly (clang, -O0):
<fgetc_256_bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0x414(%rbp)
mov    -0x414(%rbp),%eax
add    $0x1,%eax
cltq
movl   $0x2a,-0x410(%rbp,%rax,4)
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgetc_256_bad>:
jmp    1030 <fgetc@plt>

LLVM IR (-O0):
define void @fgetc_256_bad(i32* %0) {
%2 = alloca i32*
%3 = alloca [256 x i32]
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 @fgetc(i32* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [256 x i32], [256 x i32]* %3, i64 0, i64 %9
store i32 42, i32* %10
ret void
}

LLVM IR (-O2):
define void @fgetc_256_bad(i32* nocapture %0) {
%2 = tail call i32 @fgetc(i32* %0)
ret void
}
/* Type definitions */
struct Var {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pA(char *, char const *, char const *);
void __func_minus_sint(struct Var *avar, const char *areg, const char *lreg,
                       const char *rreg) {
  pA("%s = -%s;", areg, lreg);
}


x86 assembly (clang, -O0):
<__func_minus_sint>:
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    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xec9(%rip),%rdi
call   1030 <pA@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.Var = type { i32 }
@.str = [10 x i8] c"%s = -%s;\00"
define void @__func_minus_sint(%struct.Var* nocapture readnone %0, i8* %1, i8* %2, i8* nocapture readnone %3) {
%5 = tail call i32 @pA(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ obj_tester();
int /*<<< orphan*/ poly_tester();
int main() {
  obj_tester();
  poly_tester();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @obj_tester()
%2 = tail call i32 (...) @poly_tester()
ret i32 0
}
void IncreamentAll(int *array, int n) {}


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

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

LLVM IR (-O0):
define void @IncreamentAll(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @IncreamentAll(i32* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int ph_smtp_handle_packet(void *handler, const char *packet, ssize_t len) {
  return 0;
}


x86 assembly (clang, -O0):
<ph_smtp_handle_packet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ph_smtp_handle_packet(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
int escapedquote(const char *start) {
  while (*start) {
    if (*start == '\\') {
      if (!start[1])
        return 1;
      start += 2;
    }
    start++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<escapedquote>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115c <escapedquote+0x5c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
jne    114b <escapedquote+0x4b>
mov    -0x10(%rbp),%rax
cmpb   $0x0,0x1(%rax)
jne    113f <escapedquote+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    1163 <escapedquote+0x63>
mov    -0x10(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <escapedquote+0x8>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<escapedquote>:
jmp    1118 <escapedquote+0x18>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
test   %al,%al
je     112b <escapedquote+0x2b>
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0x5c,%al
jne    1110 <escapedquote+0x10>
cmpb   $0x0,0x1(%rdi)
je     112e <escapedquote+0x2e>
add    $0x2,%rdi
jmp    1114 <escapedquote+0x14>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @escapedquote(i8* nocapture %0) {
br label %2
2: ; preds = %11, %1
%3 = phi i8* [ %0, %1 ], [ %13, %11 ]
%4 = load i8, i8* %3
switch i8 %4, label %11 [
i8 0, label %14
i8 92, label %5
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %3, i64 2
br label %11
11: ; preds = %2, %9
%12 = phi i8* [ %10, %9 ], [ %3, %2 ]
%13 = getelementptr inbounds i8, i8* %12, i64 1
br label %2
14: ; preds = %2, %5
%15 = phi i32 [ 1, %5 ], [ 0, %2 ]
ret i32 %15
}
/* Type definitions */
typedef int y;
typedef int x;
typedef int __m128i;

/* Variables and functions */
__m128i _mm_I(__m128i x, __m128i y, __m128i z) {
  return (((x) & (z)) | ((y) & ~(z)));
}


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

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

LLVM IR (-O0):
define i32 @_mm_I(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* %6
%9 = and i32 %7, %8
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = xor i32 %11, -1
%13 = and i32 %10, %12
%14 = or i32 %9, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @_mm_I(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %2, %0
%5 = xor i32 %2, -1
%6 = and i32 %5, %1
%7 = or i32 %4, %6
ret i32 %7
}
signed int f7(signed int v_foo) {
  signed int v_shr = ((unsigned int)v_foo) >> 2;
  signed int v_and = v_shr & -7;
  return v_and;
}


x86 assembly (clang, -O0):
<f7>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xfffffff9,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f7>:
mov    %edi,%eax
shr    $0x2,%eax
and    $0xfffffff9,%eax
ret

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

LLVM IR (-O2):
define i32 @f7(i32 %0) {
%2 = lshr i32 %0, 2
%3 = and i32 %2, 1073741817
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef int int32_t;

/* Variables and functions */
uint32_t _ASR32(uint32_t val, int amount) {
  return (uint32_t)((int32_t)val >> amount);
}


x86 assembly (clang, -O0):
<_ASR32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ASR32>:
mov    %esi,%ecx
sar    %cl,%edi
movslq %edi,%rax
ret

LLVM IR (-O0):
define i64 @_ASR32(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = trunc i64 %5 to i32
%7 = load i32, i32* %4
%8 = ashr i32 %6, %7
%9 = sext i32 %8 to i64
ret i64 %9
}

LLVM IR (-O2):
define i64 @_ASR32(i64 %0, i32 %1) {
%3 = trunc i64 %0 to i32
%4 = ashr i32 %3, %1
%5 = sext i32 %4 to i64
ret i64 %5
}
/* Type definitions */
typedef int __u32;

/* Variables and functions */
__u32 signed_asl(__u32 val, signed int shift) {
  if (shift >= 0) {
    val <<= shift;
  } else {
    val >>= -shift;
  }
  return val;
}


x86 assembly (clang, -O0):
<signed_asl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1124 <signed_asl+0x24>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x4(%rbp)
jmp    1131 <signed_asl+0x31>
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
sar    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signed_asl>:
mov    %edi,%eax
mov    %esi,%ecx
shl    %cl,%eax
neg    %cl
sar    %cl,%edi
test   %esi,%esi
cmovs  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @signed_asl(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, -1
%4 = shl i32 %0, %1
%5 = sub nsw i32 0, %1
%6 = ashr i32 %0, %5
%7 = select i1 %3, i32 %4, i32 %6
ret i32 %7
}
void worker(void) {}


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

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

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

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

/* Variables and functions */
int w5100_read(unsigned int, int /*<<< orphan*/ *, unsigned int);
unsigned w5100_readSn(unsigned sock, unsigned addr, uint8_t *buf,
                      unsigned len) {
  return w5100_read(0x0400 + sock * 0x0100 + addr, buf, len);
}


x86 assembly (clang, -O0):
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
shl    $0x8,%edi
add    $0x400,%edi
add    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <w5100_read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
shl    $0x8,%edi
add    %esi,%edi
add    $0x400,%edi
mov    %rdx,%rsi
mov    %ecx,%edx
jmp    1030 <w5100_read@plt>

LLVM IR (-O0):
define i32 @w5100_readSn(i32 %0, i32 %1, i32* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = mul i32 %9, 256
%11 = add i32 1024, %10
%12 = load i32, i32* %6
%13 = add i32 %11, %12
%14 = load i32*, i32** %7
%15 = load i32, i32* %8
%16 = call i32 @w5100_read(i32 %13, i32* %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @w5100_readSn(i32 %0, i32 %1, i32* %2, i32 %3) {
%5 = shl i32 %0, 8
%6 = add i32 %5, 1024
%7 = add i32 %6, %1
%8 = tail call i32 @w5100_read(i32 %7, i32* %2, i32 %3)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int usage() {
  printf("Usage: swap [-h] <input file> <output file> [truncate to size]\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [64 x i8] c"Usage: swap [-h] <input file> <output file> [truncate to size]\0A\00"
define i32 @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [63 x i8] c"Usage: swap [-h] <input file> <output file> [truncate to size]\00"
define i32 @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ gmvexit();
int /*<<< orphan*/ stderr;
void fldwrterr() {
  fprintf(stderr, "Not enough disk space for field database file.\n");
  fprintf(stderr, "Set the environmental variable TMPDIR to a directory "
                  "with more disk space.\n");
  fprintf(stderr, "eg.: setenv TMPDIR mydirectroy\n");
  gmvexit();
}


x86 assembly (clang, -O0):
<fldwrterr>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xee7(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
lea    0xf1e(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <gmvexit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fldwrterr>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xef1(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf2f(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <gmvexit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [48 x i8] c"Not enough disk space for field database file.\0A\00"
@.str.1 = [76 x i8] c"Set the environmental variable TMPDIR to a directory with more disk space.\0A\00"
@.str.2 = [32 x i8] c"eg.: setenv TMPDIR mydirectroy\0A\00"
define void @fldwrterr() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 (...) @gmvexit()
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [48 x i8] c"Not enough disk space for field database file.\0A\00"
@.str.1 = [76 x i8] c"Set the environmental variable TMPDIR to a directory with more disk space.\0A\00"
@.str.2 = [32 x i8] c"eg.: setenv TMPDIR mydirectroy\0A\00"
define void @fldwrterr() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 (...) @gmvexit()
ret void
}
void nfs_fscache_invalidate_page(struct page *page, struct inode *inode,
                                 unsigned long offset) {}


x86 assembly (clang, -O0):
<nfs_fscache_invalidate_page>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.page = type opaque
%struct.inode = type opaque
define void @nfs_fscache_invalidate_page(%struct.page* %0, %struct.inode* %1, i64 %2) {
%4 = alloca %struct.page*
%5 = alloca %struct.inode*
%6 = alloca i64
store %struct.page* %0, %struct.page** %4
store %struct.inode* %1, %struct.inode** %5
store i64 %2, i64* %6
ret void
}

LLVM IR (-O2):
%struct.page = type opaque
%struct.inode = type opaque
define void @nfs_fscache_invalidate_page(%struct.page* nocapture %0, %struct.inode* nocapture %1, i64 %2) {
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t enshift(uint16_t x) { return x & 0x001f; }


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

x86 assembly (clang, -O2):
<enshift>:
mov    %edi,%eax
and    $0x1f,%eax
ret

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

LLVM IR (-O2):
define i32 @enshift(i32 %0) {
%2 = and i32 %0, 31
ret i32 %2
}
/* Type definitions */
struct range {
  int dummy;
};
struct genomeRangeTree {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ genomeRangeTreeFindOrAddRangeTree(struct genomeRangeTree *,
                                                     char *);
struct range *rangeTreeAddValList(int /*<<< orphan*/, int, int, void *);
struct range *genomeRangeTreeAddValList(struct genomeRangeTree *tree,
                                        char *chrom, int start, int end,
                                        void *val) {
  return rangeTreeAddValList(genomeRangeTreeFindOrAddRangeTree(tree, chrom),
                             start, end, val);
}


x86 assembly (clang, -O0):
<genomeRangeTreeAddValList>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <genomeRangeTreeFindOrAddRangeTree@plt>
mov    %eax,%edi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x20(%rbp),%rcx
call   1040 <rangeTreeAddValList@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genomeRangeTreeAddValList>:
push   %rbp
push   %r14
push   %rbx
mov    %r8,%r14
mov    %ecx,%ebp
mov    %edx,%ebx
call   1030 <genomeRangeTreeFindOrAddRangeTree@plt>
mov    %eax,%edi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r14,%rcx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <rangeTreeAddValList@plt>

LLVM IR (-O0):
%struct.range = type { i32 }
%struct.genomeRangeTree = type { i32 }
define %struct.range* @genomeRangeTreeAddValList(%struct.genomeRangeTree* %0, i8* %1, i32 %2, i32 %3, i8* %4) {
%6 = alloca %struct.genomeRangeTree*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
store %struct.genomeRangeTree* %0, %struct.genomeRangeTree** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = load %struct.genomeRangeTree*, %struct.genomeRangeTree** %6
%12 = load i8*, i8** %7
%13 = call i32 @genomeRangeTreeFindOrAddRangeTree(%struct.genomeRangeTree* %11, i8* %12)
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i8*, i8** %10
%17 = call %struct.range* @rangeTreeAddValList(i32 %13, i32 %14, i32 %15, i8* %16)
ret %struct.range* %17
}

LLVM IR (-O2):
%struct.range = type { i32 }
%struct.genomeRangeTree = type { i32 }
define %struct.range* @genomeRangeTreeAddValList(%struct.genomeRangeTree* %0, i8* %1, i32 %2, i32 %3, i8* %4) {
%6 = tail call i32 @genomeRangeTreeFindOrAddRangeTree(%struct.genomeRangeTree* %0, i8* %1)
%7 = tail call %struct.range* @rangeTreeAddValList(i32 %6, i32 %2, i32 %3, i8* %4)
ret %struct.range* %7
}
/* Variables and functions */
int /*<<< orphan*/ drmFree(void *);
int drmRandomDestroy(void *state) {
  drmFree(state);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @drmRandomDestroy(i8* %0) {
%2 = tail call i32 @drmFree(i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ yaffsfs_SetError(int);
int yaffs_set_error(int error) {
  yaffsfs_SetError(error);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @yaffs_set_error(i32 %0) {
%2 = tail call i32 @yaffsfs_SetError(i32 %0)
ret i32 0
}
int do_125() { return 125; }


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

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

LLVM IR (-O0):
define i32 @do_125() {
ret i32 125
}

LLVM IR (-O2):
define i32 @do_125() {
ret i32 125
}
/* Variables and functions */
int fun(int);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("10Äêºó¹²ÓÐ%dÍ·Å£\n", fun(10));
  getchar();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1030 <fun@plt>
lea    0xebe(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"10\C3\84\C3\AA\C2\BA\C3\B3\C2\B9\C2\B2\C3\93\C3\90%d\C3\8D\C2\B7\C3\85\C2\A3\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @fun(i32 10)
%3 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"10\C3\84\C3\AA\C2\BA\C3\B3\C2\B9\C2\B2\C3\93\C3\90%d\C3\8D\C2\B7\C3\85\C2\A3\0A\00"
define i32 @main() {
%1 = tail call i32 @fun(i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
char *strrchr(char *, char);
char *brevity_name(char *pathname, int dir_name_length, int flags) {
  if (flags == 0x01) {
    return (pathname + dir_name_length);
  } else {
    return (strrchr(pathname, '/') + 1);
  }
}


x86 assembly (clang, -O0):
<brevity_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
cmpl   $0x1,-0x18(%rbp)
jne    1140 <brevity_name+0x30>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1156 <brevity_name+0x46>
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<brevity_name>:
mov    %rdi,%rax
cmp    $0x1,%edx
jne    111f <brevity_name+0xf>
movslq %esi,%rcx
add    %rcx,%rax
ret
push   %rax
mov    %rax,%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
add    $0x1,%rax
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i8* @brevity_name(i8* %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 1
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
br label %11
8: ; preds = %3
%9 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%10 = getelementptr inbounds i8, i8* %9, i64 1
br label %11
11: ; preds = %8, %5
%12 = phi i8* [ %7, %5 ], [ %10, %8 ]
ret i8* %12
}
/* Type definitions */
struct msgbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void *msgbuf_push_uninit(struct msgbuf *, size_t);
void *msgbuf_push(struct msgbuf *b, const void *p, size_t size) {
  void *dst = msgbuf_push_uninit(b, size);
  memcpy(dst, p, size);
  return dst;
}


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

x86 assembly (clang, -O2):
<msgbuf_push>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdx,%rsi
call   1040 <msgbuf_push_uninit@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.msgbuf = type { i32 }
define i8* @msgbuf_push(%struct.msgbuf* %0, i8* %1, i64 %2) {
%4 = alloca %struct.msgbuf*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store %struct.msgbuf* %0, %struct.msgbuf** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load %struct.msgbuf*, %struct.msgbuf** %4
%9 = load i64, i64* %6
%10 = call i8* @msgbuf_push_uninit(%struct.msgbuf* %8, i64 %9)
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = load i8*, i8** %5
%13 = load i64, i64* %6
%14 = call i32 @memcpy(i8* %11, i8* %12, i64 %13)
%15 = load i8*, i8** %7
ret i8* %15
}

LLVM IR (-O2):
%struct.msgbuf = type { i32 }
define i8* @msgbuf_push(%struct.msgbuf* %0, i8* %1, i64 %2) {
%4 = tail call i8* @msgbuf_push_uninit(%struct.msgbuf* %0, i64 %2)
%5 = tail call i32 @memcpy(i8* %4, i8* %1, i64 %2)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ SSL_get0_alpn_selected(int /*<<< orphan*/ *,
                                          int /*<<< orphan*/ *,
                                          int /*<<< orphan*/ *);
int main() {
  SSL_get0_alpn_selected(NULL, NULL, NULL);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @SSL_get0_alpn_selected(i32* null, i32* null, i32* null)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memmove(void *, char *, int);
int strlen(char *);
void *render_string(char *str, void *dest) {
  int len = strlen(str);
  memmove(dest, str, len);
  return dest + len;
}


x86 assembly (clang, -O0):
<render_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memmove@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<render_string>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <memmove@plt>
movslq %ebp,%rax
add    %r14,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @render_string(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %5
%8 = load i8*, i8** %4
%9 = load i8*, i8** %3
%10 = load i32, i32* %5
%11 = call i32 @memmove(i8* %8, i8* %9, i32 %10)
%12 = load i8*, i8** %4
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr i8, i8* %12, i64 %14
ret i8* %15
}

LLVM IR (-O2):
define i8* @render_string(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @memmove(i8* %1, i8* %0, i32 %3)
%5 = sext i32 %3 to i64
%6 = getelementptr i8, i8* %1, i64 %5
ret i8* %6
}
float mapf(float val, float min1, float max1, float min2, float max2) {
  return (val - min1) / (max1 - min1) * (max2 - min2) + min2;
}


x86 assembly (clang, -O0):
<mapf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
subss  -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  -0x14(%rbp),%xmm2
subss  -0x10(%rbp),%xmm2
movss  -0x10(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mapf>:
subss  %xmm1,%xmm0
subss  %xmm1,%xmm2
divss  %xmm2,%xmm0
subss  %xmm3,%xmm4
mulss  %xmm4,%xmm0
addss  %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @mapf(float %0, float %1, float %2, float %3, float %4) {
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
store float %0, float* %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store float %4, float* %10
%11 = load float, float* %6
%12 = load float, float* %7
%13 = fsub float %11, %12
%14 = load float, float* %8
%15 = load float, float* %7
%16 = fsub float %14, %15
%17 = fdiv float %13, %16
%18 = load float, float* %10
%19 = load float, float* %9
%20 = fsub float %18, %19
%21 = load float, float* %9
%22 = call float @llvm.fmuladd.f32(float %17, float %20, float %21)
ret float %22
}

LLVM IR (-O2):
define float @mapf(float %0, float %1, float %2, float %3, float %4) {
%6 = fsub float %0, %1
%7 = fsub float %2, %1
%8 = fdiv float %6, %7
%9 = fsub float %4, %3
%10 = tail call float @llvm.fmuladd.f32(float %8, float %9, float %3)
ret float %10
}
int test_imm_D3uint8_reg(unsigned char val) {
  return ((val) & (0xD3 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_D3uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -45
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int lcm_2(int, int);
int lcm(int *arr, int n) {
  int l = 1;
  for (int i = 0; i < n; i++) {
    l = lcm_2(arr[i], l);
  }
  return l;
}


x86 assembly (clang, -O0):
<lcm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115d <lcm+0x4d>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    -0x10(%rbp),%esi
call   1030 <lcm_2@plt>
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <lcm+0x1d>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcm>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1146 <lcm+0x36>
mov    %rdi,%r14
mov    %esi,%r15d
mov    $0x1,%eax
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edi
mov    %eax,%esi
call   1030 <lcm_2@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <lcm+0x20>
jmp    114b <lcm+0x3b>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @lcm(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
store i32 1, i32* %5
store i32 0, i32* %6
br label %7
7: ; preds = %19, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %22
11: ; preds = %7
%12 = load i32*, i32** %3
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = load i32, i32* %15
%17 = load i32, i32* %5
%18 = call i32 @lcm_2(i32 %16, i32 %17)
store i32 %18, i32* %5
br label %19
19: ; preds = %11
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
store i32 %21, i32* %6
br label %7
22: ; preds = %7
%23 = load i32, i32* %5
ret i32 %23
}

LLVM IR (-O2):
define i32 @lcm(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = phi i32 [ 1, %2 ], [ %13, %8 ]
ret i32 %7
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %14, %8 ]
%10 = phi i32 [ 1, %4 ], [ %13, %8 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %9
%12 = load i32, i32* %11
%13 = tail call i32 @lcm_2(i32 %12, i32 %10)
%14 = add nuw nsw i64 %9, 1
%15 = icmp eq i64 %14, %5
br i1 %15, label %6, label %8
}
int HEX_strlen(const char *str) {
  register const char *s;
  for (s = str; *s; ++s)
    ;
  return (s - str);
}


x86 assembly (clang, -O0):
<HEX_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1133 <HEX_strlen+0x33>
jmp    1122 <HEX_strlen+0x22>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <HEX_strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HEX_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <HEX_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @HEX_strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int /*<<< orphan*/ foo(char);
int main() {
  char l = 'D';
  foo(l);
  bar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x44,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1040 <foo@plt>
mov    $0x0,%al
call   1030 <bar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x44,%edi
call   1040 <foo@plt>
xor    %eax,%eax
call   1030 <bar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i8 signext 68)
%2 = tail call i32 (...) @bar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_57() {
  Assert_real((isqrt(57) == 7),
              "/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/stdlib/isqrt.c",
              290, ("Integer square root of 57 should be 7"));
}


x86 assembly (clang, -O0):
<t_sqrt_57>:
push   %rbp
mov    %rsp,%rbp
mov    $0x39,%edi
call   1030 <isqrt@plt>
cmp    $0x7,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x122,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_57>:
push   %rax
mov    $0x39,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x7,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x122,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 57 should be 7\00"
define void @t_sqrt_57() {
%1 = call i32 @isqrt(i32 57)
%2 = icmp eq i32 %1, 7
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 290, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 57 should be 7\00"
define void @t_sqrt_57() {
%1 = tail call i32 @isqrt(i32 57)
%2 = icmp eq i32 %1, 7
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 290, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcat(char *, char *);
void eleven() {
  char *s = (char *)malloc(sizeof(char) * 20);
  memset(s, 0, 20);
  strcat(s, "Hello ");
  strcat(s, "World!");
  printf("%s\n", s);
  free(s);
}


x86 assembly (clang, -O0):
<eleven>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x14,%edi
call   1060 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1050 <memset@plt>
mov    -0x8(%rbp),%rdi
lea    0xe7f(%rip),%rsi
call   1070 <strcat@plt>
mov    -0x8(%rbp),%rdi
lea    0xe76(%rip),%rsi
call   1070 <strcat@plt>
mov    -0x8(%rbp),%rsi
lea    0xe6d(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eleven>:
push   %rbx
mov    $0x14,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1050 <memset@plt>
lea    0xe8c(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcat@plt>
lea    0xe84(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcat@plt>
lea    0xe7c(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"Hello \00"
@.str.1 = [7 x i8] c"World!\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define void @eleven() {
%1 = alloca i8*
%2 = call i64 @malloc(i32 20)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i32 @memset(i8* %4, i32 0, i32 20)
%6 = load i8*, i8** %1
%7 = call i32 @strcat(i8* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = load i8*, i8** %1
%9 = call i32 @strcat(i8* %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%10 = load i8*, i8** %1
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %10)
%12 = load i8*, i8** %1
%13 = call i32 @free(i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"Hello \00"
@.str.1 = [7 x i8] c"World!\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define void @eleven() {
%1 = tail call i64 @malloc(i32 20)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @memset(i8* %2, i32 0, i32 20)
%4 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %2)
%7 = tail call i32 @free(i8* %2)
ret void
}
void SPIM_1_RestoreConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @SPIM_1_RestoreConfig() {
ret void
}
void XSyncValueEqual() {}


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

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

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

LLVM IR (-O2):
define void @XSyncValueEqual() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outbyte(int);
void bell() { outbyte(7); }


x86 assembly (clang, -O0):
<bell>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7,%edi
call   1030 <outbyte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bell>:
mov    $0x7,%edi
jmp    1030 <outbyte@plt>

LLVM IR (-O0):
define void @bell() {
%1 = call i32 @outbyte(i32 7)
ret void
}

LLVM IR (-O2):
define void @bell() {
%1 = tail call i32 @outbyte(i32 7)
ret void
}
void defFirst() {
  enum __attribute__((aligned(16))) __attribute__((deprecated(""))) T {
    E0,
    E1
  } *
      p0;
  enum T *p1;
}


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

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

LLVM IR (-O0):
define void @defFirst() {
%1 = alloca i32*
%2 = alloca i32*
ret void
}

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