xunge/DecIR huggingface dataset:
/* Variables and functions */
float NormalDistributionIntegral(int, int, float);
float IntervalOverlapProbability(int len1, int len2, int sep_mean,
                                 float sep_sd) {
  return (NormalDistributionIntegral(len1, sep_mean, sep_sd) +
          NormalDistributionIntegral(len2, -sep_mean, sep_sd) - 1);
}


x86 assembly (clang, -O0):
<IntervalOverlapProbability>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movss  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
movss  -0x10(%rbp),%xmm0
call   1030 <NormalDistributionIntegral@plt>
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%edi
xor    %esi,%esi
sub    -0xc(%rbp),%esi
movss  -0x10(%rbp),%xmm0
call   1030 <NormalDistributionIntegral@plt>
movaps %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
addss  %xmm1,%xmm0
movss  0xe9f(%rip),%xmm1
subss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IntervalOverlapProbability>:
push   %rbp
push   %rbx
push   %rax
movss  %xmm0,(%rsp)
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edx,%esi
call   1030 <NormalDistributionIntegral@plt>
movss  %xmm0,0x4(%rsp)
neg    %ebx
mov    %ebp,%edi
mov    %ebx,%esi
movss  (%rsp),%xmm0
call   1030 <NormalDistributionIntegral@plt>
addss  0x4(%rsp),%xmm0
addss  0xeb9(%rip),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define float @IntervalOverlapProbability(i32 %0, i32 %1, i32 %2, float %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca float
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store float %3, float* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %7
%11 = load float, float* %8
%12 = call float @NormalDistributionIntegral(i32 %9, i32 %10, float %11)
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = sub nsw i32 0, %14
%16 = load float, float* %8
%17 = call float @NormalDistributionIntegral(i32 %13, i32 %15, float %16)
%18 = fadd float %12, %17
%19 = fsub float %18, 1.000000e+00
ret float %19
}

LLVM IR (-O2):
define float @IntervalOverlapProbability(i32 %0, i32 %1, i32 %2, float %3) {
%5 = tail call float @NormalDistributionIntegral(i32 %0, i32 %2, float %3)
%6 = sub nsw i32 0, %2
%7 = tail call float @NormalDistributionIntegral(i32 %1, i32 %6, float %3)
%8 = fadd float %5, %7
%9 = fadd float %8, -1.000000e+00
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, void *);
void *sbrk(int /*<<< orphan*/);
int check_mem_leak(char *where) {
  void *addr;
  addr = sbrk(0);
  printf("\tsbrk(0) %s: addr = %u\n", where, addr);
}


x86 assembly (clang, -O0):
<check_mem_leak>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
xor    %edi,%edi
call   1040 <sbrk@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_mem_leak>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <sbrk@plt>
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"\09sbrk(0) %s: addr = %u\0A\00"
define i32 @check_mem_leak(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = call i8* @sbrk(i32 0)
store i8* %5, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
@.str = [24 x i8] c"\09sbrk(0) %s: addr = %u\0A\00"
define i32 @check_mem_leak(i8* %0) {
%2 = tail call i8* @sbrk(i32 0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %2)
ret i32 undef
}
/* Variables and functions */
int recv(int, char *, int, int /*<<< orphan*/);
int receiveConfirmMsg(int sock) {
  char msg[2000];
  int read_size = recv(sock, msg, 2000, 0);
  return read_size;
}


x86 assembly (clang, -O0):
<receiveConfirmMsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7f0,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x7e0(%rbp),%rsi
mov    $0x7d0,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0x7e4(%rbp)
mov    -0x7e4(%rbp),%eax
add    $0x7f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<receiveConfirmMsg>:
sub    $0x7d8,%rsp
mov    %rsp,%rsi
mov    $0x7d0,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
add    $0x7d8,%rsp
ret

LLVM IR (-O0):
define i32 @receiveConfirmMsg(i32 %0) {
%2 = alloca i32
%3 = alloca [2000 x i8]
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = getelementptr inbounds [2000 x i8], [2000 x i8]* %3, i64 0, i64 0
%7 = call i32 @recv(i32 %5, i8* %6, i32 2000, i32 0)
store i32 %7, i32* %4
%8 = load i32, i32* %4
ret i32 %8
}

LLVM IR (-O2):
define i32 @receiveConfirmMsg(i32 %0) {
%2 = alloca [2000 x i8]
%3 = getelementptr inbounds [2000 x i8], [2000 x i8]* %2, i64 0, i64 0
%4 = call i32 @recv(i32 %0, i8* %3, i32 2000, i32 0)
ret i32 %4
}
int main(int argc, char *argv[]) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
jmp    1112 <main+0x12>

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %6
6: ; preds = %2, %6
br label %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ Proc0();
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ pass(char *);
int /*<<< orphan*/ stdout;
main() {
  Proc0();
  pass("struct");
  fflush(stdout);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <Proc0@plt>
lea    0xeb3(%rip),%rdi
call   1030 <pass@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <Proc0@plt>
lea    0xec1(%rip),%rdi
call   1030 <pass@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"struct\00"
@stdout = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @Proc0()
%3 = call i32 @pass(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = call i32 @fflush(i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"struct\00"
@stdout = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @Proc0()
%2 = tail call i32 @pass(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bprintf(char *, size_t, char *, char *, char *);
int strlen(char *);
char *xalloc(size_t);
char *strjoin(char *u, char *v) {
  size_t n;
  char *s;
  n = strlen(u) + strlen(v) + 1;
  s = xalloc(n);
  bprintf(s, n + 1, "%s%s", u, v);
  return s;
}


x86 assembly (clang, -O0):
<strjoin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
add    %ecx,%eax
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <xalloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x1,%rsi
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
lea    0xe73(%rip),%rdx
call   1040 <bprintf@plt>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strjoin>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <strlen@plt>
mov    %eax,%ebx
mov    %r14,%rdi
call   1030 <strlen@plt>
add    %ebx,%eax
add    $0x1,%eax
movslq %eax,%rbx
mov    %rbx,%rdi
call   1050 <xalloc@plt>
mov    %rax,%r12
add    $0x1,%rbx
lea    0xe95(%rip),%rdx
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r15,%rcx
mov    %r14,%r8
call   1040 <bprintf@plt>
mov    %r12,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%s%s\00"
define i8* @strjoin(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = load i8*, i8** %4
%10 = call i32 @strlen(i8* %9)
%11 = add nsw i32 %8, %10
%12 = add nsw i32 %11, 1
%13 = sext i32 %12 to i64
store i64 %13, i64* %5
%14 = load i64, i64* %5
%15 = call i8* @xalloc(i64 %14)
store i8* %15, i8** %6
%16 = load i8*, i8** %6
%17 = load i64, i64* %5
%18 = add i64 %17, 1
%19 = load i8*, i8** %3
%20 = load i8*, i8** %4
%21 = call i32 @bprintf(i8* %16, i64 %18, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %19, i8* %20)
%22 = load i8*, i8** %6
ret i8* %22
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s%s\00"
define i8* @strjoin(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = add i32 %3, 1
%6 = add i32 %5, %4
%7 = sext i32 %6 to i64
%8 = tail call i8* @xalloc(i64 %7)
%9 = add nsw i64 %7, 1
%10 = tail call i32 @bprintf(i8* %8, i64 %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret i8* %8
}
/* Type definitions */
typedef scalar_t__ __m128d;

/* Variables and functions */
__m128d __attribute__((__always___, __nodebug__))
_mm_sub_pd(__m128d a, __m128d b) {
  return a - b;
}


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

x86 assembly (clang, -O2):
<_mm_sub_pd>:
mov    %rdi,%rax
sub    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @_mm_sub_pd(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 = sub nsw i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @_mm_sub_pd(i64 %0, i64 %1) {
%3 = sub nsw i64 %0, %1
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf2(char *, int);
void GenNumLabel(int Label) { printf2("$L%d:\n", Label); }


x86 assembly (clang, -O0):
<GenNumLabel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GenNumLabel>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf2@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"$L%d:\0A\00"
define void @GenNumLabel(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf2(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"$L%d:\0A\00"
define void @GenNumLabel(i32 %0) {
%2 = tail call i32 @printf2(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
struct crypt_data {
  scalar_t__ initialized;
};
typedef int /*<<< orphan*/ salt;

/* Variables and functions */
int /*<<< orphan*/ create_salt(unsigned char *, int);
int /*<<< orphan*/ crypt_r(char *, char *, struct crypt_data *);
char *strdup(int /*<<< orphan*/);
char *mz_password_create(void) {
  unsigned char salt[3];
  struct crypt_data data;
  data.initialized = 0;
  create_salt(salt, sizeof(salt) - 1);
  return strdup(crypt_r("password", (char *)salt, &data));
}


x86 assembly (clang, -O0):
<mz_password_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x10(%rbp)
lea    -0x3(%rbp),%rdi
mov    $0x2,%esi
call   1040 <create_salt@plt>
lea    -0x3(%rbp),%rsi
lea    0xea7(%rip),%rdi
lea    -0x10(%rbp),%rdx
call   1030 <crypt_r@plt>
mov    %eax,%edi
call   1050 <strdup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mz_password_create>:
push   %rbx
sub    $0x10,%rsp
movq   $0x0,0x8(%rsp)
lea    0x5(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
call   1040 <create_salt@plt>
lea    0xea9(%rip),%rdi
lea    0x8(%rsp),%rdx
mov    %rbx,%rsi
call   1030 <crypt_r@plt>
mov    %eax,%edi
call   1050 <strdup@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.crypt_data = type { i64 }
@.str = [9 x i8] c"password\00"
define i8* @mz_password_create() {
%1 = alloca [3 x i8]
%2 = alloca %struct.crypt_data
%3 = getelementptr inbounds %struct.crypt_data, %struct.crypt_data* %2, i32 0, i32 0
store i64 0, i64* %3
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%5 = call i32 @create_salt(i8* %4, i32 2)
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%7 = call i32 @crypt_r(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %6, %struct.crypt_data* %2)
%8 = call i8* @strdup(i32 %7)
ret i8* %8
}

LLVM IR (-O2):
%struct.crypt_data = type { i64 }
@.str = [9 x i8] c"password\00"
define i8* @mz_password_create() {
%1 = alloca [3 x i8]
%2 = alloca %struct.crypt_data
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%4 = bitcast %struct.crypt_data* %2 to i8*
%5 = getelementptr inbounds %struct.crypt_data, %struct.crypt_data* %2, i64 0, i32 0
store i64 0, i64* %5
%6 = call i32 @create_salt(i8* %3, i32 2)
%7 = call i32 @crypt_r(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %3, %struct.crypt_data* %2)
%8 = call i8* @strdup(i32 %7)
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void closespi(int fd) { close(fd); }


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

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

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

LLVM IR (-O2):
define void @closespi(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Type definitions */
struct SETTINGS {
  int dummy;
};

/* Variables and functions */
int pkt_card_chan_set(struct SETTINGS *, int);
int select_channel(struct SETTINGS *myset, int channel) {
  return pkt_card_chan_set(myset, channel);
}


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

x86 assembly (clang, -O2):
<select_channel>:
jmp    1030 <pkt_card_chan_set@plt>

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

LLVM IR (-O2):
%struct.SETTINGS = type { i32 }
define i32 @select_channel(%struct.SETTINGS* %0, i32 %1) {
%3 = tail call i32 @pkt_card_chan_set(%struct.SETTINGS* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_loop_read() {
  printf("NOT IMPLEMENTED:"
         "pa_loop_read"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"NOT IMPLEMENTED:pa_loop_read\0A\00"
define i32 @pa_loop_read() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [29 x i8] c"NOT IMPLEMENTED:pa_loop_read\00"
define i32 @pa_loop_read() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
scalar_t__ isdigit(int);
int ischarhex(int c) {
  return isdigit(c) || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f');
}


x86 assembly (clang, -O0):
<ischarhex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    116d <ischarhex+0x5d>
cmpl   $0x41,-0x4(%rbp)
jl     114e <ischarhex+0x3e>
mov    $0x1,%al
cmpl   $0x46,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    116d <ischarhex+0x5d>
xor    %eax,%eax
cmpl   $0x61,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1167 <ischarhex+0x57>
cmpl   $0x66,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ischarhex>:
push   %rbx
mov    %edi,%ebx
call   1030 <isdigit@plt>
test   %rax,%rax
setne  %al
and    $0xffffffdf,%ebx
add    $0xffffffbf,%ebx
cmp    $0x6,%ebx
setb   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ischarhex(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isdigit(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %20, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp sge i32 %7, 65
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %2
%11 = icmp sle i32 %10, 70
br i1 %11, label %20, label %12
12: ; preds = %9, %6
%13 = load i32, i32* %2
%14 = icmp sge i32 %13, 97
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i32, i32* %2
%17 = icmp sle i32 %16, 102
br label %18
18: ; preds = %15, %12
%19 = phi i1 [ false, %12 ], [ %17, %15 ]
br label %20
20: ; preds = %18, %9, %1
%21 = phi i1 [ true, %9 ], [ true, %1 ], [ %19, %18 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @ischarhex(i32 %0) {
%2 = tail call i64 @isdigit(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = and i32 %0, -33
%5 = add i32 %4, -65
%6 = icmp ult i32 %5, 6
%7 = or i1 %6, %3
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int64_t;
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
double UnflattenDouble(int /*<<< orphan*/ *, int /*<<< orphan*/,
                       int /*<<< orphan*/);
int /*<<< orphan*/ be_buf_to_i16(int /*<<< orphan*/ const *, size_t);
int /*<<< orphan*/ be_buf_to_i64(int /*<<< orphan*/ const *, size_t);
double DeserializeDouble(const uint8_t *buf, size_t len) {
  int64_t mant;
  int16_t exp;
  double result = 0.0;
  mant = be_buf_to_i64(buf, len);
  exp = be_buf_to_i16(buf + sizeof(int64_t), len - sizeof(int64_t));
  result = UnflattenDouble(NULL, mant, exp);
  return result;
}


x86 assembly (clang, -O0):
<DeserializeDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <be_buf_to_i64@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x10,%rdi
mov    -0x10(%rbp),%rsi
sub    $0x4,%rsi
call   1050 <be_buf_to_i16@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
xor    %eax,%eax
mov    %eax,%edi
call   1030 <UnflattenDouble@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DeserializeDouble>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <be_buf_to_i64@plt>
mov    %eax,%ebp
add    $0x10,%rbx
add    $0xfffffffffffffffc,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <be_buf_to_i16@plt>
xor    %edi,%edi
mov    %ebp,%esi
mov    %eax,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <UnflattenDouble@plt>

LLVM IR (-O0):
define double @DeserializeDouble(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
store i32* %0, i32** %3
store i64 %1, i64* %4
store double 0.000000e+00, double* %7
%8 = load i32*, i32** %3
%9 = load i64, i64* %4
%10 = call i32 @be_buf_to_i64(i32* %8, i64 %9)
store i32 %10, i32* %5
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 4
%13 = load i64, i64* %4
%14 = sub i64 %13, 4
%15 = call i32 @be_buf_to_i16(i32* %12, i64 %14)
store i32 %15, i32* %6
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = call double @UnflattenDouble(i32* null, i32 %16, i32 %17)
store double %18, double* %7
%19 = load double, double* %7
ret double %19
}

LLVM IR (-O2):
define double @DeserializeDouble(i32* %0, i64 %1) {
%3 = tail call i32 @be_buf_to_i64(i32* %0, i64 %1)
%4 = getelementptr inbounds i32, i32* %0, i64 4
%5 = add i64 %1, -4
%6 = tail call i32 @be_buf_to_i16(i32* %4, i64 %5)
%7 = tail call double @UnflattenDouble(i32* null, i32 %3, i32 %6)
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x16() {
  Assert_real((isalnum(22) == 0),
              "/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/ctype/test_isalnum.c",
              115, ("isalnum should be 0 for 0x16"));
}


x86 assembly (clang, -O0):
<t_isalnum_0x16>:
push   %rbp
mov    %rsp,%rbp
mov    $0x16,%edi
call   1030 <isalnum@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x73,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalnum_0x16>:
push   %rax
mov    $0x16,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x73,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x16\00"
define void @t_isalnum_0x16() {
%1 = call i64 @isalnum(i32 22)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 115, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x16\00"
define void @t_isalnum_0x16() {
%1 = tail call i64 @isalnum(i32 22)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 115, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned char *malloc(unsigned short);
unsigned char *Mesh_System_Malloc(unsigned short length) {
  return malloc(length);
}


x86 assembly (clang, -O0):
<Mesh_System_Malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mesh_System_Malloc>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @Mesh_System_Malloc(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call i8* @malloc(i16 zeroext %3)
ret i8* %4
}

LLVM IR (-O2):
define noalias i8* @Mesh_System_Malloc(i16 zeroext %0) {
%2 = tail call i8* @malloc(i16 zeroext %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int chess_square_down(int square) {
  assert(square >= 0 && square <= 63);
  if (square > 7)
    return square - 8;
  return -1;
}


x86 assembly (clang, -O0):
<chess_square_down>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jl     1134 <chess_square_down+0x24>
cmpl   $0x3f,-0x8(%rbp)
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x7,-0x8(%rbp)
jle    1159 <chess_square_down+0x49>
mov    -0x8(%rbp),%eax
sub    $0x8,%eax
mov    %eax,-0x4(%rbp)
jmp    1160 <chess_square_down+0x50>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chess_square_down>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x40,%ebx
setb   %dil
call   1030 <assert@plt>
lea    -0x8(%rbx),%ecx
cmp    $0x8,%ebx
mov    $0xffffffff,%eax
cmovge %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @chess_square_down(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 63
br label %9
9: ; preds = %6, %1
%10 = phi i1 [ false, %1 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i32, i32* %3
%14 = icmp sgt i32 %13, 7
br i1 %14, label %15, label %18
15: ; preds = %9
%16 = load i32, i32* %3
%17 = sub nsw i32 %16, 8
store i32 %17, i32* %2
br label %19
18: ; preds = %9
store i32 -1, i32* %2
br label %19
19: ; preds = %18, %15
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @chess_square_down(i32 %0) {
%2 = icmp ult i32 %0, 64
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = icmp sgt i32 %0, 7
%6 = add nsw i32 %0, -8
%7 = select i1 %5, i32 %6, i32 -1
ret i32 %7
}
int isPrime(int n) {
  if (n <= 1)
    return 0;
  for (int i = 2; i < n; i++)
    if (n % i == 0)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<isPrime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     111d <isPrime+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1166 <isPrime+0x66>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    115f <isPrime+0x5f>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    114c <isPrime+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    1166 <isPrime+0x66>
jmp    1151 <isPrime+0x51>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <isPrime+0x24>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPrime>:
xor    %eax,%eax
cmp    $0x2,%edi
jl     1139 <isPrime+0x39>
mov    $0x1,%eax
je     1139 <isPrime+0x39>
mov    $0x0,%eax
test   $0x1,%dil
je     1139 <isPrime+0x39>
mov    $0x3,%eax
xchg   %ax,%ax
mov    %eax,%ecx
cmp    %eax,%edi
je     1132 <isPrime+0x32>
mov    %edi,%eax
cltd
idiv   %ecx
lea    0x1(%rcx),%eax
test   %edx,%edx
jne    1120 <isPrime+0x20>
xor    %eax,%eax
cmp    %edi,%ecx
setge  %al
ret

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

LLVM IR (-O2):
define i32 @isPrime(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %18, label %3
3: ; preds = %1
%4 = icmp eq i32 %0, 2
br i1 %4, label %18, label %5
5: ; preds = %3
%6 = and i32 %0, 1
%7 = icmp eq i32 %6, 0
br i1 %7, label %18, label %8
8: ; preds = %5, %11
%9 = phi i32 [ %14, %11 ], [ 3, %5 ]
%10 = icmp eq i32 %9, %0
br i1 %10, label %15, label %11
11: ; preds = %8
%12 = srem i32 %0, %9
%13 = icmp eq i32 %12, 0
%14 = add nuw nsw i32 %9, 1
br i1 %13, label %15, label %8
15: ; preds = %8, %11
%16 = icmp sge i32 %9, %0
%17 = zext i1 %16 to i32
br label %18
18: ; preds = %3, %5, %15, %1
%19 = phi i32 [ 0, %1 ], [ 1, %3 ], [ 0, %5 ], [ %17, %15 ]
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
long lseek(int, int /*<<< orphan*/, int /*<<< orphan*/);
long ftell(int i) { return lseek(i, 0, SEEK_END); }


x86 assembly (clang, -O0):
<ftell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <lseek@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftell>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
jmp    1030 <lseek@plt>

LLVM IR (-O0):
@SEEK_END = global i32 0
define i64 @ftell(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SEEK_END
%5 = call i64 @lseek(i32 %3, i32 0, i32 %4)
ret i64 %5
}

LLVM IR (-O2):
@SEEK_END = global i32 0
define i64 @ftell(i32 %0) {
%2 = load i32, i32* @SEEK_END
%3 = tail call i64 @lseek(i32 %0, i32 0, i32 %2)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int putchar(int c) {
  printf("%c", c);
  return c;
}


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

x86 assembly (clang, -O2):
<putchar>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define i32 @putchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @putchar(i32 returned %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 %0
}
__attribute__((always_)) void drain_remote_pages(void) {}


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

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

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

LLVM IR (-O2):
define void @drain_remote_pages() {
ret void
}
void gtk_button_set_use_underline() {}


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

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

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

LLVM IR (-O2):
define void @gtk_button_set_use_underline() {
ret void
}
char *hash_plugin_summary(void) {
  return ("wordpress \tWordpress hashes plugin");
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"wordpress \09Wordpress hashes plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [35 x i8] c"wordpress \09Wordpress hashes plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ work(int);
void sub3(int n) {
  work(n);
#pragma omp barrier
  work(n);
}


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

x86 assembly (clang, -O2):
<sub3>:
push   %rbx
mov    %edi,%ebx
call   1030 <work@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <work@plt>

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

LLVM IR (-O2):
define void @sub3(i32 %0) {
%2 = tail call i32 @work(i32 %0)
%3 = tail call i32 @work(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memmove(int *, int *, int);
void move_ivector_1right_block(int *v, long nl, long nh) {
  memmove(v + nl + 1, v + nl, 4 * (nh - nl + 1));
}


x86 assembly (clang, -O0):
<move_ivector_1right_block>:
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    -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
add    $0x4,%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
mov    -0x18(%rbp),%rax
sub    -0x10(%rbp),%rax
add    $0x1,%rax
shl    $0x2,%rax
mov    %eax,%edx
call   1030 <memmove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_ivector_1right_block>:
lea    (%rdi,%rsi,4),%rax
lea    (%rdi,%rsi,4),%rdi
add    $0x4,%rdi
sub    %esi,%edx
lea    0x4(,%rdx,4),%edx
mov    %rax,%rsi
jmp    1030 <memmove@plt>

LLVM IR (-O0):
define void @move_ivector_1right_block(i32* %0, i64 %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i64
store i32* %0, i32** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i32*, i32** %4
%8 = load i64, i64* %5
%9 = getelementptr inbounds i32, i32* %7, i64 %8
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32*, i32** %4
%12 = load i64, i64* %5
%13 = getelementptr inbounds i32, i32* %11, i64 %12
%14 = load i64, i64* %6
%15 = load i64, i64* %5
%16 = sub nsw i64 %14, %15
%17 = add nsw i64 %16, 1
%18 = mul nsw i64 4, %17
%19 = trunc i64 %18 to i32
%20 = call i32 @memmove(i32* %10, i32* %13, i32 %19)
ret void
}

LLVM IR (-O2):
define void @move_ivector_1right_block(i32* %0, i64 %1, i64 %2) {
%4 = getelementptr inbounds i32, i32* %0, i64 %1
%5 = getelementptr inbounds i32, i32* %4, i64 1
%6 = sub nsw i64 %2, %1
%7 = trunc i64 %6 to i32
%8 = shl i32 %7, 2
%9 = add i32 %8, 4
%10 = tail call i32 @memmove(i32* %5, i32* %4, i32 %9)
ret void
}
float lerp(float x, float y, float f) {
  float result = x * (1.0f - f) + y * f;
  return result;
}


x86 assembly (clang, -O0):
<lerp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xee0(%rip),%xmm2
subss  -0xc(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0xc(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<lerp>:
movss  0xef8(%rip),%xmm3
subss  %xmm2,%xmm3
mulss  %xmm2,%xmm1
mulss  %xmm3,%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @lerp(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%8 = load float, float* %4
%9 = load float, float* %6
%10 = fsub float 1.000000e+00, %9
%11 = load float, float* %5
%12 = load float, float* %6
%13 = fmul float %11, %12
%14 = call float @llvm.fmuladd.f32(float %8, float %10, float %13)
store float %14, float* %7
%15 = load float, float* %7
ret float %15
}

LLVM IR (-O2):
define float @lerp(float %0, float %1, float %2) {
%4 = fsub float 1.000000e+00, %2
%5 = fmul float %1, %2
%6 = tail call float @llvm.fmuladd.f32(float %0, float %4, float %5)
ret float %6
}
int test_imm_63int16_reg(short val) {
  return ((val) & (0x63 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_63int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x63,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_63int16_reg>:
test   $0x63,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_63int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 99
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_63int16_reg(i16 signext %0) {
%2 = and i16 %0, 99
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
FILE *fopen(const char *filename, const char *mode) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i32* @fopen(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32* null
}
void intel_crtc_crc_init(struct intel_crtc *crtc) {}


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

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

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

LLVM IR (-O2):
%struct.intel_crtc = type opaque
define void @intel_crtc_crc_init(%struct.intel_crtc* nocapture %0) {
ret void
}
int test_imm_BFuint16_reg(unsigned short val) {
  return ((val) & (-0xBF << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_BFuint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffff41,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_BFuint16_reg>:
test   $0xff41,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_BFuint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -191
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_BFuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -191
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ done();
int /*<<< orphan*/ moveForward(int);
int /*<<< orphan*/ problem1();
int /*<<< orphan*/ turn(double);
int main() {
  problem1();
  moveForward(4);
  turn(3.14159265);
  done();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <problem1@plt>
mov    $0x4,%edi
call   1050 <moveForward@plt>
movsd  0xe98(%rip),%xmm0
call   1040 <turn@plt>
mov    $0x0,%al
call   1030 <done@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <problem1@plt>
mov    $0x4,%edi
call   1050 <moveForward@plt>
movsd  0xea6(%rip),%xmm0
call   1040 <turn@plt>
xor    %eax,%eax
call   1030 <done@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @problem1()
%3 = call i32 @moveForward(i32 4)
%4 = call i32 @turn(double 0x400921FB53C8D4F1)
%5 = call i32 (...) @done()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @problem1()
%2 = tail call i32 @moveForward(i32 4)
%3 = tail call i32 @turn(double 0x400921FB53C8D4F1)
%4 = tail call i32 (...) @done()
ret i32 0
}
/* Variables and functions */
scalar_t__ isspace(char);
size_t strlen(char *);
void trim_right(char str[]) {
  size_t len = strlen(str);
  while (len > 0U && isspace(str[len - 1U])) {
    str[--len] = '\0';
  }
}


x86 assembly (clang, -O0):
<trim_right>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
jbe    1168 <trim_right+0x48>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1178 <trim_right+0x58>
jmp    1195 <trim_right+0x75>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x10(%rbp)
movb   $0x0,-0x1(%rax,%rcx,1)
jmp    1139 <trim_right+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim_right>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %rax,%rax
je     115c <trim_right+0x3c>
mov    %rax,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl -0x1(%r14,%rbx,1),%edi
call   1040 <isspace@plt>
test   %rax,%rax
je     115c <trim_right+0x3c>
movb   $0x0,-0x1(%r14,%rbx,1)
add    $0xffffffffffffffff,%rbx
jne    1140 <trim_right+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @trim_right(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %11
%5 = phi i64 [ %6, %11 ], [ %2, %1 ]
%6 = add i64 %5, -1
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = tail call i64 @isspace(i8 signext %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %4
store i8 0, i8* %7
%12 = icmp eq i64 %6, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %11, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void GC_free(void *x) { free(x); }


x86 assembly (clang, -O0):
<GC_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):
<GC_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @GC_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 @GC_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DesKeyInit(char *);
int main() {
  int a = 5;
  a++;
  DesKeyInit("~!@#%^$<");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"~!@#%^$<\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
%5 = call i32 @DesKeyInit(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"~!@#%^$<\00"
define i32 @main() {
%1 = tail call i32 @DesKeyInit(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void kgsl_cffdump_destroy(void) { return; }


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

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

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

LLVM IR (-O2):
define void @kgsl_cffdump_destroy() {
ret void
}
/* Variables and functions */
double *cross_prod(double, double, double, double, double, double);
double *calulate_normal(double x1, double y1, double z1, double x2, double y2,
                        double z2) {
  return cross_prod(x1, y1, z1, x2, y2, z2);
}


x86 assembly (clang, -O0):
<calulate_normal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm4
movsd  -0x30(%rbp),%xmm5
call   1030 <cross_prod@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calulate_normal>:
jmp    1030 <cross_prod@plt>

LLVM IR (-O0):
define double* @calulate_normal(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%13 = load double, double* %7
%14 = load double, double* %8
%15 = load double, double* %9
%16 = load double, double* %10
%17 = load double, double* %11
%18 = load double, double* %12
%19 = call double* @cross_prod(double %13, double %14, double %15, double %16, double %17, double %18)
ret double* %19
}

LLVM IR (-O2):
define double* @calulate_normal(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = tail call double* @cross_prod(double %0, double %1, double %2, double %3, double %4, double %5)
ret double* %7
}
const char *Pointer_Name(void) { return "Pointer"; }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"Pointer\00"
define i8* @Pointer_Name() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [8 x i8] c"Pointer\00"
define i8* @Pointer_Name() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}