xunge/DecIR huggingface dataset:
/* Variables and functions */
int gb_random_range_int(int /*<<< orphan*/, int);
float gb_random_range_float(float min_inc, float max_inc) {
  int int_result = gb_random_range_int(0, 2147483646);
  float result = int_result / (float)2147483646;
  result *= max_inc - min_inc;
  result += min_inc;
  return result;
}


x86 assembly (clang, -O0):
<gb_random_range_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
xor    %edi,%edi
mov    $0x7ffffffe,%esi
call   1030 <gb_random_range_int@plt>
mov    %eax,-0xc(%rbp)
cvtsi2ssl -0xc(%rbp),%xmm0
movss  0xec2(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gb_random_range_float>:
push   %rax
movss  %xmm1,0x4(%rsp)
movss  %xmm0,(%rsp)
xor    %edi,%edi
mov    $0x7ffffffe,%esi
call   1030 <gb_random_range_int@plt>
xorps  %xmm1,%xmm1
cvtsi2ss %eax,%xmm1
mulss  0xec9(%rip),%xmm1
movss  0x4(%rsp),%xmm0
movss  (%rsp),%xmm2
subss  %xmm2,%xmm0
mulss  %xmm1,%xmm0
addss  %xmm2,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @gb_random_range_float(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca i32
%6 = alloca float
store float %0, float* %3
store float %1, float* %4
%7 = call i32 @gb_random_range_int(i32 0, i32 2147483646)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = sitofp i32 %8 to float
%10 = fdiv float %9, 0x41E0000000000000
store float %10, float* %6
%11 = load float, float* %4
%12 = load float, float* %3
%13 = fsub float %11, %12
%14 = load float, float* %6
%15 = fmul float %14, %13
store float %15, float* %6
%16 = load float, float* %3
%17 = load float, float* %6
%18 = fadd float %17, %16
store float %18, float* %6
%19 = load float, float* %6
ret float %19
}

LLVM IR (-O2):
define float @gb_random_range_float(float %0, float %1) {
%3 = tail call i32 @gb_random_range_int(i32 0, i32 2147483646)
%4 = sitofp i32 %3 to float
%5 = fmul float %4, 0x3E00000000000000
%6 = fsub float %1, %0
%7 = fmul float %6, %5
%8 = fadd float %7, %0
ret float %8
}
unsigned long
str$match_wild_not(const struct dsc$descriptor_s *candidate_string,
                   const struct dsc$descriptor_s *pattern_string) {
  assert(0);
  return 2392148;
}


x86 assembly (clang, -O0):
<str$match_wild_not>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
mov    $0x0,%al
call   1030 <assert@plt>
mov    $0x248054,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str$match_wild_not>:
push   %rax
xor    %edi,%edi
xor    %eax,%eax
call   1030 <assert@plt>
mov    $0x248054,%eax
pop    %rcx
ret

LLVM IR (-O0):
%"struct.dsc$descriptor_s" = type opaque
define i64 @"str$match_wild_not"(%"struct.dsc$descriptor_s"* %0, %"struct.dsc$descriptor_s"* %1) {
%3 = alloca %"struct.dsc$descriptor_s"*
%4 = alloca %"struct.dsc$descriptor_s"*
store %"struct.dsc$descriptor_s"* %0, %"struct.dsc$descriptor_s"** %3
store %"struct.dsc$descriptor_s"* %1, %"struct.dsc$descriptor_s"** %4
%5 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 0)
ret i64 2392148
}

LLVM IR (-O2):
%"struct.dsc$descriptor_s" = type opaque
define i64 @"str$match_wild_not"(%"struct.dsc$descriptor_s"* nocapture readnone %0, %"struct.dsc$descriptor_s"* nocapture readnone %1) {
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 0)
ret i64 2392148
}
/* Variables and functions */
int /*<<< orphan*/ syscall_print(int, int /*<<< orphan*/, char *,
                                 int /*<<< orphan*/);
void print(char *str) { syscall_print(3, 0, str, 0); }


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x3,%edi
xor    %ecx,%ecx
mov    %ecx,%esi
call   1030 <syscall_print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
mov    %rdi,%rdx
mov    $0x3,%edi
xor    %esi,%esi
xor    %ecx,%ecx
jmp    1030 <syscall_print@plt>

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

LLVM IR (-O2):
define void @print(i8* %0) {
%2 = tail call i32 @syscall_print(i32 3, i32 0, i8* %0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug_break();
int /*<<< orphan*/ printf(char *);
int main() {
  debug_break();
  printf("hello world\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"hello world\00"
define i32 @main() {
%1 = tail call i32 (...) @debug_break()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int getuid();
unsigned geteuid(void) { return getuid(); }


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

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

LLVM IR (-O0):
define i32 @geteuid() {
%1 = call i32 (...) @getuid()
ret i32 %1
}

LLVM IR (-O2):
define i32 @geteuid() {
%1 = tail call i32 (...) @getuid()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_237() {
  Assert_real((isqrt(237) == 15),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              1190, ("Integer square root of 237 should be 15"));
}


x86 assembly (clang, -O0):
<t_sqrt_237>:
push   %rbp
mov    %rsp,%rbp
mov    $0xed,%edi
call   1030 <isqrt@plt>
cmp    $0xf,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x4a6,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_237>:
push   %rax
mov    $0xed,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xf,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x4a6,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 237 should be 15\00"
define void @t_sqrt_237() {
%1 = call i32 @isqrt(i32 237)
%2 = icmp eq i32 %1, 15
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1190, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 237 should be 15\00"
define void @t_sqrt_237() {
%1 = tail call i32 @isqrt(i32 237)
%2 = icmp eq i32 %1, 15
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1190, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ptr_free(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<ptr_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @ptr_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ll;

/* Variables and functions */
int /*<<< orphan*/ memcpy(double *, long long *, int);
double fb_CVDFROMLONGINT(long long ll) {
  do {
    if ((8) == sizeof(ll) && (8) == sizeof(double)) {
      double to;
      memcpy(&to, &ll, 8);
      return to;
    } else {
      return (double)0;
    }
  } while (0);
}


x86 assembly (clang, -O0):
<fb_CVDFROMLONGINT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x8,%edx
call   1030 <memcpy@plt>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_CVDFROMLONGINT>:
sub    $0x18,%rsp
mov    %rdi,0x10(%rsp)
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
mov    $0x8,%edx
call   1030 <memcpy@plt>
movsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @fb_CVDFROMLONGINT(i64 %0) {
%2 = alloca i64
%3 = alloca double
store i64 %0, i64* %2
br label %4
4: ; preds = %1
%5 = call i32 @memcpy(double* %3, i64* %2, i32 8)
%6 = load double, double* %3
br label %7
7: ; preds = %4
ret double %6
}

LLVM IR (-O2):
define double @fb_CVDFROMLONGINT(i64 %0) {
%2 = alloca i64
%3 = alloca double
store i64 %0, i64* %2
%4 = bitcast double* %3 to i8*
%5 = call i32 @memcpy(double* %3, i64* %2, i32 8)
%6 = load double, double* %3
ret double %6
}
char Up(char c) { return ('a' <= c && c <= 'z') ? c - 32 : c; }


x86 assembly (clang, -O0):
<Up>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x61,%eax
cmp    %ecx,%eax
jg     1137 <Up+0x37>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
jg     1137 <Up+0x37>
movsbl -0x1(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    113e <Up+0x3e>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Up>:
lea    -0x61(%rdi),%eax
lea    -0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @Up(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sle i32 97, %4
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = sub nsw i32 %12, 32
br label %17
14: ; preds = %6, %1
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
br label %17
17: ; preds = %14, %10
%18 = phi i32 [ %13, %10 ], [ %16, %14 ]
%19 = trunc i32 %18 to i8
ret i8 %19
}

LLVM IR (-O2):
define signext i8 @Up(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, -32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void disp_help() {
  fprintf(stdout, "Implementation of OAEP-mode RSA encryption (rfc3447). This "
                  "program can be\n");
  fprintf(stdout, "used to generate a (private, public) key pair and "
                  "encrypt/decrypt arbitrary\n");
  fprintf(stdout, "files.\n\n");
}


x86 assembly (clang, -O0):
<disp_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xf12(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
lea    0xf4a(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<disp_help>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf1c(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf5b(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [75 x i8] c"Implementation of OAEP-mode RSA encryption (rfc3447). This program can be\0A\00"
@.str.1 = [77 x i8] c"used to generate a (private, public) key pair and encrypt/decrypt arbitrary\0A\00"
@.str.2 = [9 x i8] c"files.\0A\0A\00"
define void @disp_help() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stdout
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [75 x i8] c"Implementation of OAEP-mode RSA encryption (rfc3447). This program can be\0A\00"
@.str.1 = [77 x i8] c"used to generate a (private, public) key pair and encrypt/decrypt arbitrary\0A\00"
@.str.2 = [9 x i8] c"files.\0A\0A\00"
define void @disp_help() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stdout
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
char const *fixit(char const *, char const *);
const char *fixtype(const char *type) { return (fixit(type, type)); }


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

x86 assembly (clang, -O2):
<fixtype>:
mov    %rdi,%rsi
jmp    1030 <fixit@plt>

LLVM IR (-O0):
define i8* @fixtype(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @fixit(i8* %3, i8* %4)
ret i8* %5
}

LLVM IR (-O2):
define i8* @fixtype(i8* %0) {
%2 = tail call i8* @fixit(i8* %0, i8* %0)
ret i8* %2
}
/* Variables and functions */
scalar_t__ strchr(char const *, int);
int isspace(int c) {
  const char space[] = " \f\n\r\t\v";
  return strchr(space, c) ? 1 : 0;
}


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0xedf(%rip),%eax
mov    %eax,-0xb(%rbp)
mov    0xed9(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xed1(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0xb(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
push   %rax
mov    %edi,%esi
movl   $0xb090d,0x3(%rsp)
movl   $0xd0a0c20,(%rsp)
mov    %rsp,%rdi
call   1030 <strchr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.isspace.space = [7 x i8] c" \0C\0A\0D\09\0B\00"
define i32 @isspace(i32 %0) {
%2 = alloca i32
%3 = alloca [7 x i8]
store i32 %0, i32* %2
%4 = bitcast [7 x i8]* %3 to i8*
%5 = getelementptr inbounds [7 x i8], [7 x i8]* %3, i64 0, i64 0
%6 = load i32, i32* %2
%7 = call i64 @strchr(i8* %5, i32 %6)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 1, i32 0
ret i32 %10
}

LLVM IR (-O2):
@__const.isspace.space = [7 x i8] c" \0C\0A\0D\09\0B\00"
define i32 @isspace(i32 %0) {
%2 = alloca [7 x i8]
%3 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%4 = call i64 @strchr(i8* %3, i32 %0)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int strlen(char *);
char *skipname(char *p) {
  int n = strlen(p) + 1;
  p += n;
  if (n &= 3)
    p += 4 - n;
  return (p);
}


x86 assembly (clang, -O0):
<skipname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
and    $0x3,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     1164 <skipname+0x54>
mov    $0x4,%ecx
sub    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipname>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
add    %rax,%rbx
add    $0x1,%eax
and    $0x3,%eax
mov    $0x4,%ecx
sub    %eax,%ecx
test   %eax,%eax
cmove  %eax,%ecx
lea    (%rcx,%rbx,1),%rax
add    $0x1,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @skipname(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = and i32 %3, 3
%7 = icmp eq i32 %6, 0
%8 = sub nuw nsw i32 4, %6
%9 = select i1 %7, i32 0, i32 %8
%10 = zext i32 %9 to i64
%11 = getelementptr i8, i8* %5, i64 %10
ret i8* %11
}
void perf_measure_ipc(void) {}


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

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

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

LLVM IR (-O2):
define void @perf_measure_ipc() {
ret void
}
void PWMGenIntClear(unsigned long ulBase, unsigned long ulGen,
                    unsigned long ulInts) {
  ;
  ;

  ;
  (*((volatile unsigned long *)(((ulBase) + (ulGen)) + 0x0000000C))) = ulInts;
}


x86 assembly (clang, -O0):
<PWMGenIntClear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rcx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMGenIntClear>:
mov    %rdx,0xc(%rdi,%rsi,1)
ret

LLVM IR (-O0):
define void @PWMGenIntClear(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = load i64, i64* %4
%9 = load i64, i64* %5
%10 = add i64 %8, %9
%11 = add i64 %10, 12
%12 = inttoptr i64 %11 to i64*
store volatile i64 %7, i64* %12
ret void
}

LLVM IR (-O2):
define void @PWMGenIntClear(i64 %0, i64 %1, i64 %2) {
%4 = add i64 %0, 12
%5 = add i64 %4, %1
%6 = inttoptr i64 %5 to i64*
store volatile i64 %2, i64* %6
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_loadu_si128(int /*<<< orphan*/ const *);
int /*<<< orphan*/ _mm_storeu_si128(int /*<<< orphan*/ *, int /*<<< orphan*/);
void rte_mov16(uint8_t *dst, const uint8_t *src) {
  __m128i xmm0;
  xmm0 = _mm_loadu_si128((const __m128i *)(const __m128i *)src);
  _mm_storeu_si128((__m128i *)dst, xmm0);
}


x86 assembly (clang, -O0):
<rte_mov16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <_mm_loadu_si128@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <_mm_storeu_si128@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rte_mov16>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <_mm_loadu_si128@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <_mm_storeu_si128@plt>

LLVM IR (-O0):
define void @rte_mov16(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** %4
%7 = call i32 @_mm_loadu_si128(i32* %6)
store i32 %7, i32* %5
%8 = load i32*, i32** %3
%9 = load i32, i32* %5
%10 = call i32 @_mm_storeu_si128(i32* %8, i32 %9)
ret void
}

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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ gen_lohi_caps(int /*<<< orphan*/ *, int);
void gen_reg_glb_lohi(FILE *outfile, char *regname, int lohi, int dim) {
  fprintf(outfile, "_REG_GLOB_");
  gen_lohi_caps(outfile, lohi);
  fprintf(outfile, "(%s, %d)", regname, dim);
}


x86 assembly (clang, -O0):
<gen_reg_glb_lohi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xebf(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <gen_lohi_caps@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%ecx
lea    0xea5(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_reg_glb_lohi>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0xeb7(%rip),%rdi
mov    $0xa,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <gen_lohi_caps@plt>
lea    0xe9f(%rip),%rsi
mov    %rbx,%rdi
mov    %r15,%rdx
mov    %r14d,%ecx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"_REG_GLOB_\00"
@.str.1 = [9 x i8] c"(%s, %d)\00"
define void @gen_reg_glb_lohi(i32* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%11 = load i32*, i32** %5
%12 = load i32, i32* %7
%13 = call i32 @gen_lohi_caps(i32* %11, i32 %12)
%14 = load i32*, i32** %5
%15 = load i8*, i8** %6
%16 = load i32, i32* %8
%17 = call i32 (i32*, i8*, ...) @fprintf(i32* %14, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %15, i32 %16)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"_REG_GLOB_\00"
@.str.1 = [9 x i8] c"(%s, %d)\00"
define void @gen_reg_glb_lohi(i32* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i64 @fwrite(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i64 10, i64 1, i32* %0)
%6 = tail call i32 @gen_lohi_caps(i32* %0, i32 %2)
%7 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %1, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int add(int a, int b) {
  printf("calculator_basic::add() called!\n");
  int sum = a;
  int i;
  for (i = 0; i < b; ++i) {
    ++sum;
  }
  return sum;
}


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    115a <add+0x4a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1137 <add+0x27>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
test   %ebx,%ebx
cmovns %ebx,%eax
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [33 x i8] c"calculator_basic::add() called!\0A\00"
define i32 @add(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %3
store i32 %8, i32* %5
store i32 0, i32* %6
br label %9
9: ; preds = %16, %2
%10 = load i32, i32* %6
%11 = load i32, i32* %4
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %19
13: ; preds = %9
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
store i32 %15, i32* %5
br label %16
16: ; preds = %13
%17 = load i32, i32* %6
%18 = add nsw i32 %17, 1
store i32 %18, i32* %6
br label %9
19: ; preds = %9
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
@str = [32 x i8] c"calculator_basic::add() called!\00"
define i32 @add(i32 %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%4 = icmp sgt i32 %1, 0
%5 = select i1 %4, i32 %1, i32 0
%6 = add i32 %5, %0
ret i32 %6
}
/* Variables and functions */
double quagno_(double *, double *);
double cquagno(double *f, double *para) { return quagno_(f, para); }


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

x86 assembly (clang, -O2):
<cquagno>:
jmp    1030 <quagno_@plt>

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

LLVM IR (-O2):
define double @cquagno(double* %0, double* %1) {
%3 = tail call double @quagno_(double* %0, double* %1)
ret double %3
}
void stop_syscall() {}


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

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

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

LLVM IR (-O2):
define void @stop_syscall() {
ret void
}
unsigned long umax(unsigned long a, unsigned long b) { return a > b ? a : b; }


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

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

LLVM IR (-O0):
define i64 @umax(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 ugt 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 @umax(i64 %0, i64 %1) {
%3 = icmp ugt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int get_accumulated_throttled_time(int /*<<< orphan*/, int, double *);
int /*<<< orphan*/ pp0_node_to_cpu(int /*<<< orphan*/);
int get_pp0_accumulated_throttled_time(
    uint64_t node, double *accumulated_throttled_time_seconds) {
  uint64_t cpu = pp0_node_to_cpu(node);
  return get_accumulated_throttled_time(cpu, 0x63b,
                                        accumulated_throttled_time_seconds);
}


x86 assembly (clang, -O0):
<get_pp0_accumulated_throttled_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <pp0_node_to_cpu@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    $0x63b,%esi
call   1030 <get_accumulated_throttled_time@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pp0_accumulated_throttled_time>:
push   %rbx
mov    %rsi,%rbx
call   1040 <pp0_node_to_cpu@plt>
mov    %eax,%edi
mov    $0x63b,%esi
mov    %rbx,%rdx
pop    %rbx
jmp    1030 <get_accumulated_throttled_time@plt>

LLVM IR (-O0):
define i32 @get_pp0_accumulated_throttled_time(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i32
store i32 %0, i32* %3
store double* %1, double** %4
%6 = load i32, i32* %3
%7 = call i32 @pp0_node_to_cpu(i32 %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load double*, double** %4
%10 = call i32 @get_accumulated_throttled_time(i32 %8, i32 1595, double* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @get_pp0_accumulated_throttled_time(i32 %0, double* %1) {
%3 = tail call i32 @pp0_node_to_cpu(i32 %0)
%4 = tail call i32 @get_accumulated_throttled_time(i32 %3, i32 1595, double* %1)
ret i32 %4
}
unsigned int ft_llonglen(long long nbr) {
  unsigned int len;
  len = (nbr < 0) ? 2 : 1;
  while (nbr < -9 || nbr > 9) {
    nbr /= 10;
    len++;
  }
  return (len);
}


x86 assembly (clang, -O0):
<ft_llonglen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x1,%eax
mov    $0x2,%ecx
cmp    $0x0,%rdx
cmovl  %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    $0x1,%al
cmpq   $0xfffffffffffffff7,-0x8(%rbp)
mov    %al,-0xd(%rbp)
jl     113b <ft_llonglen+0x3b>
cmpq   $0x9,-0x8(%rbp)
setg   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    114b <ft_llonglen+0x4b>
jmp    116b <ft_llonglen+0x6b>
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1120 <ft_llonglen+0x20>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_llonglen>:
mov    %rdi,%rcx
shr    $0x3f,%rcx
add    $0x1,%ecx
lea    -0xa(%rdi),%rdx
cmp    $0xffffffffffffffec,%rdx
ja     1152 <ft_llonglen+0x52>
mov    %rdi,%rax
movabs $0x6666666666666667,%rsi
66 66 66
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
imul   %rsi
mov    %rdx,%rdi
shr    $0x3f,%rdi
sar    $0x2,%rdx
lea    (%rdx,%rdi,1),%rax
add    $0x1,%ecx
add    %rdi,%rdx
add    $0xfffffffffffffff6,%rdx
cmp    $0xffffffffffffffed,%rdx
jb     1130 <ft_llonglen+0x30>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ft_llonglen(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = icmp slt i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 2, i32 1
store i32 %7, i32* %3
br label %8
8: ; preds = %16, %1
%9 = load i64, i64* %2
%10 = icmp slt i64 %9, -9
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = load i64, i64* %2
%13 = icmp sgt i64 %12, 9
br label %14
14: ; preds = %11, %8
%15 = phi i1 [ true, %8 ], [ %13, %11 ]
br i1 %15, label %16, label %21
16: ; preds = %14
%17 = load i64, i64* %2
%18 = sdiv i64 %17, 10
store i64 %18, i64* %2
%19 = load i32, i32* %3
%20 = add i32 %19, 1
store i32 %20, i32* %3
br label %8
21: ; preds = %14
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @ft_llonglen(i64 %0) {
%2 = icmp slt i64 %0, 0
%3 = select i1 %2, i32 2, i32 1
%4 = add i64 %0, -10
%5 = icmp ult i64 %4, -19
br i1 %5, label %6, label %13
6: ; preds = %1, %6
%7 = phi i32 [ %10, %6 ], [ %3, %1 ]
%8 = phi i64 [ %9, %6 ], [ %0, %1 ]
%9 = sdiv i64 %8, 10
%10 = add i32 %7, 1
%11 = add nsw i64 %9, -10
%12 = icmp ult i64 %11, -19
br i1 %12, label %6, label %13
13: ; preds = %6, %1
%14 = phi i32 [ %3, %1 ], [ %10, %6 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ ispoweroftwo(int);
int main() {
  ispoweroftwo(4);
  ispoweroftwo(128);
  ispoweroftwo(25000);
  ispoweroftwo(999);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
call   1030 <ispoweroftwo@plt>
mov    $0x80,%edi
call   1030 <ispoweroftwo@plt>
mov    $0x61a8,%edi
call   1030 <ispoweroftwo@plt>
mov    $0x3e7,%edi
call   1030 <ispoweroftwo@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1030 <ispoweroftwo@plt>
mov    $0x80,%edi
call   1030 <ispoweroftwo@plt>
mov    $0x61a8,%edi
call   1030 <ispoweroftwo@plt>
mov    $0x3e7,%edi
call   1030 <ispoweroftwo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @ispoweroftwo(i32 4)
%2 = call i32 @ispoweroftwo(i32 128)
%3 = call i32 @ispoweroftwo(i32 25000)
%4 = call i32 @ispoweroftwo(i32 999)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @ispoweroftwo(i32 4)
%2 = tail call i32 @ispoweroftwo(i32 128)
%3 = tail call i32 @ispoweroftwo(i32 25000)
%4 = tail call i32 @ispoweroftwo(i32 999)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ e_tax();
void e_tax_accu() { e_tax(); }


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

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

LLVM IR (-O0):
define void @e_tax_accu() {
%1 = call i32 (...) @e_tax()
ret void
}

LLVM IR (-O2):
define void @e_tax_accu() {
%1 = tail call i32 (...) @e_tax()
ret void
}
void g_string_sized_new() {}


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

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

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

LLVM IR (-O2):
define void @g_string_sized_new() {
ret void
}
unsigned long sign_extend(unsigned long val, unsigned int size) {
  unsigned long mask;
  if (size >= sizeof(unsigned long) * 8)
    return val;
  mask = 1U << (size - 1);
  return (val ^ mask) - mask;
}


x86 assembly (clang, -O0):
<sign_extend>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    $0x40,%rax
jb     1125 <sign_extend+0x25>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1148 <sign_extend+0x48>
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%eax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
xor    -0x20(%rbp),%rax
sub    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign_extend>:
lea    -0x1(%rsi),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %rdx,%rax
xor    %rdi,%rax
sub    %rdx,%rax
cmp    $0x40,%esi
cmovae %rdi,%rax
ret

LLVM IR (-O0):
define i64 @sign_extend(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
%6 = alloca i64
store i64 %0, i64* %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = zext i32 %7 to i64
%9 = icmp uge i64 %8, 64
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i64, i64* %4
store i64 %11, i64* %3
br label %22
12: ; preds = %2
%13 = load i32, i32* %5
%14 = sub i32 %13, 1
%15 = shl i32 1, %14
%16 = zext i32 %15 to i64
store i64 %16, i64* %6
%17 = load i64, i64* %4
%18 = load i64, i64* %6
%19 = xor i64 %17, %18
%20 = load i64, i64* %6
%21 = sub i64 %19, %20
store i64 %21, i64* %3
br label %22
22: ; preds = %12, %10
%23 = load i64, i64* %3
ret i64 %23
}

LLVM IR (-O2):
define i64 @sign_extend(i64 %0, i32 %1) {
%3 = icmp ugt i32 %1, 63
%4 = add i32 %1, -1
%5 = shl nuw i32 1, %4
%6 = zext i32 %5 to i64
%7 = xor i64 %6, %0
%8 = sub i64 %7, %6
%9 = select i1 %3, i64 %0, i64 %8
ret i64 %9
}
char *foo(unsigned size) {
  static char buf[32];
  register int i;
  if (size > 31)
    size = 31;
  for (i = 0; i < size; i++) {
    buf[i] = ' ';
  }
  buf[size] = '\0';
  return buf;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x1f,-0x4(%rbp)
jbe    1118 <foo+0x18>
movl   $0x1f,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    1148 <foo+0x48>
movslq -0x8(%rbp),%rcx
lea    0x2efa(%rip),%rax
movb   $0x20,(%rax,%rcx,1)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111f <foo+0x1f>
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
lea    0x2edc(%rip),%rax
movb   $0x0,(%rax,%rcx,1)
lea    0x2ed1(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
cmp    $0x1f,%edi
mov    $0x1f,%eax
cmovb  %edi,%eax
test   %eax,%eax
je     1138 <foo+0x28>
mov    %eax,%ebx
lea    0x2f17(%rip),%rdi
mov    $0x20,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
jmp    113a <foo+0x2a>
xor    %ebx,%ebx
lea    0x2eff(%rip),%rax
movb   $0x0,(%rbx,%rax,1)
pop    %rbx
ret

LLVM IR (-O0):
@foo.buf = internal global [32 x i8] zeroinitializer
define i8* @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp ugt i32 %4, 31
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 31, i32* %2
br label %7
7: ; preds = %6, %1
store i32 0, i32* %3
br label %8
8: ; preds = %16, %7
%9 = load i32, i32* %3
%10 = load i32, i32* %2
%11 = icmp ult i32 %9, %10
br i1 %11, label %12, label %19
12: ; preds = %8
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [32 x i8], [32 x i8]* @foo.buf, i64 0, i64 %14
store i8 32, i8* %15
br label %16
16: ; preds = %12
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %8
19: ; preds = %8
%20 = load i32, i32* %2
%21 = zext i32 %20 to i64
%22 = getelementptr inbounds [32 x i8], [32 x i8]* @foo.buf, i64 0, i64 %21
store i8 0, i8* %22
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @foo.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@foo.buf = internal global [32 x i8] zeroinitializer
define i8* @foo(i32 %0) {
%2 = icmp ult i32 %0, 31
%3 = select i1 %2, i32 %0, i32 31
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = zext i32 %3 to i64
br label %7
7: ; preds = %1, %5
%8 = phi i64 [ %6, %5 ], [ 0, %1 ]
%9 = getelementptr inbounds [32 x i8], [32 x i8]* @foo.buf, i64 0, i64 %8
store i8 0, i8* %9
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @foo.buf, i64 0, i64 0)
}
int cycle_is_fetch_ba(unsigned int flags) {
  return (flags & 0x00000100) ? 1 : 0;
}


x86 assembly (clang, -O0):
<cycle_is_fetch_ba>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x100,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cycle_is_fetch_ba>:
mov    %edi,%eax
shr    $0x8,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @cycle_is_fetch_ba(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 256
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 1, i32 0
ret i32 %7
}

LLVM IR (-O2):
define i32 @cycle_is_fetch_ba(i32 %0) {
%2 = lshr i32 %0, 8
%3 = and i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ifreeTouch(int **);
int /*<<< orphan*/ ifreeTouch2(int ***);
void ifree_2D(int **x, int N) {
  int i;
  for (i = 0; i < N; i++) {
    ifreeTouch((x + i));
  }
  ifreeTouch2(&x);
  return;
}


x86 assembly (clang, -O0):
<ifree_2D>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1164 <ifree_2D+0x44>
mov    -0x8(%rbp),%rdi
movslq -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
call   1040 <ifreeTouch@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <ifree_2D+0x16>
lea    -0x8(%rbp),%rdi
call   1030 <ifreeTouch2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ifree_2D>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,(%rsp)
test   %esi,%esi
jle    1152 <ifree_2D+0x32>
mov    %rdi,%rbx
mov    %esi,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1040 <ifreeTouch@plt>
add    $0x8,%rbx
add    $0xffffffffffffffff,%r14
jne    1140 <ifree_2D+0x20>
mov    %rsp,%rdi
call   1030 <ifreeTouch2@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @ifree_2D(i32** %0, i32 %1) {
%3 = alloca i32**
store i32** %0, i32*** %3
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %13
5: ; preds = %2
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %11, %7 ]
%9 = getelementptr inbounds i32*, i32** %0, i64 %8
%10 = tail call i32 @ifreeTouch(i32** %9)
%11 = add nuw nsw i64 %8, 1
%12 = icmp eq i64 %11, %6
br i1 %12, label %13, label %7
13: ; preds = %7, %2
%14 = call i32 @ifreeTouch2(i32*** %3)
ret void
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
double ttod(struct timespec *t) {
  return (double)((double)t->tv_sec) +
         ((double)t->tv_nsec / (double)1000000000);
}


x86 assembly (clang, -O0):
<ttod>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2sdq 0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
cvtsi2sdq (%rax),%xmm1
movsd  0xedd(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ttod>:
cvtsi2sdq 0x8(%rdi),%xmm1
cvtsi2sdq (%rdi),%xmm0
divsd  0xeed(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define double @ttod(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load %struct.timespec*, %struct.timespec** %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = load %struct.timespec*, %struct.timespec** %2
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 0
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = fdiv double %10, 1.000000e+09
%12 = fadd double %6, %11
ret double %12
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define double @ttod(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%3 = load i64, i64* %2
%4 = sitofp i64 %3 to double
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = fdiv double %7, 1.000000e+09
%9 = fadd double %8, %4
ret double %9
}
void sdr_threads_debug(int enabled) {}


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

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

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

LLVM IR (-O2):
define void @sdr_threads_debug(i32 %0) {
ret void
}
void UserNonSelfEventQueueEmptyCalloutf(void) {}


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

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

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

LLVM IR (-O2):
define void @UserNonSelfEventQueueEmptyCalloutf() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __mriPlatform_LeavingDebugger();
int /*<<< orphan*/ __mriPlatform_LeavingDebuggerHook();
int /*<<< orphan*/ clearFirstExceptionFlag();
void prepareForDebuggerExit(void) {
  __mriPlatform_LeavingDebugger();
  __mriPlatform_LeavingDebuggerHook();
  clearFirstExceptionFlag();
}


x86 assembly (clang, -O0):
<prepareForDebuggerExit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <__mriPlatform_LeavingDebugger@plt>
mov    $0x0,%al
call   1050 <__mriPlatform_LeavingDebuggerHook@plt>
mov    $0x0,%al
call   1030 <clearFirstExceptionFlag@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<prepareForDebuggerExit>:
push   %rax
xor    %eax,%eax
call   1040 <__mriPlatform_LeavingDebugger@plt>
xor    %eax,%eax
call   1050 <__mriPlatform_LeavingDebuggerHook@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <clearFirstExceptionFlag@plt>

LLVM IR (-O0):
define void @prepareForDebuggerExit() {
%1 = call i32 (...) @__mriPlatform_LeavingDebugger()
%2 = call i32 (...) @__mriPlatform_LeavingDebuggerHook()
%3 = call i32 (...) @clearFirstExceptionFlag()
ret void
}

LLVM IR (-O2):
define void @prepareForDebuggerExit() {
%1 = tail call i32 (...) @__mriPlatform_LeavingDebugger()
%2 = tail call i32 (...) @__mriPlatform_LeavingDebuggerHook()
%3 = tail call i32 (...) @clearFirstExceptionFlag()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int pthread_create(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                   void *(*)(void *), void *);
void safe_pthread_create(pthread_t *thread, const pthread_attr_t *attr,
                         void *(*start_routine)(void *), void *arg) {
  int rv = pthread_create(thread, attr, start_routine, arg);
  if (rv != 0) {
    printf("ERROR: unable to create new thread.\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<safe_pthread_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1040 <pthread_create@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     1180 <safe_pthread_create+0x50>
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_pthread_create>:
push   %rax
call   1040 <pthread_create@plt>
test   %eax,%eax
jne    113c <safe_pthread_create+0xc>
pop    %rax
ret
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"ERROR: unable to create new thread.\0A\00"
define void @safe_pthread_create(i32* %0, i32* %1, i8* (i8*)* %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i8* (i8*)*
%8 = alloca i8*
%9 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i8* (i8*)* %2, i8* (i8*)** %7
store i8* %3, i8** %8
%10 = load i32*, i32** %5
%11 = load i32*, i32** %6
%12 = load i8* (i8*)*, i8* (i8*)** %7
%13 = load i8*, i8** %8
%14 = call i32 @pthread_create(i32* %10, i32* %11, i8* (i8*)* %12, i8* %13)
store i32 %14, i32* %9
%15 = load i32, i32* %9
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %4
%18 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%19 = call i32 @exit(i32 1)
unreachable
20: ; preds = %4
ret void
}

LLVM IR (-O2):
@str = [36 x i8] c"ERROR: unable to create new thread.\00"
define void @safe_pthread_create(i32* %0, i32* %1, i8* (i8*)* %2, i8* %3) {
%5 = tail call i32 @pthread_create(i32* %0, i32* %1, i8* (i8*)* %2, i8* %3)
%6 = icmp eq i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %4
ret void
}