xunge/DecIR huggingface dataset:
/* Variables and functions */
double sqrt(double);
double calculate_standard_deviation(double variance) {
  double value = sqrt(variance);
  return value;
}


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

x86 assembly (clang, -O2):
<calculate_standard_deviation>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     111f <calculate_standard_deviation+0xf>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @calculate_standard_deviation(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @sqrt(double %4)
store double %5, double* %3
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @calculate_standard_deviation(double %0) {
%2 = tail call double @sqrt(double %0)
ret double %2
}
__attribute__((no, noclone)) unsigned short foo14(unsigned short arg) {
  unsigned short ret = 1;
  if (arg + 1 < ((!1) ? -(1 << (sizeof(char) * 8 - 1)) : 0) ||
      arg + 1 > ((!0) ? ((1 << (sizeof(char) * 8 - 1)) - 1)
                      : ((1 << (sizeof(char) * 8)) - 1)))
    return ret;
  arg = arg + 1;
  ret = (char)arg;
  return arg;
}


x86 assembly (clang, -O0):
<foo14>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
movw   $0x1,-0x6(%rbp)
movzwl -0x4(%rbp),%eax
add    $0x1,%eax
cmp    $0x0,%eax
jl     1131 <foo14+0x31>
movzwl -0x4(%rbp),%eax
add    $0x1,%eax
cmp    $0x7f,%eax
jle    113e <foo14+0x3e>
mov    -0x6(%rbp),%ax
mov    %ax,-0x2(%rbp)
jmp    115c <foo14+0x5c>
movzwl -0x4(%rbp),%eax
add    $0x1,%eax
mov    %ax,-0x4(%rbp)
mov    -0x4(%rbp),%ax
movsbl %al,%eax
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo14>:
lea    0x1(%rdi),%ecx
cmp    $0x7f,%di
mov    $0x1,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define zeroext i16 @foo14(i16 zeroext %0) {
%2 = add i16 %0, 1
%3 = icmp ugt i16 %0, 126
%4 = select i1 %3, i16 1, i16 %2
ret i16 %4
}
void CLeq(const volatile void *e1, const volatile void *e2, const char *why,
          const char *text, const char *file, int line, const char *func) {
  if (!(e1 <= e2) || 0) {
    deputy_fail_mayreturn(why, text, file, line, func);
  };
}


x86 assembly (clang, -O0):
<CLeq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    115c <CLeq+0x4c>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
mov    0x10(%rbp),%r8
mov    $0x0,%al
call   1030 <deputy_fail_mayreturn@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CLeq>:
cmp    %rsi,%rdi
jbe    1130 <CLeq+0x20>
mov    0x8(%rsp),%rax
mov    %rdx,%rdi
mov    %rcx,%rsi
mov    %r8,%rdx
mov    %r9d,%ecx
mov    %rax,%r8
xor    %eax,%eax
jmp    1030 <deputy_fail_mayreturn@plt>
ret

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

LLVM IR (-O2):
define void @CLeq(i8* readnone %0, i8* readnone %1, i8* %2, i8* %3, i8* %4, i32 %5, i8* %6) {
%8 = icmp ugt i8* %0, %1
br i1 %8, label %9, label %11
9: ; preds = %7
%10 = tail call i32 (i8*, i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @deputy_fail_mayreturn to i32 (i8*, i8*, i8*, i32, i8*, ...)*)(i8* %2, i8* %3, i8* %4, i32 %5, i8* %6)
br label %11
11: ; preds = %9, %7
ret void
}
/* Variables and functions */
long meat_time_offset_days(int const);
signed long int meat_time_offset_weeks(int const i_weeks) {
  return meat_time_offset_days(i_weeks * 7);
}


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

x86 assembly (clang, -O2):
<meat_time_offset_weeks>:
lea    0x0(,%rdi,8),%eax
sub    %edi,%eax
mov    %eax,%edi
jmp    1030 <meat_time_offset_days@plt>

LLVM IR (-O0):
define i64 @meat_time_offset_weeks(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 7
%5 = call i64 @meat_time_offset_days(i32 %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @meat_time_offset_weeks(i32 %0) {
%2 = mul nsw i32 %0, 7
%3 = tail call i64 @meat_time_offset_days(i32 %2)
ret i64 %3
}
int Collision(int a, int size, int amount) { return (a + amount) % size; }


x86 assembly (clang, -O0):
<Collision>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Collision>:
lea    (%rdi,%rdx,1),%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @Collision(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %2, %0
%5 = srem i32 %4, %1
ret i32 %5
}
char hexchar(unsigned int b) {
  if (b < 10)
    return '0' + b;
  return 'a' + (b - 10);
}


x86 assembly (clang, -O0):
<hexchar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jae    111f <hexchar+0x1f>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    112b <hexchar+0x2b>
mov    -0x8(%rbp),%eax
sub    $0xa,%eax
add    $0x61,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexchar>:
cmp    $0xa,%edi
mov    $0x30,%ecx
mov    $0x57,%eax
cmovb  %ecx,%eax
add    %dil,%al
ret

LLVM IR (-O0):
define signext i8 @hexchar(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ult i32 %4, 10
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = add i32 48, %7
%9 = trunc i32 %8 to i8
store i8 %9, i8* %2
br label %15
10: ; preds = %1
%11 = load i32, i32* %3
%12 = sub i32 %11, 10
%13 = add i32 97, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %2
br label %15
15: ; preds = %10, %6
%16 = load i8, i8* %2
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @hexchar(i32 %0) {
%2 = icmp ult i32 %0, 10
%3 = trunc i32 %0 to i8
%4 = select i1 %2, i8 48, i8 87
%5 = add i8 %4, %3
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ Keccak(int, int, unsigned char const *, unsigned int, int,
                          unsigned char *, int);
void FIPS202_SHAKE128(const unsigned char *input, unsigned int inputByteLen,
                      unsigned char *output, int outputByteLen) {
  Keccak(1344, 256, input, inputByteLen, 0x1F, output, outputByteLen);
}


x86 assembly (clang, -O0):
<FIPS202_SHAKE128>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r9
mov    -0x1c(%rbp),%eax
mov    $0x540,%edi
mov    $0x100,%esi
mov    $0x1f,%r8d
mov    %eax,(%rsp)
call   1030 <Keccak@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FIPS202_SHAKE128>:
push   %rax
mov    %rdx,%r9
mov    %esi,%eax
mov    %rdi,%rdx
mov    %ecx,(%rsp)
mov    $0x540,%edi
mov    $0x100,%esi
mov    %eax,%ecx
mov    $0x1f,%r8d
call   1030 <Keccak@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @FIPS202_SHAKE128(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 i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @Keccak(i32 1344, i32 256, i8* %9, i32 %10, i32 31, i8* %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @FIPS202_SHAKE128(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @Keccak(i32 1344, i32 256, i8* %0, i32 %1, i32 31, i8* %2, i32 %3)
ret void
}
unsigned long DPMI_GetRealModeVector(int num) { return 0; }


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

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

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

LLVM IR (-O2):
define i64 @DPMI_GetRealModeVector(i32 %0) {
ret i64 0
}
/* Type definitions */
typedef int /*<<< orphan*/ USERNOTICE;

/* Variables and functions */
scalar_t__ ASN1_item_new(int /*<<< orphan*/ *);
int /*<<< orphan*/ USERNOTICE_it;
USERNOTICE *USERNOTICE_new(void) {
  return (USERNOTICE *)ASN1_item_new(&USERNOTICE_it);
}


x86 assembly (clang, -O0):
<USERNOTICE_new>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rdi
call   1030 <ASN1_item_new@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<USERNOTICE_new>:
mov    0x2ec9(%rip),%rdi
jmp    1030 <ASN1_item_new@plt>

LLVM IR (-O0):
@USERNOTICE_it = global i32 0
define i32* @USERNOTICE_new() {
%1 = call i64 @ASN1_item_new(i32* @USERNOTICE_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}

LLVM IR (-O2):
@USERNOTICE_it = global i32 0
define i32* @USERNOTICE_new() {
%1 = tail call i64 @ASN1_item_new(i32* @USERNOTICE_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ _restore_port();
int /*<<< orphan*/ _set_port_to_screen_window();
int /*<<< orphan*/ game_window_is_full_screen();
int /*<<< orphan*/ update_everything(short);
void update_interface(short time_elapsed) {
  if (!game_window_is_full_screen()) {
    _set_port_to_screen_window();
    update_everything(time_elapsed);
    _restore_port();
  }
  return;
}


x86 assembly (clang, -O0):
<update_interface>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0x0,%al
call   1060 <game_window_is_full_screen@plt>
cmp    $0x0,%eax
jne    1176 <update_interface+0x36>
mov    $0x0,%al
call   1040 <_set_port_to_screen_window@plt>
movswl -0x2(%rbp),%edi
call   1050 <update_everything@plt>
mov    $0x0,%al
call   1030 <_restore_port@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_interface>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1060 <game_window_is_full_screen@plt>
test   %eax,%eax
je     1150 <update_interface+0x10>
pop    %rbx
ret
xor    %eax,%eax
call   1040 <_set_port_to_screen_window@plt>
movswl %bx,%edi
call   1050 <update_everything@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <_restore_port@plt>

LLVM IR (-O0):
define void @update_interface(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = call i32 (...) @game_window_is_full_screen()
%4 = icmp ne i32 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = call i32 (...) @_set_port_to_screen_window()
%7 = load i16, i16* %2
%8 = call i32 @update_everything(i16 signext %7)
%9 = call i32 (...) @_restore_port()
br label %10
10: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @update_interface(i16 signext %0) {
%2 = tail call i32 (...) @game_window_is_full_screen()
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 (...) @_set_port_to_screen_window()
%6 = tail call i32 @update_everything(i16 signext %0)
%7 = tail call i32 (...) @_restore_port()
br label %8
8: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void usage(FILE *fp, char **argv) {
  fprintf(fp,
          "Usage: %s [options]\n\n"
          "Options:\n"
          "-d | --device name   Video device name [/dev/video]\n"
          "-h | --help          Print this message\n"
          "-m | --mmap          Use memory mapped buffers\n"
          "-r | --read          Use read() calls\n"
          "-u | --userp         Use application allocated buffers\n"
          "",
          argv[0]);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xece(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    (%rsi),%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [263 x i8] c"Usage: %s [options]\0A\0AOptions:\0A-d | --device name Video device name [/dev/video]\0A-h | --help Print this message\0A-m | --mmap Use memory mapped buffers\0A-r | --read Use read() calls\0A-u | --userp Use application allocated buffers\0A\00"
define void @usage(i32* %0, i8** %1) {
%3 = alloca i32*
%4 = alloca i8**
store i32* %0, i32** %3
store i8** %1, i8*** %4
%5 = load i32*, i32** %3
%6 = load i8**, i8*** %4
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([263 x i8], [263 x i8]* @.str, i64 0, i64 0), i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [263 x i8] c"Usage: %s [options]\0A\0AOptions:\0A-d | --device name Video device name [/dev/video]\0A-h | --help Print this message\0A-m | --mmap Use memory mapped buffers\0A-r | --read Use read() calls\0A-u | --userp Use application allocated buffers\0A\00"
define void @usage(i32* nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([263 x i8], [263 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fa() { printf("version:0\n"); }


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

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

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

LLVM IR (-O2):
@str = [10 x i8] c"version:0\00"
define void @fa() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret void
}
char *strcpy2(char *s1, const char *s2) {
  char *result = s1;
  while (*s2 != '\0' && *s2 != '\n')
    *s1++ = *s2++;
  *s1 = '\0';
  return result;
}


x86 assembly (clang, -O0):
<strcpy2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     1139 <strcpy2+0x39>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1149 <strcpy2+0x49>
jmp    1170 <strcpy2+0x70>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1114 <strcpy2+0x14>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy2>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
test   %dl,%dl
je     1126 <strcpy2+0x26>
cmp    $0xa,%dl
je     1126 <strcpy2+0x26>
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
jmp    1110 <strcpy2+0x10>
movb   $0x0,(%rax,%rcx,1)
ret

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

LLVM IR (-O2):
define i8* @strcpy2(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %1, %2 ], [ %8, %7 ]
%5 = phi i8* [ %0, %2 ], [ %9, %7 ]
%6 = load i8, i8* %4
switch i8 %6, label %7 [
i8 0, label %10
i8 10, label %10
]
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %6, i8* %5
br label %3
10: ; preds = %3, %3
store i8 0, i8* %5
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
proc() {
  char buffer[1024];
  printf("Hello World!");
}


x86 assembly (clang, -O0):
<proc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x410,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World!\00"
define i32 @proc() {
%1 = alloca i32
%2 = alloca [1024 x i8]
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello World!\00"
define i32 @proc() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Fortran2cstring(char *, char *, int, int);
int PAPI_remove_named_event(int, char *);
void papif_remove_named_event__(int *EventSet, char *EventName, int *check,
                                int Event_len) {
  char tmp[128];
  Fortran2cstring(tmp, EventName, 128, Event_len);
  *check = PAPI_remove_named_event(*EventSet, tmp);
}


x86 assembly (clang, -O0):
<papif_remove_named_event__>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%ecx
mov    $0x80,%edx
call   1040 <Fortran2cstring@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
lea    -0xa0(%rbp),%rsi
call   1030 <PAPI_remove_named_event@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_remove_named_event__>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
mov    %rdx,%r14
mov    %rdi,%rbx
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0x80,%edx
call   1040 <Fortran2cstring@plt>
mov    (%rbx),%edi
mov    %r15,%rsi
call   1030 <PAPI_remove_named_event@plt>
mov    %eax,(%r14)
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @papif_remove_named_event__(i32* %0, i8* %1, i32* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca [128 x i8]
store i32* %0, i32** %5
store i8* %1, i8** %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%10 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%11 = load i8*, i8** %6
%12 = load i32, i32* %8
%13 = call i32 @Fortran2cstring(i8* %10, i8* %11, i32 128, i32 %12)
%14 = load i32*, i32** %5
%15 = load i32, i32* %14
%16 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%17 = call i32 @PAPI_remove_named_event(i32 %15, i8* %16)
%18 = load i32*, i32** %7
store i32 %17, i32* %18
ret void
}

LLVM IR (-O2):
define void @papif_remove_named_event__(i32* nocapture %0, i8* %1, i32* nocapture writeonly %2, i32 %3) {
%5 = alloca [128 x i8]
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%7 = call i32 @Fortran2cstring(i8* %6, i8* %1, i32 128, i32 %3)
%8 = load i32, i32* %0
%9 = call i32 @PAPI_remove_named_event(i32 %8, i8* %6)
store i32 %9, i32* %2
ret void
}
unsigned char unsignedchar_ignoring_signedshort(unsigned char x,
                                                signed short y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedchar_ignoring_signedshort>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsignedchar_ignoring_signedshort>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @unsignedchar_ignoring_signedshort(i8 zeroext %0, i16 signext %1) {
%3 = alloca i8
%4 = alloca i16
store i8 %0, i8* %3
store i16 %1, i16* %4
%5 = load i8, i8* %3
ret i8 %5
}

LLVM IR (-O2):
define zeroext i8 @unsignedchar_ignoring_signedshort(i8 returned zeroext %0, i16 signext %1) {
ret i8 %0
}
/* Type definitions */
struct siphash {
  int dummy;
};
struct ether_addr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ siphash24_compress(struct ether_addr const *, int,
                                      struct siphash *);
void ether_addr_hash_func(const struct ether_addr *p, struct siphash *state) {
  siphash24_compress(p, sizeof(struct ether_addr), state);
}


x86 assembly (clang, -O0):
<ether_addr_hash_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x4,%esi
call   1030 <siphash24_compress@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ether_addr_hash_func>:
mov    %rsi,%rdx
mov    $0x4,%esi
jmp    1030 <siphash24_compress@plt>

LLVM IR (-O0):
%struct.ether_addr = type { i32 }
%struct.siphash = type { i32 }
define void @ether_addr_hash_func(%struct.ether_addr* %0, %struct.siphash* %1) {
%3 = alloca %struct.ether_addr*
%4 = alloca %struct.siphash*
store %struct.ether_addr* %0, %struct.ether_addr** %3
store %struct.siphash* %1, %struct.siphash** %4
%5 = load %struct.ether_addr*, %struct.ether_addr** %3
%6 = load %struct.siphash*, %struct.siphash** %4
%7 = call i32 @siphash24_compress(%struct.ether_addr* %5, i32 4, %struct.siphash* %6)
ret void
}

LLVM IR (-O2):
%struct.ether_addr = type { i32 }
%struct.siphash = type { i32 }
define void @ether_addr_hash_func(%struct.ether_addr* %0, %struct.siphash* %1) {
%3 = tail call i32 @siphash24_compress(%struct.ether_addr* %0, i32 4, %struct.siphash* %1)
ret void
}
void wsInternalInit() {}


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

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

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

LLVM IR (-O2):
define void @wsInternalInit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void jclose(int sock) { close(sock); }


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

x86 assembly (clang, -O2):
<jclose>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @jclose(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *memmove(void *, void *, unsigned int);
int /*<<< orphan*/ printf(char *, void *, void *);
void checked_memmove(void *dst, void *src, unsigned n) {
  void *ret = memmove(dst, src, n);
  if (ret != dst) {
    printf("Wrong memmove return value: %p != %p\n", ret, dst);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<checked_memmove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memmove@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x8(%rbp),%rax
je     1183 <checked_memmove+0x53>
mov    -0x20(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checked_memmove>:
push   %rbx
mov    %rdi,%rbx
call   1040 <memmove@plt>
cmp    %rbx,%rax
jne    1140 <checked_memmove+0x10>
pop    %rbx
ret
lea    0xeb9(%rip),%rdi
mov    %rax,%rsi
mov    %rbx,%rdx
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"Wrong memmove return value: %p != %p\0A\00"
define void @checked_memmove(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i8* @memmove(i8* %8, i8* %9, i32 %10)
store i8* %11, i8** %7
%12 = load i8*, i8** %7
%13 = load i8*, i8** %4
%14 = icmp ne i8* %12, %13
br i1 %14, label %15, label %20
15: ; preds = %3
%16 = load i8*, i8** %7
%17 = load i8*, i8** %4
%18 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %16, i8* %17)
%19 = call i32 @exit(i32 1)
unreachable
20: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"Wrong memmove return value: %p != %p\0A\00"
define void @checked_memmove(i8* %0, i8* %1, i32 %2) {
%4 = tail call i8* @memmove(i8* %0, i8* %1, i32 %2)
%5 = icmp eq i8* %4, %0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %0)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ printid(char);
void main() {
  char b;
  b = 1 || 2 || 3 || 4;
  if (b)
    print("b");
  printid(b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x1,-0x1(%rbp)
cmpb   $0x0,-0x1(%rbp)
je     1142 <main+0x22>
lea    0xec3(%rip),%rdi
call   1030 <print@plt>
movsbl -0x1(%rbp),%edi
call   1040 <printid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <print@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <printid@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"b\00"
define void @main() {
%1 = alloca i8
store i8 1, i8* %1
%2 = load i8, i8* %1
%3 = icmp ne i8 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @print(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
%7 = load i8, i8* %1
%8 = call i32 @printid(i8 signext %7)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"b\00"
define void @main() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printid(i8 signext 1)
ret void
}
__attribute__((weak)) void PendSV_Handler(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<PendSV_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <PendSV_Handler+0x9>
jmp    1109 <PendSV_Handler+0x9>

x86 assembly (clang, -O2):
<PendSV_Handler>:
jmp    1100 <PendSV_Handler>

LLVM IR (-O0):
define weak void @PendSV_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define weak void @PendSV_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
void PDMR3CritSectName(void) {}


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

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

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

LLVM IR (-O2):
define void @PDMR3CritSectName() {
ret void
}
void fb_write_cell(short i, char c, unsigned char fg, unsigned char bg) {
  unsigned char *fb = (unsigned char *)0x000B8000;
  ;
  fb[i * 2] = c;
  fb[i * 2 + 1] = ((bg & 0x0f) << 4) | (fg & 0x0f);
}


x86 assembly (clang, -O0):
<fb_write_cell>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %di,%si
mov    %si,-0x2(%rbp)
mov    %dl,-0x3(%rbp)
mov    %cl,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    $0xb8000,%eax
mov    %rax,-0x10(%rbp)
mov    -0x3(%rbp),%dl
mov    -0x10(%rbp),%rax
movswl -0x2(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
movzbl -0x5(%rbp),%eax
and    $0xf,%eax
shl    $0x4,%eax
movzbl -0x4(%rbp),%ecx
and    $0xf,%ecx
or     %ecx,%eax
mov    %al,%dl
mov    -0x10(%rbp),%rax
movswl -0x2(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_write_cell>:
movslq %edi,%rax
mov    %sil,0xb8000(%rax,%rax,1)
shl    $0x4,%cl
and    $0xf,%dl
or     %cl,%dl
mov    %dl,0xb8001(%rax,%rax,1)
ret

LLVM IR (-O0):
define void @fb_write_cell(i16 signext %0, i8 signext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = alloca i16
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8*
store i16 %0, i16* %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
store i8* inttoptr (i64 753664 to i8*), i8** %9
%10 = load i8, i8* %6
%11 = load i8*, i8** %9
%12 = load i16, i16* %5
%13 = sext i16 %12 to i32
%14 = mul nsw i32 %13, 2
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %11, i64 %15
store i8 %10, i8* %16
%17 = load i8, i8* %8
%18 = zext i8 %17 to i32
%19 = and i32 %18, 15
%20 = shl i32 %19, 4
%21 = load i8, i8* %7
%22 = zext i8 %21 to i32
%23 = and i32 %22, 15
%24 = or i32 %20, %23
%25 = trunc i32 %24 to i8
%26 = load i8*, i8** %9
%27 = load i16, i16* %5
%28 = sext i16 %27 to i32
%29 = mul nsw i32 %28, 2
%30 = add nsw i32 %29, 1
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8, i8* %26, i64 %31
store i8 %25, i8* %32
ret void
}

LLVM IR (-O2):
define void @fb_write_cell(i16 signext %0, i8 signext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = sext i16 %0 to i32
%6 = shl nsw i32 %5, 1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* inttoptr (i64 753664 to i8*), i64 %7
store i8 %1, i8* %8
%9 = shl i8 %3, 4
%10 = and i8 %2, 15
%11 = or i8 %9, %10
%12 = or i32 %6, 1
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* inttoptr (i64 753664 to i8*), i64 %13
store i8 %11, i8* %14
ret void
}
/* Type definitions */
struct Cyc_Absyn_Exp {
  int dummy;
};

/* Variables and functions */
struct Cyc_Absyn_Exp *Cyc_Absyn_signed_int_exp(int, unsigned int);
struct Cyc_Absyn_Exp *Cyc_Absyn_bool_exp(int b, unsigned loc) {
  int _T0;
  int _T1;
  unsigned _T2;
  struct Cyc_Absyn_Exp *_T3;
  _T1 = b;
  if (!_T1)
    goto _TL89;
  _T0 = 1;
  goto _TL8A;
_TL89:
  _T0 = 0;
_TL8A:
  _T2 = loc;
  _T3 = Cyc_Absyn_signed_int_exp(_T0, _T2);
  return _T3;
}


x86 assembly (clang, -O0):
<Cyc_Absyn_bool_exp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1133 <Cyc_Absyn_bool_exp+0x23>
jmp    113f <Cyc_Absyn_bool_exp+0x2f>
movl   $0x1,-0xc(%rbp)
jmp    1146 <Cyc_Absyn_bool_exp+0x36>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <Cyc_Absyn_signed_int_exp@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Absyn_bool_exp>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
mov    %eax,%edi
jmp    1030 <Cyc_Absyn_signed_int_exp@plt>

LLVM IR (-O0):
%struct.Cyc_Absyn_Exp = type { i32 }
define %struct.Cyc_Absyn_Exp* @Cyc_Absyn_bool_exp(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.Cyc_Absyn_Exp*
store i32 %0, i32* %3
store i32 %1, i32* %4
%9 = load i32, i32* %3
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp ne i32 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %2
br label %14
13: ; preds = %2
store i32 1, i32* %5
br label %15
14: ; preds = %12
store i32 0, i32* %5
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %4
store i32 %16, i32* %7
%17 = load i32, i32* %5
%18 = load i32, i32* %7
%19 = call %struct.Cyc_Absyn_Exp* @Cyc_Absyn_signed_int_exp(i32 %17, i32 %18)
store %struct.Cyc_Absyn_Exp* %19, %struct.Cyc_Absyn_Exp** %8
%20 = load %struct.Cyc_Absyn_Exp*, %struct.Cyc_Absyn_Exp** %8
ret %struct.Cyc_Absyn_Exp* %20
}

LLVM IR (-O2):
%struct.Cyc_Absyn_Exp = type { i32 }
define %struct.Cyc_Absyn_Exp* @Cyc_Absyn_bool_exp(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, 0
%4 = zext i1 %3 to i32
%5 = tail call %struct.Cyc_Absyn_Exp* @Cyc_Absyn_signed_int_exp(i32 %4, i32 %1)
ret %struct.Cyc_Absyn_Exp* %5
}
/* Variables and functions */
scalar_t__ GC_malloc(unsigned int);
void *GC_calloc(unsigned int n, unsigned int t) {
  return (void *)GC_malloc(n * t);
}


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

x86 assembly (clang, -O2):
<GC_calloc>:
imul   %esi,%edi
jmp    1030 <GC_malloc@plt>

LLVM IR (-O0):
define i8* @GC_calloc(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 = mul i32 %5, %6
%8 = call i64 @GC_malloc(i32 %7)
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}

LLVM IR (-O2):
define i8* @GC_calloc(i32 %0, i32 %1) {
%3 = mul i32 %1, %0
%4 = tail call i64 @GC_malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ inw(unsigned int);
unsigned short le16_to_cpu(int /*<<< orphan*/);
unsigned short nsp32_read2(unsigned int base, unsigned int index) {
  return le16_to_cpu(inw(base + index));
}


x86 assembly (clang, -O0):
<nsp32_read2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
add    -0x8(%rbp),%edi
call   1030 <inw@plt>
mov    %eax,%edi
call   1040 <le16_to_cpu@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsp32_read2>:
push   %rax
add    %esi,%edi
call   1030 <inw@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <le16_to_cpu@plt>

LLVM IR (-O0):
define zeroext i16 @nsp32_read2(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 = add i32 %5, %6
%8 = call i32 @inw(i32 %7)
%9 = call zeroext i16 @le16_to_cpu(i32 %8)
ret i16 %9
}

LLVM IR (-O2):
define zeroext i16 @nsp32_read2(i32 %0, i32 %1) {
%3 = add i32 %1, %0
%4 = tail call i32 @inw(i32 %3)
%5 = tail call zeroext i16 @le16_to_cpu(i32 %4)
ret i16 %5
}
void amaret_local_Mcu_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @amaret_local_Mcu_targetInit__I() {
ret void
}
/* Type definitions */
struct hle_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ rsp_break(struct hle_t *, int);
void task_done(struct hle_t *hle) { rsp_break(hle, 0x200); }


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

x86 assembly (clang, -O2):
<task_done>:
mov    $0x200,%esi
jmp    1030 <rsp_break@plt>

LLVM IR (-O0):
%struct.hle_t = type { i32 }
define void @task_done(%struct.hle_t* %0) {
%2 = alloca %struct.hle_t*
store %struct.hle_t* %0, %struct.hle_t** %2
%3 = load %struct.hle_t*, %struct.hle_t** %2
%4 = call i32 @rsp_break(%struct.hle_t* %3, i32 512)
ret void
}

LLVM IR (-O2):
%struct.hle_t = type { i32 }
define void @task_done(%struct.hle_t* %0) {
%2 = tail call i32 @rsp_break(%struct.hle_t* %0, i32 512)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_fractal_data();
int /*<<< orphan*/ plot_fractal(int /*<<< orphan*/);
int /*<<< orphan*/ start_video_mode();
void print_fractal() {
  start_video_mode();
  plot_fractal(get_fractal_data());
  while (1)
    ;
}


x86 assembly (clang, -O0):
<print_fractal>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <start_video_mode@plt>
mov    $0x0,%al
call   1050 <get_fractal_data@plt>
mov    %eax,%edi
call   1030 <plot_fractal@plt>
jmp    1149 <print_fractal+0x19>

x86 assembly (clang, -O2):
<print_fractal>:
push   %rax
xor    %eax,%eax
call   1040 <start_video_mode@plt>
xor    %eax,%eax
call   1050 <get_fractal_data@plt>
mov    %eax,%edi
call   1030 <plot_fractal@plt>
cs nopw 0x0(%rax,%rax,1)
jmp    1150 <print_fractal+0x20>

LLVM IR (-O0):
define void @print_fractal() {
%1 = call i32 (...) @start_video_mode()
%2 = call i32 (...) @get_fractal_data()
%3 = call i32 @plot_fractal(i32 %2)
br label %4
4: ; preds = %0, %4
br label %4
}

LLVM IR (-O2):
define void @print_fractal() {
%1 = tail call i32 (...) @start_video_mode()
%2 = tail call i32 (...) @get_fractal_data()
%3 = tail call i32 @plot_fractal(i32 %2)
br label %4
4: ; preds = %0, %4
br label %4
}
/* Variables and functions */
scalar_t__ __builtin_pow10(double);
int /*<<< orphan*/ link_failure_builtin_pow10();
void test_builtin_pow10(double d) {
  if (__builtin_pow10(d) != __builtin_pow10(d))
    link_failure_builtin_pow10();
}


x86 assembly (clang, -O0):
<test_builtin_pow10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <__builtin_pow10@plt>
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <__builtin_pow10@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_builtin_pow10+0x3c>
mov    $0x0,%al
call   1030 <link_failure_builtin_pow10@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_builtin_pow10>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1040 <__builtin_pow10@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1040 <__builtin_pow10@plt>
cmp    %rax,%rbx
jne    1149 <test_builtin_pow10+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1030 <link_failure_builtin_pow10@plt>

LLVM IR (-O0):
define void @test_builtin_pow10(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @__builtin_pow10(double %3)
%5 = load double, double* %2
%6 = call i64 @__builtin_pow10(double %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_builtin_pow10()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_builtin_pow10(double %0) {
%2 = tail call i64 @__builtin_pow10(double %0)
%3 = tail call i64 @__builtin_pow10(double %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_builtin_pow10()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
void *realloc(void *, size_t);
void *mempool_realloc(void *ptr, size_t size) { return (realloc(ptr, size)); }


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

x86 assembly (clang, -O2):
<mempool_realloc>:
jmp    1030 <realloc@plt>

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

LLVM IR (-O2):
define noalias i8* @mempool_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ BUFSIZ;
int /*<<< orphan*/ _IOFBF;
int /*<<< orphan*/ _IONBF;
int /*<<< orphan*/ setvbuf(int /*<<< orphan*/ *, char *, int /*<<< orphan*/,
                           int /*<<< orphan*/);
void setbuf(FILE *stream, char *buf) {
  setvbuf(stream, buf, (buf != NULL ? _IOFBF : _IONBF), BUFSIZ);
}


x86 assembly (clang, -O0):
<setbuf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114c <setbuf+0x3c>
mov    0x2e8e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
jmp    1158 <setbuf+0x48>
mov    0x2e95(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%edx
mov    0x2e6e(%rip),%rax
mov    (%rax),%ecx
call   1030 <setvbuf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setbuf>:
test   %rsi,%rsi
jne    111e <setbuf+0xe>
mov    0x2ecc(%rip),%rax
jmp    1125 <setbuf+0x15>
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
mov    0x2eaa(%rip),%rax
mov    (%rax),%ecx
jmp    1030 <setvbuf@plt>

LLVM IR (-O0):
@_IOFBF = global i32 0
@_IONBF = global i32 0
@BUFSIZ = global i32 0
define void @setbuf(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* @_IOFBF
br label %13
11: ; preds = %2
%12 = load i32, i32* @_IONBF
br label %13
13: ; preds = %11, %9
%14 = phi i32 [ %10, %9 ], [ %12, %11 ]
%15 = load i32, i32* @BUFSIZ
%16 = call i32 @setvbuf(i32* %5, i8* %6, i32 %14, i32 %15)
ret void
}

LLVM IR (-O2):
@_IOFBF = global i32 0
@_IONBF = global i32 0
@BUFSIZ = global i32 0
define void @setbuf(i32* nocapture %0, i8* %1) {
%3 = icmp eq i8* %1, null
%4 = load i32, i32* @_IOFBF
%5 = load i32, i32* @_IONBF
%6 = select i1 %3, i32 %5, i32 %4
%7 = load i32, i32* @BUFSIZ
%8 = tail call i32 @setvbuf(i32* %0, i8* %1, i32 %6, i32 %7)
ret void
}
void wifi_evt_sme_wps_credential_ssid(
    const struct wifi_msg_sme_wps_credential_ssid_evt_t *msg) {}


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

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

LLVM IR (-O0):
%struct.wifi_msg_sme_wps_credential_ssid_evt_t = type opaque
define void @wifi_evt_sme_wps_credential_ssid(%struct.wifi_msg_sme_wps_credential_ssid_evt_t* %0) {
%2 = alloca %struct.wifi_msg_sme_wps_credential_ssid_evt_t*
store %struct.wifi_msg_sme_wps_credential_ssid_evt_t* %0, %struct.wifi_msg_sme_wps_credential_ssid_evt_t** %2
ret void
}

LLVM IR (-O2):
%struct.wifi_msg_sme_wps_credential_ssid_evt_t = type opaque
define void @wifi_evt_sme_wps_credential_ssid(%struct.wifi_msg_sme_wps_credential_ssid_evt_t* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ split_sexigesimal_str(char const *, float **);
float parse_sexigesimal_str(const char *str) {
  float splitted[3];
  split_sexigesimal_str(str, &splitted);
  return splitted[0] + splitted[1] / 60 + splitted[2] / 3600;
}


x86 assembly (clang, -O0):
<parse_sexigesimal_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <split_sexigesimal_str@plt>
movss  -0x14(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
movss  0xec9(%rip),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
movss  -0xc(%rbp),%xmm1
movss  0xeb0(%rip),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_sexigesimal_str>:
sub    $0x18,%rsp
lea    0xc(%rsp),%rsi
call   1030 <split_sexigesimal_str@plt>
movsd  0x10(%rsp),%xmm0
divps  0xed5(%rip),%xmm0
movss  0xc(%rsp),%xmm1
addss  %xmm0,%xmm1
shufps $0x55,%xmm0,%xmm0
addss  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @parse_sexigesimal_str(i8* %0) {
%2 = alloca i8*
%3 = alloca [3 x float]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast [3 x float]* %3 to float**
%6 = call i32 @split_sexigesimal_str(i8* %4, float** %5)
%7 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 0
%8 = load float, float* %7
%9 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 1
%10 = load float, float* %9
%11 = fdiv float %10, 6.000000e+01
%12 = fadd float %8, %11
%13 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 2
%14 = load float, float* %13
%15 = fdiv float %14, 3.600000e+03
%16 = fadd float %12, %15
ret float %16
}

LLVM IR (-O2):
define float @parse_sexigesimal_str(i8* %0) {
%2 = alloca [3 x float]
%3 = bitcast [3 x float]* %2 to i8*
%4 = bitcast [3 x float]* %2 to float**
%5 = call i32 @split_sexigesimal_str(i8* %0, float** %4)
%6 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 0
%7 = load float, float* %6
%8 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 1
%9 = bitcast float* %8 to <2 x float>*
%10 = load <2 x float>, <2 x float>* %9
%11 = fdiv <2 x float> %10, <float 6.000000e+01, float 3.600000e+03>
%12 = extractelement <2 x float> %11, i64 0
%13 = fadd float %7, %12
%14 = extractelement <2 x float> %11, i64 1
%15 = fadd float %13, %14
ret float %15
}
int settings_backend_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @settings_backend_init() {
ret i32 0
}
int isbaseprime(long long int x) {
  if (x != 1)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isbaseprime>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x1,-0x10(%rbp)
je     111f <isbaseprime+0x1f>
movl   $0x1,-0x4(%rbp)
jmp    1126 <isbaseprime+0x26>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isbaseprime>:
xor    %eax,%eax
cmp    $0x1,%rdi
setne  %al
ret

LLVM IR (-O0):
define i32 @isbaseprime(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp ne i64 %4, 1
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 @isbaseprime(i64 %0) {
%2 = icmp ne i64 %0, 1
%3 = zext i1 %2 to i32
ret i32 %3
}