xunge/DecIR huggingface dataset:
/* Type definitions */
struct feature_pair {
  int dummy;
};
struct CovariateAnalysis {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void _emitJSONCovProb(const struct feature_pair *pair,
                      const struct CovariateAnalysis *covan, FILE *fp) {}


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

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

LLVM IR (-O0):
%struct.feature_pair = type { i32 }
%struct.CovariateAnalysis = type { i32 }
define void @_emitJSONCovProb(%struct.feature_pair* %0, %struct.CovariateAnalysis* %1, i32* %2) {
%4 = alloca %struct.feature_pair*
%5 = alloca %struct.CovariateAnalysis*
%6 = alloca i32*
store %struct.feature_pair* %0, %struct.feature_pair** %4
store %struct.CovariateAnalysis* %1, %struct.CovariateAnalysis** %5
store i32* %2, i32** %6
ret void
}

LLVM IR (-O2):
%struct.feature_pair = type { i32 }
%struct.CovariateAnalysis = type { i32 }
define void @_emitJSONCovProb(%struct.feature_pair* nocapture %0, %struct.CovariateAnalysis* nocapture %1, i32* nocapture %2) {
ret void
}
/* Variables and functions */
int f462(int *);
int f463(int *p) { return f462(p); }


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

x86 assembly (clang, -O2):
<f463>:
jmp    1030 <f462@plt>

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

LLVM IR (-O2):
define i32 @f463(i32* %0) {
%2 = tail call i32 @f462(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ USB_ResetCore();
void USB_Reset_Event(void) { USB_ResetCore(); }


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

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

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

LLVM IR (-O2):
define void @USB_Reset_Event() {
%1 = tail call i32 (...) @USB_ResetCore()
ret void
}
/* Variables and functions */
int __isptymaster(int);
int unlockpt(int fd) { return __isptymaster(fd); }


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

x86 assembly (clang, -O2):
<unlockpt>:
jmp    1030 <__isptymaster@plt>

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

LLVM IR (-O2):
define i32 @unlockpt(i32 %0) {
%2 = tail call i32 @__isptymaster(i32 %0)
ret i32 %2
}
/* Variables and functions */
int strcmp(char const *, char const *);
int _compare_string_ptrs(const void **_a, const void **_b) {
  return strcmp((const char *)*_a, (const char *)*_b);
}


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

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

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

LLVM IR (-O2):
define i32 @_compare_string_ptrs(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %3, i8* dereferenceable(1) %4)
ret i32 %5
}
int ns_is_big_endian(void) {
  static const int n = 1;
  return ((char *)&n)[0] == 0;
}


x86 assembly (clang, -O0):
<ns_is_big_endian>:
push   %rbp
mov    %rsp,%rbp
movsbl 0xef5(%rip),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@ns_is_big_endian.n = internal constant i32 1
define i32 @ns_is_big_endian() {
%1 = load i8, i8* bitcast (i32* @ns_is_big_endian.n to i8*)
%2 = sext i8 %1 to i32
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @ns_is_big_endian() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ initpt_(int *, double *, int *, double *);
void mgh_initpt(int n, double *x, int nprob, double factor) {
  double _factor = factor;
  int _n = n, _nprob = nprob;
  assert(sizeof(double) == sizeof(*x));
  initpt_(&_n, (double *)x, &_nprob, &_factor);
}


x86 assembly (clang, -O0):
<mgh_initpt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    $0x1,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rsi
lea    -0x2c(%rbp),%rdi
lea    -0x30(%rbp),%rdx
lea    -0x28(%rbp),%rcx
call   1040 <initpt_@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mgh_initpt>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
movsd  %xmm0,0x8(%rsp)
mov    %edi,0x4(%rsp)
mov    %edx,(%rsp)
mov    $0x1,%edi
call   1030 <assert@plt>
lea    0x4(%rsp),%rdi
mov    %rsp,%rdx
lea    0x8(%rsp),%rcx
mov    %rbx,%rsi
call   1040 <initpt_@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @mgh_initpt(i32 %0, double* %1, i32 %2, double %3) {
%5 = alloca i32
%6 = alloca double*
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %5
store double* %1, double** %6
store i32 %2, i32* %7
store double %3, double* %8
%12 = load double, double* %8
store double %12, double* %9
%13 = load i32, i32* %5
store i32 %13, i32* %10
%14 = load i32, i32* %7
store i32 %14, i32* %11
%15 = call i32 @assert(i32 1)
%16 = load double*, double** %6
%17 = call i32 @initpt_(i32* %10, double* %16, i32* %11, double* %9)
ret void
}

LLVM IR (-O2):
define void @mgh_initpt(i32 %0, double* %1, i32 %2, double %3) {
%5 = alloca double
%6 = alloca i32
%7 = alloca i32
%8 = bitcast double* %5 to i8*
store double %3, double* %5
%9 = bitcast i32* %6 to i8*
store i32 %0, i32* %6
%10 = bitcast i32* %7 to i8*
store i32 %2, i32* %7
%11 = tail call i32 @assert(i32 1)
%12 = call i32 @initpt_(i32* %6, double* %1, i32* %7, double* %5)
ret void
}
int clone_superblocks(struct disk_image *di) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.disk_image = type opaque
define i32 @clone_superblocks(%struct.disk_image* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint8_t instruction_extension_extract_scale(uint16_t instruction) {
  return (instruction >> 0x09) & 0x03;
}


x86 assembly (clang, -O0):
<instruction_extension_extract_scale>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x9,%eax
and    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<instruction_extension_extract_scale>:
mov    %edi,%eax
shr    $0x9,%eax
and    $0x3,%eax
ret

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

LLVM IR (-O2):
define i32 @instruction_extension_extract_scale(i32 %0) {
%2 = lshr i32 %0, 9
%3 = and i32 %2, 3
ret i32 %3
}
/* Variables and functions */
int error(int, char *);
int b_unlimit(int argc, char *argv[]) {
  if (argc > 1)
    return error(1, argv[0]);
  return error(49, argv[0]);
}


x86 assembly (clang, -O0):
<b_unlimit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1142 <b_unlimit+0x32>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    $0x1,%edi
call   1030 <error@plt>
mov    %eax,-0x4(%rbp)
jmp    1156 <b_unlimit+0x46>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    $0x31,%edi
call   1030 <error@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_unlimit>:
cmp    $0x2,%edi
mov    (%rsi),%rsi
mov    $0x1,%eax
mov    $0x31,%edi
cmovge %eax,%edi
jmp    1030 <error@plt>

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

LLVM IR (-O2):
define i32 @b_unlimit(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
%4 = load i8*, i8** %1
%5 = select i1 %3, i32 1, i32 49
%6 = tail call i32 @error(i32 %5, i8* %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ clr_HasBMS(unsigned char *);
unsigned char *mk_void_BMS(unsigned char *pds) {
  clr_HasBMS(pds);
  return NULL;
}


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

x86 assembly (clang, -O2):
<mk_void_BMS>:
push   %rax
call   1030 <clr_HasBMS@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define noalias i8* @mk_void_BMS(i8* %0) {
%2 = tail call i32 @clr_HasBMS(i8* %0)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ UART1_Write(char);
void PrintHandler(char c) { UART1_Write(c); }


x86 assembly (clang, -O0):
<PrintHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <UART1_Write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintHandler>:
jmp    1030 <UART1_Write@plt>

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

LLVM IR (-O2):
define void @PrintHandler(i8 signext %0) {
%2 = tail call i32 @UART1_Write(i8 signext %0)
ret void
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
pid_t getpid(void) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<getpid>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec4(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpid>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @getpid() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @getpid() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret i32 -1
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ blue_mask;
};
typedef TYPE_1__ XImage;

/* Variables and functions */
unsigned long get_XImage_blue_mask(void *_p) {
  return (unsigned long)((XImage *)_p)->blue_mask;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XImage_blue_mask(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XImage_blue_mask(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ cpuAND();
int /*<<< orphan*/ cpuRORa();
int /*<<< orphan*/ cpuSetARRRegs();
void cpuARR() {
  cpuAND();
  cpuRORa();
  cpuSetARRRegs();
}


x86 assembly (clang, -O0):
<cpuARR>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <cpuAND@plt>
mov    $0x0,%al
call   1050 <cpuRORa@plt>
mov    $0x0,%al
call   1030 <cpuSetARRRegs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuARR>:
push   %rax
xor    %eax,%eax
call   1040 <cpuAND@plt>
xor    %eax,%eax
call   1050 <cpuRORa@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <cpuSetARRRegs@plt>

LLVM IR (-O0):
define void @cpuARR() {
%1 = call i32 (...) @cpuAND()
%2 = call i32 (...) @cpuRORa()
%3 = call i32 (...) @cpuSetARRRegs()
ret void
}

LLVM IR (-O2):
define void @cpuARR() {
%1 = tail call i32 (...) @cpuAND()
%2 = tail call i32 (...) @cpuRORa()
%3 = tail call i32 (...) @cpuSetARRRegs()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void foo(char *name, double d, double e, double f, int g) {
  if (g != 5)
    abort();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
mov    %esi,-0x24(%rbp)
cmpl   $0x5,-0x24(%rbp)
je     113f <foo+0x2f>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
cmp    $0x5,%esi
jne    1116 <foo+0x6>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define void @foo(i8* nocapture readnone %0, double %1, double %2, double %3, i32 %4) {
%6 = icmp eq i32 %4, 5
br i1 %6, label %9, label %7
7: ; preds = %5
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %5
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, int);
int self_atoi(char *);
int main(void) {
  char s[] = "-12344567";
  printf("%d\n", self_atoi(s));
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0xe(%rbp)
mov    0xec7(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0xe(%rbp),%rdi
call   1040 <self_atoi@plt>
mov    %eax,%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x363534343332312d,%rax
34 35 36
mov    %rax,0x8(%rsp)
movw   $0x37,0x10(%rsp)
lea    0x8(%rsp),%rdi
call   1040 <self_atoi@plt>
lea    0xebf(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.s = [10 x i8] c"-12344567\00"
@.str = [4 x i8] c"%d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @self_atoi(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIG_UNBLOCK;
int /*<<< orphan*/ sigfillset(int /*<<< orphan*/ *);
int /*<<< orphan*/ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *);
int sig_exit(void) {
  sigset_t mask;
  sigfillset(&mask);
  sigprocmask(SIG_UNBLOCK, &mask, NULL);
  return 0;
}


x86 assembly (clang, -O0):
<sig_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <sigfillset@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    -0x4(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigprocmask@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_exit>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <sigfillset@plt>
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@SIG_UNBLOCK = global i32 0
define i32 @sig_exit() {
%1 = alloca i32
%2 = call i32 @sigfillset(i32* %1)
%3 = load i32, i32* @SIG_UNBLOCK
%4 = call i32 @sigprocmask(i32 %3, i32* %1, i32* null)
ret i32 0
}

LLVM IR (-O2):
@SIG_UNBLOCK = global i32 0
define i32 @sig_exit() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @sigfillset(i32* %1)
%4 = load i32, i32* @SIG_UNBLOCK
%5 = call i32 @sigprocmask(i32 %4, i32* %1, i32* null)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ displays_refute_equal_failed(int, int, char const *, int);
void Displayer_display_refute_equal_failed(int exp, int act, const char *file,
                                           int line) {
  displays_refute_equal_failed(exp, act, file, line);
}


x86 assembly (clang, -O0):
<Displayer_display_refute_equal_failed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <displays_refute_equal_failed@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Displayer_display_refute_equal_failed>:
jmp    1030 <displays_refute_equal_failed@plt>

LLVM IR (-O0):
define void @Displayer_display_refute_equal_failed(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @displays_refute_equal_failed(i32 %9, i32 %10, i8* %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @Displayer_display_refute_equal_failed(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @displays_refute_equal_failed(i32 %0, i32 %1, i8* %2, i32 %3)
ret void
}
int g(void) { return 9; }


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

x86 assembly (clang, -O2):
<g>:
mov    $0x9,%eax
ret

LLVM IR (-O0):
define i32 @g() {
ret i32 9
}

LLVM IR (-O2):
define i32 @g() {
ret i32 9
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void freeMatrix(int **matrix, int rowSize) {
  int i;
  for (i = 0; i < rowSize; i++)
    free((void *)matrix[i]);
  free((void *)matrix);
}


x86 assembly (clang, -O0):
<freeMatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <freeMatrix+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <freeMatrix+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeMatrix>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <freeMatrix+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <freeMatrix+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @freeMatrix(i32** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i32*, i32** %0, i64 %7
%9 = bitcast i32** %8 to i8**
%10 = load i8*, i8** %9
%11 = tail call i32 @free(i8* %10)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = bitcast i32** %0 to i8*
%16 = tail call i32 @free(i8* %15)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char, char);
void fun(char a[10]) {
  char c = a[3];
  int i = sizeof(a);
  a = a + 3;
  printf("sizeof a:%d,a[3] = %c,*(a+3) = %c\n", i, c, *a);
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%al
mov    %al,-0x9(%rbp)
movl   $0x8,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x3,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%esi
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
lea    0xeb6(%rip),%rdi
movsbl %cl,%edx
movsbl (%rax),%ecx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
movsbl 0x3(%rdi),%ecx
lea    0xee5(%rip),%rdi
mov    $0x8,%esi
mov    %ecx,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"sizeof a:%d,a[3] = %c,*(a+3) = %c\0A\00"
define void @fun(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 3
%7 = load i8, i8* %6
store i8 %7, i8* %3
store i32 8, i32* %4
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 3
store i8* %9, i8** %2
%10 = load i32, i32* %4
%11 = load i8, i8* %3
%12 = load i8*, i8** %2
%13 = load i8, i8* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %10, i8 signext %11, i8 signext %13)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"sizeof a:%d,a[3] = %c,*(a+3) = %c\0A\00"
define void @fun(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 8, i8 signext %3, i8 signext %3)
ret void
}
unsigned float_i2f(int x) { return 2; }


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

x86 assembly (clang, -O2):
<float_i2f>:
mov    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @float_i2f(i32 %0) {
ret i32 2
}
/* Variables and functions */
int NI_USUAL_RTSI_SELECT(unsigned int);
unsigned NI_CDIO_SCAN_BEGIN_SRC_RTSI(unsigned rtsi_channel) {
  return NI_USUAL_RTSI_SELECT(rtsi_channel);
}


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

x86 assembly (clang, -O2):
<NI_CDIO_SCAN_BEGIN_SRC_RTSI>:
jmp    1030 <NI_USUAL_RTSI_SELECT@plt>

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

LLVM IR (-O2):
define i32 @NI_CDIO_SCAN_BEGIN_SRC_RTSI(i32 %0) {
%2 = tail call i32 @NI_USUAL_RTSI_SELECT(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int v(char *);
int main() {
  char *str = "Gate2015";
  if (1) {
    printf("This will never get printed !");
  }
  printf("%d", v(str));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee1(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeca(%rip),%rdi
call   1030 <v@plt>
lea    0xee5(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"Gate2015\00"
@.str.1 = [30 x i8] c"This will never get printed !\00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @v(i8* %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"Gate2015\00"
@.str.1 = [30 x i8] c"This will never get printed !\00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @v(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %2)
ret i32 0
}
int g(int *p) {
  *p++;
  return *p;
}


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

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

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

LLVM IR (-O2):
define i32 @g(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
scalar_t__ GetVramAddr(int, int);
void set_pixel(int x, int y, unsigned long color) {
  unsigned long *vptrc = 0, *vptrl = 0;
  vptrc = (unsigned long *)GetVramAddr(x, y);
  vptrl = (unsigned long *)vptrc;
  *vptrl = (unsigned long)color;
}


x86 assembly (clang, -O0):
<set_pixel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <GetVramAddr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_pixel>:
push   %rbx
mov    %rdx,%rbx
call   1030 <GetVramAddr@plt>
mov    %rbx,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @set_pixel(i32 %0, i32 %1, i64 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i64
%7 = alloca i64*
%8 = alloca i64*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i64 %2, i64* %6
store i64* null, i64** %7
store i64* null, i64** %8
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = call i64 @GetVramAddr(i32 %9, i32 %10)
%12 = inttoptr i64 %11 to i64*
store i64* %12, i64** %7
%13 = load i64*, i64** %7
store i64* %13, i64** %8
%14 = load i64, i64* %6
%15 = load i64*, i64** %8
store i64 %14, i64* %15
ret void
}

LLVM IR (-O2):
define void @set_pixel(i32 %0, i32 %1, i64 %2) {
%4 = tail call i64 @GetVramAddr(i32 %0, i32 %1)
%5 = inttoptr i64 %4 to i64*
store i64 %2, i64* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void superlu_free(void *addr) { free(addr); }


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

LLVM IR (-O0):
define void @superlu_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 @superlu_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void EPIConfigHB8TimingSet(uint32_t ui32Base, uint32_t ui32CS,
                           uint32_t ui32Config) {
  ASSERT(ui32Base == 0x400D0000);
  ASSERT(ui32CS < 4);
  (*((volatile uint32_t *)(ui32Base + (0x00000310 + (ui32CS << 2))))) =
      ui32Config;
}


x86 assembly (clang, -O0):
<EPIConfigHB8TimingSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x400d0000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
cmpl   $0x4,-0x8(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%edx
shl    $0x2,%edx
add    $0x310,%edx
add    %edx,%eax
cltq
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EPIConfigHB8TimingSet>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
cmp    $0x400d0000,%ebp
sete   %dil
call   1030 <ASSERT@plt>
xor    %edi,%edi
cmp    $0x4,%ebx
setl   %dil
call   1030 <ASSERT@plt>
lea    0x310(%rbp,%rbx,4),%eax
cltq
mov    %r14d,(%rax)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @EPIConfigHB8TimingSet(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 1074593792
%9 = zext i1 %8 to i32
%10 = call i32 @ASSERT(i32 %9)
%11 = load i32, i32* %5
%12 = icmp slt i32 %11, 4
%13 = zext i1 %12 to i32
%14 = call i32 @ASSERT(i32 %13)
%15 = load i32, i32* %6
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = shl i32 %17, 2
%19 = add nsw i32 784, %18
%20 = add nsw i32 %16, %19
%21 = sext i32 %20 to i64
%22 = inttoptr i64 %21 to i32*
store volatile i32 %15, i32* %22
ret void
}

LLVM IR (-O2):
define void @EPIConfigHB8TimingSet(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, 1074593792
%5 = zext i1 %4 to i32
%6 = tail call i32 @ASSERT(i32 %5)
%7 = icmp slt i32 %1, 4
%8 = zext i1 %7 to i32
%9 = tail call i32 @ASSERT(i32 %8)
%10 = shl i32 %1, 2
%11 = add i32 %0, 784
%12 = add i32 %11, %10
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i32*
store volatile i32 %2, i32* %14
ret void
}
/* Type definitions */
typedef scalar_t__ cl_int;

/* Variables and functions */
scalar_t__ CL_SUCCESS;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           scalar_t__);
int /*<<< orphan*/ stderr;
void checkErr(cl_int err, const char *name) {
  if (err != CL_SUCCESS) {
    fprintf(stderr, "ERROR: %s (%d)\n", name, err);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<checkErr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2e9d(%rip),%rcx
cmp    (%rcx),%rax
je     116b <checkErr+0x4b>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rcx
lea    0xea4(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkErr>:
push   %rax
mov    0x2eb0(%rip),%rax
cmp    %rdi,(%rax)
jne    112f <checkErr+0xf>
pop    %rax
ret
mov    %rsi,%rdx
mov    %rdi,%rcx
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
lea    0xebb(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@CL_SUCCESS = global i64 0
@stderr = global i32 0
@.str = [16 x i8] c"ERROR: %s (%d)\0A\00"
define void @checkErr(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%5 = load i64, i64* %3
%6 = load i64, i64* @CL_SUCCESS
%7 = icmp ne i64 %5, %6
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %4
%11 = load i64, i64* %3
%12 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %10, i64 %11)
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %2
ret void
}

LLVM IR (-O2):
@CL_SUCCESS = global i64 0
@stderr = global i32 0
@.str = [16 x i8] c"ERROR: %s (%d)\0A\00"
define void @checkErr(i64 %0, i8* %1) {
%3 = load i64, i64* @CL_SUCCESS
%4 = icmp eq i64 %3, %0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %1, i64 %0)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ a_init();
int main() {
  a_init();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <a_init@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @a_init()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @a_init()
ret i32 0
}
int map_index(int i, int j, int k, int m, int n, int p) {
  return n * p * i + p * j + k;
}


x86 assembly (clang, -O0):
<map_index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x18(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    -0x18(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    %ecx,%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<map_index>:
imul   %r8d,%edi
lea    (%rdi,%rsi,1),%eax
imul   %r9d,%eax
add    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @map_index(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = mul i32 %4, %0
%8 = add i32 %7, %1
%9 = mul i32 %8, %5
%10 = add i32 %9, %2
ret i32 %10
}
int c_rawreader__(fd, bb, n)
int *fd, *n;
char bb[];
{
  int i, nn;
  nn = (*n);
  i = read(*fd, bb, nn);
  if (i == nn)
    return (0);
  else
    return (i);
}


x86 assembly (clang, -O0):
<c_rawreader__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rsi
mov    -0x28(%rbp),%edx
mov    $0x0,%al
call   1030 <read@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x28(%rbp),%eax
jne    115c <c_rawreader__+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    1162 <c_rawreader__+0x52>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_rawreader__>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdx),%ebx
mov    (%rdi),%edi
xor    %ebp,%ebp
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <read@plt>
cmp    %ebx,%eax
cmove  %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @c_rawreader__(i32* nocapture %0, i8* %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = load i32, i32* %0
%6 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @read to i32 (i32, i8*, i32, ...)*)(i32 %5, i8* %1, i32 %4)
%7 = icmp eq i32 %6, %4
%8 = select i1 %7, i32 0, i32 %6
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ _lis(int *, int, int *);
int lis(int arr[], int n) {
  int max = 1;
  _lis(arr, n, &max);
  return max;
}


x86 assembly (clang, -O0):
<lis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x10(%rbp),%rdx
call   1030 <_lis@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lis>:
push   %rax
movl   $0x1,0x4(%rsp)
lea    0x4(%rsp),%rdx
call   1030 <_lis@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @lis(i32* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 1, i32* %3
%5 = call i32 @_lis(i32* %0, i32 %1, i32* %3)
%6 = load i32, i32* %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ CompileDoes(int);
int DecodeName();
void DoRedo(void) {
  int y;
  if ((y = DecodeName()) != (-1))
    CompileDoes(y);
}


x86 assembly (clang, -O0):
<DoRedo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <DecodeName@plt>
mov    %eax,-0x4(%rbp)
cmp    $0xffffffff,%eax
je     1143 <DoRedo+0x23>
mov    -0x4(%rbp),%edi
call   1040 <CompileDoes@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoRedo>:
push   %rax
xor    %eax,%eax
call   1030 <DecodeName@plt>
cmp    $0xffffffff,%eax
je     1135 <DoRedo+0x15>
mov    %eax,%edi
pop    %rax
jmp    1040 <CompileDoes@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @DoRedo() {
%1 = tail call i32 (...) @DecodeName()
%2 = icmp eq i32 %1, -1
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @CompileDoes(i32 %1)
br label %5
5: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
void usage(void) {
  puts("usage: spyserv [ -s SERVER ] [ -p SERVERPORT ] [ -l LOCALPORT ]");
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [64 x i8] c"usage: spyserv [ -s SERVER ] [ -p SERVERPORT ] [ -l LOCALPORT ]\00"
define void @usage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [64 x i8] c"usage: spyserv [ -s SERVER ] [ -p SERVERPORT ] [ -l LOCALPORT ]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ syscall(int, int, int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/, int /*<<< orphan*/);
void msgwait(int port) { syscall(4, port, 0, 0, 0, 0); }


x86 assembly (clang, -O0):
<msgwait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x4,%edi
xor    %r9d,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msgwait>:
mov    %edi,%esi
mov    $0x4,%edi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define void @msgwait(i32 %0) {
%2 = tail call i32 @syscall(i32 4, i32 %0, i32 0, i32 0, i32 0, i32 0)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ root;
};
typedef TYPE_1__ XEnterWindowEvent;

/* Variables and functions */
unsigned long get_XEnterWindowEvent_root(void *_p) {
  return (unsigned long)((XEnterWindowEvent *)_p)->root;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XEnterWindowEvent_root(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XEnterWindowEvent_root(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int HextoDec(char *);
int strlen(char *);
int xstrtoi(char *hex) { return HextoDec(hex + strlen(hex) - 1); }


x86 assembly (clang, -O0):
<xstrtoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
cltq
add    %rax,%rdi
add    $0xffffffffffffffff,%rdi
call   1040 <HextoDec@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrtoi>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
lea    (%rbx,%rax,1),%rdi
add    $0xffffffffffffffff,%rdi
pop    %rbx
jmp    1040 <HextoDec@plt>

LLVM IR (-O0):
define i32 @xstrtoi(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %3, i64 %6
%8 = getelementptr inbounds i8, i8* %7, i64 -1
%9 = call i32 @HextoDec(i8* %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @xstrtoi(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = getelementptr inbounds i8, i8* %4, i64 -1
%6 = tail call i32 @HextoDec(i8* %5)
ret i32 %6
}
unsigned char FPT_CalcLrc(unsigned char buffer[]) {
  int i;
  unsigned char lrc;
  lrc = 0;
  for (i = 0; i < 32; i++)
    lrc ^= buffer[i];
  return lrc;
}


x86 assembly (clang, -O0):
<FPT_CalcLrc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0xd(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
jge    1140 <FPT_CalcLrc+0x40>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%ecx
movzbl -0xd(%rbp),%eax
xor    %ecx,%eax
mov    %al,-0xd(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1113 <FPT_CalcLrc+0x13>
movzbl -0xd(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FPT_CalcLrc>:
movdqu (%rdi),%xmm0
movdqu 0x10(%rdi),%xmm1
pxor   %xmm0,%xmm1
pshufd $0xee,%xmm1,%xmm0
pxor   %xmm1,%xmm0
pshufd $0x55,%xmm0,%xmm1
pxor   %xmm0,%xmm1
movdqa %xmm1,%xmm0
psrld  $0x10,%xmm0
pxor   %xmm1,%xmm0
movdqa %xmm0,%xmm1
psrlw  $0x8,%xmm1
pxor   %xmm0,%xmm1
movd   %xmm1,%eax
ret

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

LLVM IR (-O2):
define zeroext i8 @FPT_CalcLrc(i8* nocapture %0) {
%2 = bitcast i8* %0 to <32 x i8>*
%3 = load <32 x i8>, <32 x i8>* %2
%4 = call i8 @llvm.vector.reduce.xor.v32i8(<32 x i8> %3)
ret i8 %4
}