xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int fpu_control_t;
typedef int fexcept_t;

/* Variables and functions */
int FE_ALL_EXCEPT;
int /*<<< orphan*/ _FPU_GETCW(int);
int /*<<< orphan*/ _FPU_SETCW(int);
int fesetexceptflag(const fexcept_t *flagp, int excepts) {
  fpu_control_t temp;
  _FPU_GETCW(temp);
  excepts &= FE_ALL_EXCEPT;
  temp = (temp & ~excepts) | (*flagp & excepts);
  _FPU_SETCW(temp);
  return 0;
}


x86 assembly (clang, -O0):
<fesetexceptflag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <_FPU_GETCW@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1040 <_FPU_SETCW@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fesetexceptflag>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
call   1030 <_FPU_GETCW@plt>
mov    0x2eab(%rip),%rax
and    (%rax),%ebx
and    (%r14),%ebx
mov    %ebx,%edi
call   1040 <_FPU_SETCW@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@FE_ALL_EXCEPT = global i32 0
define i32 @fesetexceptflag(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %5
%7 = call i32 @_FPU_GETCW(i32 %6)
%8 = load i32, i32* @FE_ALL_EXCEPT
%9 = load i32, i32* %4
%10 = and i32 %9, %8
store i32 %10, i32* %4
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = xor i32 %12, -1
%14 = and i32 %11, %13
%15 = load i32*, i32** %3
%16 = load i32, i32* %15
%17 = load i32, i32* %4
%18 = and i32 %16, %17
%19 = or i32 %14, %18
store i32 %19, i32* %5
%20 = load i32, i32* %5
%21 = call i32 @_FPU_SETCW(i32 %20)
ret i32 0
}

LLVM IR (-O2):
@FE_ALL_EXCEPT = global i32 0
define i32 @fesetexceptflag(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @_FPU_GETCW(i32 undef)
%4 = load i32, i32* @FE_ALL_EXCEPT
%5 = and i32 %4, %1
%6 = load i32, i32* %0
%7 = and i32 %5, %6
%8 = tail call i32 @_FPU_SETCW(i32 %7)
ret i32 0
}
void AR30ToABGR() {}


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

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

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

LLVM IR (-O2):
define void @AR30ToABGR() {
ret void
}
void udpsrvsession_destroy(struct udpsrvsession_s *cursession) {}


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

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

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

LLVM IR (-O2):
%struct.udpsrvsession_s = type opaque
define void @udpsrvsession_destroy(%struct.udpsrvsession_s* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ memchr(char *, int, size_t);
char *char_index(char *haystack, size_t hay_size, char *needle) {
  return (char *)memchr(haystack, (int)*needle, hay_size);
}


x86 assembly (clang, -O0):
<char_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
movsbl (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1030 <memchr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_index>:
mov    %rsi,%rax
movsbl (%rdx),%esi
mov    %rax,%rdx
jmp    1030 <memchr@plt>

LLVM IR (-O0):
define i8* @char_index(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %6
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = load i64, i64* %5
%12 = call i64 @memchr(i8* %7, i32 %10, i64 %11)
%13 = inttoptr i64 %12 to i8*
ret i8* %13
}

LLVM IR (-O2):
define i8* @char_index(i8* %0, i64 %1, i8* nocapture %2) {
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = tail call i64 @memchr(i8* %0, i32 %5, i64 %1)
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void print_usage(char **argv) {
  fprintf(stderr,
          "usage: %s [-s <track>] [-t <pid>] <file>\n"
          "\t-s\tset track number (0-7 or 0x80-0x87)\n"
          "\t-t\tuse transport stream demultiplexer, pid 0x10-0x1ffe\n",
          argv[0]);
  exit(1);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%eax
mov    (%rdi),%rdx
lea    0xecc(%rip),%rsi
mov    %eax,%edi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [138 x i8] c"usage: %s [-s <track>] [-t <pid>] <file>\0A\09-s\09set track number (0-7 or 0x80-0x87)\0A\09-t\09use transport stream demultiplexer, pid 0x10-0x1ffe\0A\00"
define void @print_usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i32, i32* @stderr
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i64 0
%6 = load i8*, i8** %5
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [138 x i8] c"usage: %s [-s <track>] [-t <pid>] <file>\0A\09-s\09set track number (0-7 or 0x80-0x87)\0A\09-t\09use transport stream demultiplexer, pid 0x10-0x1ffe\0A\00"
define void @print_usage(i8** nocapture %0) {
%2 = load i32, i32* @stderr
%3 = load i8*, i8** %0
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello ocaml world\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"Hello ocaml world\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [18 x i8] c"Hello ocaml world\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int resta(int a, int b) {
  int resta;
  resta = a - b;
  return resta;
}


x86 assembly (clang, -O0):
<resta>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @resta(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
void swapshort(short *ashort) {
  unsigned char *temp, temp2;
  temp = (unsigned char *)ashort;
  temp2 = temp[0];
  temp[0] = temp[1];
  temp[1] = temp2;
}


x86 assembly (clang, -O0):
<swapshort>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapshort>:
rolw   $0x8,(%rdi)
ret

LLVM IR (-O0):
define void @swapshort(i16* %0) {
%2 = alloca i16*
%3 = alloca i8*
%4 = alloca i8
store i16* %0, i16** %2
%5 = load i16*, i16** %2
%6 = bitcast i16* %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
store i8 %9, i8* %4
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 0
store i8 %12, i8* %14
%15 = load i8, i8* %4
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 1
store i8 %15, i8* %17
ret void
}

LLVM IR (-O2):
define void @swapshort(i16* nocapture %0) {
%2 = bitcast i16* %0 to i8*
%3 = load i8, i8* %2
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = load i8, i8* %4
store i8 %5, i8* %2
store i8 %3, i8* %4
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ itch(char *);
int main(void) {
  itch("itch.properties");
  return EXIT_SUCCESS;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <itch@plt>
mov    0x2ebc(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"itch.properties\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @itch(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}

LLVM IR (-O2):
@.str = [16 x i8] c"itch.properties\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @itch(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Variables and functions */
int rand();
int generaIngrediente() { return rand() % 3 + 1; }


x86 assembly (clang, -O0):
<generaIngrediente>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<generaIngrediente>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x55555556,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @generaIngrediente() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 3
%3 = add nsw i32 %2, 1
ret i32 %3
}

LLVM IR (-O2):
define i32 @generaIngrediente() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 3
%3 = add nsw i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int solve_with_standard_doubles(int max, double eps, int *nit) {
  int fail = _ada_use_c2phc(272, &max, nit, &eps);
  return fail;
}


x86 assembly (clang, -O0):
<solve_with_standard_doubles>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdx
mov    $0x110,%edi
lea    -0x4(%rbp),%rsi
lea    -0x10(%rbp),%rcx
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solve_with_standard_doubles>:
sub    $0x18,%rsp
mov    %rsi,%rdx
mov    %edi,0xc(%rsp)
movsd  %xmm0,0x10(%rsp)
lea    0xc(%rsp),%rsi
lea    0x10(%rsp),%rcx
mov    $0x110,%edi
call   1030 <_ada_use_c2phc@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @solve_with_standard_doubles(i32 %0, double %1, i32* %2) {
%4 = alloca i32
%5 = alloca double
store i32 %0, i32* %4
store double %1, double* %5
%6 = call i32 @_ada_use_c2phc(i32 272, i32* %4, i32* %2, double* %5)
ret i32 %6
}
double radius_from_max_dimension(double radius_minor, double r_ratio,
                                 double hlength) {
  const double rad_max =
      (r_ratio < 1.0 ? radius_minor : r_ratio * radius_minor);
  return (rad_max > hlength ? rad_max : hlength);
}


x86 assembly (clang, -O0):
<radius_from_max_dimension>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  0xee5(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1135 <radius_from_max_dimension+0x35>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    1144 <radius_from_max_dimension+0x44>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    116d <radius_from_max_dimension+0x6d>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    1177 <radius_from_max_dimension+0x77>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<radius_from_max_dimension>:
movsd  0xef8(%rip),%xmm3
maxsd  %xmm1,%xmm3
mulsd  %xmm3,%xmm0
maxsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @radius_from_max_dimension(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %5
%9 = fcmp olt double %8, 1.000000e+00
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load double, double* %4
br label %16
12: ; preds = %3
%13 = load double, double* %5
%14 = load double, double* %4
%15 = fmul double %13, %14
br label %16
16: ; preds = %12, %10
%17 = phi double [ %11, %10 ], [ %15, %12 ]
store double %17, double* %7
%18 = load double, double* %7
%19 = load double, double* %6
%20 = fcmp ogt double %18, %19
br i1 %20, label %21, label %23
21: ; preds = %16
%22 = load double, double* %7
br label %25
23: ; preds = %16
%24 = load double, double* %6
br label %25
25: ; preds = %23, %21
%26 = phi double [ %22, %21 ], [ %24, %23 ]
ret double %26
}

LLVM IR (-O2):
define double @radius_from_max_dimension(double %0, double %1, double %2) {
%4 = fcmp olt double %1, 1.000000e+00
%5 = select i1 %4, double 1.000000e+00, double %1
%6 = fmul double %5, %0
%7 = fcmp ogt double %6, %2
%8 = select i1 %7, double %6, double %2
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char *);
void ctrlc(int ignored) {
  puts("\nDone!\n");
  exit(1);
}


x86 assembly (clang, -O0):
<ctrlc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [8 x i8] c"\0ADone!\0A\00"
define void @ctrlc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [8 x i8] c"\0ADone!\0A\00"
define void @ctrlc(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef unsigned int uint64_t;

/* Variables and functions */
unsigned another_unsigned_high_prod(unsigned x, unsigned y) {
  uint64_t mul = (uint64_t)x * y;
  return mul >> 32;
}


x86 assembly (clang, -O0):
<another_unsigned_high_prod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
shr    %cl,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @another_unsigned_high_prod(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = mul i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = lshr i32 %9, 32
ret i32 %10
}

LLVM IR (-O2):
define i32 @another_unsigned_high_prod(i32 %0, i32 %1) {
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int printf(char *);
int /*<<< orphan*/ stderr;
int header_not_modified(void) {
  fprintf(stderr, "304 Not Modified\n");
  return printf("Status: 304 Not Modified\n");
}


x86 assembly (clang, -O0):
<header_not_modified>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
call   1040 <fprintf@plt>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<header_not_modified>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xed7(%rip),%rsi
call   1040 <fprintf@plt>
lea    0xec3(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"304 Not Modified\0A\00"
@.str.1 = [26 x i8] c"Status: 304 Not Modified\0A\00"
define i32 @header_not_modified() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret i32 %3
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"304 Not Modified\0A\00"
@.str.1 = [26 x i8] c"Status: 304 Not Modified\0A\00"
define i32 @header_not_modified() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret i32 %3
}
/* Variables and functions */
float logf(float);
float Log2(float x) {
  return (x > 0.0f) ? (logf(x) / (0.6931471805599453f)) : x;
}


x86 assembly (clang, -O0):
<Log2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    114e <Log2+0x3e>
movss  -0x4(%rbp),%xmm0
call   1030 <logf@plt>
movss  0xec0(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1158 <Log2+0x48>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Log2>:
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    112a <Log2+0x1a>
push   %rax
call   1030 <logf@plt>
divss  0xeda(%rip),%xmm0
add    $0x8,%rsp
ret

LLVM IR (-O0):
define float @Log2(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp ogt float %3, 0.000000e+00
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load float, float* %2
%7 = call float @logf(float %6)
%8 = fdiv float %7, 0x3FE62E4300000000
br label %11
9: ; preds = %1
%10 = load float, float* %2
br label %11
11: ; preds = %9, %5
%12 = phi float [ %8, %5 ], [ %10, %9 ]
ret float %12
}

LLVM IR (-O2):
define float @Log2(float %0) {
%2 = fcmp ogt float %0, 0.000000e+00
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call float @logf(float %0)
%5 = fdiv float %4, 0x3FE62E4300000000
br label %6
6: ; preds = %1, %3
%7 = phi float [ %5, %3 ], [ %0, %1 ]
ret float %7
}
void putuserdata(userdata) char *userdata;
{
  alignbits();
  putbits(0x1B2L, 32);
  while (*userdata)
    putbits(*userdata++, 8);
}


x86 assembly (clang, -O0):
<putuserdata>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <alignbits@plt>
mov    $0x1b2,%edi
mov    $0x20,%esi
mov    $0x0,%al
call   1040 <putbits@plt>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1174 <putuserdata+0x54>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
mov    $0x8,%esi
mov    $0x0,%al
call   1040 <putbits@plt>
jmp    1144 <putuserdata+0x24>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putuserdata>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <alignbits@plt>
mov    $0x1b2,%edi
mov    $0x20,%esi
xor    %eax,%eax
call   1040 <putbits@plt>
mov    (%rbx),%al
test   %al,%al
je     116a <putuserdata+0x4a>
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
movsbl %al,%edi
mov    $0x8,%esi
xor    %eax,%eax
call   1040 <putbits@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1150 <putuserdata+0x30>
pop    %rbx
ret

LLVM IR (-O0):
define void @putuserdata(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @alignbits()
%4 = call i32 (i64, i32, ...) bitcast (i32 (...)* @putbits to i32 (i64, i32, ...)*)(i64 434, i32 32)
br label %5
5: ; preds = %9, %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %2
%12 = load i8, i8* %10
%13 = sext i8 %12 to i32
%14 = call i32 (i32, i32, ...) bitcast (i32 (...)* @putbits to i32 (i32, i32, ...)*)(i32 %13, i32 8)
br label %5
15: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @putuserdata(i8* nocapture %0) {
%2 = tail call i32 (...) @alignbits()
%3 = tail call i32 (i64, i32, ...) bitcast (i32 (...)* @putbits to i32 (i64, i32, ...)*)(i64 434, i32 32)
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %1, %6
%7 = phi i8 [ %12, %6 ], [ %4, %1 ]
%8 = phi i8* [ %9, %6 ], [ %0, %1 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = sext i8 %7 to i32
%11 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @putbits to i32 (i32, i32, ...)*)(i32 %10, i32 8)
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %1
ret void
}
unsigned int system_atomics_decrement(volatile unsigned int *value_ptr) {
  unsigned int previous_value;
  { previous_value = __sync_fetch_and_sub(value_ptr, 1) - 1; }
  return previous_value;
}


x86 assembly (clang, -O0):
<system_atomics_decrement>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0xffffffff,%eax
lock xadd %eax,(%rcx)
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<system_atomics_decrement>:
mov    $0xffffffff,%eax
lock xadd %eax,(%rdi)
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @system_atomics_decrement(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = atomicrmw sub i32* %4, i32 1 seq_cst
%6 = sub i32 %5, 1
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @system_atomics_decrement(i32* nocapture %0) {
%2 = atomicrmw sub i32* %0, i32 1 seq_cst
%3 = add i32 %2, -1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ dasumsub(int const *, double const *, int const *, double *);
double c_dasum(const int N, const double *X, const int stride) {
  double sum;
  dasumsub(&N, X, &stride, &sum);
  return sum;
}


x86 assembly (clang, -O0):
<c_dasum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x4(%rbp),%rdi
lea    -0x14(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1030 <dasumsub@plt>
movsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_dasum>:
sub    $0x18,%rsp
mov    %edi,0xc(%rsp)
mov    %edx,0x8(%rsp)
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rdx
lea    0x10(%rsp),%rcx
call   1030 <dasumsub@plt>
movsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define double @c_dasum(i32 %0, double* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
store i32 %0, i32* %4
store i32 %2, i32* %5
%7 = bitcast double* %6 to i8*
%8 = call i32 @dasumsub(i32* %4, double* %1, i32* %5, double* %6)
%9 = load double, double* %6
ret double %9
}
char *langRomTypePanasonic16() { return "Panasonic 16kB SRAM"; }


x86 assembly (clang, -O0):
<langRomTypePanasonic16>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<langRomTypePanasonic16>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Panasonic 16kB SRAM\00"
define i8* @langRomTypePanasonic16() {
ret i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [20 x i8] c"Panasonic 16kB SRAM\00"
define i8* @langRomTypePanasonic16() {
ret i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  long long int res = 0;
  if (res < -2147483648LL) {
    printf("Error: 0 < -2147483648\n");
    return 1;
  } else if (2147483647LL < res) {
    printf("Error: 2147483647 < 0\n");
    return 2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0xffffffff80000000,-0x10(%rbp)
80
jge    114d <main+0x3d>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1180 <main+0x70>
mov    $0x7fffffff,%eax
cmp    -0x10(%rbp),%rax
jge    1174 <main+0x64>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
movl   $0x2,-0x4(%rbp)
jmp    1180 <main+0x70>
jmp    1179 <main+0x69>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(char *, char const *, int);
int strlen(char const *);
char *my_strdup(const char *s) {
  int size = strlen(s) + 1;
  char *p = (char *)malloc(size);
  if (p) {
    memcpy(p, s, size);
  }
  return p;
}


x86 assembly (clang, -O0):
<my_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1172 <my_strdup+0x42>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strdup>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    %eax,%ebp
add    $0x1,%ebp
mov    %ebp,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     115d <my_strdup+0x2d>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @my_strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @memcpy(i8* %5, i8* %0, i32 %3)
br label %9
9: ; preds = %7, %1
ret i8* %5
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMRF2_get(void) { return U_WMRCORENONE_get("U_WMRF2"); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRF2\00"
define i32 @U_WMRF2_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
int foo(int *a, int r, int *b) {
  int ret = 0;
  *a = 1;
  if (r == 3) {
    *a = 5;
    *b = 3;
  }
  return ret;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
cmpl   $0x3,-0xc(%rbp)
jne    113e <foo+0x3e>
mov    -0x8(%rbp),%rax
movl   $0x5,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x3,(%rax)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movl   $0x1,(%rdi)
cmp    $0x3,%esi
jne    1117 <foo+0x17>
movl   $0x5,(%rdi)
movl   $0x3,(%rdx)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32* nocapture writeonly %0, i32 %1, i32* nocapture writeonly %2) {
store i32 1, i32* %0
%4 = icmp eq i32 %1, 3
br i1 %4, label %5, label %6
5: ; preds = %3
store i32 5, i32* %0
store i32 3, i32* %2
br label %6
6: ; preds = %5, %3
ret i32 0
}
/* Type definitions */
typedef unsigned int uint32_t;

/* Variables and functions */
unsigned int htonl(unsigned int);
uint32_t pack_host(char *host) {
  uint32_t res = 0;
  int i;
  for (i = 0; i < 4; i++)
    res |= (unsigned)(host[i] & 0xff) << ((3 - i) * 8);
  return htonl(res);
}


x86 assembly (clang, -O0):
<pack_host>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jge    1166 <pack_host+0x56>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
and    $0xff,%eax
mov    $0x3,%ecx
sub    -0x10(%rbp),%ecx
shl    $0x3,%ecx
shl    %cl,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112a <pack_host+0x1a>
mov    -0xc(%rbp),%edi
call   1030 <htonl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pack_host>:
mov    (%rdi),%edi
bswap  %edi
jmp    1030 <htonl@plt>

LLVM IR (-O0):
define i32 @pack_host(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %22, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 4
br i1 %7, label %8, label %25
8: ; preds = %5
%9 = load i8*, i8** %2
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = and i32 %14, 255
%16 = load i32, i32* %4
%17 = sub nsw i32 3, %16
%18 = mul nsw i32 %17, 8
%19 = shl i32 %15, %18
%20 = load i32, i32* %3
%21 = or i32 %20, %19
store i32 %21, i32* %3
br label %22
22: ; preds = %8
%23 = load i32, i32* %4
%24 = add nsw i32 %23, 1
store i32 %24, i32* %4
br label %5
25: ; preds = %5
%26 = load i32, i32* %3
%27 = call i32 @htonl(i32 %26)
ret i32 %27
}

LLVM IR (-O2):
define i32 @pack_host(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %13, %9
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
%19 = tail call i32 @htonl(i32 %18)
ret i32 %19
}
/* Variables and functions */
long long build_value(unsigned long long, int);
int /*<<< orphan*/ divmod(long long, long long, long long, int *, int *,
                          unsigned long long *);
long long int intDblRmdr(long long int z, long long int y, long long int x) {
  unsigned long long int r;
  int sx, sy;
  divmod(z, y, x, &sx, &sy, &r);
  return build_value(r, sy);
}


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

x86 assembly (clang, -O2):
<intDblRmdr>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rcx
lea    0x4(%rsp),%r8
lea    0x8(%rsp),%r9
call   1040 <divmod@plt>
mov    0x8(%rsp),%rdi
mov    0x4(%rsp),%esi
call   1030 <build_value@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i64 @intDblRmdr(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
%7 = bitcast i64* %4 to i8*
%8 = bitcast i32* %5 to i8*
%9 = bitcast i32* %6 to i8*
%10 = call i32 @divmod(i64 %0, i64 %1, i64 %2, i32* %5, i32* %6, i64* %4)
%11 = load i64, i64* %4
%12 = load i32, i32* %6
%13 = call i64 @build_value(i64 %11, i32 %12)
ret i64 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int32_t;

/* Variables and functions */
u_int32_t read_long(u_int32_t *addr) { return *addr; }


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

x86 assembly (clang, -O2):
<read_long>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @read_long(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
void dev_flop5_reset(void *dev) {}


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

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

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

LLVM IR (-O2):
define void @dev_flop5_reset(i8* nocapture %0) {
ret void
}
long long st_maxll(long long x, long long y) { return x > y ? x : y; }


x86 assembly (clang, -O0):
<st_maxll>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1127 <st_maxll+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <st_maxll+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<st_maxll>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @st_maxll(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
void foo251() {}


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

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

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

LLVM IR (-O2):
define void @foo251() {
ret void
}
/* Variables and functions */
char *strncpy(char *dst, const char *src, size_t n) {
  char *temp = dst;
  while (n-- && (*dst++ = *src++))
    ;
  return temp;
}


x86 assembly (clang, -O0):
<strncpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rcx
mov    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x21(%rbp)
je     1164 <strncpy+0x64>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    1174 <strncpy+0x74>
jmp    1179 <strncpy+0x79>
jmp    1118 <strncpy+0x18>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
cmp    %rcx,%rdx
je     1126 <strncpy+0x26>
movzbl (%rsi,%rcx,1),%edi
mov    %dil,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dil,%dil
jne    1110 <strncpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strncpy(i8* returned writeonly %0, i8* nocapture %1, i64 %2) {
br label %4
4: ; preds = %9, %3
%5 = phi i8* [ %1, %3 ], [ %11, %9 ]
%6 = phi i64 [ %2, %3 ], [ %10, %9 ]
%7 = phi i8* [ %0, %3 ], [ %13, %9 ]
%8 = icmp eq i64 %6, 0
br i1 %8, label %15, label %9
9: ; preds = %4
%10 = add i64 %6, -1
%11 = getelementptr inbounds i8, i8* %5, i64 1
%12 = load i8, i8* %5
%13 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %12, i8* %7
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %9
ret i8* %0
}
int isqdigit(int c) {
  if ((c == '0') || (c == '1') || (c == '2') || (c == '3') || (c == '4') ||
      (c == '5') || (c == '6') || (c == '7')) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isqdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x30,-0x8(%rbp)
je     1157 <isqdigit+0x57>
cmpl   $0x31,-0x8(%rbp)
je     1157 <isqdigit+0x57>
cmpl   $0x32,-0x8(%rbp)
je     1157 <isqdigit+0x57>
cmpl   $0x33,-0x8(%rbp)
je     1157 <isqdigit+0x57>
cmpl   $0x34,-0x8(%rbp)
je     1157 <isqdigit+0x57>
cmpl   $0x35,-0x8(%rbp)
je     1157 <isqdigit+0x57>
cmpl   $0x36,-0x8(%rbp)
je     1157 <isqdigit+0x57>
cmpl   $0x37,-0x8(%rbp)
jne    1163 <isqdigit+0x63>
movl   $0x1,-0x4(%rbp)
jmp    116a <isqdigit+0x6a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isqdigit>:
and    $0xfffffff8,%edi
xor    %eax,%eax
cmp    $0x30,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isqdigit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 48
br i1 %5, label %27, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 49
br i1 %8, label %27, label %9
9: ; preds = %6
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 50
br i1 %11, label %27, label %12
12: ; preds = %9
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 51
br i1 %14, label %27, label %15
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, 52
br i1 %17, label %27, label %18
18: ; preds = %15
%19 = load i32, i32* %3
%20 = icmp eq i32 %19, 53
br i1 %20, label %27, label %21
21: ; preds = %18
%22 = load i32, i32* %3
%23 = icmp eq i32 %22, 54
br i1 %23, label %27, label %24
24: ; preds = %21
%25 = load i32, i32* %3
%26 = icmp eq i32 %25, 55
br i1 %26, label %27, label %28
27: ; preds = %24, %21, %18, %15, %12, %9, %6, %1
store i32 1, i32* %2
br label %29
28: ; preds = %24
store i32 0, i32* %2
br label %29
29: ; preds = %28, %27
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
define i32 @isqdigit(i32 %0) {
%2 = and i32 %0, -8
%3 = icmp eq i32 %2, 48
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ dlclose(void *);
void Sys_UnloadLibrary(void *handle) {
  if (handle != ((void *)0))
    dlclose(handle);
}


x86 assembly (clang, -O0):
<Sys_UnloadLibrary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <Sys_UnloadLibrary+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <dlclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sys_UnloadLibrary>:
test   %rdi,%rdi
je     111a <Sys_UnloadLibrary+0xa>
jmp    1030 <dlclose@plt>
ret

LLVM IR (-O0):
define void @Sys_UnloadLibrary(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @dlclose(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @Sys_UnloadLibrary(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @dlclose(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
int strncmp(char *, char *, int);
void strncmp_diff_length_0() {
  char *x = "12345";
  char *y = "234";
  clang_analyzer_eval(strncmp(x, y, 5) == -1);
}


x86 assembly (clang, -O0):
<strncmp_diff_length_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xecc(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
cmp    $0xffffffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncmp_diff_length_0>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed7(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
pop    %rax
jmp    1040 <clang_analyzer_eval@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"12345\00"
@.str.1 = [4 x i8] c"234\00"
define void @strncmp_diff_length_0() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %1
%4 = load i8*, i8** %2
%5 = call i32 @strncmp(i8* %3, i8* %4, i32 5)
%6 = icmp eq i32 %5, -1
%7 = zext i1 %6 to i32
%8 = call i32 @clang_analyzer_eval(i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"12345\00"
@.str.1 = [4 x i8] c"234\00"
define void @strncmp_diff_length_0() {
%1 = tail call i32 @strncmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 5)
%2 = icmp eq i32 %1, -1
%3 = zext i1 %2 to i32
%4 = tail call i32 @clang_analyzer_eval(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
size_t strlen(char *);
void strcat_strlen_Bad() {
  char str[20];
  strcpy(str, "abc");
  strcat(str, "defgh");
  int a[8];
  a[strlen(str)] = 0;
}


x86 assembly (clang, -O0):
<strcat_strlen_Bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x20(%rbp),%rdi
lea    0xebd(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x20(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1050 <strcat@plt>
lea    -0x20(%rbp),%rdi
call   1040 <strlen@plt>
movl   $0x0,-0x40(%rbp,%rax,4)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat_strlen_Bad>:
push   %rbx
sub    $0x20,%rsp
lea    0xed4(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xec6(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"abc\00"
@.str.1 = [6 x i8] c"defgh\00"
define void @strcat_strlen_Bad() {
%1 = alloca [20 x i8]
%2 = alloca [8 x i32]
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%6 = call i32 @strcat(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%8 = call i64 @strlen(i8* %7)
%9 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 %8
store i32 0, i32* %9
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"abc\00"
@.str.1 = [6 x i8] c"defgh\00"
define void @strcat_strlen_Bad() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @strcat(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}