xunge/DecIR huggingface dataset:
double ftgetr8(entry, kw)
char *entry;
struct Keyword *kw;
{
  char temp[30];
  if (ftgetc(entry, kw, temp, 30))
    return (atof(temp));
  else
    return ((double)0.0);
}


x86 assembly (clang, -O0):
<ftgetr8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x40(%rbp),%rdx
mov    $0x1e,%ecx
mov    $0x0,%al
call   1040 <ftgetc@plt>
cmp    $0x0,%eax
je     116a <ftgetr8+0x4a>
lea    -0x40(%rbp),%rdi
mov    $0x0,%al
call   1030 <atof@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1172 <ftgetr8+0x52>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftgetr8>:
sub    $0x28,%rsp
mov    %rsp,%rdx
mov    $0x1e,%ecx
xor    %eax,%eax
call   1040 <ftgetc@plt>
test   %eax,%eax
je     114a <ftgetr8+0x2a>
mov    %rsp,%rdi
xor    %eax,%eax
call   1030 <atof@plt>
cvtsi2sd %eax,%xmm0
add    $0x28,%rsp
ret
xorps  %xmm0,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
%struct.Keyword = type opaque
define double @ftgetr8(i8* %0, %struct.Keyword* %1) {
%3 = alloca double
%4 = alloca i8*
%5 = alloca %struct.Keyword*
%6 = alloca [30 x i8]
store i8* %0, i8** %4
store %struct.Keyword* %1, %struct.Keyword** %5
%7 = load i8*, i8** %4
%8 = load %struct.Keyword*, %struct.Keyword** %5
%9 = getelementptr inbounds [30 x i8], [30 x i8]* %6, i64 0, i64 0
%10 = call i32 (i8*, %struct.Keyword*, i8*, i32, ...) bitcast (i32 (...)* @ftgetc to i32 (i8*, %struct.Keyword*, i8*, i32, ...)*)(i8* %7, %struct.Keyword* %8, i8* %9, i32 30)
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = getelementptr inbounds [30 x i8], [30 x i8]* %6, i64 0, i64 0
%14 = call i32 (i8*, ...) bitcast (i32 (...)* @atof to i32 (i8*, ...)*)(i8* %13)
%15 = sitofp i32 %14 to double
store double %15, double* %3
br label %17
16: ; preds = %2
store double 0.000000e+00, double* %3
br label %17
17: ; preds = %16, %12
%18 = load double, double* %3
ret double %18
}

LLVM IR (-O2):
%struct.Keyword = type opaque
define double @ftgetr8(i8* %0, %struct.Keyword* %1) {
%3 = alloca [30 x i8]
%4 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%5 = call i32 (i8*, %struct.Keyword*, i8*, i32, ...) bitcast (i32 (...)* @ftgetc to i32 (i8*, %struct.Keyword*, i8*, i32, ...)*)(i8* %0, %struct.Keyword* %1, i8* %4, i32 30)
%6 = icmp eq i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @atof to i32 (i8*, ...)*)(i8* %4)
%9 = sitofp i32 %8 to double
br label %10
10: ; preds = %2, %7
%11 = phi double [ %9, %7 ], [ 0.000000e+00, %2 ]
ret double %11
}
float E3D_Max(float a, float b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<E3D_Max>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112c <E3D_Max+0x2c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1136 <E3D_Max+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<E3D_Max>:
maxss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @E3D_Max(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp ogt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @E3D_Max(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help() {
  printf("Usage: smtp [OPTIONS]\n\n"
         "Mandatory arguments:\n"
         "\t-t, --to ADDRESS\tspecify destination email address\n"
         "\t-f, --from ADDRESS\tspecify sender's email address\n"
         "Optional arguments:\n"
         "\t-s, --subject SUBJECT\tspecify subject of message\n"
         "\t-m, --message FILENAME\tread text of message from FILENAME\n"
         "\t-a, --attach FILENAME\tadd FILENAME to message as attachment\n"
         "\t-c, --cc ADDRESS\tadd ADDRESS to CC list\n"
         "\t-h, --host HOSTNAME\tconnect to smpt server HOSTNAME (default: "
         "localhost)\n");
}


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

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

LLVM IR (-O0):
@.str = [453 x i8] c"Usage: smtp [OPTIONS]\0A\0AMandatory arguments:\0A\09-t, --to ADDRESS\09specify destination email address\0A\09-f, --from ADDRESS\09specify sender's email address\0AOptional arguments:\0A\09-s, --subject SUBJECT\09specify subject of message\0A\09-m, --message FILENAME\09read text of message from FILENAME\0A\09-a, --attach FILENAME\09add FILENAME to message as attachment\0A\09-c, --cc ADDRESS\09add ADDRESS to CC list\0A\09-h, --host HOSTNAME\09connect to smpt server HOSTNAME (default: localhost)\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([453 x i8], [453 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [452 x i8] c"Usage: smtp [OPTIONS]\0A\0AMandatory arguments:\0A\09-t, --to ADDRESS\09specify destination email address\0A\09-f, --from ADDRESS\09specify sender's email address\0AOptional arguments:\0A\09-s, --subject SUBJECT\09specify subject of message\0A\09-m, --message FILENAME\09read text of message from FILENAME\0A\09-a, --attach FILENAME\09add FILENAME to message as attachment\0A\09-c, --cc ADDRESS\09add ADDRESS to CC list\0A\09-h, --host HOSTNAME\09connect to smpt server HOSTNAME (default: localhost)\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([452 x i8], [452 x i8]* @str, i64 0, i64 0))
ret void
}
void foo_2_2_1_1_1_2_1_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_1_1_1_2_1_2_1() {
ret void
}
void lrs_getdigits(long *a, long *b) {
  *a = ((0L) * 4);
  *b = ((0L) * 4);
  return;
}


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

x86 assembly (clang, -O2):
<lrs_getdigits>:
movq   $0x0,(%rdi)
movq   $0x0,(%rsi)
ret

LLVM IR (-O0):
define void @lrs_getdigits(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
store i64* %0, i64** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %3
store i64 0, i64* %5
%6 = load i64*, i64** %4
store i64 0, i64* %6
ret void
}

LLVM IR (-O2):
define void @lrs_getdigits(i64* nocapture writeonly %0, i64* nocapture writeonly %1) {
store i64 0, i64* %0
store i64 0, i64* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
scalar_t__ reallocf(char *, int);
void reallocfRadar6337483_4() {
  char *buf = malloc(100);
  char *buf2 = (char *)reallocf(buf, 0x1000000);
  if (!buf2) {
    return;
  } else {
    free(buf2);
  }
}


x86 assembly (clang, -O0):
<reallocfRadar6337483_4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x64,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1000000,%esi
call   1050 <reallocf@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1168 <reallocfRadar6337483_4+0x38>
jmp    1171 <reallocfRadar6337483_4+0x41>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reallocfRadar6337483_4>:
push   %rax
mov    $0x64,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
mov    $0x1000000,%esi
call   1050 <reallocf@plt>
test   %rax,%rax
je     1156 <reallocfRadar6337483_4+0x26>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @reallocfRadar6337483_4() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* @malloc(i32 100)
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i64 @reallocf(i8* %4, i32 16777216)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %2
%7 = load i8*, i8** %2
%8 = icmp ne i8* %7, null
br i1 %8, label %10, label %9
9: ; preds = %0
br label %13
10: ; preds = %0
%11 = load i8*, i8** %2
%12 = call i32 @free(i8* %11)
br label %13
13: ; preds = %9, %10
ret void
}

LLVM IR (-O2):
define void @reallocfRadar6337483_4() {
%1 = tail call dereferenceable_or_null(100) i8* @malloc(i32 100)
%2 = tail call i64 @reallocf(i8* %1, i32 16777216)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = inttoptr i64 %2 to i8*
%6 = tail call i32 @free(i8* %5)
br label %7
7: ; preds = %0, %4
ret void
}
/* Variables and functions */
unsigned long long sh(unsigned long long);
unsigned long long h(unsigned long long a) {
  return sh(a & 0xfffffffcffffffffull);
}


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movabs $0xfffffffcffffffff,%rdi
ff ff ff
and    -0x8(%rbp),%rdi
call   1030 <sh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h>:
movabs $0xfffffffcffffffff,%rax
ff ff ff
and    %rax,%rdi
jmp    1030 <sh@plt>

LLVM IR (-O0):
define i64 @h(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, -12884901889
%5 = call i64 @sh(i64 %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @h(i64 %0) {
%2 = and i64 %0, -12884901889
%3 = tail call i64 @sh(i64 %2)
ret i64 %3
}
/* Variables and functions */
float log10f(float);
float __ocl_log10_float(float src) { return log10f(src); }


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

x86 assembly (clang, -O2):
<__ocl_log10_float>:
jmp    1030 <log10f@plt>

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

LLVM IR (-O2):
define float @__ocl_log10_float(float %0) {
%2 = tail call float @log10f(float %0)
ret float %2
}
int fMax2(int a, int b) {
  int larger = (a * (a / b) + b * (b / a)) / (a / b + b / a);
  return larger;
}


x86 assembly (clang, -O0):
<fMax2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x8(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %eax,%edx
mov    -0x14(%rbp),%eax
imul   %edx,%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %eax,%edx
mov    -0x10(%rbp),%eax
add    %edx,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fMax2>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %eax,%r8d
mov    %esi,%eax
cltd
idiv   %edi
mov    %eax,%ecx
imul   %eax,%esi
add    %r8d,%ecx
imul   %edi,%r8d
add    %esi,%r8d
mov    %r8d,%eax
cltd
idiv   %ecx
ret

LLVM IR (-O0):
define i32 @fMax2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = sdiv i32 %7, %8
%10 = mul nsw i32 %6, %9
%11 = load i32, i32* %4
%12 = load i32, i32* %4
%13 = load i32, i32* %3
%14 = sdiv i32 %12, %13
%15 = mul nsw i32 %11, %14
%16 = add nsw i32 %10, %15
%17 = load i32, i32* %3
%18 = load i32, i32* %4
%19 = sdiv i32 %17, %18
%20 = load i32, i32* %4
%21 = load i32, i32* %3
%22 = sdiv i32 %20, %21
%23 = add nsw i32 %19, %22
%24 = sdiv i32 %16, %23
store i32 %24, i32* %5
%25 = load i32, i32* %5
ret i32 %25
}

LLVM IR (-O2):
define i32 @fMax2(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
%4 = mul nsw i32 %3, %0
%5 = sdiv i32 %1, %0
%6 = mul nsw i32 %5, %1
%7 = add nsw i32 %6, %4
%8 = add nsw i32 %5, %3
%9 = sdiv i32 %7, %8
ret i32 %9
}
void gdk_keymap_translate_keyboard_state() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ SEEK_CUR;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
void qemu_file_skip(FILE *f, int size) { fseek(f, size, SEEK_CUR); }


x86 assembly (clang, -O0):
<qemu_file_skip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    0x2ebb(%rip),%rax
mov    (%rax),%edx
call   1030 <fseek@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qemu_file_skip>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edx
jmp    1030 <fseek@plt>

LLVM IR (-O0):
@SEEK_CUR = global i32 0
define void @qemu_file_skip(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = load i32, i32* @SEEK_CUR
%8 = call i32 @fseek(i32* %5, i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
@SEEK_CUR = global i32 0
define void @qemu_file_skip(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* @SEEK_CUR
%4 = tail call i32 @fseek(i32* %0, i32 %1, i32 %3)
ret void
}
void av_opt_is_set_to_default_by_name() {}


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

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

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

LLVM IR (-O2):
define void @av_opt_is_set_to_default_by_name() {
ret void
}
/* Type definitions */
typedef int int8_t;
typedef int /*<<< orphan*/ input;
typedef int /*<<< orphan*/ expected;

/* Variables and functions */
int /*<<< orphan*/ test_rebase(int, int *, int, int, int *, int);
void test_binary_to_multiple_decimal(void) {
  int8_t input[] = {1, 0, 1, 0, 1, 0};
  int8_t expected[] = {4, 2};
  test_rebase(2, input, (sizeof(input) / sizeof(input[0])), 10, expected,
              (sizeof(expected) / sizeof(expected[0])));
}


x86 assembly (clang, -O0):
<test_binary_to_multiple_decimal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed8(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rsi
lea    -0x28(%rbp),%r8
mov    $0x2,%r9d
mov    $0x6,%edx
mov    $0xa,%ecx
mov    %r9d,%edi
call   1030 <test_rebase@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_binary_to_multiple_decimal>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movabs $0x200000004,%rax
mov    %rax,0x8(%rsp)
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%r8
mov    $0x2,%edi
mov    $0x6,%edx
mov    $0xa,%ecx
mov    $0x2,%r9d
call   1030 <test_rebase@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.test_binary_to_multiple_decimal.input = [6 x i32] [i32 1, i32 0, i32 1, i32 0, i32 1, i32 0]
@__const.test_binary_to_multiple_decimal.expected = [2 x i32] [i32 4, i32 2]
define void @test_binary_to_multiple_decimal() {
%1 = alloca [6 x i32]
%2 = alloca [2 x i32]
%3 = bitcast [6 x i32]* %1 to i8*
%4 = bitcast [2 x i32]* %2 to i8*
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%7 = call i32 @test_rebase(i32 2, i32* %5, i32 6, i32 10, i32* %6, i32 2)
ret void
}

LLVM IR (-O2):
@__const.test_binary_to_multiple_decimal.input = [6 x i32] [i32 1, i32 0, i32 1, i32 0, i32 1, i32 0]
define void @test_binary_to_multiple_decimal() {
%1 = alloca [6 x i32]
%2 = alloca i64
%3 = bitcast [6 x i32]* %1 to i8*
%4 = bitcast i64* %2 to i8*
store i64 8589934596, i64* %2
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%6 = bitcast i64* %2 to i32*
%7 = call i32 @test_rebase(i32 2, i32* %5, i32 6, i32 10, i32* %6, i32 2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ mbstate_t;

/* Variables and functions */
size_t __mbsrtowcs(int /*<<< orphan*/ *, char const **, size_t,
                   int /*<<< orphan*/ *);
int /*<<< orphan*/ memset(int /*<<< orphan*/ *, char, int);
size_t mbstowcs(wchar_t *pwcs, const char *s, size_t n) {
  mbstate_t state;
  memset(&state, '\0', sizeof state);
  return __mbsrtowcs(pwcs, &s, n, &state);
}


x86 assembly (clang, -O0):
<mbstowcs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x1c(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    -0x10(%rbp),%rsi
lea    -0x1c(%rbp),%rcx
call   1030 <__mbsrtowcs@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mbstowcs>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rdi,%rbx
mov    %rsi,(%rsp)
lea    0xc(%rsp),%r15
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
mov    %r15,%rcx
call   1030 <__mbsrtowcs@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i64 @mbstowcs(i32* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i32
store i8* %1, i8** %4
%6 = bitcast i32* %5 to i8*
%7 = call i32 @memset(i32* %5, i8 signext 0, i32 4)
%8 = call i64 @__mbsrtowcs(i32* %0, i8** %4, i64 %2, i32* %5)
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void EPIConfigSDRAMSet(unsigned long ulBase, unsigned long ulConfig,
                       unsigned long ulRefresh) {
  DEBUG_ASSERT(ulBase == 0x400D0000);
  DEBUG_ASSERT(ulRefresh < 2048);
  ulConfig &= ~0x07FF0000;
  ulConfig |= ulRefresh << 16;
  (*((volatile unsigned long *)(ulBase + 0x00000010))) = ulConfig;
}


x86 assembly (clang, -O0):
<EPIConfigSDRAMSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x400d0000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
cmpq   $0x800,-0x18(%rbp)
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rax
and    $0xfffffffff800ffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
shl    $0x10,%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x10(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EPIConfigSDRAMSet>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %edi,%edi
cmp    $0x400d0000,%r15
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
xor    %edi,%edi
cmp    $0x800,%rbx
setb   %dil
call   1030 <DEBUG_ASSERT@plt>
and    $0xfffffffff800ffff,%r14
shl    $0x10,%rbx
or     %r14,%rbx
mov    %rbx,0x10(%r15)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @EPIConfigSDRAMSet(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = icmp eq i64 %7, 1074593792
%9 = zext i1 %8 to i32
%10 = call i32 @DEBUG_ASSERT(i32 %9)
%11 = load i64, i64* %6
%12 = icmp ult i64 %11, 2048
%13 = zext i1 %12 to i32
%14 = call i32 @DEBUG_ASSERT(i32 %13)
%15 = load i64, i64* %5
%16 = and i64 %15, -134152193
store i64 %16, i64* %5
%17 = load i64, i64* %6
%18 = shl i64 %17, 16
%19 = load i64, i64* %5
%20 = or i64 %19, %18
store i64 %20, i64* %5
%21 = load i64, i64* %5
%22 = load i64, i64* %4
%23 = add i64 %22, 16
%24 = inttoptr i64 %23 to i64*
store volatile i64 %21, i64* %24
ret void
}

LLVM IR (-O2):
define void @EPIConfigSDRAMSet(i64 %0, i64 %1, i64 %2) {
%4 = icmp eq i64 %0, 1074593792
%5 = zext i1 %4 to i32
%6 = tail call i32 @DEBUG_ASSERT(i32 %5)
%7 = icmp ult i64 %2, 2048
%8 = zext i1 %7 to i32
%9 = tail call i32 @DEBUG_ASSERT(i32 %8)
%10 = and i64 %1, -134152193
%11 = shl i64 %2, 16
%12 = or i64 %11, %10
%13 = add i64 %0, 16
%14 = inttoptr i64 %13 to i64*
store volatile i64 %12, i64* %14
ret void
}
/* Variables and functions */
int /*<<< orphan*/ par();
int /*<<< orphan*/ printf(char *);
void __real_par(void) {
  printf("__real_par \n");
  par();
}


x86 assembly (clang, -O0):
<__real_par>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <par@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__real_par>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <par@plt>

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

LLVM IR (-O2):
@str = [12 x i8] c"__real_par \00"
define void @__real_par() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @par()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int handle_xform_masked(int /*<<< orphan*/, unsigned long *, unsigned long,
                        unsigned long *);
bool handle_xform(uint32_t insn, unsigned long *gprs, unsigned long *addr) {
  return handle_xform_masked(insn, gprs, -1UL, addr);
}


x86 assembly (clang, -O0):
<handle_xform>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    $0xffffffffffffffff,%rdx
call   1030 <handle_xform_masked@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_xform>:
mov    %rdx,%rcx
mov    $0xffffffffffffffff,%rdx
jmp    1030 <handle_xform_masked@plt>

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

LLVM IR (-O2):
define i32 @handle_xform(i32 %0, i64* %1, i64* %2) {
%4 = tail call i32 @handle_xform_masked(i32 %0, i64* %1, i64 -1, i64* %2)
ret i32 %4
}
char *__strdup(s) const char *s;
{
  char *dup;
  dup = (char *)malloc(strlen(s) + 1);
  if (dup)
    strcpy(dup, s);
  return dup;
}


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

x86 assembly (clang, -O2):
<__strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <__strdup+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @__strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = load i8*, i8** %2
%13 = call i8* @strcpy(i8* %11, i8* %12)
br label %14
14: ; preds = %10, %1
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
define i8* @__strdup(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i8* @strcpy(i8* %4, i8* dereferenceable(1) %0)
br label %8
8: ; preds = %6, %1
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef scalar_t__ uint32_t;
struct cart_unif_data {
  int dummy;
};

/* Variables and functions */
struct cart_unif_data *cart_unif_add_chunk(struct cart_unif_data *, char *,
                                           scalar_t__,
                                           int /*<<< orphan*/ const *);
scalar_t__ strlen(char const *);
struct cart_unif_data *
cart_unif_add_boardname_chunk(struct cart_unif_data *chunks,
                              const char *boardname) {
  return cart_unif_add_chunk(chunks, "MAPR", (uint32_t)strlen(boardname) + 1,
                             (const uint8_t *)boardname);
}


x86 assembly (clang, -O0):
<cart_unif_add_boardname_chunk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rdx
add    $0x1,%rdx
mov    -0x10(%rbp),%rcx
lea    0xea9(%rip),%rsi
call   1040 <cart_unif_add_chunk@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cart_unif_add_boardname_chunk>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rdx
lea    0xec3(%rip),%rsi
mov    %r14,%rdi
mov    %rbx,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <cart_unif_add_chunk@plt>

LLVM IR (-O0):
%struct.cart_unif_data = type { i32 }
@.str = [5 x i8] c"MAPR\00"
define %struct.cart_unif_data* @cart_unif_add_boardname_chunk(%struct.cart_unif_data* %0, i8* %1) {
%3 = alloca %struct.cart_unif_data*
%4 = alloca i8*
store %struct.cart_unif_data* %0, %struct.cart_unif_data** %3
store i8* %1, i8** %4
%5 = load %struct.cart_unif_data*, %struct.cart_unif_data** %3
%6 = load i8*, i8** %4
%7 = call i64 @strlen(i8* %6)
%8 = add nsw i64 %7, 1
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
%11 = call %struct.cart_unif_data* @cart_unif_add_chunk(%struct.cart_unif_data* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %8, i32* %10)
ret %struct.cart_unif_data* %11
}

LLVM IR (-O2):
%struct.cart_unif_data = type { i32 }
@.str = [5 x i8] c"MAPR\00"
define %struct.cart_unif_data* @cart_unif_add_boardname_chunk(%struct.cart_unif_data* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = add nsw i64 %3, 1
%5 = bitcast i8* %1 to i32*
%6 = tail call %struct.cart_unif_data* @cart_unif_add_chunk(%struct.cart_unif_data* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %4, i32* %5)
ret %struct.cart_unif_data* %6
}
int main2() {}


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

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

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

LLVM IR (-O2):
define i32 @main2() {
ret i32 undef
}
/* Variables and functions */
scalar_t__ ft_islower(int);
scalar_t__ ft_isupper(int);
int ft_isalpha(int c) {
  if (ft_isupper(c) || ft_islower(c))
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_isalpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <ft_isupper@plt>
cmp    $0x0,%rax
jne    114f <ft_isalpha+0x2f>
mov    -0x8(%rbp),%edi
call   1030 <ft_islower@plt>
cmp    $0x0,%rax
je     115b <ft_isalpha+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1162 <ft_isalpha+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isalpha>:
push   %rbx
mov    %edi,%ebx
call   1040 <ft_isupper@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <ft_isalpha+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <ft_islower@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ft_isalpha(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @ft_isupper(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i64 @ft_islower(i32 %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i32 1, i32* %2
br label %13
12: ; preds = %7
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @ft_isalpha(i32 %0) {
%2 = tail call i64 @ft_isupper(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @ft_islower(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void Syntax(const char *cmd) {
  printf("%s [display] [-w width] [-h height] xmin xmax ymin ymax\n", cmd);
  exit(-1);
}


x86 assembly (clang, -O0):
<Syntax>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Syntax>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [57 x i8] c"%s [display] [-w width] [-h height] xmin xmax ymin ymax\0A\00"
define void @Syntax(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [57 x i8] c"%s [display] [-w width] [-h height] xmin xmax ymin ymax\0A\00"
define void @Syntax(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
size_t popcount12(unsigned int);
void gen_hamming_weight_polynomial(unsigned int *all_codes,
                                   int *hamming_weight_polynomial) {
  for (int i = 0; i < 64; ++i) {
    hamming_weight_polynomial[popcount12(all_codes[i])] += 1;
  }
}


x86 assembly (clang, -O0):
<gen_hamming_weight_polynomial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x40,-0x14(%rbp)
jge    1167 <gen_hamming_weight_polynomial+0x57>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <popcount12@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <gen_hamming_weight_polynomial+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_hamming_weight_polynomial>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
nopl   (%rax)
mov    (%r15,%rbx,4),%edi
call   1030 <popcount12@plt>
addl   $0x1,(%r14,%rax,4)
add    $0x1,%rbx
cmp    $0x40,%rbx
jne    1120 <gen_hamming_weight_polynomial+0x10>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @gen_hamming_weight_polynomial(i32* nocapture %0, i32* nocapture %1) {
br label %4
3: ; preds = %4
ret void
4: ; preds = %2, %4
%5 = phi i64 [ 0, %2 ], [ %12, %4 ]
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = tail call i64 @popcount12(i32 %7)
%9 = getelementptr inbounds i32, i32* %1, i64 %8
%10 = load i32, i32* %9
%11 = add nsw i32 %10, 1
store i32 %11, i32* %9
%12 = add nuw nsw i64 %5, 1
%13 = icmp eq i64 %12, 64
br i1 %13, label %3, label %4
}
/* Variables and functions */
float sqrtf(float);
float IvSqrt(float val) { return sqrtf(val); }


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

x86 assembly (clang, -O2):
<IvSqrt>:
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     111d <IvSqrt+0xd>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrtf@plt>

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

LLVM IR (-O2):
define float @IvSqrt(float %0) {
%2 = tail call float @sqrtf(float %0)
ret float %2
}
void dhf(void *b) {}


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

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

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

LLVM IR (-O2):
define void @dhf(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int pong_get_version();
int pong_is_compatible_dll(void) {
  unsigned int major = pong_get_version() >> 16;
  return major == 1;
}


x86 assembly (clang, -O0):
<pong_is_compatible_dll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <pong_get_version@plt>
sar    $0x10,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pong_is_compatible_dll>:
push   %rax
xor    %eax,%eax
call   1030 <pong_get_version@plt>
and    $0xffff0000,%eax
xor    %ecx,%ecx
cmp    $0x10000,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @pong_is_compatible_dll() {
%1 = alloca i32
%2 = call i32 (...) @pong_get_version()
%3 = ashr i32 %2, 16
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @pong_is_compatible_dll() {
%1 = tail call i32 (...) @pong_get_version()
%2 = and i32 %1, -65536
%3 = icmp eq i32 %2, 65536
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ isLetter(char);
scalar_t__ isNumber(char);
short int isAlphaNumeric(char chrsource) {
  if (isLetter(chrsource) || isNumber(chrsource))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isAlphaNumeric>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x3(%rbp)
movsbl -0x3(%rbp),%edi
call   1040 <isLetter@plt>
cmp    $0x0,%rax
jne    1154 <isAlphaNumeric+0x34>
movsbl -0x3(%rbp),%edi
call   1030 <isNumber@plt>
cmp    $0x0,%rax
je     115f <isAlphaNumeric+0x3f>
movw   $0x1,-0x2(%rbp)
jmp    1165 <isAlphaNumeric+0x45>
movw   $0x0,-0x2(%rbp)
movswl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isAlphaNumeric>:
push   %rbx
mov    %edi,%ebx
call   1040 <isLetter@plt>
mov    %rax,%rcx
mov    $0x1,%ax
test   %rcx,%rcx
je     1136 <isAlphaNumeric+0x16>
pop    %rbx
ret
movsbl %bl,%edi
call   1030 <isNumber@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define signext i16 @isAlphaNumeric(i8 signext %0) {
%2 = alloca i16
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i64 @isLetter(i8 signext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = call i64 @isNumber(i8 signext %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i16 1, i16* %2
br label %13
12: ; preds = %7
store i16 0, i16* %2
br label %13
13: ; preds = %12, %11
%14 = load i16, i16* %2
ret i16 %14
}

LLVM IR (-O2):
define signext i16 @isAlphaNumeric(i8 signext %0) {
%2 = tail call i64 @isLetter(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @isNumber(i8 signext %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i16
br label %8
8: ; preds = %4, %1
%9 = phi i16 [ 1, %1 ], [ %7, %4 ]
ret i16 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ evutil_socket_t;

/* Variables and functions */
int evutil_make_socket_nonblocking(evutil_socket_t fd) {
  (void)fd;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @evutil_make_socket_nonblocking(i32 %0) {
ret i32 0
}
int testFuncStatementInt1(int int1, int int2) {
  int sum = 0U;
  sum = int1 + int2;
  return (sum);
}


x86 assembly (clang, -O0):
<testFuncStatementInt1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<testFuncStatementInt1>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @testFuncStatementInt1(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
char *strrchr(s, c)
register const char *s;
int c;
{
  char *rtnval = 0;
  do {
    if (*s == c)
      rtnval = (char *)s;
  } while (*s++);
  return (rtnval);
}


x86 assembly (clang, -O0):
<strrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    112b <strrchr+0x2b>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1130 <strrchr+0x30>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
jne    1113 <strrchr+0x13>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrchr>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%rdi),%ecx
cmp    %esi,%ecx
cmove  %rdi,%rax
add    $0x1,%rdi
test   %ecx,%ecx
jne    1110 <strrchr+0x10>
ret

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

LLVM IR (-O2):
define i8* @strrchr(i8* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %10, %3 ]
%5 = phi i8* [ null, %2 ], [ %9, %3 ]
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, %1
%9 = select i1 %8, i8* %4, i8* %5
%10 = getelementptr inbounds i8, i8* %4, i64 1
%11 = icmp eq i8 %6, 0
br i1 %11, label %12, label %3
12: ; preds = %3
ret i8* %9
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t UdKalmanArrayLength(int32_t n) { return ((n + 1) * n) / 2; }


x86 assembly (clang, -O0):
<UdKalmanArrayLength>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
imul   -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<UdKalmanArrayLength>:
lea    0x1(%rdi),%ecx
imul   %edi,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @UdKalmanArrayLength(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
%5 = load i32, i32* %2
%6 = mul nsw i32 %4, %5
%7 = sdiv i32 %6, 2
ret i32 %7
}

LLVM IR (-O2):
define i32 @UdKalmanArrayLength(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = mul nsw i32 %2, %0
%4 = sdiv i32 %3, 2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ raise(int);
void abort(void) {
  raise(22);
  exit(1);
}


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
mov    $0x16,%edi
call   1030 <raise@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<abort>:
push   %rax
mov    $0x16,%edi
call   1030 <raise@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @abort() {
%1 = call i32 @raise(i32 22)
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @abort() {
%1 = tail call i32 @raise(i32 22)
%2 = tail call i32 @exit(i32 1)
unreachable
}
void ff_hevc_put_hevc_uni_w_epel_v12_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_epel_v12_8_sse4() {
ret void
}
OP(dd, ca) { op_ca(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <op_ca@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_ca()
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fread(unsigned char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, unsigned char,
                         int /*<<< orphan*/);
unsigned char read1(FILE *f, unsigned char offset, unsigned char bit) {
  fseek(f, offset, SEEK_SET);
  unsigned char c = 0;
  fread(&c, sizeof(unsigned char), 1, f);
  return (c & (1 << bit)) > 0 ? 1 : 0;
}


x86 assembly (clang, -O0):
<read1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%al
mov    0x2e9b(%rip),%rcx
mov    (%rcx),%edx
movzbl %al,%esi
call   1040 <fseek@plt>
movb   $0x0,-0xb(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0xb(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fread@plt>
movzbl -0xb(%rbp),%edx
movzbl -0xa(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovg  %ecx,%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read1>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
call   1040 <fseek@plt>
movb   $0x0,0x7(%rsp)
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
movzbl 0x7(%rsp),%eax
bt     %ebp,%eax
setb   %al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@SEEK_SET = global i32 0
define zeroext i8 @read1(i32* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i32*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
store i32* %0, i32** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%8 = load i32*, i32** %4
%9 = load i8, i8* %5
%10 = load i32, i32* @SEEK_SET
%11 = call i32 @fseek(i32* %8, i8 zeroext %9, i32 %10)
store i8 0, i8* %7
%12 = load i32*, i32** %4
%13 = call i32 @fread(i8* %7, i32 1, i32 1, i32* %12)
%14 = load i8, i8* %7
%15 = zext i8 %14 to i32
%16 = load i8, i8* %6
%17 = zext i8 %16 to i32
%18 = shl i32 1, %17
%19 = and i32 %15, %18
%20 = icmp sgt i32 %19, 0
%21 = zext i1 %20 to i64
%22 = select i1 %20, i32 1, i32 0
%23 = trunc i32 %22 to i8
ret i8 %23
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define zeroext i8 @read1(i32* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8
%5 = load i32, i32* @SEEK_SET
%6 = tail call i32 @fseek(i32* %0, i8 zeroext %1, i32 %5)
store i8 0, i8* %4
%7 = call i32 @fread(i8* %4, i32 1, i32 1, i32* %0)
%8 = load i8, i8* %4
%9 = zext i8 %8 to i32
%10 = zext i8 %2 to i32
%11 = shl nuw i32 1, %10
%12 = and i32 %11, %9
%13 = icmp ne i32 %12, 0
%14 = zext i1 %13 to i8
ret i8 %14
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int /*<<< orphan*/ sleep(int);
int main() {
  foo();
  sleep(10000);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 @sleep(i32 10000)
ret i32 0
}