xunge/DecIR huggingface dataset:
void memcpy_2(char *source, char *target) {
  while (*target++ = *source++)
    ;
}


x86 assembly (clang, -O0):
<memcpy_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     113b <memcpy_2+0x3b>
jmp    110c <memcpy_2+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcpy_2>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
mov    %cl,(%rsi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <memcpy_2+0x10>
ret

LLVM IR (-O0):
define void @memcpy_2(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %12, %2
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %3
%8 = load i8, i8* %6
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %4
store i8 %8, i8* %9
%11 = icmp ne i8 %8, 0
br i1 %11, label %12, label %13
12: ; preds = %5
br label %5
13: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @memcpy_2(i8* nocapture %0, i8* nocapture writeonly %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %6, %3 ]
%5 = phi i8* [ %1, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret void
}
/* Type definitions */
struct XorrisO {
  int dummy;
};

/* Variables and functions */
int Xorriso_external_filter(struct XorrisO *, char *, char *, char *,
                            int /*<<< orphan*/, int /*<<< orphan*/ *, int);
int Xorriso_option_unregister_filter(struct XorrisO *xorriso, char *name,
                                     int flag) {
  int ret;
  ret = Xorriso_external_filter(xorriso, name, "", "", 0, NULL, 1);
  return (ret);
}


x86 assembly (clang, -O0):
<Xorriso_option_unregister_filter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0xece(%rip),%rcx
xor    %r8d,%r8d
xor    %eax,%eax
mov    %eax,%r9d
mov    %rcx,%rdx
movl   $0x1,(%rsp)
call   1030 <Xorriso_external_filter@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Xorriso_option_unregister_filter>:
push   %rax
movl   $0x1,(%rsp)
lea    0xee1(%rip),%rcx
mov    %rcx,%rdx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <Xorriso_external_filter@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.XorrisO = type { i32 }
@.str = [1 x i8] zeroinitializer
define i32 @Xorriso_option_unregister_filter(%struct.XorrisO* %0, i8* %1, i32 %2) {
%4 = alloca %struct.XorrisO*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store %struct.XorrisO* %0, %struct.XorrisO** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load %struct.XorrisO*, %struct.XorrisO** %4
%9 = load i8*, i8** %5
%10 = call i32 @Xorriso_external_filter(%struct.XorrisO* %8, i8* %9, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 0, i32* null, i32 1)
store i32 %10, i32* %7
%11 = load i32, i32* %7
ret i32 %11
}

LLVM IR (-O2):
%struct.XorrisO = type { i32 }
@.str = [1 x i8] zeroinitializer
define i32 @Xorriso_option_unregister_filter(%struct.XorrisO* %0, i8* %1, i32 %2) {
%4 = tail call i32 @Xorriso_external_filter(%struct.XorrisO* %0, i8* %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 0, i32* null, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ niceprint(char *);
void muck(void) {
  niceprint(
      "The adventurers must wade through a broad, 3'-deep pit of slimy muck. "
      "The muck is difficult terrain and characters have disadvantage on "
      "Dexterity saving throws while within it, but their travel pace for the "
      "day is slowed by half if they go around it.\n\n");
}


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

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

LLVM IR (-O0):
@.str = [253 x i8] c"The adventurers must wade through a broad, 3'-deep pit of slimy muck. The muck is difficult terrain and characters have disadvantage on Dexterity saving throws while within it, but their travel pace for the day is slowed by half if they go around it.\0A\0A\00"
define void @muck() {
%1 = call i32 @niceprint(i8* getelementptr inbounds ([253 x i8], [253 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [253 x i8] c"The adventurers must wade through a broad, 3'-deep pit of slimy muck. The muck is difficult terrain and characters have disadvantage on Dexterity saving throws while within it, but their travel pace for the day is slowed by half if they go around it.\0A\0A\00"
define void @muck() {
%1 = tail call i32 @niceprint(i8* getelementptr inbounds ([253 x i8], [253 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Bar158(long, long, long, long, unsigned long, unsigned long);
void bar(long x, long y, long w, long h, unsigned long cfg, unsigned long cbg) {
  Bar158(x, y, w, h, cfg, cbg);
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1030 <Bar158@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
jmp    1030 <Bar158@plt>

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

LLVM IR (-O2):
define void @bar(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5) {
%7 = tail call i32 @Bar158(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5)
ret void
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ nrerror(char *);
unsigned long *lvector(long nl, long nh) {
  unsigned long *v;
  v = (unsigned long *)malloc((size_t)((nh - nl + 1 + 1) * sizeof(long)));
  if (!v)
    nrerror("allocation failure in lvector()");
  return v - nl + 1;
}


x86 assembly (clang, -O0):
<lvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
sub    -0x8(%rbp),%rdi
add    $0x1,%rdi
add    $0x1,%rdi
shl    $0x3,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1164 <lvector+0x44>
lea    0xea1(%rip),%rdi
call   1030 <nrerror@plt>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    -0x8(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
add    $0x8,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lvector>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
sub    %rdi,%rsi
lea    0x10(,%rsi,8),%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114b <lvector+0x2b>
lea    0xeba(%rip),%rdi
call   1030 <nrerror@plt>
shl    $0x3,%r14
sub    %r14,%rbx
add    $0x8,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [32 x i8] c"allocation failure in lvector()\00"
define i64* @lvector(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = add nsw i64 %8, 1
%10 = add nsw i64 %9, 1
%11 = mul i64 %10, 8
%12 = call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to i64*
store i64* %13, i64** %5
%14 = load i64*, i64** %5
%15 = icmp ne i64* %14, null
br i1 %15, label %18, label %16
16: ; preds = %2
%17 = call i32 @nrerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %2
%19 = load i64*, i64** %5
%20 = load i64, i64* %3
%21 = sub i64 0, %20
%22 = getelementptr inbounds i64, i64* %19, i64 %21
%23 = getelementptr inbounds i64, i64* %22, i64 1
ret i64* %23
}

LLVM IR (-O2):
@.str = [32 x i8] c"allocation failure in lvector()\00"
define i64* @lvector(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = shl i64 %3, 3
%5 = add i64 %4, 16
%6 = tail call i64 @malloc(i64 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @nrerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = inttoptr i64 %6 to i64*
%12 = sub i64 0, %0
%13 = getelementptr inbounds i64, i64* %11, i64 %12
%14 = getelementptr inbounds i64, i64* %13, i64 1
ret i64* %14
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, long);
scalar_t__ memalign(int, int);
int /*<<< orphan*/ stderr;
float *fvec_new(long n) {
  float *ret = (float *)memalign(16, sizeof(*ret) * n);
  if (!ret) {
    fprintf(stderr, "fvec_new %ld : out of memory\n", n);
    abort();
  }
  return ret;
}


x86 assembly (clang, -O0):
<fvec_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%esi
mov    $0x10,%edi
call   1050 <memalign@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    117f <fvec_new+0x4f>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe8d(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fvec_new>:
push   %rbx
mov    %rdi,%rbx
lea    0x0(,%rdi,4),%esi
mov    $0x10,%edi
call   1050 <memalign@plt>
test   %rax,%rax
je     114c <fvec_new+0x1c>
pop    %rbx
ret
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
lea    0xea4(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"fvec_new %ld : out of memory\0A\00"
define float* @fvec_new(i64 %0) {
%2 = alloca i64
%3 = alloca float*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = mul i64 4, %4
%6 = trunc i64 %5 to i32
%7 = call i64 @memalign(i32 16, i32 %6)
%8 = inttoptr i64 %7 to float*
store float* %8, float** %3
%9 = load float*, float** %3
%10 = icmp ne float* %9, null
br i1 %10, label %16, label %11
11: ; preds = %1
%12 = load i32, i32* @stderr
%13 = load i64, i64* %2
%14 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i64 %13)
%15 = call i32 (...) @abort()
unreachable
16: ; preds = %1
%17 = load float*, float** %3
ret float* %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"fvec_new %ld : out of memory\0A\00"
define float* @fvec_new(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = shl i32 %2, 2
%4 = tail call i64 @memalign(i32 16, i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i64 %0)
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %1
%11 = inttoptr i64 %4 to float*
ret float* %11
}
/* Type definitions */
typedef int /*<<< orphan*/ i2d_of_void;
typedef int /*<<< orphan*/ PKCS7;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int PEM_ASN1_write_bio(int /*<<< orphan*/ *, int /*<<< orphan*/,
                       int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                       int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                       int /*<<< orphan*/, int /*<<< orphan*/ *,
                       int /*<<< orphan*/ *);
int /*<<< orphan*/ PEM_STRING_PKCS7;
scalar_t__ i2d_PKCS7;
int PEM_write_bio_PKCS7(BIO *bp, PKCS7 *x) {
  return PEM_ASN1_write_bio((i2d_of_void *)i2d_PKCS7, PEM_STRING_PKCS7, bp, x,
                            NULL, NULL, 0, NULL, NULL);
}


x86 assembly (clang, -O0):
<PEM_write_bio_PKCS7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%rdi
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r9d
xor    %eax,%eax
mov    %r9,%r8
movl   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
call   1030 <PEM_ASN1_write_bio@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PEM_write_bio_PKCS7>:
sub    $0x18,%rsp
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ebf(%rip),%rax
mov    (%rax),%rdi
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
xorps  %xmm0,%xmm0
movups %xmm0,0x8(%rsp)
movl   $0x0,(%rsp)
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <PEM_ASN1_write_bio@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@i2d_PKCS7 = global i64 0
@PEM_STRING_PKCS7 = global i32 0
define i32 @PEM_write_bio_PKCS7(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i64, i64* @i2d_PKCS7
%6 = inttoptr i64 %5 to i32*
%7 = load i32, i32* @PEM_STRING_PKCS7
%8 = load i32*, i32** %3
%9 = load i32*, i32** %4
%10 = call i32 @PEM_ASN1_write_bio(i32* %6, i32 %7, i32* %8, i32* %9, i32* null, i32* null, i32 0, i32* null, i32* null)
ret i32 %10
}

LLVM IR (-O2):
@i2d_PKCS7 = global i64 0
@PEM_STRING_PKCS7 = global i32 0
define i32 @PEM_write_bio_PKCS7(i32* %0, i32* %1) {
%3 = load i64, i64* @i2d_PKCS7
%4 = inttoptr i64 %3 to i32*
%5 = load i32, i32* @PEM_STRING_PKCS7
%6 = tail call i32 @PEM_ASN1_write_bio(i32* %4, i32 %5, i32* %0, i32* %1, i32* null, i32* null, i32 0, i32* null, i32* null)
ret i32 %6
}
/* Variables and functions */
float M_PI_2;
float sin(float);
float SineEaseIn(float p) { return sin((p - 1) * M_PI_2) + 1; }


x86 assembly (clang, -O0):
<SineEaseIn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xed6(%rip),%xmm1
subss  %xmm1,%xmm0
mov    0x2eb3(%rip),%rax
mulss  (%rax),%xmm0
call   1030 <sin@plt>
movss  0xeba(%rip),%xmm1
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SineEaseIn>:
push   %rax
addss  0xee7(%rip),%xmm0
mov    0x2ec8(%rip),%rax
mulss  (%rax),%xmm0
call   1030 <sin@plt>
addss  0xed3(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_PI_2 = global float 0.000000e+00
define float @SineEaseIn(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fsub float %3, 1.000000e+00
%5 = load float, float* @M_PI_2
%6 = fmul float %4, %5
%7 = call float @sin(float %6)
%8 = fadd float %7, 1.000000e+00
ret float %8
}

LLVM IR (-O2):
@M_PI_2 = global float 0.000000e+00
define float @SineEaseIn(float %0) {
%2 = fadd float %0, -1.000000e+00
%3 = load float, float* @M_PI_2
%4 = fmul float %2, %3
%5 = tail call float @sin(float %4)
%6 = fadd float %5, 1.000000e+00
ret float %6
}
int fuzzy_eq(void *n1, void *n2) {
  int x, y;
  x = *(int *)n1;
  y = *(int *)n2;
  int r = x - y;
  if (r < 0)
    r = -r;
  return r < 3 ? 0 : 1;
}


x86 assembly (clang, -O0):
<fuzzy_eq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
sub    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1139 <fuzzy_eq+0x39>
xor    %eax,%eax
sub    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x3,%edx
cmovl  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fuzzy_eq>:
mov    (%rdi),%eax
sub    (%rsi),%eax
mov    %eax,%ecx
neg    %ecx
cmovs  %eax,%ecx
xor    %eax,%eax
cmp    $0x3,%ecx
setae  %al
ret

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

LLVM IR (-O2):
define i32 @fuzzy_eq(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
%8 = tail call i32 @llvm.abs.i32(i32 %7, i1 true)
%9 = icmp ugt i32 %8, 2
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printw(char *);
void ion_cmd_ssh(char *cmd) { printw("\n\rssh command\n\r\n\r"); }


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"\0A\0Dssh command\0A\0D\0A\0D\00"
define void @ion_cmd_ssh(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printw(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"\0A\0Dssh command\0A\0D\0A\0D\00"
define void @ion_cmd_ssh(i8* nocapture readnone %0) {
%2 = tail call i32 @printw(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned int b6_utf8_dec_len(const void *buf) {
  unsigned int c = *(const unsigned char *)buf;
  if (!(c & 0x80))
    return 1;
  if ((c & 0xe0) == 0xc0)
    return 2;
  if ((c & 0xf0) == 0xe0)
    return 3;
  if ((c & 0xf8) == 0xf0)
    return 4;
  return 0;
}


x86 assembly (clang, -O0):
<b6_utf8_dec_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
jne    112f <b6_utf8_dec_len+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    1193 <b6_utf8_dec_len+0x93>
mov    -0x14(%rbp),%eax
and    $0xe0,%eax
cmp    $0xc0,%eax
jne    114e <b6_utf8_dec_len+0x4e>
movl   $0x2,-0x4(%rbp)
jmp    1193 <b6_utf8_dec_len+0x93>
mov    -0x14(%rbp),%eax
and    $0xf0,%eax
cmp    $0xe0,%eax
jne    116d <b6_utf8_dec_len+0x6d>
movl   $0x3,-0x4(%rbp)
jmp    1193 <b6_utf8_dec_len+0x93>
mov    -0x14(%rbp),%eax
and    $0xf8,%eax
cmp    $0xf0,%eax
jne    118c <b6_utf8_dec_len+0x8c>
movl   $0x4,-0x4(%rbp)
jmp    1193 <b6_utf8_dec_len+0x93>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b6_utf8_dec_len>:
movzbl (%rdi),%ecx
mov    $0x1,%eax
test   $0x80,%cl
je     1142 <b6_utf8_dec_len+0x42>
mov    %ecx,%edx
and    $0xffffffe0,%edx
mov    $0x2,%eax
cmp    $0xc0,%edx
je     1142 <b6_utf8_dec_len+0x42>
mov    %ecx,%edx
and    $0xfffffff0,%edx
mov    $0x3,%eax
cmp    $0xe0,%edx
je     1142 <b6_utf8_dec_len+0x42>
and    $0xfffffff8,%ecx
xor    %eax,%eax
cmp    $0xf0,%ecx
sete   %al
shl    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @b6_utf8_dec_len(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = and i32 %8, 128
%10 = icmp ne i32 %9, 0
br i1 %10, label %12, label %11
11: ; preds = %1
store i32 1, i32* %2
br label %28
12: ; preds = %1
%13 = load i32, i32* %4
%14 = and i32 %13, 224
%15 = icmp eq i32 %14, 192
br i1 %15, label %16, label %17
16: ; preds = %12
store i32 2, i32* %2
br label %28
17: ; preds = %12
%18 = load i32, i32* %4
%19 = and i32 %18, 240
%20 = icmp eq i32 %19, 224
br i1 %20, label %21, label %22
21: ; preds = %17
store i32 3, i32* %2
br label %28
22: ; preds = %17
%23 = load i32, i32* %4
%24 = and i32 %23, 248
%25 = icmp eq i32 %24, 240
br i1 %25, label %26, label %27
26: ; preds = %22
store i32 4, i32* %2
br label %28
27: ; preds = %22
store i32 0, i32* %2
br label %28
28: ; preds = %27, %26, %21, %16, %11
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
define i32 @b6_utf8_dec_len(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = and i32 %3, 128
%5 = icmp eq i32 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %1
%7 = and i32 %3, 224
%8 = icmp eq i32 %7, 192
br i1 %8, label %16, label %9
9: ; preds = %6
%10 = and i32 %3, 240
%11 = icmp eq i32 %10, 224
br i1 %11, label %16, label %12
12: ; preds = %9
%13 = and i32 %3, 248
%14 = icmp eq i32 %13, 240
%15 = select i1 %14, i32 4, i32 0
br label %16
16: ; preds = %12, %9, %6, %1
%17 = phi i32 [ 1, %1 ], [ 2, %6 ], [ 3, %9 ], [ %15, %12 ]
ret i32 %17
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void output_line(char *line, FILE *output_file) { fputs(line, output_file); }


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

x86 assembly (clang, -O2):
<output_line>:
jmp    1030 <fputs@plt>

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

LLVM IR (-O2):
define void @output_line(i8* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @fputs(i8* %0, i32* %1)
ret void
}
long util_cpu_time() {
  long t = 0;
  return t;
}


x86 assembly (clang, -O0):
<util_cpu_time>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @util_cpu_time() {
%1 = alloca i64
store i64 0, i64* %1
%2 = load i64, i64* %1
ret i64 %2
}

LLVM IR (-O2):
define i64 @util_cpu_time() {
ret i64 0
}
int test_imm_7Duint8_reg(unsigned char val) {
  return ((val) & (0x7D << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_7Duint8_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, 125
%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_7Duint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 125
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned char, unsigned char,
                           unsigned char, unsigned char);
char *ip4_ntoa(unsigned char ip[4]) {
  static char buf[16];
  sprintf(buf, "%u.%u.%u.%u", ip[0], ip[1], ip[2], ip[3]);
  return buf;
}


x86 assembly (clang, -O0):
<ip4_ntoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%dl
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%r8b
mov    -0x8(%rbp),%rax
lea    0x2f04(%rip),%rdi
lea    0xebd(%rip),%rsi
movzbl %dl,%edx
movzbl %cl,%ecx
movzbl %r8b,%r8d
movzbl 0x3(%rax),%r9d
call   1030 <sprintf@plt>
lea    0x2ee2(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ip4_ntoa>:
push   %rbx
movzbl (%rdi),%edx
movzbl 0x1(%rdi),%ecx
movzbl 0x2(%rdi),%r8d
movzbl 0x3(%rdi),%r9d
lea    0x2f17(%rip),%rbx
lea    0xed0(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@ip4_ntoa.buf = internal global [16 x i8] zeroinitializer
@.str = [12 x i8] c"%u.%u.%u.%u\00"
define i8* @ip4_ntoa(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %7
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 2
%11 = load i8, i8* %10
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 3
%14 = load i8, i8* %13
%15 = call i32 @sprintf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @ip4_ntoa.buf, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8 zeroext %5, i8 zeroext %8, i8 zeroext %11, i8 zeroext %14)
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @ip4_ntoa.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@ip4_ntoa.buf = internal global [16 x i8] zeroinitializer
@.str = [12 x i8] c"%u.%u.%u.%u\00"
define i8* @ip4_ntoa(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 3
%8 = load i8, i8* %7
%9 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @ip4_ntoa.buf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8 zeroext %2, i8 zeroext %4, i8 zeroext %6, i8 zeroext %8)
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @ip4_ntoa.buf, i64 0, i64 0)
}
char const *expandfn(char const *fn) { return fn; }


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

x86 assembly (clang, -O2):
<expandfn>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @expandfn(i8* readnone returned %0) {
ret i8* %0
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int __attribute__((pure)) native_endianness() {
  return (char)*((uint32_t *)("\1\0\0\2"));
}


x86 assembly (clang, -O0):
<native_endianness>:
push   %rbp
mov    %rsp,%rbp
mov    0xef5(%rip),%rax
movsbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"\01\00\00\02\00"
define i32 @native_endianness() {
%1 = load i64, i64* bitcast ([5 x i8]* @.str to i64*)
%2 = trunc i64 %1 to i8
%3 = sext i8 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @native_endianness() {
ret i32 1
}
void example_if() {
  int a = 10;
  int b = 14;
  asm volatile("# "
               "--- Example 1 ---");
  if (a > b) {
    asm volatile("nop # @{ "
                 "log('a>b')"
                 " }@");
  }
  asm volatile("# "
               "--- Example 2 ---");
  if (a < b) {
    asm volatile("nop # @{ "
                 "log('a<b')"
                 " }@");
  } else {
    asm volatile("nop # @{ "
                 "log('a>=b')"
                 " }@");
  }
  asm volatile("# "
               "--- Example 3 ---");
  if (a <= b) {
    asm volatile("nop # @{ "
                 "log('a<=b')"
                 " }@");
  } else if (a >= b) {
    asm volatile("nop # @{ "
                 "log('a>=b')"
                 " }@");
  } else {
    asm volatile("nop # @{ "
                 "log('a==b')"
                 " }@");
  }
}


x86 assembly (clang, -O0):
<example_if>:
push   %rbp
mov    %rsp,%rbp
movl   $0xa,-0x4(%rbp)
movl   $0xe,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    111f <example_if+0x1f>
nop
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1131 <example_if+0x31>
nop
jmp    1132 <example_if+0x32>
nop
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1144 <example_if+0x44>
nop
jmp    115c <example_if+0x5c>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1156 <example_if+0x56>
nop
jmp    1157 <example_if+0x57>
nop
jmp    115c <example_if+0x5c>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @example_if() {
tail call void asm sideeffect "# --- Example 1 ---", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "# --- Example 2 ---", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "nop # @{ log('a<b') }@", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "# --- Example 3 ---", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "nop # @{ log('a<=b') }@", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int *foo = malloc(4);
  int *bar = foo;
  free(foo);
  int number = *bar;
  printf("Use: %d\n", number);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
lea    0xe8f(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <free@plt>
mov    (%rbx),%esi
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"Use: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* @malloc(i32 4)
%4 = tail call i32 @free(i32* %3)
%5 = load i32, i32* %3
%6 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ e_ldy();
int /*<<< orphan*/ e_zpx();
void e_ldy_zpx() {
  e_zpx();
  e_ldy();
}


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

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

LLVM IR (-O0):
define void @e_ldy_zpx() {
%1 = call i32 (...) @e_zpx()
%2 = call i32 (...) @e_ldy()
ret void
}

LLVM IR (-O2):
define void @e_ldy_zpx() {
%1 = tail call i32 (...) @e_zpx()
%2 = tail call i32 (...) @e_ldy()
ret void
}
int iscntrl(int c) { return (c >= 0 && c < 32) || c == 127; }


x86 assembly (clang, -O0):
<iscntrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1120 <iscntrl+0x20>
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     112a <iscntrl+0x2a>
cmpl   $0x7f,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @iscntrl(i32 %0) {
%2 = icmp ult i32 %0, 32
%3 = icmp eq i32 %0, 127
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
void f8(const int *x __attribute__((unused)), int y __attribute__((unused))) {}


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

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

LLVM IR (-O0):
define void @f8(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 @f8(i32* nocapture %0, i32 %1) {
ret void
}
void pm8921_bms_charging_end(void) {}


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

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

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

LLVM IR (-O2):
define void @pm8921_bms_charging_end() {
ret void
}
int binaryEqual(register const char *a, register const char *b,
                register unsigned len) {
  while (len--)
    if (*a++ != *b++)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<binaryEqual>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x1c(%rbp)
cmp    $0x0,%eax
je     1160 <binaryEqual+0x60>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     115b <binaryEqual+0x5b>
movl   $0x0,-0x4(%rbp)
jmp    1167 <binaryEqual+0x67>
jmp    110f <binaryEqual+0xf>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<binaryEqual>:
mov    %edx,%r8d
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
cmp    %ecx,%r8d
je     1128 <binaryEqual+0x28>
movzbl (%rdi,%rcx,1),%edx
lea    0x1(%rcx),%rax
cmp    (%rsi,%rcx,1),%dl
mov    %rax,%rcx
je     1110 <binaryEqual+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @binaryEqual(i8* nocapture %0, i8* nocapture %1, i32 %2) {
br label %4
4: ; preds = %9, %3
%5 = phi i8* [ %0, %3 ], [ %11, %9 ]
%6 = phi i8* [ %1, %3 ], [ %13, %9 ]
%7 = phi i32 [ %2, %3 ], [ %10, %9 ]
%8 = icmp eq i32 %7, 0
br i1 %8, label %16, label %9
9: ; preds = %4
%10 = add i32 %7, -1
%11 = getelementptr inbounds i8, i8* %5, i64 1
%12 = load i8, i8* %5
%13 = getelementptr inbounds i8, i8* %6, i64 1
%14 = load i8, i8* %6
%15 = icmp eq i8 %12, %14
br i1 %15, label %4, label %16
16: ; preds = %4, %9
%17 = phi i32 [ 0, %9 ], [ 1, %4 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr,
          "vita-libs-gen by xerpi\n"
          "usage:\n\tvita-libs-gen nids.json [extra.json ...] output-dir\n");
}


x86 assembly (clang, -O0):
<usage>:
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):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [84 x i8] c"vita-libs-gen by xerpi\0Ausage:\0A\09vita-libs-gen nids.json [extra.json ...] output-dir\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [84 x i8] c"vita-libs-gen by xerpi\0Ausage:\0A\09vita-libs-gen nids.json [extra.json ...] output-dir\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: read_fqbin [-f][-e][-E] fqbin_file seq_name\n\n");
  printf("    -f    Output sequence in fasta format\n");
  printf("    -e    Output extras for sequence\n");
  printf("    -E    Output only extras for sequence\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xefe(%rip),%rdi
call   1030 <printf@plt>
lea    0xf1d(%rip),%rdi
call   1030 <printf@plt>
lea    0xf37(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf00(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1e(%rip),%rdi
call   1030 <puts@plt>
lea    0xf37(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"Usage: read_fqbin [-f][-e][-E] fqbin_file seq_name\0A\0A\00"
@.str.1 = [43 x i8] c" -f Output sequence in fasta format\0A\00"
@.str.2 = [38 x i8] c" -e Output extras for sequence\0A\00"
@.str.3 = [43 x i8] c" -E Output only extras for sequence\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@str = [52 x i8] c"Usage: read_fqbin [-f][-e][-E] fqbin_file seq_name\0A\00"
@str.4 = [42 x i8] c" -f Output sequence in fasta format\00"
@str.5 = [37 x i8] c" -e Output extras for sequence\00"
@str.6 = [42 x i8] c" -E Output only extras for sequence\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.6, i64 0, i64 0))
%5 = tail call i32 @exit(i32 -1)
unreachable
}
int fastMap1023toX(unsigned long x, int in_min, int in_max, int out_min,
                   int out_max) {
  return (x * out_max) >> 10;
}


x86 assembly (clang, -O0):
<fastMap1023toX>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
imul   %rcx,%rax
shr    $0xa,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastMap1023toX>:
movslq %r8d,%rax
imul   %rdi,%rax
shr    $0xa,%rax
ret

LLVM IR (-O0):
define i32 @fastMap1023toX(i64 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i64 %0, i64* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i64, i64* %6
%12 = load i32, i32* %10
%13 = sext i32 %12 to i64
%14 = mul i64 %11, %13
%15 = lshr i64 %14, 10
%16 = trunc i64 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @fastMap1023toX(i64 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = sext i32 %4 to i64
%7 = mul i64 %6, %0
%8 = lshr i64 %7, 10
%9 = trunc i64 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ output_line(char *);
void gen_statement_end(void) { output_line(";end"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c";end\00"
define void @gen_statement_end() {
%1 = call i32 @output_line(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c";end\00"
define void @gen_statement_end() {
%1 = tail call i32 @output_line(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
void potentiometers_init_hal(void) {}


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

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

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

LLVM IR (-O2):
define void @potentiometers_init_hal() {
ret void
}
/* Variables and functions */
long labs(long);
long int absint(long int i) { return labs(i); }


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

x86 assembly (clang, -O2):
<absint>:
mov    %rdi,%rax
neg    %rax
cmovs  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @absint(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ COLOR_WHITE;
int /*<<< orphan*/ ChangeColor(int /*<<< orphan*/);
void SetColorWhite() { ChangeColor(COLOR_WHITE); }


x86 assembly (clang, -O0):
<SetColorWhite>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <ChangeColor@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetColorWhite>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <ChangeColor@plt>

LLVM IR (-O0):
@COLOR_WHITE = global i32 0
define void @SetColorWhite() {
%1 = load i32, i32* @COLOR_WHITE
%2 = call i32 @ChangeColor(i32 %1)
ret void
}

LLVM IR (-O2):
@COLOR_WHITE = global i32 0
define void @SetColorWhite() {
%1 = load i32, i32* @COLOR_WHITE
%2 = tail call i32 @ChangeColor(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fib();
int main() { fib(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @fib()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @fib()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) { printf("usage: brightness + [+|-...]\n"); }


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"usage: brightness + [+|-...]\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [29 x i8] c"usage: brightness + [+|-...]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret void
}
int strchr_num(const char *str, char c) {
  int count = 0;
  while (*str) {
    if (*str++ == c) {
      count++;
    }
  }
  return count;
}


x86 assembly (clang, -O0):
<strchr_num>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <strchr_num+0x4e>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1149 <strchr_num+0x49>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1115 <strchr_num+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr_num>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <strchr_num+0x26>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    %sil,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <strchr_num+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strchr_num(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i32 [ %12, %5 ], [ 0, %2 ]
%8 = phi i8* [ %9, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = icmp eq i8 %6, %1
%11 = zext i1 %10 to i32
%12 = add nuw nsw i32 %7, %11
%13 = load i8, i8* %9
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %12, %5 ]
ret i32 %16
}
void PrintValue(char *tag, unsigned char *val, int len) {}


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

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

LLVM IR (-O0):
define void @PrintValue(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 void
}

LLVM IR (-O2):
define void @PrintValue(i8* nocapture %0, i8* nocapture %1, i32 %2) {
ret void
}