xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ session_access_folder(char *, char *, char *, char *, char *);
char *session_degrade_state(char *application_name, char *session,
                            char *folder_name, char *role_name) {
  char *state = "lookup";
  if (session_access_folder(application_name, session, folder_name, role_name,
                            state)) {
    return state;
  } else {
    return (char *)0;
  }
}


x86 assembly (clang, -O0):
<session_degrade_state>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
lea    0xed1(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
call   1030 <session_access_folder@plt>
cmp    $0x0,%rax
je     1163 <session_degrade_state+0x53>
mov    -0x30(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116b <session_degrade_state+0x5b>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<session_degrade_state>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%r8
call   1030 <session_access_folder@plt>
test   %rax,%rax
cmovne %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"lookup\00"
define i8* @session_degrade_state(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = load i8*, i8** %9
%15 = load i8*, i8** %10
%16 = call i64 @session_access_folder(i8* %11, i8* %12, i8* %13, i8* %14, i8* %15)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %4
%19 = load i8*, i8** %10
store i8* %19, i8** %5
br label %21
20: ; preds = %4
store i8* null, i8** %5
br label %21
21: ; preds = %20, %18
%22 = load i8*, i8** %5
ret i8* %22
}

LLVM IR (-O2):
@.str = [7 x i8] c"lookup\00"
define i8* @session_degrade_state(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i64 @session_access_folder(i8* %0, i8* %1, i8* %2, i8* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i8* null, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
ret i8* %7
}
void named_subroutine2nsrStart_inNsr_nsrEnd() {}


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

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

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

LLVM IR (-O2):
define void @named_subroutine2nsrStart_inNsr_nsrEnd() {
ret void
}
int testAll(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @testAll() {
ret i32 0
}
int count() {
  static int c = 3000;
  return c++;
}


x86 assembly (clang, -O0):
<count>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f16(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2f0b(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<count>:
mov    0x2f1a(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f11(%rip)
ret

LLVM IR (-O0):
@count.c = internal global i32 3000
define i32 @count() {
%1 = load i32, i32* @count.c
%2 = add nsw i32 %1, 1
store i32 %2, i32* @count.c
ret i32 %1
}

LLVM IR (-O2):
@count.c = internal unnamed_addr global i32 3000
define i32 @count() {
%1 = load i32, i32* @count.c
%2 = add nsw i32 %1, 1
store i32 %2, i32* @count.c
ret i32 %1
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t posix_acl_xxx_hash(uint32_t inode, uint8_t acltype) {
  return inode * 0x56BF7623 + acltype;
}


x86 assembly (clang, -O0):
<posix_acl_xxx_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0x56bf7623,-0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<posix_acl_xxx_hash>:
imul   $0x56bf7623,%edi,%eax
add    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @posix_acl_xxx_hash(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, 1455388195
%4 = add nsw i32 %3, %1
ret i32 %4
}
adrx0adr1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if ((((double *)10000000)[x0]) <=
      (*((double *)(11111111 & ~(__alignof__(double) - 1)))))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adrx0adr1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
movslq -0x1c(%rbp),%rcx
mov    $0x989680,%eax
movsd  (%rax,%rcx,8),%xmm1
mov    $0xa98ac0,%eax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jb     1149 <adrx0adr1+0x49>
movl   $0x1,-0x4(%rbp)
jmp    1150 <adrx0adr1+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrx0adr1>:
movslq %edi,%rcx
movsd  0xa98ac0,%xmm0
xor    %eax,%eax
ucomisd 0x989680(,%rcx,8),%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @adrx0adr1(double %0, double %1, i32 %2, i32 %3, double* %4, double* %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
store double %0, double* %8
store double %1, double* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store double* %4, double** %12
store double* %5, double** %13
%14 = load i32, i32* %10
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds double, double* inttoptr (i64 10000000 to double*), i64 %15
%17 = load double, double* %16
%18 = load double, double* inttoptr (i64 11111104 to double*)
%19 = fcmp ole double %17, %18
br i1 %19, label %20, label %21
20: ; preds = %6
store i32 1, i32* %7
br label %22
21: ; preds = %6
store i32 0, i32* %7
br label %22
22: ; preds = %21, %20
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
define i32 @adrx0adr1(double %0, double %1, i32 %2, i32 %3, double* nocapture readnone %4, double* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds double, double* inttoptr (i64 10000000 to double*), i64 %7
%9 = load double, double* %8
%10 = load double, double* inttoptr (i64 11111104 to double*)
%11 = fcmp ole double %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ cnfImprt(char *const, int, char *);
int /*<<< orphan*/ errSyser(char *, int);
int /*<<< orphan*/ starFree(char *);
char *starMallocAtomic(int);
void err_syser_(char *const TOKEN, int *const SYSTAT, int TOKEN_length) {
  int systat;
  char *token;
  ;
  systat = *SYSTAT;
  token = starMallocAtomic(TOKEN_length + 1);
  cnfImprt(TOKEN, TOKEN_length, token);
  errSyser(token, systat);
  starFree(token);
}


x86 assembly (clang, -O0):
<err_syser_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
add    $0x1,%edi
call   1040 <starMallocAtomic@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1060 <cnfImprt@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1050 <errSyser@plt>
mov    -0x20(%rbp),%rdi
call   1030 <starFree@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<err_syser_>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rdi,%r14
mov    (%rsi),%r15d
lea    0x1(%rbx),%edi
call   1040 <starMallocAtomic@plt>
mov    %rax,%rbp
mov    %r14,%rdi
mov    %ebx,%esi
mov    %rax,%rdx
call   1060 <cnfImprt@plt>
mov    %rbp,%rdi
mov    %r15d,%esi
call   1050 <errSyser@plt>
mov    %rbp,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <starFree@plt>

LLVM IR (-O0):
define void @err_syser_(i8* %0, i32* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
store i32 %10, i32* %7
%11 = load i32, i32* %6
%12 = add nsw i32 %11, 1
%13 = call i8* @starMallocAtomic(i32 %12)
store i8* %13, i8** %8
%14 = load i8*, i8** %4
%15 = load i32, i32* %6
%16 = load i8*, i8** %8
%17 = call i32 @cnfImprt(i8* %14, i32 %15, i8* %16)
%18 = load i8*, i8** %8
%19 = load i32, i32* %7
%20 = call i32 @errSyser(i8* %18, i32 %19)
%21 = load i8*, i8** %8
%22 = call i32 @starFree(i8* %21)
ret void
}

LLVM IR (-O2):
define void @err_syser_(i8* %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %1
%5 = add nsw i32 %2, 1
%6 = tail call i8* @starMallocAtomic(i32 %5)
%7 = tail call i32 @cnfImprt(i8* %0, i32 %2, i8* %6)
%8 = tail call i32 @errSyser(i8* %6, i32 %4)
%9 = tail call i32 @starFree(i8* %6)
ret void
}
/* Variables and functions */
int init_conversion(int);
int set_dos_codepage(int codepage) { return init_conversion(codepage); }


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

x86 assembly (clang, -O2):
<set_dos_codepage>:
jmp    1030 <init_conversion@plt>

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

LLVM IR (-O2):
define i32 @set_dos_codepage(i32 %0) {
%2 = tail call i32 @init_conversion(i32 %0)
ret i32 %2
}
int do_b_scroll(cnt)
long cnt;
{ (void)scrollb(scro_size((unsigned)cnt), 1); }


x86 assembly (clang, -O0):
<do_b_scroll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%edi
mov    $0x0,%al
call   1040 <scro_size@plt>
mov    %eax,%edi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <scrollb@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_b_scroll>:
push   %rax
xor    %eax,%eax
call   1040 <scro_size@plt>
mov    %eax,%edi
mov    $0x1,%esi
xor    %eax,%eax
pop    %rcx
jmp    1030 <scrollb@plt>

LLVM IR (-O0):
define i32 @do_b_scroll(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = trunc i64 %4 to i32
%6 = call i32 (i32, ...) bitcast (i32 (...)* @scro_size to i32 (i32, ...)*)(i32 %5)
%7 = call i32 (i32, i32, ...) bitcast (i32 (...)* @scrollb to i32 (i32, i32, ...)*)(i32 %6, i32 1)
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @do_b_scroll(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @scro_size to i32 (i32, ...)*)(i32 %2)
%4 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @scrollb to i32 (i32, i32, ...)*)(i32 %3, i32 1)
ret i32 undef
}
void SPI1_DisableRxInt(void) {}


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

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

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

LLVM IR (-O2):
define void @SPI1_DisableRxInt() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
struct tcphdr {
  int /*<<< orphan*/ dest;
};

/* Variables and functions */
int /*<<< orphan*/ ntohs(int /*<<< orphan*/);
uint16_t tcphdr_dest_ntohs(struct tcphdr *h) { return ntohs(h->dest); }


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

x86 assembly (clang, -O2):
<tcphdr_dest_ntohs>:
mov    (%rdi),%edi
jmp    1030 <ntohs@plt>

LLVM IR (-O0):
%struct.tcphdr = type { i32 }
define i32 @tcphdr_dest_ntohs(%struct.tcphdr* %0) {
%2 = alloca %struct.tcphdr*
store %struct.tcphdr* %0, %struct.tcphdr** %2
%3 = load %struct.tcphdr*, %struct.tcphdr** %2
%4 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i32 @ntohs(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
%struct.tcphdr = type { i32 }
define i32 @tcphdr_dest_ntohs(%struct.tcphdr* nocapture %0) {
%2 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i32 @ntohs(i32 %3)
ret i32 %4
}
unsigned long hweight_long(unsigned long w) {
  int i, c = 0;
  for (i = 0; i < sizeof(w) * 8; i++) {
    c += w & 1;
    w >>= 1;
  }
  return c;
}


x86 assembly (clang, -O0):
<hweight_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
movslq -0xc(%rbp),%rax
cmp    $0x40,%rax
jae    1150 <hweight_long+0x50>
mov    -0x8(%rbp),%rcx
and    $0x1,%rcx
movslq -0x10(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <hweight_long+0x16>
movslq -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hweight_long>:
mov    $0x40,%ecx
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x1,%edx
add    %edx,%eax
mov    %edi,%edx
shr    %edx
and    $0x1,%edx
add    %eax,%edx
mov    %edi,%eax
shr    $0x2,%eax
and    $0x1,%eax
add    %edx,%eax
mov    %edi,%edx
shr    $0x3,%edx
and    $0x1,%edx
add    %eax,%edx
shr    $0x4,%rdi
movslq %edx,%rax
add    $0xfffffffc,%ecx
jne    1110 <hweight_long+0x10>
ret

LLVM IR (-O0):
define i64 @hweight_long(i64 %0) {
%2 = alloca i64
%3 = alloca i32
%4 = alloca i32
store i64 %0, i64* %2
store i32 0, i32* %4
store i32 0, i32* %3
br label %5
5: ; preds = %18, %1
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = icmp ult i64 %7, 64
br i1 %8, label %9, label %21
9: ; preds = %5
%10 = load i64, i64* %2
%11 = and i64 %10, 1
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = add i64 %13, %11
%15 = trunc i64 %14 to i32
store i32 %15, i32* %4
%16 = load i64, i64* %2
%17 = lshr i64 %16, 1
store i64 %17, i64* %2
br label %18
18: ; preds = %9
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %5
21: ; preds = %5
%22 = load i32, i32* %4
%23 = sext i32 %22 to i64
ret i64 %23
}

LLVM IR (-O2):
define i64 @hweight_long(i64 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %20, %2 ]
%4 = phi i32 [ 0, %1 ], [ %18, %2 ]
%5 = phi i64 [ %0, %1 ], [ %17, %2 ]
%6 = and i64 %5, 1
%7 = add nsw i64 %3, %6
%8 = lshr i64 %5, 1
%9 = and i64 %8, 1
%10 = add nsw i64 %7, %9
%11 = lshr i64 %5, 2
%12 = and i64 %11, 1
%13 = add nsw i64 %10, %12
%14 = lshr i64 %5, 3
%15 = and i64 %14, 1
%16 = add nsw i64 %13, %15
%17 = lshr i64 %5, 4
%18 = add nuw nsw i32 %4, 4
%19 = shl i64 %16, 32
%20 = ashr exact i64 %19, 32
%21 = icmp eq i32 %18, 64
br i1 %21, label %22, label %2
22: ; preds = %2
ret i64 %20
}
/* Variables and functions */
int atoi(char *);
int str_to_int(char *s) { return atoi(s); }


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

x86 assembly (clang, -O2):
<str_to_int>:
jmp    1030 <atoi@plt>

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

LLVM IR (-O2):
define i32 @str_to_int(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ core13_print(char *, char const *);
void U_EMRALPHABLEND_print(const char *contents) {
  core13_print("U_EMRALPHABLEND", contents);
}


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

x86 assembly (clang, -O2):
<U_EMRALPHABLEND_print>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <core13_print@plt>

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

LLVM IR (-O2):
@.str = [16 x i8] c"U_EMRALPHABLEND\00"
define void @U_EMRALPHABLEND_print(i8* %0) {
%2 = tail call i32 @core13_print(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
char *strncpy(char *, char const *, size_t);
int DEPLOY_STRNCPY(char *strDest, size_t numberOfElements,
                   const char *strSource, size_t count) {
  char *s = strncpy(strDest, strSource, count);
  if (count < numberOfElements) {
    s[count] = '\0';
  } else {
    s[numberOfElements - 1] = '\0';
  }
  return (s == strDest) ? 0 : 1;
}


x86 assembly (clang, -O0):
<DEPLOY_STRNCPY>:
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    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <strncpy@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    115c <DEPLOY_STRNCPY+0x4c>
mov    -0x28(%rbp),%rax
mov    -0x20(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    116c <DEPLOY_STRNCPY+0x5c>
mov    -0x28(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x28(%rbp),%rdx
mov    -0x8(%rbp),%rsi
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DEPLOY_STRNCPY>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rdx,%rsi
mov    %rcx,%rdx
call   1030 <strncpy@plt>
lea    -0x1(%r14),%rax
cmp    %r14,%rbx
cmovb  %rbx,%rax
movb   $0x0,(%r15,%rax,1)
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @DEPLOY_STRNCPY(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%10 = load i8*, i8** %5
%11 = load i8*, i8** %7
%12 = load i64, i64* %8
%13 = call i8* @strncpy(i8* %10, i8* %11, i64 %12)
store i8* %13, i8** %9
%14 = load i64, i64* %8
%15 = load i64, i64* %6
%16 = icmp ult i64 %14, %15
br i1 %16, label %17, label %21
17: ; preds = %4
%18 = load i8*, i8** %9
%19 = load i64, i64* %8
%20 = getelementptr inbounds i8, i8* %18, i64 %19
store i8 0, i8* %20
br label %26
21: ; preds = %4
%22 = load i8*, i8** %9
%23 = load i64, i64* %6
%24 = sub i64 %23, 1
%25 = getelementptr inbounds i8, i8* %22, i64 %24
store i8 0, i8* %25
br label %26
26: ; preds = %21, %17
%27 = load i8*, i8** %9
%28 = load i8*, i8** %5
%29 = icmp eq i8* %27, %28
%30 = zext i1 %29 to i64
%31 = select i1 %29, i32 0, i32 1
ret i32 %31
}

LLVM IR (-O2):
define i32 @DEPLOY_STRNCPY(i8* %0, i64 %1, i8* nocapture %2, i64 %3) {
%5 = tail call i8* @strncpy(i8* dereferenceable(1) %0, i8* %2, i64 %3)
%6 = icmp ult i64 %3, %1
%7 = add i64 %1, -1
%8 = select i1 %6, i64 %3, i64 %7
%9 = getelementptr inbounds i8, i8* %0, i64 %8
store i8 0, i8* %9
ret i32 0
}
void println(void *s) { printf("%s\n", s); }


x86 assembly (clang, -O0):
<println>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<println>:
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
define void @println(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
ret void
}
/* Variables and functions */
int is_dec(char const *);
int is_hex(char const *);
int is_number(const char *n) {
  if (n[0] == '0' && n[1] == 'x')
    return is_hex(n + 2);
  else
    return is_dec(n);
}


x86 assembly (clang, -O0):
<is_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jne    1162 <is_number+0x42>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x78,%eax
jne    1162 <is_number+0x42>
mov    -0x10(%rbp),%rdi
add    $0x2,%rdi
call   1030 <is_hex@plt>
mov    %eax,-0x4(%rbp)
jmp    116e <is_number+0x4e>
mov    -0x10(%rbp),%rdi
call   1040 <is_dec@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_number>:
cmpb   $0x30,(%rdi)
jne    1134 <is_number+0x14>
cmpb   $0x78,0x1(%rdi)
jne    1134 <is_number+0x14>
add    $0x2,%rdi
jmp    1030 <is_hex@plt>
jmp    1040 <is_dec@plt>

LLVM IR (-O0):
define i32 @is_number(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 48
br i1 %8, label %9, label %19
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 120
br i1 %14, label %15, label %19
15: ; preds = %9
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 2
%18 = call i32 @is_hex(i8* %17)
store i32 %18, i32* %2
br label %22
19: ; preds = %9, %1
%20 = load i8*, i8** %3
%21 = call i32 @is_dec(i8* %20)
store i32 %21, i32* %2
br label %22
22: ; preds = %19, %15
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @is_number(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 48
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 120
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = tail call i32 @is_hex(i8* %9)
br label %13
11: ; preds = %4, %1
%12 = tail call i32 @is_dec(i8* %0)
br label %13
13: ; preds = %11, %8
%14 = phi i32 [ %10, %8 ], [ %12, %11 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ malloc(size_t);
void *memset(int /*<<< orphan*/, int /*<<< orphan*/, size_t);
void *builtin_no_leak(size_t s) { return memset(malloc(s), 0, s); }


x86 assembly (clang, -O0):
<builtin_no_leak>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<builtin_no_leak>:
push   %rbx
mov    %rdi,%rbx
call   1040 <malloc@plt>
mov    %eax,%edi
xor    %esi,%esi
mov    %rbx,%rdx
pop    %rbx
jmp    1030 <memset@plt>

LLVM IR (-O0):
define i8* @builtin_no_leak(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @malloc(i64 %3)
%5 = load i64, i64* %2
%6 = call i8* @memset(i32 %4, i32 0, i64 %5)
ret i8* %6
}

LLVM IR (-O2):
define i8* @builtin_no_leak(i64 %0) {
%2 = tail call i32 @malloc(i64 %0)
%3 = tail call i8* @memset(i32 %2, i32 0, i64 %0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ DisplayUsage();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void DisplayInvalidParameter(char *param) {
  fprintf(stderr, "make_mask: Parameter %s is invalid.\n", param);
  DisplayUsage();
}


x86 assembly (clang, -O0):
<DisplayInvalidParameter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <DisplayUsage@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DisplayInvalidParameter>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <DisplayUsage@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"make_mask: Parameter %s is invalid.\0A\00"
define void @DisplayInvalidParameter(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @DisplayUsage()
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"make_mask: Parameter %s is invalid.\0A\00"
define void @DisplayInvalidParameter(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @DisplayUsage()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ s;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, ...);
int /*<<< orphan*/ swap1(int *, int *);
int main() {
  char s[10] = "hehehaha";
  printf("%lu\n", (sizeof(s)));
  int a = 5, b = 10;
  swap1(&a, &b);
  printf("%d %d\n", a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0xe(%rbp)
mov    0xec7(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    0xebe(%rip),%rdi
mov    $0xa,%esi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x5,-0x14(%rbp)
movl   $0xa,-0x18(%rbp)
lea    -0x14(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <swap1@plt>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1030 <printf@plt>
movl   $0x5,0x4(%rsp)
movl   $0xa,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <swap1@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xea7(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.s = [10 x i8] c"hehehaha\00\00"
@.str = [5 x i8] c"%lu\0A\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [10 x i8]* %2 to i8*
%6 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 10)
store i32 5, i32* %3
store i32 10, i32* %4
%7 = call i32 @swap1(i32* %3, i32* %4)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lu\0A\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 10)
%4 = bitcast i32* %1 to i8*
store i32 5, i32* %1
%5 = bitcast i32* %2 to i8*
store i32 10, i32* %2
%6 = call i32 @swap1(i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}
/* Variables and functions */
scalar_t__ isdiv(unsigned long);
int /*<<< orphan*/ printf(char *, unsigned long);
int main() {
  unsigned long loop = 2520;
  while (1) {
    if (isdiv(loop)) {
      printf("%u", loop);
      break;
    }
    loop += 20;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x9d8,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <isdiv@plt>
cmp    $0x0,%rax
je     115f <main+0x3f>
mov    -0x10(%rbp),%rsi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
jmp    1170 <main+0x50>
mov    -0x10(%rbp),%rax
add    $0x14,%rax
mov    %rax,-0x10(%rbp)
jmp    1137 <main+0x17>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x9c4,%ebx
cs nopw 0x0(%rax,%rax,1)
add    $0x14,%rbx
mov    %rbx,%rdi
call   1040 <isdiv@plt>
test   %rax,%rax
je     1130 <main+0x10>
lea    0xeb8(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%u\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i64 [ 2520, %0 ], [ %5, %1 ]
%3 = tail call i64 @isdiv(i64 %2)
%4 = icmp eq i64 %3, 0
%5 = add i64 %2, 20
br i1 %4, label %1, label %6
6: ; preds = %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 %2)
ret i32 0
}
long next() {
  static long seed = 997;
  seed = seed * 123457 + 97;
  if (seed < 0)
    seed = -seed;
  return seed;
}


x86 assembly (clang, -O0):
<next>:
push   %rbp
mov    %rsp,%rbp
imul   $0x1e241,0x2f11(%rip),%rax
add    $0x61,%rax
mov    %rax,0x2f06(%rip)
cmpq   $0x0,0x2efe(%rip)
jge    1138 <next+0x38>
xor    %eax,%eax
sub    0x2eef(%rip),%rax
mov    %rax,0x2ee8(%rip)
mov    0x2ee1(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next>:
imul   $0x1e241,0x2f15(%rip),%rcx
lea    0x61(%rcx),%rdx
lea    0x61(%rcx),%rax
neg    %rax
cmp    $0xffffffffffffff9f,%rcx
cmovge %rdx,%rax
mov    %rax,0x2efb(%rip)
ret

LLVM IR (-O0):
@next.seed = internal global i64 997
define i64 @next() {
%1 = load i64, i64* @next.seed
%2 = mul nsw i64 %1, 123457
%3 = add nsw i64 %2, 97
store i64 %3, i64* @next.seed
%4 = load i64, i64* @next.seed
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i64, i64* @next.seed
%8 = sub nsw i64 0, %7
store i64 %8, i64* @next.seed
br label %9
9: ; preds = %6, %0
%10 = load i64, i64* @next.seed
ret i64 %10
}

LLVM IR (-O2):
@next.seed = internal unnamed_addr global i64 997
define i64 @next() {
%1 = load i64, i64* @next.seed
%2 = mul nsw i64 %1, 123457
%3 = add nsw i64 %2, 97
%4 = icmp slt i64 %2, -97
%5 = sub i64 -97, %2
%6 = select i1 %4, i64 %5, i64 %3
store i64 %6, i64* @next.seed
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
main() {
  printf("This is a test for ltrace\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [27 x i8] c"This is a test for ltrace\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [26 x i8] c"This is a test for ltrace\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
XDefineCursor() {}


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

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

LLVM IR (-O0):
define i32 @XDefineCursor() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XDefineCursor() {
ret i32 undef
}
int main(void) {
  int a, b, c, d, e, f, g;
  f = a * b + c / d - f % g;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%eax
cltd
idivl  -0x14(%rbp)
mov    %eax,%ecx
mov    -0x28(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%eax
cltd
idivl  -0x20(%rbp)
mov    -0x24(%rbp),%eax
sub    %edx,%eax
mov    %eax,-0x1c(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = mul nsw i32 %9, %10
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = sdiv i32 %12, %13
%15 = add nsw i32 %11, %14
%16 = load i32, i32* %7
%17 = load i32, i32* %8
%18 = srem i32 %16, %17
%19 = sub nsw i32 %15, %18
store i32 %19, i32* %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ errStart();
void err_start_(void) { errStart(); }


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

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

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

LLVM IR (-O2):
define void @err_start_() {
%1 = tail call i32 (...) @errStart()
ret void
}
void glGetClipPlanex(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glGetClipPlanex() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int getpid();
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, int);
void checkR(int result) {
  if (result < 0) {
    perror("Read Error");
    printf("error dans pid %d \n", getpid());
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<checkR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1184 <checkR+0x44>
lea    0xea4(%rip),%rdi
call   1050 <perror@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e63(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkR>:
test   %edi,%edi
js     1145 <checkR+0x5>
ret
push   %rax
lea    0xeb3(%rip),%rdi
call   1050 <perror@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xeab(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"Read Error\00"
@.str.1 = [20 x i8] c"error dans pid %d \0A\00"
@EXIT_FAILURE = global i32 0
define void @checkR(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @getpid()
%8 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"Read Error\00"
@.str.1 = [20 x i8] c"error dans pid %d \0A\00"
@EXIT_FAILURE = global i32 0
define void @checkR(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1
%4 = tail call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (...) @getpid()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret void
}
/* Variables and functions */
#define EAGAIN 132
#define EALREADY 131
#define EINPROGRESS 130
#define EINTR 129
#define ENOTCONN 128
int BIO_fd_non_fatal_error(int err) {
  switch (err) {
  case ENOTCONN:
  case EINTR:
  case EAGAIN:
  case EINPROGRESS:
  case EALREADY:
    return (1);
  default:
    break;
  }
  return (0);
}


x86 assembly (clang, -O0):
<BIO_fd_non_fatal_error>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffff80,%eax
sub    $0x4,%eax
ja     1127 <BIO_fd_non_fatal_error+0x27>
jmp    111b <BIO_fd_non_fatal_error+0x1b>
movl   $0x1,-0x4(%rbp)
jmp    1133 <BIO_fd_non_fatal_error+0x33>
jmp    112c <BIO_fd_non_fatal_error+0x2c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BIO_fd_non_fatal_error>:
add    $0xffffff80,%edi
xor    %eax,%eax
cmp    $0x5,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @BIO_fd_non_fatal_error(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 128, label %5
i32 129, label %5
i32 132, label %5
i32 130, label %5
i32 131, label %5
]
5: ; preds = %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %8
6: ; preds = %1
br label %7
7: ; preds = %6
store i32 0, i32* %2
br label %8
8: ; preds = %7, %5
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @BIO_fd_non_fatal_error(i32 %0) {
%2 = add i32 %0, -128
%3 = icmp ult i32 %2, 5
%4 = zext i1 %3 to i32
ret i32 %4
}
void downcase(p) char *p;
{
  if (!p)
    return;
  while (*p)
    *p++ = tolower(*p);
}


x86 assembly (clang, -O0):
<downcase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <downcase+0x1c>
jmp    1162 <downcase+0x52>
jmp    1131 <downcase+0x21>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1162 <downcase+0x52>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1131 <downcase+0x21>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<downcase>:
push   %rbx
test   %rdi,%rdi
je     1146 <downcase+0x36>
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1146 <downcase+0x36>
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <downcase+0x20>
pop    %rbx
ret

LLVM IR (-O0):
define void @downcase(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
br label %19
6: ; preds = %1
br label %7
7: ; preds = %11, %6
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %7
%12 = load i8*, i8** %2
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = call i32 @tolower(i32 %14)
%16 = trunc i32 %15 to i8
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %2
store i8 %16, i8* %17
br label %7
19: ; preds = %5, %7
ret void
}

LLVM IR (-O2):
define void @downcase(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %13, %6 ], [ %4, %3 ]
%8 = phi i8* [ %12, %6 ], [ %0, %3 ]
%9 = sext i8 %7 to i32
%10 = tail call i32 @tolower(i32 %9)
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %11, i8* %8
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %6, %3, %1
ret void
}
int vint_set_cmp_int(const void *e1, const void *e2) {
  int i1 = (*((const int *)e1));
  int i2 = (*((const int *)e2));
  return (i1 - i2);
}


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

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

LLVM IR (-O0):
define i32 @vint_set_cmp_int(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = sub nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @vint_set_cmp_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
int CountSoundClass(unsigned char **class) {
  unsigned char **p;
  int no = 0;
  for (p = class; **p; p++)
    no++;
  return no;
}


x86 assembly (clang, -O0):
<CountSoundClass>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
cmpb   $0x0,(%rax)
je     1141 <CountSoundClass+0x41>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    1117 <CountSoundClass+0x17>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CountSoundClass>:
mov    (%rdi),%rax
cmpb   $0x0,(%rax)
je     111f <CountSoundClass+0x1f>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
mov    0x8(%rdi,%rax,8),%rcx
add    $0x1,%rax
cmpb   $0x0,(%rcx)
jne    1110 <CountSoundClass+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @CountSoundClass(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %8, %5 ], [ 0, %1 ]
%7 = phi i8** [ %9, %5 ], [ %0, %1 ]
%8 = add nuw nsw i32 %6, 1
%9 = getelementptr inbounds i8*, i8** %7, i64 1
%10 = load i8*, i8** %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %1
%14 = phi i32 [ 0, %1 ], [ %8, %5 ]
ret i32 %14
}
/* Type definitions */
struct skynet_context {
  int dummy;
};

/* Variables and functions */
char const *skynet_getenv(char const *);
const char *cmd_getenv(struct skynet_context *context, const char *param) {
  return skynet_getenv(param);
}


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

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

LLVM IR (-O0):
%struct.skynet_context = type { i32 }
define i8* @cmd_getenv(%struct.skynet_context* %0, i8* %1) {
%3 = alloca %struct.skynet_context*
%4 = alloca i8*
store %struct.skynet_context* %0, %struct.skynet_context** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i8* @skynet_getenv(i8* %5)
ret i8* %6
}

LLVM IR (-O2):
%struct.skynet_context = type { i32 }
define i8* @cmd_getenv(%struct.skynet_context* nocapture readnone %0, i8* %1) {
%3 = tail call i8* @skynet_getenv(i8* %1)
ret i8* %3
}
/* Type definitions */
struct coprthr_device {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _printcl(char *, int, char *, char *);
void *map_image(struct coprthr_device *dev, void *argp) {
  do {
    if ("<4>"
        "cmdcall_x86_64:map_image: unsupported"[1] <= '0')
      _printcl("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/browndeer/coprthr/refs/heads/"
               "parallellocalypse/src/libcoprthr/arch/x86_64/devcmds_x86_64.c",
               459, "clmesg",
               "<4>"
               "cmdcall_x86_64:map_image: unsupported");
  } while (0);
  return (0);
}


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

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

LLVM IR (-O0):
%struct.coprthr_device = type { i32 }
define i8* @map_image(%struct.coprthr_device* %0, i8* %1) {
%3 = alloca %struct.coprthr_device*
%4 = alloca i8*
store %struct.coprthr_device* %0, %struct.coprthr_device** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %2
br label %6
6: ; preds = %5
ret i8* null
}

LLVM IR (-O2):
%struct.coprthr_device = type { i32 }
define noalias i8* @map_image(%struct.coprthr_device* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
void g_slist_insert_before() {}


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

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

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

LLVM IR (-O2):
define void @g_slist_insert_before() {
ret void
}
void test_9() {}


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

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

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

LLVM IR (-O2):
define void @test_9() {
ret void
}
/* Variables and functions */
void *m_try_malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *m_try_malloc0(size_t size) {
  void *ptr;
  ptr = m_try_malloc(size);
  if (ptr) {
    memset(ptr, 0, size);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<m_try_malloc0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <m_try_malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1153 <m_try_malloc0+0x33>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_try_malloc0>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <m_try_malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1141 <m_try_malloc0+0x21>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @m_try_malloc0(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @m_try_malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = load i64, i64* %2
%11 = call i32 @memset(i8* %9, i32 0, i64 %10)
br label %12
12: ; preds = %8, %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @m_try_malloc0(i64 %0) {
%2 = tail call i8* @m_try_malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}