xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ ehnlc_exit(int);
int /*<<< orphan*/ ehnlc_fprintf(int /*<<< orphan*/, char *, char const *,
                                 char const *, int, char const *);
int /*<<< orphan*/ stderr;
void ehnlc_assert_fail(const char *func, const char *file, int line,
                       const char *expression_str) {
  ehnlc_fprintf(stderr, "assert(%s) FAILED at %s:%d in %s\n", expression_str,
                file, line, func);
  ehnlc_exit(134);
}


x86 assembly (clang, -O0):
<ehnlc_assert_fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
mov    -0x8(%rbp),%r9
lea    0xea9(%rip),%rsi
call   1030 <ehnlc_fprintf@plt>
mov    $0x86,%edi
call   1040 <ehnlc_exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ehnlc_assert_fail>:
push   %rax
mov    %edx,%r8d
mov    %rsi,%rax
mov    %rdi,%r9
mov    0x2eaf(%rip),%rdx
mov    (%rdx),%edi
lea    0xec6(%rip),%rsi
mov    %rcx,%rdx
mov    %rax,%rcx
call   1030 <ehnlc_fprintf@plt>
mov    $0x86,%edi
pop    %rax
jmp    1040 <ehnlc_exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"assert(%s) FAILED at %s:%d in %s\0A\00"
define void @ehnlc_assert_fail(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %8
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i8*, i8** %5
%14 = call i32 @ehnlc_fprintf(i32 %9, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11, i32 %12, i8* %13)
%15 = call i32 @ehnlc_exit(i32 134)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"assert(%s) FAILED at %s:%d in %s\0A\00"
define void @ehnlc_assert_fail(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = load i32, i32* @stderr
%6 = tail call i32 @ehnlc_fprintf(i32 %5, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %1, i32 %2, i8* %0)
%7 = tail call i32 @ehnlc_exit(i32 134)
ret void
}
void ARGBShade() {}


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

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

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

LLVM IR (-O2):
define void @ARGBShade() {
ret void
}
/* Variables and functions */
int strlen(char *str) {
  int count;
  count = 0;
  while (*str != 0) {
    count++;
    str++;
  }
  return count;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1139 <strlen+0x39>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111c <strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
int c005(void) { return 0; }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @c005() {
ret i32 0
}

LLVM IR (-O2):
define i32 @c005() {
ret i32 0
}
/* Variables and functions */
scalar_t__ get_line(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
int main(void) {
  char buffer[1024];
  while (get_line(buffer, stdin)) {
    printf("%s\r\n", buffer);
  }
  printf("%c", 12);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x410(%rbp),%rdi
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
call   1030 <get_line@plt>
cmp    $0x0,%rax
je     116b <main+0x4b>
lea    -0x410(%rbp),%rsi
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1132 <main+0x12>
lea    0xe93(%rip),%rdi
mov    $0xc,%esi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x400,%rsp
mov    0x2ea5(%rip),%r15
mov    (%r15),%esi
mov    %rsp,%rdi
call   1040 <get_line@plt>
test   %rax,%rax
je     117d <main+0x4d>
lea    0xea6(%rip),%r14
mov    %rsp,%rbx
nopl   (%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%r15),%esi
mov    %rbx,%rdi
call   1040 <get_line@plt>
test   %rax,%rax
jne    1160 <main+0x30>
mov    $0xc,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [5 x i8] c"%s\0D\0A\00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1024 x i8]
store i32 0, i32* %1
br label %3
3: ; preds = %8, %0
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = call i64 @get_line(i8* %4, i32 %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %3
11: ; preds = %3
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 12)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [5 x i8] c"%s\0D\0A\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i64 @get_line(i8* %2, i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %0, %6
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %2)
%8 = load i32, i32* @stdin
%9 = call i64 @get_line(i8* %2, i32 %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %6
11: ; preds = %6, %0
%12 = call i32 @putchar(i32 12)
ret i32 0
}
int RTW_STATUS_CODE(int error_code) {
  if (error_code >= 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<RTW_STATUS_CODE>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     111d <RTW_STATUS_CODE+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1124 <RTW_STATUS_CODE+0x24>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RTW_STATUS_CODE>:
mov    %edi,%eax
not    %eax
shr    $0x1f,%eax
ret

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

LLVM IR (-O2):
define i32 @RTW_STATUS_CODE(i32 %0) {
%2 = xor i32 %0, -1
%3 = lshr i32 %2, 31
ret i32 %3
}
void __DELETE_java_lang_NullPointerException(void *me, void *client_data) {}


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

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

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

LLVM IR (-O2):
define void @__DELETE_java_lang_NullPointerException(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Type definitions */
struct timespec {
  float tv_sec;
  scalar_t__ tv_nsec;
};

/* Variables and functions */
float timediff_sec(struct timespec *start, struct timespec *end) {
  return (end->tv_sec - start->tv_sec) +
         ((float)(end->tv_nsec - start->tv_nsec)) / 1e9f;
}


x86 assembly (clang, -O0):
<timediff_sec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
subss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    -0x8(%rbp),%rcx
sub    0x8(%rcx),%rax
cvtsi2ss %rax,%xmm1
movss  0xec7(%rip),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<timediff_sec>:
movss  (%rsi),%xmm1
subss  (%rdi),%xmm1
mov    0x8(%rsi),%rax
sub    0x8(%rdi),%rax
cvtsi2ss %rax,%xmm0
divss  0xee3(%rip),%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timespec = type { float, i64 }
define float @timediff_sec(%struct.timespec* %0, %struct.timespec* %1) {
%3 = alloca %struct.timespec*
%4 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load %struct.timespec*, %struct.timespec** %4
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 0
%7 = load float, float* %6
%8 = load %struct.timespec*, %struct.timespec** %3
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 0
%10 = load float, float* %9
%11 = fsub float %7, %10
%12 = load %struct.timespec*, %struct.timespec** %4
%13 = getelementptr inbounds %struct.timespec, %struct.timespec* %12, i32 0, i32 1
%14 = load i64, i64* %13
%15 = load %struct.timespec*, %struct.timespec** %3
%16 = getelementptr inbounds %struct.timespec, %struct.timespec* %15, i32 0, i32 1
%17 = load i64, i64* %16
%18 = sub nsw i64 %14, %17
%19 = sitofp i64 %18 to float
%20 = fdiv float %19, 1.000000e+09
%21 = fadd float %11, %20
ret float %21
}

LLVM IR (-O2):
%struct.timespec = type { float, i64 }
define float @timediff_sec(%struct.timespec* nocapture %0, %struct.timespec* nocapture %1) {
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%4 = load float, float* %3
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%6 = load float, float* %5
%7 = fsub float %4, %6
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%9 = load i64, i64* %8
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%11 = load i64, i64* %10
%12 = sub nsw i64 %9, %11
%13 = sitofp i64 %12 to float
%14 = fdiv float %13, 1.000000e+09
%15 = fadd float %7, %14
ret float %15
}
/* Type definitions */
typedef size_t uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void store_UINT16(uint16_t *arr, uint32_t idx, uint16_t value) {
  arr[idx] = value;
}


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

x86 assembly (clang, -O2):
<store_UINT16>:
mov    %edx,(%rdi,%rsi,4)
ret

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

LLVM IR (-O2):
define void @store_UINT16(i32* nocapture writeonly %0, i64 %1, i32 %2) {
%4 = getelementptr inbounds i32, i32* %0, i64 %1
store i32 %2, i32* %4
ret void
}
/* Variables and functions */
int strlen(char *);
scalar_t__ wfile_eitherslash(char);
int wfile_absolute_path(char *path) {
  int len;
  len = strlen(path);
  if (len < 1)
    return (0);
  if (wfile_eitherslash(path[0]))
    return (-1);
  return (0);
}


x86 assembly (clang, -O0):
<wfile_absolute_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jge    114e <wfile_absolute_path+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1177 <wfile_absolute_path+0x57>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <wfile_eitherslash@plt>
cmp    $0x0,%rax
je     1170 <wfile_absolute_path+0x50>
movl   $0xffffffff,-0x4(%rbp)
jmp    1177 <wfile_absolute_path+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wfile_absolute_path>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
test   %eax,%eax
jle    113c <wfile_absolute_path+0x1c>
movsbl (%rbx),%edi
call   1030 <wfile_eitherslash@plt>
neg    %rax
sbb    %eax,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @wfile_absolute_path(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp slt i32 %2, 1
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = load i8, i8* %0
%6 = tail call i64 @wfile_eitherslash(i8 signext %5)
%7 = icmp ne i64 %6, 0
%8 = sext i1 %7 to i32
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ bus_write(int, char);
void LCD_Write_COM(char VL) { bus_write(0xBE, VL); }


x86 assembly (clang, -O0):
<LCD_Write_COM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0xbe,%edi
movsbl -0x1(%rbp),%esi
call   1030 <bus_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD_Write_COM>:
mov    %edi,%esi
mov    $0xbe,%edi
jmp    1030 <bus_write@plt>

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

LLVM IR (-O2):
define void @LCD_Write_COM(i8 signext %0) {
%2 = tail call i32 @bus_write(i32 190, i8 signext %0)
ret void
}
adrreg0reg1_set(r0, r1, x0, x1, p0, p1) float r0, r1;
float *p0, *p1;
{ (p0[10000000]) = r1; }


x86 assembly (clang, -O0):
<adrreg0reg1_set>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm1,-0x30(%rbp)
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movss  -0xc(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,0x2625a00(%rax)
02
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrreg0reg1_set>:
cvtsd2ss %xmm1,%xmm0
movss  %xmm0,0x2625a00(%rdx)
02
ret

LLVM IR (-O0):
define i32 @adrreg0reg1_set(double %0, double %1, i32 %2, i32 %3, float* %4, float* %5) {
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca i32
%11 = alloca i32
%12 = alloca float*
%13 = alloca float*
%14 = fptrunc double %0 to float
%15 = fptrunc double %1 to float
store float %14, float* %8
store float %15, float* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store float* %4, float** %12
store float* %5, float** %13
%16 = load float, float* %9
%17 = load float*, float** %12
%18 = getelementptr inbounds float, float* %17, i64 10000000
store float %16, float* %18
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
define i32 @adrreg0reg1_set(double %0, double %1, i32 %2, i32 %3, float* nocapture writeonly %4, float* nocapture readnone %5) {
%7 = fptrunc double %1 to float
%8 = getelementptr inbounds float, float* %4, i64 10000000
store float %7, float* %8
ret i32 undef
}
int msm_fsusb_init_phy(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @msm_fsusb_init_phy() {
ret i32 0
}

LLVM IR (-O2):
define i32 @msm_fsusb_init_phy() {
ret i32 0
}
double floor(double x) {
  int i = x;
  for (; i < x - 10, i < x; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<floor>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1138 <floor+0x38>
jmp    112a <floor+0x2a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <floor+0x11>
cvtsi2sdl -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<floor>:
cvttsd2si %xmm0,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
add    $0x1,%eax
ucomisd %xmm1,%xmm0
ja     1110 <floor+0x10>
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @floor(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
%4 = load double, double* %2
%5 = fptosi double %4 to i32
store i32 %5, i32* %3
br label %6
6: ; preds = %18, %1
%7 = load i32, i32* %3
%8 = sitofp i32 %7 to double
%9 = load double, double* %2
%10 = fsub double %9, 1.000000e+01
%11 = fcmp olt double %8, %10
%12 = zext i1 %11 to i32
%13 = load i32, i32* %3
%14 = sitofp i32 %13 to double
%15 = load double, double* %2
%16 = fcmp olt double %14, %15
br i1 %16, label %17, label %21
17: ; preds = %6
br label %18
18: ; preds = %17
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %6
21: ; preds = %6
%22 = load i32, i32* %3
%23 = sitofp i32 %22 to double
ret double %23
}

LLVM IR (-O2):
define double @floor(double %0) {
%2 = fptosi double %0 to i32
br label %3
3: ; preds = %3, %1
%4 = phi i32 [ %2, %1 ], [ %7, %3 ]
%5 = sitofp i32 %4 to double
%6 = fcmp olt double %5, %0
%7 = add nsw i32 %4, 1
br i1 %6, label %3, label %8
8: ; preds = %3
ret double %5
}
double b(double x) { return x - ((x * x * x * x * x - 7) / x * x); }


x86 assembly (clang, -O0):
<b>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm0
movsd  0xecd(%rip),%xmm2
addsd  %xmm2,%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<b>:
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
addsd  0xee4(%rip),%xmm1
divsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @b(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = fmul double %4, %5
%7 = load double, double* %2
%8 = fmul double %6, %7
%9 = load double, double* %2
%10 = fmul double %8, %9
%11 = load double, double* %2
%12 = call double @llvm.fmuladd.f64(double %10, double %11, double -7.000000e+00)
%13 = load double, double* %2
%14 = fdiv double %12, %13
%15 = load double, double* %2
%16 = fneg double %14
%17 = call double @llvm.fmuladd.f64(double %16, double %15, double %3)
ret double %17
}

LLVM IR (-O2):
define double @b(double %0) {
%2 = fmul double %0, %0
%3 = fmul double %2, %0
%4 = fmul double %3, %0
%5 = tail call double @llvm.fmuladd.f64(double %4, double %0, double -7.000000e+00)
%6 = fneg double %5
%7 = fdiv double %6, %0
%8 = tail call double @llvm.fmuladd.f64(double %7, double %0, double %0)
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ ajVarinExit();
int /*<<< orphan*/ ajVaroutExit();
void ajVarExit(void) {
  ajVarinExit();
  ajVaroutExit();
  return;
}


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

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

LLVM IR (-O0):
define void @ajVarExit() {
%1 = call i32 (...) @ajVarinExit()
%2 = call i32 (...) @ajVaroutExit()
ret void
}

LLVM IR (-O2):
define void @ajVarExit() {
%1 = tail call i32 (...) @ajVarinExit()
%2 = tail call i32 (...) @ajVaroutExit()
ret void
}
/* Variables and functions */
void *calloc(int, int);
int /*<<< orphan*/ error(char *);
void *alloc0(int size) {
  void *data = calloc(1, size);
  if (!data)
    error("memory allocation failed");
  return data;
}


x86 assembly (clang, -O0):
<alloc0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1153 <alloc0+0x33>
lea    0xeb2(%rip),%rdi
call   1040 <error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc0>:
push   %rbx
mov    %edi,%esi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1141 <alloc0+0x21>
lea    0xec4(%rip),%rdi
call   1040 <error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"memory allocation failed\00"
define i8* @alloc0(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @calloc(i32 1, i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @error(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [25 x i8] c"memory allocation failed\00"
define noalias i8* @alloc0(i32 %0) {
%2 = tail call i8* @calloc(i32 1, i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @error(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
int default_bankreg(int flat, int addrreg, int datareg) {
  if (flat) {
    return 0x09;
  }
  if ((addrreg == 0x2e && datareg == 0x2f) ||
      (addrreg == 0x4e && datareg == 0x4f)) {
    return 0x07;
  }
  return 0x4e;
}


x86 assembly (clang, -O0):
<default_bankreg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1123 <default_bankreg+0x23>
movl   $0x9,-0x4(%rbp)
jmp    115e <default_bankreg+0x5e>
cmpl   $0x2e,-0xc(%rbp)
jne    1137 <default_bankreg+0x37>
cmpl   $0x2f,-0x10(%rbp)
je     114b <default_bankreg+0x4b>
cmpl   $0x4e,-0xc(%rbp)
jne    1157 <default_bankreg+0x57>
cmpl   $0x4f,-0x10(%rbp)
jne    1157 <default_bankreg+0x57>
movl   $0x7,-0x4(%rbp)
jmp    115e <default_bankreg+0x5e>
movl   $0x4e,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_bankreg>:
mov    $0x9,%eax
test   %edi,%edi
je     110a <default_bankreg+0xa>
ret
cmp    $0x2e,%esi
jne    1119 <default_bankreg+0x19>
mov    $0x7,%eax
cmp    $0x2f,%edx
je     1109 <default_bankreg+0x9>
xor    $0x4e,%esi
xor    $0x4f,%edx
or     %esi,%edx
mov    $0x7,%ecx
mov    $0x4e,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @default_bankreg(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = icmp eq i32 %1, 46
%7 = icmp eq i32 %2, 47
%8 = and i1 %6, %7
br i1 %8, label %14, label %9
9: ; preds = %5
%10 = icmp eq i32 %1, 78
%11 = icmp eq i32 %2, 79
%12 = and i1 %10, %11
%13 = select i1 %12, i32 7, i32 78
br label %14
14: ; preds = %9, %5, %3
%15 = phi i32 [ 9, %3 ], [ 7, %5 ], [ %13, %9 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void print_checksum_callback(void *a, int tag, const char *val, int len) {
  if (tag == 10) {
    printf("%.3s", val);
  }
}


x86 assembly (clang, -O0):
<print_checksum_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpl   $0xa,-0xc(%rbp)
jne    1140 <print_checksum_callback+0x30>
mov    -0x18(%rbp),%rsi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_checksum_callback>:
cmp    $0xa,%esi
jne    1124 <print_checksum_callback+0x14>
lea    0xee4(%rip),%rdi
mov    %rdx,%rsi
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%.3s\00"
define void @print_checksum_callback(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = icmp eq i32 %9, 10
br i1 %10, label %11, label %14
11: ; preds = %4
%12 = load i8*, i8** %7
%13 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %11, %4
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%.3s\00"
define void @print_checksum_callback(i8* nocapture readnone %0, i32 %1, i8* %2, i32 %3) {
%5 = icmp eq i32 %1, 10
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ loop();
void foo(void) {
  loop();
  loop();
  loop();
}


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

x86 assembly (clang, -O2):
<foo>:
push   %rax
xor    %eax,%eax
call   1030 <loop@plt>
xor    %eax,%eax
call   1030 <loop@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <loop@plt>

LLVM IR (-O0):
define void @foo() {
%1 = call i32 (...) @loop()
%2 = call i32 (...) @loop()
%3 = call i32 (...) @loop()
ret void
}

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 (...) @loop()
%2 = tail call i32 (...) @loop()
%3 = tail call i32 (...) @loop()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fprintf(FILE *stream __attribute__((unused)),
            const char *format __attribute__((unused)), ...) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @fprintf(i32* nocapture readnone %0, i8* nocapture readnone %1, ...) {
ret i32 0
}
/* Variables and functions */
double copysign(double, double);
double SIGN(double a, double b) { return copysign(a, b); }


x86 assembly (clang, -O0):
<SIGN>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movaps 0xee1(%rip),%xmm2
pand   %xmm2,%xmm1
movaps 0xee6(%rip),%xmm2
pand   %xmm2,%xmm0
por    %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<SIGN>:
andps  0xef9(%rip),%xmm1
andps  0xf02(%rip),%xmm0
orps   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @SIGN(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @llvm.copysign.f64(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @SIGN(double %0, double %1) {
%3 = tail call double @llvm.copysign.f64(double %0, double %1)
ret double %3
}
float chaine_rayon_max(float l1, float l2) { return 0; }


x86 assembly (clang, -O0):
<chaine_rayon_max>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @chaine_rayon_max(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
ret float 0.000000e+00
}

LLVM IR (-O2):
define float @chaine_rayon_max(float %0, float %1) {
ret float 0.000000e+00
}
int compare_intsAsc(const void *p, const void *q) {
  int x = *(const int *)p;
  int y = *(const int *)q;
  if (x < y)
    return -1;
  else if (x > y)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<compare_intsAsc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1136 <compare_intsAsc+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    115a <compare_intsAsc+0x5a>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    114e <compare_intsAsc+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    115a <compare_intsAsc+0x5a>
jmp    1153 <compare_intsAsc+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_intsAsc>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare_intsAsc(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = icmp sgt i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M230_f(char *s) {
  debug("M230_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M230_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M230_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M230_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M230_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M230_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M230_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
void *realloc(void *, size_t);
void *frealloc(void *p, size_t size) {
  if (size == 0)
    return p;
  if ((p = realloc(p, size)) == NULL)
    die("Failed to reserve memory:");
  return p;
}


x86 assembly (clang, -O0):
<frealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1148 <frealloc+0x28>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <frealloc+0x57>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    116f <frealloc+0x4f>
lea    0xe96(%rip),%rdi
call   1040 <die@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<frealloc>:
push   %rax
mov    %rdi,%rax
test   %rsi,%rsi
je     1136 <frealloc+0x16>
mov    %rax,%rdi
call   1030 <realloc@plt>
test   %rax,%rax
je     1138 <frealloc+0x18>
pop    %rcx
ret
lea    0xec1(%rip),%rdi
call   1040 <die@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Failed to reserve memory:\00"
define i8* @frealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
%6 = load i64, i64* %5
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i8*, i8** %4
store i8* %9, i8** %3
br label %19
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = load i64, i64* %5
%13 = call i8* @realloc(i8* %11, i64 %12)
store i8* %13, i8** %4
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %17
15: ; preds = %10
%16 = call i32 @die(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %15, %10
%18 = load i8*, i8** %4
store i8* %18, i8** %3
br label %19
19: ; preds = %17, %8
%20 = load i8*, i8** %3
ret i8* %20
}

LLVM IR (-O2):
@.str = [26 x i8] c"Failed to reserve memory:\00"
define i8* @frealloc(i8* %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = tail call i8* @realloc(i8* %0, i64 %1)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @die(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %4, %7, %2
%10 = phi i8* [ %0, %2 ], [ null, %7 ], [ %5, %4 ]
ret i8* %10
}
/* Variables and functions */
int bin_to_dec(long);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, long *);
int main() {
  long b;
  printf("Enter the binary use only 1 or 0:\n");
  scanf("%ld", &b);
  printf("It's %d in the decimal system", bin_to_dec(b));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <bin_to_dec@plt>
mov    %eax,%esi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
lea    0xeac(%rip),%rdi
mov    %rsp,%rsi
call   1060 <scanf@plt>
mov    (%rsp),%rdi
call   1050 <bin_to_dec@plt>
lea    0xe98(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Enter the binary use only 1 or 0:\0A\00"
@.str.1 = [4 x i8] c"%ld\00"
@.str.2 = [30 x i8] c"It's %d in the decimal system\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %2)
%5 = load i64, i64* %2
%6 = call i32 @bin_to_dec(i64 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%ld\00"
@.str.2 = [30 x i8] c"It's %d in the decimal system\00"
@str = [34 x i8] c"Enter the binary use only 1 or 0:\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %1)
%5 = load i64, i64* %1
%6 = call i32 @bin_to_dec(i64 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
double __attribute((unit("m"))) cast_1_error(double a) {
  return (double __attribute((unit("m"))))a;
}


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

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

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

LLVM IR (-O2):
define double @cast_1_error(double returned %0) {
ret double %0
}
void gtk_icon_info_free() {}


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

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

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

LLVM IR (-O2):
define void @gtk_icon_info_free() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_nl();
void text_table_start(int do_indent, int *ptmargin) {
  if (do_indent)
    *ptmargin += 4;
  write_nl();
}


x86 assembly (clang, -O0):
<text_table_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1134 <text_table_start+0x24>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x4,%ecx
mov    %ecx,(%rax)
mov    $0x0,%al
call   1030 <write_nl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<text_table_start>:
test   %edi,%edi
je     1117 <text_table_start+0x7>
addl   $0x4,(%rsi)
xor    %eax,%eax
jmp    1030 <write_nl@plt>

LLVM IR (-O0):
define void @text_table_start(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 = icmp ne i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = add nsw i32 %9, 4
store i32 %10, i32* %8
br label %11
11: ; preds = %7, %2
%12 = call i32 (...) @write_nl()
ret void
}

LLVM IR (-O2):
define void @text_table_start(i32 %0, i32* nocapture %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i32, i32* %1
%6 = add nsw i32 %5, 4
store i32 %6, i32* %1
br label %7
7: ; preds = %4, %2
%8 = tail call i32 (...) @write_nl()
ret void
}
/* Type definitions */
typedef unsigned int uint8_t;

/* Variables and functions */
uint8_t aes_mul2(uint8_t a) { return (a << 1u) ^ ((-(a >= 0x80u)) & 0x1Bu); }


x86 assembly (clang, -O0):
<aes_mul2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
cmpl   $0x80,-0x4(%rbp)
setae  %cl
and    $0x1,%cl
movzbl %cl,%edx
xor    %ecx,%ecx
sub    %edx,%ecx
and    $0x1b,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<aes_mul2>:
lea    (%rdi,%rdi,1),%ecx
xor    %edx,%edx
cmp    $0x7f,%edi
mov    $0x1b,%eax
cmovbe %edx,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @aes_mul2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 1
%5 = load i32, i32* %2
%6 = icmp uge i32 %5, 128
%7 = zext i1 %6 to i32
%8 = sub nsw i32 0, %7
%9 = and i32 %8, 27
%10 = xor i32 %4, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @aes_mul2(i32 %0) {
%2 = shl i32 %0, 1
%3 = icmp ugt i32 %0, 127
%4 = select i1 %3, i32 27, i32 0
%5 = xor i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ascfguard2l_(float *, float *, float *, int *, int *, int *,
                                int *);
void cascfguard2l(float dcu[], float cus[], float q2m0, int nx, int ny, int nxe,
                  int nye) {
  ascfguard2l_(dcu, cus, &q2m0, &nx, &ny, &nxe, &nye);
  return;
}


x86 assembly (clang, -O0):
<cascfguard2l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x18(%rbp),%rcx
lea    -0x1c(%rbp),%r8
lea    -0x20(%rbp),%r9
lea    -0x24(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <ascfguard2l_@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cascfguard2l>:
sub    $0x28,%rsp
movss  %xmm0,0x24(%rsp)
mov    %edx,0x20(%rsp)
mov    %ecx,0x1c(%rsp)
mov    %r8d,0x18(%rsp)
mov    %r9d,0x14(%rsp)
lea    0x14(%rsp),%rax
mov    %rax,(%rsp)
lea    0x24(%rsp),%rdx
lea    0x20(%rsp),%rcx
lea    0x1c(%rsp),%r8
lea    0x18(%rsp),%r9
call   1030 <ascfguard2l_@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define void @cascfguard2l(float* %0, float* %1, float %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca float*
%9 = alloca float*
%10 = alloca float
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store float* %0, float** %8
store float* %1, float** %9
store float %2, float* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%15 = load float*, float** %8
%16 = load float*, float** %9
%17 = call i32 @ascfguard2l_(float* %15, float* %16, float* %10, i32* %11, i32* %12, i32* %13, i32* %14)
ret void
}

LLVM IR (-O2):
define void @cascfguard2l(float* %0, float* %1, float %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca float
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store float %2, float* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
store i32 %5, i32* %11
store i32 %6, i32* %12
%13 = call i32 @ascfguard2l_(float* %0, float* %1, float* %8, i32* %9, i32* %10, i32* %11, i32* %12)
ret void
}
/* Variables and functions */
char *cnfCreim(char *const, int);
int /*<<< orphan*/ cnfFree(char *);
int /*<<< orphan*/ hdsTune(char *, int, int *);
void hds_tune_(char *const param_str, int *value, int *status,
               int param_str_length) {
  char *param_str_c;
  param_str_c = cnfCreim(param_str, param_str_length);
  hdsTune(param_str_c, *value, status);
  cnfFree(param_str_c);
}


x86 assembly (clang, -O0):
<hds_tune_>:
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    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1050 <cnfCreim@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rdx
call   1040 <hdsTune@plt>
mov    -0x28(%rbp),%rdi
call   1030 <cnfFree@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hds_tune_>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %ecx,%esi
call   1050 <cnfCreim@plt>
mov    %rax,%rbx
mov    (%r15),%esi
mov    %rax,%rdi
mov    %r14,%rdx
call   1040 <hdsTune@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <cnfFree@plt>

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

LLVM IR (-O2):
define void @hds_tune_(i8* %0, i32* nocapture %1, i32* %2, i32 %3) {
%5 = tail call i8* @cnfCreim(i8* %0, i32 %3)
%6 = load i32, i32* %1
%7 = tail call i32 @hdsTune(i8* %5, i32 %6, i32* %2)
%8 = tail call i32 @cnfFree(i8* %5)
ret void
}
/* Variables and functions */
int countWays(int, int);
void getWays(int nSteps, int ways[]) {
  ways[nSteps] = countWays(nSteps + 1, 2);
}


x86 assembly (clang, -O0):
<getWays>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    $0x2,%esi
call   1030 <countWays@plt>
mov    %eax,%edx
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getWays>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
lea    0x1(%rbx),%edi
mov    $0x2,%esi
call   1030 <countWays@plt>
movslq %ebx,%rcx
mov    %eax,(%r14,%rcx,4)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @getWays(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 = add nsw i32 %5, 1
%7 = call i32 @countWays(i32 %6, i32 2)
%8 = load i32*, i32** %4
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
store i32 %7, i32* %11
ret void
}

LLVM IR (-O2):
define void @getWays(i32 %0, i32* nocapture writeonly %1) {
%3 = add nsw i32 %0, 1
%4 = tail call i32 @countWays(i32 %3, i32 2)
%5 = sext i32 %0 to i64
%6 = getelementptr inbounds i32, i32* %1, i64 %5
store i32 %4, i32* %6
ret void
}
double hoursSpent(void) { return 100; }


x86 assembly (clang, -O0):
<hoursSpent>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<hoursSpent>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @hoursSpent() {
ret double 1.000000e+02
}

LLVM IR (-O2):
define double @hoursSpent() {
ret double 1.000000e+02
}