xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;
typedef int /*<<< orphan*/ p;

/* Variables and functions */
uint16_t libcperciva_le16dec(const void *pp) {
  const uint8_t *p = (uint8_t const *)pp;
  return ((uint16_t)(p[0]) + ((uint16_t)(p[1]) << 8));
}


x86 assembly (clang, -O0):
<libcperciva_le16dec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%rcx
shl    $0x8,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<libcperciva_le16dec>:
mov    0x8(%rdi),%eax
shl    $0x8,%eax
add    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @libcperciva_le16dec(i8* %0) {
%2 = alloca i8*
%3 = alloca i64*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i64*
store i64* %5, i64** %3
%6 = load i64*, i64** %3
%7 = getelementptr inbounds i64, i64* %6, i64 0
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
%10 = load i64*, i64** %3
%11 = getelementptr inbounds i64, i64* %10, i64 1
%12 = load i64, i64* %11
%13 = trunc i64 %12 to i32
%14 = shl i32 %13, 8
%15 = add nsw i32 %9, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @libcperciva_le16dec(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = getelementptr inbounds i8, i8* %0, i64 8
%6 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
%9 = shl i32 %8, 8
%10 = add nsw i32 %9, %4
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print(char *msg1, char *msg2) {
  if (msg1)
    printf("%s\n", msg1);
  if (msg2)
    printf("\t%s\n", msg2);
  printf("END OF MESSAGE");
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113d <print+0x2d>
mov    -0x8(%rbp),%rsi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpq   $0x0,-0x10(%rbp)
je     115a <print+0x4a>
mov    -0x10(%rbp),%rsi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %rbx
mov    %rsi,%rbx
test   %rdi,%rdi
je     112e <print+0xe>
call   1030 <puts@plt>
test   %rbx,%rbx
je     1144 <print+0x24>
lea    0xec6(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeba(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [5 x i8] c"\09%s\0A\00"
@.str.2 = [15 x i8] c"END OF MESSAGE\00"
define void @print(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 = icmp ne i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %10
10: ; preds = %7, %2
%11 = load i8*, i8** %4
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i8*, i8** %4
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %14)
br label %16
16: ; preds = %13, %10
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c"\09%s\0A\00"
@.str.2 = [15 x i8] c"END OF MESSAGE\00"
define void @print(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* %0)
br label %6
6: ; preds = %4, %2
%7 = icmp eq i8* %1, null
br i1 %7, label %10, label %8
8: ; preds = %6
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %1)
br label %10
10: ; preds = %8, %6
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
ret void
}
char *checkmessages(char *NXTaddr, char *NXTACCTSECRET, char *senderNXTaddr) {
  return (0);
}


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

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

LLVM IR (-O0):
define i8* @checkmessages(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @checkmessages(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
ret i8* null
}
double dddotprod(double *a, double *b) {
  return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
}


x86 assembly (clang, -O0):
<dddotprod>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dddotprod>:
movsd  0x8(%rdi),%xmm0
mulsd  0x8(%rsi),%xmm0
movsd  (%rdi),%xmm1
mulsd  (%rsi),%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  0x10(%rsi),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dddotprod(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = load double*, double** %3
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = fmul double %13, %16
%18 = call double @llvm.fmuladd.f64(double %7, double %10, double %17)
%19 = load double*, double** %3
%20 = getelementptr inbounds double, double* %19, i64 2
%21 = load double, double* %20
%22 = load double*, double** %4
%23 = getelementptr inbounds double, double* %22, i64 2
%24 = load double, double* %23
%25 = call double @llvm.fmuladd.f64(double %21, double %24, double %18)
ret double %25
}

LLVM IR (-O2):
define double @dddotprod(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = getelementptr inbounds double, double* %0, i64 1
%6 = load double, double* %5
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = load double, double* %7
%9 = fmul double %6, %8
%10 = tail call double @llvm.fmuladd.f64(double %3, double %4, double %9)
%11 = getelementptr inbounds double, double* %0, i64 2
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %1, i64 2
%14 = load double, double* %13
%15 = tail call double @llvm.fmuladd.f64(double %12, double %14, double %10)
ret double %15
}
/* Type definitions */
struct UPnPService {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void AVRCP_ResponseSink_AVTransport_Seek(struct UPnPService *Service,
                                         int ErrorCode, void *User) {
  printf("AVRCP_ Invoke Response: AVTransport/Seek[ErrorCode:%d]()\r\n",
         ErrorCode);
}


x86 assembly (clang, -O0):
<AVRCP_ResponseSink_AVTransport_Seek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
@.str = [59 x i8] c"AVRCP_ Invoke Response: AVTransport/Seek[ErrorCode:%d]()\0D\0A\00"
define void @AVRCP_ResponseSink_AVTransport_Seek(%struct.UPnPService* %0, i32 %1, i8* %2) {
%4 = alloca %struct.UPnPService*
%5 = alloca i32
%6 = alloca i8*
store %struct.UPnPService* %0, %struct.UPnPService** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [59 x i8] c"AVRCP_ Invoke Response: AVTransport/Seek[ErrorCode:%d]()\0D\0A\00"
define void @AVRCP_ResponseSink_AVTransport_Seek(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int vmcoreinfo_item_ulong(unsigned long *, char *, char const *, int);
int dfi_vmcoreinfo_offset(unsigned long *off, const char *sym) {
  return vmcoreinfo_item_ulong(off, "OFFSET", sym, 10);
}


x86 assembly (clang, -O0):
<dfi_vmcoreinfo_offset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rsi
mov    $0xa,%ecx
call   1030 <vmcoreinfo_item_ulong@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dfi_vmcoreinfo_offset>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
mov    $0xa,%ecx
jmp    1030 <vmcoreinfo_item_ulong@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"OFFSET\00"
define i32 @dfi_vmcoreinfo_offset(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 i8*, i8** %4
%7 = call i32 @vmcoreinfo_item_ulong(i64* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %6, i32 10)
ret i32 %7
}

LLVM IR (-O2):
@.str = [7 x i8] c"OFFSET\00"
define i32 @dfi_vmcoreinfo_offset(i64* %0, i8* %1) {
%3 = tail call i32 @vmcoreinfo_item_ulong(i64* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %1, i32 10)
ret i32 %3
}
void foo3(void) {
  int i;
#pragma acc kernels copyin(i)
  { i = 1; }
}


x86 assembly (clang, -O0):
<foo3>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @foo3() {
ret void
}
float phi4(float mu, float psi) { return mu * psi; }


x86 assembly (clang, -O0):
<phi4>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<phi4>:
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @phi4(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fmul float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @phi4(float %0, float %1) {
%3 = fmul float %0, %1
ret float %3
}
/* Variables and functions */
int lnk_start();
int cpio_strd(void) { return (lnk_start()); }


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

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

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

LLVM IR (-O2):
define i32 @cpio_strd() {
%1 = tail call i32 (...) @lnk_start()
ret i32 %1
}
float __complex__ p(float __complex__ a, float __complex__ b) { return a + b; }


x86 assembly (clang, -O0):
<p>:
push   %rbp
mov    %rsp,%rbp
movlpd %xmm0,-0x10(%rbp)
movlpd %xmm1,-0x18(%rbp)
movss  -0x10(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
movss  -0x18(%rbp),%xmm3
movss  -0x14(%rbp),%xmm2
addss  %xmm3,%xmm1
addss  %xmm2,%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0x4(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<p>:
addps  %xmm1,%xmm0
ret

LLVM IR (-O0):
define <2 x float> @p(<2 x float> %0, <2 x float> %1) {
%3 = alloca { float, float }
%4 = alloca { float, float }
%5 = alloca { float, float }
%6 = bitcast { float, float }* %4 to <2 x float>*
store <2 x float> %0, <2 x float>* %6
%7 = bitcast { float, float }* %5 to <2 x float>*
store <2 x float> %1, <2 x float>* %7
%8 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 0
%9 = load float, float* %8
%10 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 1
%11 = load float, float* %10
%12 = getelementptr inbounds { float, float }, { float, float }* %5, i32 0, i32 0
%13 = load float, float* %12
%14 = getelementptr inbounds { float, float }, { float, float }* %5, i32 0, i32 1
%15 = load float, float* %14
%16 = fadd float %9, %13
%17 = fadd float %11, %15
%18 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 0
%19 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 1
store float %16, float* %18
store float %17, float* %19
%20 = bitcast { float, float }* %3 to <2 x float>*
%21 = load <2 x float>, <2 x float>* %20
ret <2 x float> %21
}

LLVM IR (-O2):
define <2 x float> @p(<2 x float> %0, <2 x float> %1) {
%3 = fadd <2 x float> %0, %1
ret <2 x float> %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
scalar_t__ creat(char *, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void create_file(char *filename) {
  if (creat(filename, 0755) < 0) {
    printf("create file %s failure!\n", filename);
    exit(EXIT_FAILURE);
  } else {
    printf("create file %s success!\n", filename);
  }
}


x86 assembly (clang, -O0):
<create_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1ed,%esi
call   1040 <creat@plt>
cmp    $0x0,%rax
jge    1172 <create_file+0x42>
mov    -0x8(%rbp),%rsi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%rsi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_file>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1ed,%esi
call   1040 <creat@plt>
test   %rax,%rax
js     1153 <create_file+0x23>
lea    0xecf(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <printf@plt>
lea    0xea6(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"create file %s failure!\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [25 x i8] c"create file %s success!\0A\00"
define void @create_file(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @creat(i8* %3, i32 493)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %1
%12 = load i8*, i8** %2
%13 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %11
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"create file %s failure!\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [25 x i8] c"create file %s success!\0A\00"
define void @create_file(i8* %0) {
%2 = tail call i64 @creat(i8* %0, i32 493)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
%9 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ display;
};
typedef TYPE_1__ XEDataObject;

/* Variables and functions */
void *get_XEDataObject_display(void *_p) {
  return (void *)((XEDataObject *)_p)->display;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i8* @get_XEDataObject_display(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
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}

LLVM IR (-O2):
define i8* @get_XEDataObject_display(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void riplFree(void *block) { free(block); }


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

LLVM IR (-O0):
define void @riplFree(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 @riplFree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int dns_v_api(void) { return 0x20120806; }


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

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

LLVM IR (-O0):
define i32 @dns_v_api() {
ret i32 538052614
}

LLVM IR (-O2):
define i32 @dns_v_api() {
ret i32 538052614
}
/* Type definitions */
struct wl_subsurface {
  int dummy;
};
struct wl_proxy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_marshal(struct wl_proxy *, int);
void wl_subsurface_set_desync(struct wl_subsurface *wl_subsurface) {
  wl_proxy_marshal((struct wl_proxy *)wl_subsurface, 5);
}


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

x86 assembly (clang, -O2):
<wl_subsurface_set_desync>:
mov    $0x5,%esi
jmp    1030 <wl_proxy_marshal@plt>

LLVM IR (-O0):
%struct.wl_subsurface = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_subsurface_set_desync(%struct.wl_subsurface* %0) {
%2 = alloca %struct.wl_subsurface*
store %struct.wl_subsurface* %0, %struct.wl_subsurface** %2
%3 = load %struct.wl_subsurface*, %struct.wl_subsurface** %2
%4 = bitcast %struct.wl_subsurface* %3 to %struct.wl_proxy*
%5 = call i32 @wl_proxy_marshal(%struct.wl_proxy* %4, i32 5)
ret void
}

LLVM IR (-O2):
%struct.wl_subsurface = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_subsurface_set_desync(%struct.wl_subsurface* %0) {
%2 = bitcast %struct.wl_subsurface* %0 to %struct.wl_proxy*
%3 = tail call i32 @wl_proxy_marshal(%struct.wl_proxy* %2, i32 5)
ret void
}
/* Variables and functions */
int match(char const *, char *);
int esEtiquetaSalto(const char *linea) {
  return match(linea, "^[_a-z][0-9a-z_]+");
}


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

x86 assembly (clang, -O2):
<esEtiquetaSalto>:
lea    0xee9(%rip),%rsi
jmp    1030 <match@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"^[_a-z][0-9a-z_]+\00"
define i32 @esEtiquetaSalto(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @match(i8* %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@.str = [18 x i8] c"^[_a-z][0-9a-z_]+\00"
define i32 @esEtiquetaSalto(i8* %0) {
%2 = tail call i32 @match(i8* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int exp(float);
float function_binary(float in) { return 1 / (1 + exp(-in)); }


x86 assembly (clang, -O0):
<function_binary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
call   1030 <exp@plt>
mov    %eax,%ecx
add    $0x1,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<function_binary>:
push   %rax
xorps  0xee8(%rip),%xmm0
call   1030 <exp@plt>
lea    0x1(%rax),%ecx
add    $0x2,%eax
xor    %edx,%edx
cmp    $0x3,%eax
cmovb  %ecx,%edx
xorps  %xmm0,%xmm0
cvtsi2ss %edx,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @function_binary(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fneg float %3
%5 = call i32 @exp(float %4)
%6 = add nsw i32 1, %5
%7 = sdiv i32 1, %6
%8 = sitofp i32 %7 to float
ret float %8
}

LLVM IR (-O2):
define float @function_binary(float %0) {
%2 = fneg float %0
%3 = tail call i32 @exp(float %2)
%4 = add nsw i32 %3, 1
%5 = add i32 %3, 2
%6 = icmp ult i32 %5, 3
%7 = select i1 %6, i32 %4, i32 0
%8 = sitofp i32 %7 to float
ret float %8
}
void XcmsCIEXYZToRGBi() {}


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

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

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

LLVM IR (-O2):
define void @XcmsCIEXYZToRGBi() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void clear_screen(void) {
  printf("\n\r\033[2J");
  printf("\033[H");
}


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

x86 assembly (clang, -O2):
<clear_screen>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"\0A\0D\1B[2J\00"
@.str.1 = [4 x i8] c"\1B[H\00"
define void @clear_screen() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\0A\0D\1B[2J\00"
@.str.1 = [4 x i8] c"\1B[H\00"
define void @clear_screen() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}
char *groupNameForTask(int taskNum) {
  if (taskNum == 0)
    return "admin";
  return "admin";
}


x86 assembly (clang, -O0):
<groupNameForTask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1121 <groupNameForTask+0x21>
lea    0xee8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    112c <groupNameForTask+0x2c>
lea    0xed8(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"admin\00"
define i8* @groupNameForTask(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
8: ; preds = %7, %6
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [6 x i8] c"admin\00"
define i8* @groupNameForTask(i32 %0) {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int stress_l1cache_set(char const *, char *, int);
int stress_l1cache_set_sets(const char *opt) {
  return stress_l1cache_set(opt, "l1cache-sets", 65536);
}


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

x86 assembly (clang, -O2):
<stress_l1cache_set_sets>:
lea    0xee9(%rip),%rsi
mov    $0x10000,%edx
jmp    1030 <stress_l1cache_set@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"l1cache-sets\00"
define i32 @stress_l1cache_set_sets(i8* %0) {
%2 = tail call i32 @stress_l1cache_set(i8* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 65536)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ notify_pvcall(char *);
int pvSetCCDTemperatureRaw(char byBoardNum, char byTemp) {
  notify_pvcall("f");
  return (0);
}


x86 assembly (clang, -O0):
<pvSetCCDTemperatureRaw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
lea    0xed5(%rip),%rdi
call   1030 <notify_pvcall@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"f\00"
define i32 @pvSetCCDTemperatureRaw(i8 signext %0, i8 signext %1) {
%3 = tail call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int main(int x) {
  char c;
  return x + c;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl -0x9(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
store i32 0, i32* %2
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = add nsw i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ fatal(int /*<<< orphan*/);
void *malloc(size_t);
void *realloc(void *, size_t);
void *allocate(void *mem, size_t size) {
  mem = mem == 0 ? malloc(size) : realloc(mem, size);
  if (mem == 0)
    fatal(0);
  return mem;
}


x86 assembly (clang, -O0):
<allocate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    115d <allocate+0x2d>
mov    -0x10(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
jmp    116e <allocate+0x3e>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1188 <allocate+0x58>
xor    %edi,%edi
call   1050 <fatal@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocate>:
push   %rbx
test   %rdi,%rdi
je     113d <allocate+0xd>
call   1040 <realloc@plt>
jmp    1145 <allocate+0x15>
mov    %rsi,%rdi
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1154 <allocate+0x24>
xor    %edi,%edi
call   1050 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @allocate(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i64, i64* %4
%9 = call i8* @malloc(i64 %8)
br label %14
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = load i64, i64* %4
%13 = call i8* @realloc(i8* %11, i64 %12)
br label %14
14: ; preds = %10, %7
%15 = phi i8* [ %9, %7 ], [ %13, %10 ]
store i8* %15, i8** %3
%16 = load i8*, i8** %3
%17 = icmp eq i8* %16, null
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = call i32 @fatal(i32 0)
br label %20
20: ; preds = %18, %14
%21 = load i8*, i8** %3
ret i8* %21
}

LLVM IR (-O2):
define i8* @allocate(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i8* @malloc(i64 %1)
br label %8
6: ; preds = %2
%7 = tail call i8* @realloc(i8* %0, i64 %1)
br label %8
8: ; preds = %6, %4
%9 = phi i8* [ %5, %4 ], [ %7, %6 ]
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = tail call i32 @fatal(i32 0)
br label %13
13: ; preds = %11, %8
ret i8* %9
}
/* Variables and functions */
int labs(long);
int DST_ACGetPtableIndex(long PredicVal, int PtableLen) {
  int j;
  j = labs(PredicVal) >> (9 - 6);
  if (j >= PtableLen) {
    j = PtableLen - 1;
  }
  return j;
}


x86 assembly (clang, -O0):
<DST_ACGetPtableIndex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <labs@plt>
sar    $0x3,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1143 <DST_ACGetPtableIndex+0x33>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DST_ACGetPtableIndex>:
push   %rbx
mov    %esi,%ebx
call   1030 <labs@plt>
sar    $0x3,%eax
lea    -0x1(%rbx),%ecx
cmp    %ebx,%eax
cmovge %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @DST_ACGetPtableIndex(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%6 = load i64, i64* %3
%7 = call i32 @labs(i64 %6)
%8 = ashr i32 %7, 3
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = icmp sge i32 %9, %10
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load i32, i32* %4
%14 = sub nsw i32 %13, 1
store i32 %14, i32* %5
br label %15
15: ; preds = %12, %2
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
define i32 @DST_ACGetPtableIndex(i64 %0, i32 %1) {
%3 = tail call i32 @labs(i64 %0)
%4 = ashr i32 %3, 3
%5 = icmp slt i32 %4, %1
%6 = add nsw i32 %1, -1
%7 = select i1 %5, i32 %4, i32 %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ Test_DirWalker();
void test_run() { Test_DirWalker(); }


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

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

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

LLVM IR (-O2):
define void @test_run() {
%1 = tail call i32 (...) @Test_DirWalker()
ret void
}
/* Variables and functions */
float lerpf(float, float, float);
float bezier2_component(float p0, float p1, float p2, float t) {
  return lerpf(lerpf(p0, p1, t), lerpf(p1, p2, t), t);
}


x86 assembly (clang, -O0):
<bezier2_component>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0x10(%rbp),%xmm2
call   1030 <lerpf@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  -0x10(%rbp),%xmm2
call   1030 <lerpf@plt>
movaps %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
movss  -0x10(%rbp),%xmm2
call   1030 <lerpf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bezier2_component>:
sub    $0x18,%rsp
movss  %xmm3,0x8(%rsp)
movss  %xmm2,0x14(%rsp)
movss  %xmm1,0xc(%rsp)
movaps %xmm3,%xmm2
call   1030 <lerpf@plt>
movss  %xmm0,0x10(%rsp)
movss  0xc(%rsp),%xmm0
movss  0x14(%rsp),%xmm1
movss  0x8(%rsp),%xmm2
call   1030 <lerpf@plt>
movaps %xmm0,%xmm1
movss  0x10(%rsp),%xmm0
movss  0x8(%rsp),%xmm2
add    $0x18,%rsp
jmp    1030 <lerpf@plt>

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

LLVM IR (-O2):
define float @bezier2_component(float %0, float %1, float %2, float %3) {
%5 = tail call float @lerpf(float %0, float %1, float %3)
%6 = tail call float @lerpf(float %1, float %2, float %3)
%7 = tail call float @lerpf(float %5, float %6, float %3)
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *const);
void log_dmp_callback_console(const char *const log) { printf("%s", log); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @log_dmp_callback_console(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char const *, unsigned int);
unsigned int arikkei_memcpy(unsigned char *d, unsigned int d_len,
                            const unsigned char *s, unsigned int s_len) {
  unsigned int len = s_len;
  if (len > d_len)
    len = d_len;
  if ((len > 0) && d)
    memcpy(d, s, len);
  return s_len;
}


x86 assembly (clang, -O0):
<arikkei_memcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0xc(%rbp),%eax
jbe    113e <arikkei_memcpy+0x2e>
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jbe    1163 <arikkei_memcpy+0x53>
cmpq   $0x0,-0x8(%rbp)
je     1163 <arikkei_memcpy+0x53>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arikkei_memcpy>:
push   %rbx
mov    %ecx,%ebx
mov    %esi,%eax
cmp    %esi,%ecx
cmovbe %ecx,%eax
test   %rdi,%rdi
je     112d <arikkei_memcpy+0x1d>
test   %eax,%eax
je     112d <arikkei_memcpy+0x1d>
mov    %rdx,%rsi
mov    %eax,%edx
call   1030 <memcpy@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @arikkei_memcpy(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = load i32, i32* %8
store i32 %10, i32* %9
%11 = load i32, i32* %9
%12 = load i32, i32* %6
%13 = icmp ugt i32 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %4
%15 = load i32, i32* %6
store i32 %15, i32* %9
br label %16
16: ; preds = %14, %4
%17 = load i32, i32* %9
%18 = icmp ugt i32 %17, 0
br i1 %18, label %19, label %27
19: ; preds = %16
%20 = load i8*, i8** %5
%21 = icmp ne i8* %20, null
br i1 %21, label %22, label %27
22: ; preds = %19
%23 = load i8*, i8** %5
%24 = load i8*, i8** %7
%25 = load i32, i32* %9
%26 = call i32 @memcpy(i8* %23, i8* %24, i32 %25)
br label %27
27: ; preds = %22, %19, %16
%28 = load i32, i32* %8
ret i32 %28
}

LLVM IR (-O2):
define i32 @arikkei_memcpy(i8* %0, i32 %1, i8* %2, i32 returned %3) {
%5 = icmp ugt i32 %3, %1
%6 = select i1 %5, i32 %1, i32 %3
%7 = icmp ne i32 %6, 0
%8 = icmp ne i8* %0, null
%9 = and i1 %8, %7
br i1 %9, label %10, label %12
10: ; preds = %4
%11 = tail call i32 @memcpy(i8* %0, i8* %2, i32 %6)
br label %12
12: ; preds = %10, %4
ret i32 %3
}
/* Variables and functions */
void *mem_chr(const void *s, int c, size_t n) {
  const unsigned char *p = (const unsigned char *)s;
  while (n--) {
    if (*p == (unsigned char)c)
      return (void *)p;
    ++p;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<mem_chr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x20(%rbp)
cmp    $0x0,%rax
je     1163 <mem_chr+0x63>
mov    -0x28(%rbp),%rax
movzbl (%rax),%eax
mov    -0x14(%rbp),%ecx
movzbl %cl,%ecx
cmp    %ecx,%eax
jne    1152 <mem_chr+0x52>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116b <mem_chr+0x6b>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1117 <mem_chr+0x17>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_chr>:
test   %rdx,%rdx
je     1122 <mem_chr+0x22>
mov    %rdi,%rax
nopl   0x0(%rax,%rax,1)
cmp    %sil,(%rax)
je     1124 <mem_chr+0x24>
add    $0xffffffffffffffff,%rdx
add    $0x1,%rax
test   %rdx,%rdx
jne    1110 <mem_chr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @mem_chr(i8* %0, i32 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %16, label %5
5: ; preds = %3
%6 = trunc i32 %1 to i8
br label %7
7: ; preds = %5, %13
%8 = phi i64 [ %2, %5 ], [ %10, %13 ]
%9 = phi i8* [ %0, %5 ], [ %14, %13 ]
%10 = add i64 %8, -1
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, %6
br i1 %12, label %16, label %13
13: ; preds = %7
%14 = getelementptr inbounds i8, i8* %9, i64 1
%15 = icmp eq i64 %10, 0
br i1 %15, label %16, label %7
16: ; preds = %7, %13, %3
%17 = phi i8* [ null, %3 ], [ null, %13 ], [ %9, %7 ]
ret i8* %17
}
int main(void) {
  int a;
  &a + 2;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%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 = getelementptr inbounds i32, i32* %1, i64 2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
scalar_t__ compact_conflicts();
scalar_t__ compact_domains();
int data_init() {
  if (compact_domains())
    return -1;
  if (compact_conflicts())
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<data_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <compact_domains@plt>
cmp    $0x0,%rax
je     1145 <data_init+0x25>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <data_init+0x49>
mov    $0x0,%al
call   1040 <compact_conflicts@plt>
cmp    $0x0,%rax
je     1162 <data_init+0x42>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <data_init+0x49>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<data_init>:
push   %rax
xor    %eax,%eax
call   1030 <compact_domains@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
je     1137 <data_init+0x17>
pop    %rcx
ret
xor    %eax,%eax
call   1040 <compact_conflicts@plt>
neg    %rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @data_init() {
%1 = alloca i32
%2 = call i64 (...) @compact_domains()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 -1, i32* %1
br label %10
5: ; preds = %0
%6 = call i64 (...) @compact_conflicts()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %5
store i32 -1, i32* %1
br label %10
9: ; preds = %5
store i32 0, i32* %1
br label %10
10: ; preds = %9, %8, %4
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
define i32 @data_init() {
%1 = tail call i64 (...) @compact_domains()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i64 (...) @compact_conflicts()
%5 = icmp ne i64 %4, 0
%6 = sext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ -1, %0 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void main() {
  char a[5] = "abcd";
  int b = 3;
  printf("%c\n", a[b]);
  printf("%c\n", ((char *)b)[(int)a]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee2(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xedd(%rip),%al
mov    %al,-0x1(%rbp)
movl   $0x3,-0xc(%rbp)
movslq -0xc(%rbp),%rax
lea    0xec9(%rip),%rdi
movsbl -0x5(%rbp,%rax,1),%esi
call   1030 <printf@plt>
movslq -0xc(%rbp),%rax
lea    -0x5(%rbp),%rcx
movslq %ecx,%rcx
lea    0xead(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xc(%rsp)
movl   $0x64636261,0x8(%rsp)
64
lea    0xedc(%rip),%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
call   1030 <printf@plt>
lea    0x8(%rsp),%rax
cltq
movsbl 0x3(%rax),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.a = [5 x i8] c"abcd\00"
@.str = [4 x i8] c"%c\0A\00"
define void @main() {
%1 = alloca [5 x i8]
%2 = alloca i32
%3 = bitcast [5 x i8]* %1 to i8*
store i32 3, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 %5
%7 = load i8, i8* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %7)
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i8*
%12 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%13 = ptrtoint i8* %12 to i32
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %11, i64 %14
%16 = load i8, i8* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %16)
ret void
}

LLVM IR (-O2):
@__const.main.a = [5 x i8] c"abcd\00"
@.str = [4 x i8] c"%c\0A\00"
define void @main() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext 100)
%4 = ptrtoint [5 x i8]* %1 to i64
%5 = shl i64 %4, 32
%6 = ashr exact i64 %5, 32
%7 = getelementptr inbounds i8, i8* inttoptr (i64 3 to i8*), i64 %6
%8 = load i8, i8* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
int main(int argc, char **argv) {
  char name[20];
  printf("Hello. What's your name?\n");
  fgets(name, 20, stdin);
  printf("Hi there, %s", name);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    0x2e99(%rip),%rax
mov    (%rax),%edx
mov    $0x14,%esi
call   1040 <fgets@plt>
lea    -0x30(%rbp),%rsi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x14,%esi
call   1050 <fgets@plt>
lea    0xe9f(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Hello. What's your name?\0A\00"
@stdin = global i32 0
@.str.1 = [13 x i8] c"Hi there, %s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [20 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [20 x i8], [20 x i8]* %6, i64 0, i64 0
%9 = load i32, i32* @stdin
%10 = call i32 @fgets(i8* %8, i32 20, i32 %9)
%11 = getelementptr inbounds [20 x i8], [20 x i8]* %6, i64 0, i64 0
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %11)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str.1 = [13 x i8] c"Hi there, %s\00"
@str = [25 x i8] c"Hello. What's your name?\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [20 x i8]
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%6 = load i32, i32* @stdin
%7 = call i32 @fgets(i8* %4, i32 20, i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __u32;

/* Variables and functions */
int /*<<< orphan*/ __swahb32p(int /*<<< orphan*/ *);
void __swahb32s(__u32 *addr) {
  do {
    *(addr) = __swahb32p((addr));
  } while (0);
}


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

x86 assembly (clang, -O2):
<__swahb32s>:
push   %rbx
mov    %rdi,%rbx
call   1030 <__swahb32p@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @__swahb32s(i32* %0) {
%2 = tail call i32 @__swahb32p(i32* %0)
store i32 %2, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Neil McGettigan\n\nCastleknock,\nDublin 15\n26/09/2012\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [52 x i8] c"Neil McGettigan\0A\0ACastleknock,\0ADublin 15\0A26/09/2012\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [51 x i8] c"Neil McGettigan\0A\0ACastleknock,\0ADublin 15\0A26/09/2012\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
ret i32 0
}