xunge/DecIR huggingface dataset:
double myAtoD(char *message) { return 0; }


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

x86 assembly (clang, -O2):
<myAtoD>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @myAtoD(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @myAtoD(i8* nocapture readnone %0) {
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ Report(char *);
int astGBBuf(void) {
  Report("astGBBuf");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"astGBBuf\00"
define i32 @astGBBuf() {
%1 = call i32 @Report(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"astGBBuf\00"
define i32 @astGBBuf() {
%1 = tail call i32 @Report(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void g_utf8_find_prev_char() {}


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

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

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

LLVM IR (-O2):
define void @g_utf8_find_prev_char() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mailimf_phrase_free(char *);
void mailimf_display_name_free(char *display_name) {
  mailimf_phrase_free(display_name);
}


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

x86 assembly (clang, -O2):
<mailimf_display_name_free>:
jmp    1030 <mailimf_phrase_free@plt>

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

LLVM IR (-O2):
define void @mailimf_display_name_free(i8* %0) {
%2 = tail call i32 @mailimf_phrase_free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("Decimal: %d\n", 255);
  printf("Hexadecimal: %x\n", 255);
  printf("Hexadecimal: %X\n", 255);
  printf("Octal: %o\n", 255);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0xff,%esi
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
mov    $0xff,%esi
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
mov    $0xff,%esi
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
mov    $0xff,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Decimal: %d\0A\00"
@.str.1 = [17 x i8] c"Hexadecimal: %x\0A\00"
@.str.2 = [17 x i8] c"Hexadecimal: %X\0A\00"
@.str.3 = [11 x i8] c"Octal: %o\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 255)
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 255)
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 255)
%5 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 255)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Decimal: %d\0A\00"
@.str.1 = [17 x i8] c"Hexadecimal: %x\0A\00"
@.str.2 = [17 x i8] c"Hexadecimal: %X\0A\00"
@.str.3 = [11 x i8] c"Octal: %o\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 255)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 255)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 255)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 255)
ret i32 0
}
int isupper_function(char c) { return (c >= 'A' && c <= 'Z'); }


x86 assembly (clang, -O0):
<isupper_function>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <isupper_function+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isupper_function>:
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isupper_function(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
void c_fgets_(char *str, FILE **fp, int len) { fgets(str, len, *fp); }


x86 assembly (clang, -O0):
<c_fgets_>:
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    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
call   1030 <fgets@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_fgets_>:
mov    (%rsi),%rax
mov    %edx,%esi
mov    %rax,%rdx
jmp    1030 <fgets@plt>

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

LLVM IR (-O2):
define void @c_fgets_(i8* %0, i32** nocapture %1, i32 %2) {
%4 = load i32*, i32** %1
%5 = tail call i32 @fgets(i8* %0, i32 %2, i32* %4)
ret void
}
void audioAmpli(int on) {}


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

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

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

LLVM IR (-O2):
define void @audioAmpli(i32 %0) {
ret void
}
void Init() {
  static char First = 1;
  if (!First)
    return;
  First = 0;
}


x86 assembly (clang, -O0):
<Init>:
push   %rbp
mov    %rsp,%rbp
cmpb   $0x0,0x2f15(%rip)
jne    1116 <Init+0x16>
jmp    111d <Init+0x1d>
movb   $0x0,0x2f03(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Init>:
cmpb   $0x0,0x2f1a(%rip)
jne    1110 <Init+0x10>
movb   $0x1,0x2f11(%rip)
ret

LLVM IR (-O0):
@Init.First = internal global i8 1
define void @Init() {
%1 = load i8, i8* @Init.First
%2 = icmp ne i8 %1, 0
br i1 %2, label %4, label %3
3: ; preds = %0
br label %5
4: ; preds = %0
store i8 0, i8* @Init.First
br label %5
5: ; preds = %4, %3
ret void
}

LLVM IR (-O2):
@Init.First = internal unnamed_addr global i1 false
define void @Init() {
%1 = load i1, i1* @Init.First
br i1 %1, label %3, label %2
2: ; preds = %0
store i1 true, i1* @Init.First
br label %3
3: ; preds = %0, %2
ret void
}
/* Type definitions */
struct tms {
  int tms_stime;
  scalar_t__ tms_cstime;
  scalar_t__ tms_cutime;
  scalar_t__ tms_utime;
};
typedef int clock_t;

/* Variables and functions */
int __builtin_mfsr(int);
clock_t __attribute__((weak)) _times(struct tms *tms) {
  int tick;
  tick = __builtin_mfsr(264);
  tms->tms_utime = 0;
  tms->tms_stime = tick;
  tms->tms_cutime = 0;
  tms->tms_cstime = 0;
  return tick;
}


x86 assembly (clang, -O0):
<_times>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x108,%edi
call   1030 <__builtin_mfsr@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,0x18(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
movq   $0x0,0x10(%rax)
mov    -0x8(%rbp),%rax
movq   $0x0,0x8(%rax)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_times>:
push   %rbx
mov    %rdi,%rbx
mov    $0x108,%edi
call   1030 <__builtin_mfsr@plt>
movq   $0x0,0x18(%rbx)
mov    %eax,(%rbx)
xorps  %xmm0,%xmm0
movups %xmm0,0x8(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
%struct.tms = type { i32, i64, i64, i64 }
define weak i32 @_times(%struct.tms* %0) {
%2 = alloca %struct.tms*
%3 = alloca i32
store %struct.tms* %0, %struct.tms** %2
%4 = call i32 @__builtin_mfsr(i32 264)
store i32 %4, i32* %3
%5 = load %struct.tms*, %struct.tms** %2
%6 = getelementptr inbounds %struct.tms, %struct.tms* %5, i32 0, i32 3
store i64 0, i64* %6
%7 = load i32, i32* %3
%8 = load %struct.tms*, %struct.tms** %2
%9 = getelementptr inbounds %struct.tms, %struct.tms* %8, i32 0, i32 0
store i32 %7, i32* %9
%10 = load %struct.tms*, %struct.tms** %2
%11 = getelementptr inbounds %struct.tms, %struct.tms* %10, i32 0, i32 2
store i64 0, i64* %11
%12 = load %struct.tms*, %struct.tms** %2
%13 = getelementptr inbounds %struct.tms, %struct.tms* %12, i32 0, i32 1
store i64 0, i64* %13
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
%struct.tms = type { i32, i64, i64, i64 }
define weak i32 @_times(%struct.tms* %0) {
%2 = tail call i32 @__builtin_mfsr(i32 264)
%3 = getelementptr inbounds %struct.tms, %struct.tms* %0, i64 0, i32 3
store i64 0, i64* %3
%4 = getelementptr inbounds %struct.tms, %struct.tms* %0, i64 0, i32 0
store i32 %2, i32* %4
%5 = getelementptr inbounds %struct.tms, %struct.tms* %0, i64 0, i32 1
%6 = bitcast i64* %5 to i8*
ret i32 %2
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned short width;
};
struct TYPE_4__ {
  TYPE_1__ max_ink_extent;
};
typedef TYPE_2__ XFontSetExtents;

/* Variables and functions */
void set_XFontSetExtents_max_ink_extent_width(void *_p, unsigned short _v) {
  ((XFontSetExtents *)_p)->max_ink_extent.width = (unsigned short)_v;
}


x86 assembly (clang, -O0):
<set_XFontSetExtents_max_ink_extent_width>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XFontSetExtents_max_ink_extent_width>:
mov    %si,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i16 }
define void @set_XFontSetExtents_max_ink_extent_width(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i16 %5, i16* %9
ret void
}

LLVM IR (-O2):
define void @set_XFontSetExtents_max_ink_extent_width(i8* nocapture writeonly %0, i16 zeroext %1) {
%3 = bitcast i8* %0 to i16*
store i16 %1, i16* %3
ret void
}
void vec2_add(const float a[2], const float b[2], float out[2]) {
  out[0] = a[0] + b[0];
  out[1] = a[1] + b[1];
}


x86 assembly (clang, -O0):
<vec2_add>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
addss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x10(%rbp),%rax
addss  0x4(%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec2_add>:
movss  (%rdi),%xmm0
addss  (%rsi),%xmm0
movss  %xmm0,(%rdx)
movss  0x4(%rdi),%xmm0
addss  0x4(%rsi),%xmm0
movss  %xmm0,0x4(%rdx)
ret

LLVM IR (-O0):
define void @vec2_add(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
%7 = load float*, float** %4
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = load float*, float** %5
%11 = getelementptr inbounds float, float* %10, i64 0
%12 = load float, float* %11
%13 = fadd float %9, %12
%14 = load float*, float** %6
%15 = getelementptr inbounds float, float* %14, i64 0
store float %13, float* %15
%16 = load float*, float** %4
%17 = getelementptr inbounds float, float* %16, i64 1
%18 = load float, float* %17
%19 = load float*, float** %5
%20 = getelementptr inbounds float, float* %19, i64 1
%21 = load float, float* %20
%22 = fadd float %18, %21
%23 = load float*, float** %6
%24 = getelementptr inbounds float, float* %23, i64 1
store float %22, float* %24
ret void
}

LLVM IR (-O2):
define void @vec2_add(float* nocapture %0, float* nocapture %1, float* nocapture writeonly %2) {
%4 = load float, float* %0
%5 = load float, float* %1
%6 = fadd float %4, %5
store float %6, float* %2
%7 = getelementptr inbounds float, float* %0, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %1, i64 1
%10 = load float, float* %9
%11 = fadd float %8, %10
%12 = getelementptr inbounds float, float* %2, i64 1
store float %11, float* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ matmul2_c(float *, float *, float *);
void matmul2_neon(float m0[4], float m1[4], float d[4]) {
  matmul2_c(m0, m1, d);
}


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

x86 assembly (clang, -O2):
<matmul2_neon>:
jmp    1030 <matmul2_c@plt>

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

LLVM IR (-O2):
define void @matmul2_neon(float* %0, float* %1, float* %2) {
%4 = tail call i32 @matmul2_c(float* %0, float* %1, float* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fputc(int, int /*<<< orphan*/ *);
int fput1(int value, FILE *stream) { return fputc(value & 0xff, stream); }


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

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

LLVM IR (-O0):
define i32 @fput1(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 = and i32 %5, 255
%7 = load i32*, i32** %4
%8 = call i32 @fputc(i32 %6, i32* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @fput1(i32 %0, i32* nocapture %1) {
%3 = and i32 %0, 255
%4 = tail call i32 @fputc(i32 %3, i32* %1)
ret i32 %4
}
void __dev_setupIPQoS(int flag) {}


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

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

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

LLVM IR (-O2):
define void @__dev_setupIPQoS(i32 %0) {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void smpte_hbrmt_set_clock_frequency(uint8_t *p_hbrmt, uint8_t cf) {
  p_hbrmt[2] |= (cf >> 3) & 1;
  p_hbrmt[3] |= (cf & 0x7) << 5;
}


x86 assembly (clang, -O0):
<smpte_hbrmt_set_clock_frequency>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x3,%ecx
and    $0x1,%ecx
mov    -0x8(%rbp),%rax
or     0x8(%rax),%ecx
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
and    $0x7,%ecx
shl    $0x5,%ecx
mov    -0x8(%rbp),%rax
or     0xc(%rax),%ecx
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<smpte_hbrmt_set_clock_frequency>:
mov    %esi,%eax
shr    $0x3,%eax
and    $0x1,%eax
or     %eax,0x8(%rdi)
shl    $0x5,%esi
movzbl %sil,%eax
or     %eax,0xc(%rdi)
ret

LLVM IR (-O0):
define void @smpte_hbrmt_set_clock_frequency(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 = ashr i32 %5, 3
%7 = and i32 %6, 1
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 2
%10 = load i32, i32* %9
%11 = or i32 %10, %7
store i32 %11, i32* %9
%12 = load i32, i32* %4
%13 = and i32 %12, 7
%14 = shl i32 %13, 5
%15 = load i32*, i32** %3
%16 = getelementptr inbounds i32, i32* %15, i64 3
%17 = load i32, i32* %16
%18 = or i32 %17, %14
store i32 %18, i32* %16
ret void
}

LLVM IR (-O2):
define void @smpte_hbrmt_set_clock_frequency(i32* nocapture %0, i32 %1) {
%3 = lshr i32 %1, 3
%4 = and i32 %3, 1
%5 = getelementptr inbounds i32, i32* %0, i64 2
%6 = load i32, i32* %5
%7 = or i32 %6, %4
store i32 %7, i32* %5
%8 = shl i32 %1, 5
%9 = and i32 %8, 224
%10 = getelementptr inbounds i32, i32* %0, i64 3
%11 = load i32, i32* %10
%12 = or i32 %11, %9
store i32 %12, i32* %10
ret void
}
void __iounmap(void *addr) { return; }


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

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

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

LLVM IR (-O2):
define void @__iounmap(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(short *, void *, int);
short ntohs(short);
short getLength(void *line) {
  short ret;
  memcpy(&ret, line, 2);
  ret = ntohs(ret);
  return ret;
}


x86 assembly (clang, -O0):
<getLength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xa(%rbp),%rdi
mov    $0x2,%edx
call   1030 <memcpy@plt>
movswl -0xa(%rbp),%edi
call   1040 <ntohs@plt>
mov    %ax,-0xa(%rbp)
movswl -0xa(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getLength>:
push   %rax
mov    %rdi,%rsi
lea    0x6(%rsp),%rdi
mov    $0x2,%edx
call   1030 <memcpy@plt>
movswl 0x6(%rsp),%edi
call   1040 <ntohs@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i16 @getLength(i8* %0) {
%2 = alloca i8*
%3 = alloca i16
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @memcpy(i16* %3, i8* %4, i32 2)
%6 = load i16, i16* %3
%7 = call signext i16 @ntohs(i16 signext %6)
store i16 %7, i16* %3
%8 = load i16, i16* %3
ret i16 %8
}

LLVM IR (-O2):
define signext i16 @getLength(i8* %0) {
%2 = alloca i16
%3 = bitcast i16* %2 to i8*
%4 = call i32 @memcpy(i16* %2, i8* %0, i32 2)
%5 = load i16, i16* %2
%6 = call signext i16 @ntohs(i16 signext %5)
ret i16 %6
}
void routine_print(char *str) {
  while (*str != 0 || *str != '\0') {
    while ((((*(volatile unsigned *)((((0x03ff0000) + 0xD000)) + 0x08))) &
            (1 << 6)) == 0)
      ;
    (*(unsigned *)((((0x03ff0000) + 0xD000)) + 0x0C) = (unsigned)(*str++));
  }
}


x86 assembly (clang, -O0):
<routine_print>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
jne    112d <routine_print+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <routine_print+0x3d>
jmp    1178 <routine_print+0x78>
jmp    1142 <routine_print+0x42>
mov    $0x3ffd008,%eax
mov    (%rax),%eax
and    $0x40,%eax
cmp    $0x0,%eax
jne    115a <routine_print+0x5a>
jmp    1142 <routine_print+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%ecx
mov    $0x3ffd00c,%eax
mov    %ecx,(%rax)
jmp    1108 <routine_print+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<routine_print>:
mov    (%rdi),%al
test   %al,%al
je     1133 <routine_print+0x33>
cs nopw 0x0(%rax,%rax,1)
testl  $0x40,0x3ffd008
je     1110 <routine_print+0x10>
movsbl %al,%eax
mov    %eax,0x3ffd00c
movzbl 0x1(%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <routine_print+0x10>
ret

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

LLVM IR (-O2):
define void @routine_print(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %14, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
br label %7
7: ; preds = %4, %7
%8 = load volatile i32, i32* inttoptr (i64 67096584 to i32*)
%9 = and i32 %8, 64
%10 = icmp eq i32 %9, 0
br i1 %10, label %7, label %11
11: ; preds = %7
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = sext i8 %5 to i32
store i32 %13, i32* inttoptr (i64 67096588 to i32*)
%14 = load i8, i8* %12
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %11, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int stub3(int, int);
int stub4(int, int);
int stub5(int, int);
int stub6(int, int);
void main() {
  int max(int, int);
  int (*p)(int, int);
  p = max;
  int q = 8, w = 12;
  printf("The larger number is:%d\n", (*p)(q, w));
  printf("The larger number is:%d\n", (*p)(w, q));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x8,-0xc(%rbp)
movl   $0xc,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   *%rax
mov    %eax,%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
call   *%rax
mov    %eax,%esi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x8,%edi
mov    $0xc,%esi
call   1040 <max@plt>
lea    0xec9(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0xc,%edi
mov    $0x8,%esi
call   1040 <max@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"The larger number is:%d\0A\00"
define void @main() {
%1 = alloca i32 (i32, i32)*
%2 = alloca i32
%3 = alloca i32
store i32 (i32, i32)* @max, i32 (i32, i32)** %1
store i32 8, i32* %2
store i32 12, i32* %3
%4 = load i32 (i32, i32)*, i32 (i32, i32)** %1
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 %4(i32 %5, i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32 (i32, i32)*, i32 (i32, i32)** %1
%10 = load i32, i32* %3
%11 = load i32, i32* %2
%12 = call i32 %9(i32 %10, i32 %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"The larger number is:%d\0A\00"
define void @main() {
%1 = tail call i32 @max(i32 8, i32 12)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @max(i32 12, i32 8)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
float test2f(float a) { return __builtin_fabsf(a); }


x86 assembly (clang, -O0):
<test2f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movaps 0xeeb(%rip),%xmm1
pand   %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2f>:
andps  0xef9(%rip),%xmm0
ret

LLVM IR (-O0):
define float @test2f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @llvm.fabs.f32(float %3)
ret float %4
}

LLVM IR (-O2):
define float @test2f(float %0) {
%2 = tail call float @llvm.fabs.f32(float %0)
ret float %2
}
/* Variables and functions */
void *dlsym(void *, char const *);
void *get_library_symbol(void *lib, const char *fn) { return dlsym(lib, fn); }


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

x86 assembly (clang, -O2):
<get_library_symbol>:
jmp    1030 <dlsym@plt>

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

LLVM IR (-O2):
define i8* @get_library_symbol(i8* %0, i8* %1) {
%3 = tail call i8* @dlsym(i8* %0, i8* %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sys(char *);
int main(int argc, char *argv[]) {
  int i;
  for (i = 1; i < argc; i) {
    sys(argv[i]);
    printf("\n");
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    117b <main+0x4b>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1050 <sys@plt>
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
jmp    114d <main+0x1d>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x2,%edi
jl     1155 <main+0x25>
mov    %rsi,%rbx
nopl   0x0(%rax)
mov    0x8(%rbx),%rdi
call   1050 <sys@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1140 <main+0x10>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, 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 %21
11: ; preds = %7
%12 = load i8**, i8*** %5
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %12, i64 %14
%16 = load i8*, i8** %15
%17 = call i32 @sys(i8* %16)
%18 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %11
%20 = load i32, i32* %6
br label %7
21: ; preds = %7
%22 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
br label %6
6: ; preds = %6, %4
%7 = load i8*, i8** %5
%8 = tail call i32 @sys(i8* %7)
%9 = tail call i32 @putchar(i32 10)
br label %6
10: ; preds = %2
%11 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ usleep(int /*<<< orphan*/);
void bbb_usleep(uint32_t us) { usleep(us); }


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

x86 assembly (clang, -O2):
<bbb_usleep>:
jmp    1030 <usleep@plt>

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

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

/* Variables and functions */
int /*<<< orphan*/ addfilecfg(struct _cfg *);
struct _cfg *newfilecfg();
struct _cfg *getnewfilecfg(void) {
  struct _cfg *ptr;
  ptr = newfilecfg();
  addfilecfg(ptr);
  return ptr;
}


x86 assembly (clang, -O0):
<getnewfilecfg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <newfilecfg@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <addfilecfg@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getnewfilecfg>:
push   %rbx
xor    %eax,%eax
call   1030 <newfilecfg@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <addfilecfg@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct._cfg = type { i32 }
define %struct._cfg* @getnewfilecfg() {
%1 = alloca %struct._cfg*
%2 = call %struct._cfg* (...) @newfilecfg()
store %struct._cfg* %2, %struct._cfg** %1
%3 = load %struct._cfg*, %struct._cfg** %1
%4 = call i32 @addfilecfg(%struct._cfg* %3)
%5 = load %struct._cfg*, %struct._cfg** %1
ret %struct._cfg* %5
}

LLVM IR (-O2):
%struct._cfg = type { i32 }
define %struct._cfg* @getnewfilecfg() {
%1 = tail call %struct._cfg* (...) @newfilecfg()
%2 = tail call i32 @addfilecfg(%struct._cfg* %1)
ret %struct._cfg* %1
}
/* Variables and functions */
char chrlcaps(char);
char *strlcaps(char *s) {
  char *ret = s;
  do
    *(s) = chrlcaps(*(s));
  while (*(++s));
  return ret;
}


x86 assembly (clang, -O0):
<strlcaps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <chrlcaps@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,0x1(%rax)
jne    1124 <strlcaps+0x14>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlcaps>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
lea    0x1(%rdi),%rbx
nopl   (%rax)
movsbl %al,%edi
call   1030 <chrlcaps@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <strlcaps+0x10>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strlcaps(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** %2
%7 = load i8, i8* %6
%8 = call signext i8 @chrlcaps(i8 signext %7)
%9 = load i8*, i8** %2
store i8 %8, i8* %9
br label %10
10: ; preds = %5
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %2
%13 = load i8, i8* %12
%14 = icmp ne i8 %13, 0
br i1 %14, label %5, label %15
15: ; preds = %10
%16 = load i8*, i8** %3
ret i8* %16
}

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

/* Variables and functions */
void *__match_dat(struct dat *, unsigned char *, unsigned long, int, int *,
                  int /*<<< orphan*/);
void *match_dat(struct dat *d, unsigned char *target, unsigned long targetlen,
                int option, int *found) {
  return __match_dat(d, target, targetlen, option, found, 0);
}


x86 assembly (clang, -O0):
<match_dat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x28(%rbp),%r8
xor    %r9d,%r9d
call   1030 <__match_dat@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<match_dat>:
xor    %r9d,%r9d
jmp    1030 <__match_dat@plt>

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

LLVM IR (-O2):
%struct.dat = type { i32 }
define i8* @match_dat(%struct.dat* %0, i8* %1, i64 %2, i32 %3, i32* %4) {
%6 = tail call i8* @__match_dat(%struct.dat* %0, i8* %1, i64 %2, i32 %3, i32* %4, i32 0)
ret i8* %6
}
void printStats(int health) {
  if (health < 0) {
    logError("Negative value given for health", __func__);
  } else {
    printf("| %s%i%s HP |\n", "\x1b[32m", health, "\x1b[0m");
  }
}


x86 assembly (clang, -O0):
<printStats>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    114f <printStats+0x2f>
lea    0xec4(%rip),%rdi
lea    0xedd(%rip),%rsi
mov    $0x0,%al
call   1040 <logError@plt>
jmp    116e <printStats+0x4e>
mov    -0x4(%rbp),%edx
lea    0xed2(%rip),%rdi
lea    0xeda(%rip),%rsi
lea    0xed9(%rip),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printStats>:
test   %edi,%edi
js     1142 <printStats+0x22>
mov    %edi,%edx
lea    0xefe(%rip),%rdi
lea    0xf06(%rip),%rsi
lea    0xf05(%rip),%rcx
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xeb7(%rip),%rdi
lea    0xed0(%rip),%rsi
xor    %eax,%eax
jmp    1040 <logError@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Negative value given for health\00"
@__func__.printStats = [11 x i8] c"printStats\00"
@.str.1 = [15 x i8] c"| %s%i%s HP |\0A\00"
@.str.2 = [6 x i8] c"\1B[32m\00"
@.str.3 = [5 x i8] c"\1B[0m\00"
define void @printStats(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @logError to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__func__.printStats, i64 0, i64 0))
br label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %10
10: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"Negative value given for health\00"
@__func__.printStats = [11 x i8] c"printStats\00"
@.str.1 = [15 x i8] c"| %s%i%s HP |\0A\00"
@.str.2 = [6 x i8] c"\1B[32m\00"
@.str.3 = [5 x i8] c"\1B[0m\00"
define void @printStats(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @logError to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__func__.printStats, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_golang_block_comment();
int /*<<< orphan*/ test_golang_comment_entities();
int /*<<< orphan*/ test_golang_comments();
int /*<<< orphan*/ test_golang_empty_comments();
void all_golang_tests() {
  test_golang_comments();
  test_golang_empty_comments();
  test_golang_block_comment();
  test_golang_comment_entities();
}


x86 assembly (clang, -O0):
<all_golang_tests>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <test_golang_comments@plt>
mov    $0x0,%al
call   1060 <test_golang_empty_comments@plt>
mov    $0x0,%al
call   1050 <test_golang_block_comment@plt>
mov    $0x0,%al
call   1040 <test_golang_comment_entities@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<all_golang_tests>:
push   %rax
xor    %eax,%eax
call   1030 <test_golang_comments@plt>
xor    %eax,%eax
call   1060 <test_golang_empty_comments@plt>
xor    %eax,%eax
call   1050 <test_golang_block_comment@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <test_golang_comment_entities@plt>

LLVM IR (-O0):
define void @all_golang_tests() {
%1 = call i32 (...) @test_golang_comments()
%2 = call i32 (...) @test_golang_empty_comments()
%3 = call i32 (...) @test_golang_block_comment()
%4 = call i32 (...) @test_golang_comment_entities()
ret void
}

LLVM IR (-O2):
define void @all_golang_tests() {
%1 = tail call i32 (...) @test_golang_comments()
%2 = tail call i32 (...) @test_golang_empty_comments()
%3 = tail call i32 (...) @test_golang_block_comment()
%4 = tail call i32 (...) @test_golang_comment_entities()
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int diff_context_lines(uint64_t diffFlags) {
  int n = diffFlags & ((uint64_t)0x0000ffff);
  if (n == 0)
    n = 5;
  return n;
}


x86 assembly (clang, -O0):
<diff_context_lines>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1123 <diff_context_lines+0x23>
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<diff_context_lines>:
movzwl %di,%ecx
test   %ecx,%ecx
mov    $0x5,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @diff_context_lines(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 65535
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 5, i32* %3
br label %9
9: ; preds = %8, %1
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @diff_context_lines(i32 %0) {
%2 = and i32 %0, 65535
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 5, i32 %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void exit_cb(void *arg) {
  int a = *(int *)arg;
  printf("exit_cb a : %d\n", a);
}


x86 assembly (clang, -O0):
<exit_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exit_cb>:
mov    (%rdi),%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"exit_cb a : %d\0A\00"
define void @exit_cb(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"exit_cb a : %d\0A\00"
define void @exit_cb(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
scalar_t__ syscall(int, int, int, unsigned long, char const *, unsigned long);
long kexec_file_load(int kernel_fd, int initrd_fd, unsigned long cmdline_len,
                     const char *cmdline_ptr, unsigned long flags) {
  return (long)syscall(320, kernel_fd, initrd_fd, cmdline_len, cmdline_ptr,
                       flags);
}


x86 assembly (clang, -O0):
<kexec_file_load>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
mov    $0x140,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kexec_file_load>:
mov    %r8,%r9
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %esi,%edx
mov    %edi,%esi
mov    $0x140,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i64 @kexec_file_load(i32 %0, i32 %1, i64 %2, i8* %3, i64 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i64
store i32 %0, i32* %6
store i32 %1, i32* %7
store i64 %2, i64* %8
store i8* %3, i8** %9
store i64 %4, i64* %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i64, i64* %8
%14 = load i8*, i8** %9
%15 = load i64, i64* %10
%16 = call i64 @syscall(i32 320, i32 %11, i32 %12, i64 %13, i8* %14, i64 %15)
ret i64 %16
}

LLVM IR (-O2):
define i64 @kexec_file_load(i32 %0, i32 %1, i64 %2, i8* %3, i64 %4) {
%6 = tail call i64 @syscall(i32 320, i32 %0, i32 %1, i64 %2, i8* %3, i64 %4)
ret i64 %6
}
int test_imm_91int8_reg(signed char val) {
  return ((val) & (-0x91 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_91int8_reg>:
test   $0xffffff6f,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_91int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -145
%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_91int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -145
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ kernel_dgemm_nt_4x4_vs_lib4(int, int, int, double *,
                                               double *, double *, double *,
                                               int, int, int);
void kernel_dgemm_nt_4x4_lib4(int kmax, double *A, double *B, double *C,
                              double *D, int alg, int tc, int td) {
  kernel_dgemm_nt_4x4_vs_lib4(4, 4, kmax, A, B, C, D, alg, tc, td);
}


x86 assembly (clang, -O0):
<kernel_dgemm_nt_4x4_lib4>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x58,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9d,-0x34(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    -0x30(%rbp),%rbx
mov    -0x34(%rbp),%r11d
mov    0x10(%rbp),%r10d
mov    0x18(%rbp),%eax
mov    $0x4,%esi
mov    %esi,%edi
mov    %rbx,(%rsp)
mov    %r11d,0x8(%rsp)
mov    %r10d,0x10(%rsp)
mov    %eax,0x18(%rsp)
call   1030 <kernel_dgemm_nt_4x4_vs_lib4@plt>
add    $0x58,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel_dgemm_nt_4x4_lib4>:
push   %rbx
mov    %r9d,%eax
mov    %r8,%r10
mov    %rcx,%r9
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %edi,%edx
mov    0x10(%rsp),%r11d
mov    0x18(%rsp),%ebx
mov    $0x4,%edi
mov    $0x4,%esi
push   %rbx
push   %r11
push   %rax
push   %r10
call   1030 <kernel_dgemm_nt_4x4_vs_lib4@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @kernel_dgemm_nt_4x4_lib4(i32 %0, double* %1, double* %2, double* %3, double* %4, i32 %5, i32 %6, i32 %7) {
%9 = alloca i32
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca double*
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
store i32 %0, i32* %9
store double* %1, double** %10
store double* %2, double** %11
store double* %3, double** %12
store double* %4, double** %13
store i32 %5, i32* %14
store i32 %6, i32* %15
store i32 %7, i32* %16
%17 = load i32, i32* %9
%18 = load double*, double** %10
%19 = load double*, double** %11
%20 = load double*, double** %12
%21 = load double*, double** %13
%22 = load i32, i32* %14
%23 = load i32, i32* %15
%24 = load i32, i32* %16
%25 = call i32 @kernel_dgemm_nt_4x4_vs_lib4(i32 4, i32 4, i32 %17, double* %18, double* %19, double* %20, double* %21, i32 %22, i32 %23, i32 %24)
ret void
}

LLVM IR (-O2):
define void @kernel_dgemm_nt_4x4_lib4(i32 %0, double* %1, double* %2, double* %3, double* %4, i32 %5, i32 %6, i32 %7) {
%9 = tail call i32 @kernel_dgemm_nt_4x4_vs_lib4(i32 4, i32 4, i32 %0, double* %1, double* %2, double* %3, double* %4, i32 %5, i32 %6, i32 %7)
ret void
}
int is_capital_equal(char s1, char s2) {
  if (s1 >= 'A' && s1 <= 'Z' && s2 >= 'A' && s2 <= 'Z' && s1 == s2)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<is_capital_equal>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1160 <is_capital_equal+0x60>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     1160 <is_capital_equal+0x60>
movsbl -0x6(%rbp),%eax
cmp    $0x41,%eax
jl     1160 <is_capital_equal+0x60>
movsbl -0x6(%rbp),%eax
cmp    $0x5a,%eax
jg     1160 <is_capital_equal+0x60>
movsbl -0x5(%rbp),%eax
movsbl -0x6(%rbp),%ecx
cmp    %ecx,%eax
jne    1160 <is_capital_equal+0x60>
movl   $0x1,-0x4(%rbp)
jmp    1167 <is_capital_equal+0x67>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_capital_equal>:
lea    -0x41(%rdi),%eax
cmp    $0x1a,%al
setb   %al
lea    -0x41(%rsi),%ecx
cmp    $0x1a,%cl
setb   %cl
and    %al,%cl
cmp    %sil,%dil
sete   %al
and    %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @is_capital_equal(i8 signext %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = icmp sge i32 %7, 65
br i1 %8, label %9, label %28
9: ; preds = %2
%10 = load i8, i8* %4
%11 = sext i8 %10 to i32
%12 = icmp sle i32 %11, 90
br i1 %12, label %13, label %28
13: ; preds = %9
%14 = load i8, i8* %5
%15 = sext i8 %14 to i32
%16 = icmp sge i32 %15, 65
br i1 %16, label %17, label %28
17: ; preds = %13
%18 = load i8, i8* %5
%19 = sext i8 %18 to i32
%20 = icmp sle i32 %19, 90
br i1 %20, label %21, label %28
21: ; preds = %17
%22 = load i8, i8* %4
%23 = sext i8 %22 to i32
%24 = load i8, i8* %5
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %23, %25
br i1 %26, label %27, label %28
27: ; preds = %21
store i32 1, i32* %3
br label %29
28: ; preds = %21, %17, %13, %9, %2
store i32 0, i32* %3
br label %29
29: ; preds = %28, %27
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
define i32 @is_capital_equal(i8 signext %0, i8 signext %1) {
%3 = add i8 %0, -65
%4 = icmp ult i8 %3, 26
%5 = add i8 %1, -65
%6 = icmp ult i8 %5, 26
%7 = and i1 %4, %6
%8 = icmp eq i8 %0, %1
%9 = and i1 %8, %7
%10 = zext i1 %9 to i32
ret i32 %10
}