xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void sample3() {
  char a[20] = "You_are_a_girl";
  char *p = a;
  char **ptr = &p;
  printf("**ptr=%c\n", **ptr);
  ptr++;
  printf("**ptr=%d\n", **ptr);
}


x86 assembly (clang, -O0):
<sample3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    (%rax),%rax
lea    0xebf(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
mov    -0x30(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    (%rax),%rax
lea    0xea7(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sample3>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x59,%esi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
xor    %esi,%esi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"**ptr=%c\0A\00"
@.str.1 = [10 x i8] c"**ptr=%d\0A\00"
define void @sample3() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8 signext 89)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8 signext undef)
ret void
}
/* Variables and functions */
void *realloc(void *, unsigned long);
void *flash_realloc(void *p, unsigned long size) { return realloc(p, size); }


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

x86 assembly (clang, -O2):
<flash_realloc>:
jmp    1030 <realloc@plt>

LLVM IR (-O0):
define i8* @flash_realloc(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 = load i64, i64* %4
%7 = call i8* @realloc(i8* %5, i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define noalias i8* @flash_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
ret i8* %3
}
float *mat2_negative(float *result, float *m) {
  result[0] = -m[0];
  result[1] = -m[1];
  result[2] = -m[2];
  result[3] = -m[3];
  return result;
}


x86 assembly (clang, -O0):
<mat2_negative>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movss  0xc(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0xc(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat2_negative>:
mov    %rdi,%rax
movss  (%rsi),%xmm0
movaps 0xef2(%rip),%xmm1
xorps  %xmm1,%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
xorps  %xmm1,%xmm0
movss  %xmm0,0x4(%rdi)
movss  0x8(%rsi),%xmm0
xorps  %xmm1,%xmm0
movss  %xmm0,0x8(%rdi)
movss  0xc(%rsi),%xmm0
xorps  %xmm1,%xmm0
movss  %xmm0,0xc(%rdi)
ret

LLVM IR (-O0):
define float* @mat2_negative(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %4
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = fneg float %7
%9 = load float*, float** %3
%10 = getelementptr inbounds float, float* %9, i64 0
store float %8, float* %10
%11 = load float*, float** %4
%12 = getelementptr inbounds float, float* %11, i64 1
%13 = load float, float* %12
%14 = fneg float %13
%15 = load float*, float** %3
%16 = getelementptr inbounds float, float* %15, i64 1
store float %14, float* %16
%17 = load float*, float** %4
%18 = getelementptr inbounds float, float* %17, i64 2
%19 = load float, float* %18
%20 = fneg float %19
%21 = load float*, float** %3
%22 = getelementptr inbounds float, float* %21, i64 2
store float %20, float* %22
%23 = load float*, float** %4
%24 = getelementptr inbounds float, float* %23, i64 3
%25 = load float, float* %24
%26 = fneg float %25
%27 = load float*, float** %3
%28 = getelementptr inbounds float, float* %27, i64 3
store float %26, float* %28
%29 = load float*, float** %3
ret float* %29
}

LLVM IR (-O2):
define float* @mat2_negative(float* returned writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = fneg float %3
store float %4, float* %0
%5 = getelementptr inbounds float, float* %1, i64 1
%6 = load float, float* %5
%7 = fneg float %6
%8 = getelementptr inbounds float, float* %0, i64 1
store float %7, float* %8
%9 = getelementptr inbounds float, float* %1, i64 2
%10 = load float, float* %9
%11 = fneg float %10
%12 = getelementptr inbounds float, float* %0, i64 2
store float %11, float* %12
%13 = getelementptr inbounds float, float* %1, i64 3
%14 = load float, float* %13
%15 = fneg float %14
%16 = getelementptr inbounds float, float* %0, i64 3
store float %15, float* %16
ret float* %0
}
int getNextRandomValue(int a) { return a * a; }


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

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

LLVM IR (-O0):
define i32 @getNextRandomValue(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @getNextRandomValue(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
/* Variables and functions */
long find_nth_long(long *, int, int);
long median_long(long *array, int n_elements) {
  return find_nth_long(array, n_elements, (n_elements - 1) / 2);
}


x86 assembly (clang, -O0):
<median_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
call   1030 <find_nth_long@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<median_long>:
lea    -0x1(%rsi),%eax
shr    $0x1f,%eax
lea    (%rsi,%rax,1),%edx
add    $0xffffffff,%edx
sar    %edx
jmp    1030 <find_nth_long@plt>

LLVM IR (-O0):
define i64 @median_long(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%5 = load i64*, i64** %3
%6 = load i32, i32* %4
%7 = load i32, i32* %4
%8 = sub nsw i32 %7, 1
%9 = sdiv i32 %8, 2
%10 = call i64 @find_nth_long(i64* %5, i32 %6, i32 %9)
ret i64 %10
}

LLVM IR (-O2):
define i64 @median_long(i64* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = sdiv i32 %3, 2
%5 = tail call i64 @find_nth_long(i64* %0, i32 %1, i32 %4)
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ dhcp6_sendmessage(void *, void (*)(void *));
void dhcp6_sendrenew(void *arg) { dhcp6_sendmessage(arg, dhcp6_sendrenew); }


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

x86 assembly (clang, -O2):
<dhcp6_sendrenew>:
mov    0x2ec9(%rip),%rsi
jmp    1030 <dhcp6_sendmessage@plt>

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

LLVM IR (-O2):
define void @dhcp6_sendrenew(i8* %0) {
%2 = tail call i32 @dhcp6_sendmessage(i8* %0, void (i8*)* @dhcp6_sendrenew)
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t Hashfunc_djb2(const unsigned char *str) {
  uint64_t hash = 5381;
  int c;
  while ((c = *str++)) {
    hash = ((hash << 5) + hash) + c;
  };
  return hash;
}


x86 assembly (clang, -O0):
<Hashfunc_djb2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     1141 <Hashfunc_djb2+0x41>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <Hashfunc_djb2+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Hashfunc_djb2>:
mov    (%rdi),%cl
test   %cl,%cl
je     1138 <Hashfunc_djb2+0x38>
add    $0x1,%rdi
mov    $0x1505,%edx
mov    %edx,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl %cl,%ecx
shl    $0x5,%eax
add    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%edx
test   %cl,%cl
jne    1120 <Hashfunc_djb2+0x20>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @Hashfunc_djb2(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 5381, %1 ]
%8 = zext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = mul i32 %7, 33
%11 = add nsw i32 %10, %8
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 5381, %1 ], [ %11, %4 ]
ret i32 %15
}
void Usage() {}


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

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

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

LLVM IR (-O2):
define void @Usage() {
ret void
}
/* Variables and functions */
int COLS;
scalar_t__ strlen(char *);
int CenteredX(char *pStr) {
  int cx, leftedge = 32;
  cx = COLS - leftedge;
  cx -= strlen(pStr);
  cx /= 2;
  cx += leftedge;
  if (cx < 0)
    cx = 32;
  return cx;
}


x86 assembly (clang, -O0):
<CenteredX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x20,-0x10(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
movslq -0xc(%rbp),%rax
sub    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1170 <CenteredX+0x60>
movl   $0x20,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CenteredX>:
push   %rbx
mov    0x2ed0(%rip),%rax
mov    (%rax),%ebx
call   1030 <strlen@plt>
sub    %eax,%ebx
mov    %ebx,%eax
add    $0xffffffe0,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %ebx,%ecx
add    $0xffffffe0,%ecx
sar    %ecx
add    $0x20,%ecx
cmp    $0xffffffbf,%eax
mov    $0x20,%eax
cmovge %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@COLS = global i32 0
define i32 @CenteredX(i8* nocapture %0) {
%2 = load i32, i32* @COLS
%3 = add nsw i32 %2, -32
%4 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%5 = trunc i64 %4 to i32
%6 = sub i32 %3, %5
%7 = sdiv i32 %6, 2
%8 = add nsw i32 %7, 32
%9 = icmp slt i32 %6, -65
%10 = select i1 %9, i32 32, i32 %8
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ GPIOPinTypeGPIOOutput(int, int);
int /*<<< orphan*/ Send1byteB(unsigned char);
int /*<<< orphan*/ startB();
int /*<<< orphan*/ stopB();
void Point_reg_B(void) {
  unsigned char i = 0;
  unsigned char Initdata[4] = {0};
  Initdata[0] = 0x90;
  Initdata[1] = 0x00;
  GPIOPinTypeGPIOOutput(0x40007000, 0x00000020);
  startB();
  for (i = 0; i < 2; i++) {
    Send1byteB(Initdata[i]);
  }
  stopB();
}


x86 assembly (clang, -O0):
<Point_reg_B>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
lea    -0x5(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
movb   $0x90,-0x5(%rbp)
movb   $0x0,-0x4(%rbp)
mov    $0x40007000,%edi
mov    $0x20,%esi
call   1050 <GPIOPinTypeGPIOOutput@plt>
mov    $0x0,%al
call   1060 <startB@plt>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x2,%eax
jge    11b6 <Point_reg_B+0x66>
movzbl -0x1(%rbp),%eax
movzbl -0x5(%rbp,%rax,1),%edi
call   1030 <Send1byteB@plt>
mov    -0x1(%rbp),%al
add    $0x1,%al
mov    %al,-0x1(%rbp)
jmp    118e <Point_reg_B+0x3e>
mov    $0x0,%al
call   1070 <stopB@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Point_reg_B>:
push   %rax
mov    $0x40007000,%edi
mov    $0x20,%esi
call   1040 <GPIOPinTypeGPIOOutput@plt>
xor    %eax,%eax
call   1050 <startB@plt>
mov    $0x90,%edi
call   1030 <Send1byteB@plt>
xor    %edi,%edi
call   1030 <Send1byteB@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <stopB@plt>

LLVM IR (-O0):
define void @Point_reg_B() {
%1 = alloca i8
%2 = alloca [4 x i8]
store i8 0, i8* %1
%3 = bitcast [4 x i8]* %2 to i8*
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
store i8 -112, i8* %4
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 1
store i8 0, i8* %5
%6 = call i32 @GPIOPinTypeGPIOOutput(i32 1073770496, i32 32)
%7 = call i32 (...) @startB()
store i8 0, i8* %1
br label %8
8: ; preds = %18, %0
%9 = load i8, i8* %1
%10 = zext i8 %9 to i32
%11 = icmp slt i32 %10, 2
br i1 %11, label %12, label %21
12: ; preds = %8
%13 = load i8, i8* %1
%14 = zext i8 %13 to i64
%15 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 %14
%16 = load i8, i8* %15
%17 = call i32 @Send1byteB(i8 zeroext %16)
br label %18
18: ; preds = %12
%19 = load i8, i8* %1
%20 = add i8 %19, 1
store i8 %20, i8* %1
br label %8
21: ; preds = %8
%22 = call i32 (...) @stopB()
ret void
}

LLVM IR (-O2):
define void @Point_reg_B() {
%1 = tail call i32 @GPIOPinTypeGPIOOutput(i32 1073770496, i32 32)
%2 = tail call i32 (...) @startB()
%3 = tail call i32 @Send1byteB(i8 zeroext -112)
%4 = tail call i32 @Send1byteB(i8 zeroext 0)
%5 = tail call i32 (...) @stopB()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ a();
int /*<<< orphan*/ x();
int /*<<< orphan*/ y();
int main() {
  x();
  if (x)
    a();
  y();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <x@plt>
mov    $0x1,%al
test   $0x1,%al
jne    1155 <main+0x25>
jmp    115c <main+0x2c>
mov    $0x0,%al
call   1040 <a@plt>
mov    $0x0,%al
call   1050 <y@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @x()
br i1 true, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @a()
br label %5
5: ; preds = %3, %0
%6 = call i32 (...) @y()
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @x()
%2 = tail call i32 (...) @a()
%3 = tail call i32 (...) @y()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fan_disable(int);
int /*<<< orphan*/ fan_set_pwm(int, int /*<<< orphan*/);
void init_fans() {
  fan_disable(0);
  fan_disable(1);
  fan_disable(2);
  fan_disable(3);
  fan_set_pwm(0, 0);
  fan_set_pwm(1, 0);
  fan_set_pwm(2, 0);
  fan_set_pwm(3, 0);
}


x86 assembly (clang, -O0):
<init_fans>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <fan_disable@plt>
mov    $0x1,%edi
call   1040 <fan_disable@plt>
mov    $0x2,%edi
call   1040 <fan_disable@plt>
mov    $0x3,%edi
call   1040 <fan_disable@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1030 <fan_set_pwm@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <fan_set_pwm@plt>
mov    $0x2,%edi
xor    %esi,%esi
call   1030 <fan_set_pwm@plt>
mov    $0x3,%edi
xor    %esi,%esi
call   1030 <fan_set_pwm@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_fans>:
push   %rax
xor    %edi,%edi
call   1040 <fan_disable@plt>
mov    $0x1,%edi
call   1040 <fan_disable@plt>
mov    $0x2,%edi
call   1040 <fan_disable@plt>
mov    $0x3,%edi
call   1040 <fan_disable@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1030 <fan_set_pwm@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <fan_set_pwm@plt>
mov    $0x2,%edi
xor    %esi,%esi
call   1030 <fan_set_pwm@plt>
mov    $0x3,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <fan_set_pwm@plt>

LLVM IR (-O0):
define void @init_fans() {
%1 = call i32 @fan_disable(i32 0)
%2 = call i32 @fan_disable(i32 1)
%3 = call i32 @fan_disable(i32 2)
%4 = call i32 @fan_disable(i32 3)
%5 = call i32 @fan_set_pwm(i32 0, i32 0)
%6 = call i32 @fan_set_pwm(i32 1, i32 0)
%7 = call i32 @fan_set_pwm(i32 2, i32 0)
%8 = call i32 @fan_set_pwm(i32 3, i32 0)
ret void
}

LLVM IR (-O2):
define void @init_fans() {
%1 = tail call i32 @fan_disable(i32 0)
%2 = tail call i32 @fan_disable(i32 1)
%3 = tail call i32 @fan_disable(i32 2)
%4 = tail call i32 @fan_disable(i32 3)
%5 = tail call i32 @fan_set_pwm(i32 0, i32 0)
%6 = tail call i32 @fan_set_pwm(i32 1, i32 0)
%7 = tail call i32 @fan_set_pwm(i32 2, i32 0)
%8 = tail call i32 @fan_set_pwm(i32 3, i32 0)
ret void
}
void ASN1_T61STRING_new(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_T61STRING_new() {
ret void
}
int rl_noninc_reverse_search(count, key)
int count __attribute__((unused)), key;
{ return noninc_search(-1, (key == '/') ? '/' : 0); }


x86 assembly (clang, -O0):
<rl_noninc_reverse_search>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
xor    %esi,%esi
mov    $0x2f,%eax
cmp    $0x2f,%ecx
cmove  %eax,%esi
mov    $0xffffffff,%edi
mov    $0x0,%al
call   1030 <noninc_search@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rl_noninc_reverse_search>:
xor    %eax,%eax
cmp    $0x2f,%esi
cmovne %eax,%esi
mov    $0xffffffff,%edi
xor    %eax,%eax
jmp    1030 <noninc_search@plt>

LLVM IR (-O0):
define i32 @rl_noninc_reverse_search(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 47
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 47, i32 0
%9 = call i32 (i32, i32, ...) bitcast (i32 (...)* @noninc_search to i32 (i32, i32, ...)*)(i32 -1, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @rl_noninc_reverse_search(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 47
%4 = select i1 %3, i32 47, i32 0
%5 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @noninc_search to i32 (i32, i32, ...)*)(i32 -1, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_head_licence_snmf() {
  printf("TESS3 Copyright (C) 2015 K. Caye\n"
         "This program comes with ABSOLUTELY NO WARRANTY; for details type "
         "'./sNMF -l'.\n"
         "This is free software, and you are welcome to redistribute it\n"
         "under certain conditions; type './TESS3 -l' for details.\n\n");
}


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

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

LLVM IR (-O0):
@.str = [232 x i8] c"TESS3 Copyright (C) 2015 K. Caye\0AThis program comes with ABSOLUTELY NO WARRANTY; for details type './sNMF -l'.\0AThis is free software, and you are welcome to redistribute it\0Aunder certain conditions; type './TESS3 -l' for details.\0A\0A\00"
define void @print_head_licence_snmf() {
%1 = call i32 @printf(i8* getelementptr inbounds ([232 x i8], [232 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [231 x i8] c"TESS3 Copyright (C) 2015 K. Caye\0AThis program comes with ABSOLUTELY NO WARRANTY; for details type './sNMF -l'.\0AThis is free software, and you are welcome to redistribute it\0Aunder certain conditions; type './TESS3 -l' for details.\0A\00"
define void @print_head_licence_snmf() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([231 x i8], [231 x i8]* @str, i64 0, i64 0))
ret void
}
int SET_y(int n) { return n; }


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

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

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

LLVM IR (-O2):
define i32 @SET_y(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int spi_update(int);
unsigned short adc_get(unsigned short channel) {
  return (spi_update((0x1840 | ((channel & 0x000F) << 7)))) & 0x0FFF;
}


x86 assembly (clang, -O0):
<adc_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
and    $0xf,%edi
shl    $0x7,%edi
or     $0x1840,%edi
call   1030 <spi_update@plt>
and    $0xfff,%eax
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adc_get>:
push   %rax
and    $0xf,%edi
shl    $0x7,%edi
or     $0x1840,%edi
call   1030 <spi_update@plt>
and    $0xfff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i16 @adc_get(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 15
%6 = shl i32 %5, 7
%7 = or i32 6208, %6
%8 = call i32 @spi_update(i32 %7)
%9 = and i32 %8, 4095
%10 = trunc i32 %9 to i16
ret i16 %10
}

LLVM IR (-O2):
define zeroext i16 @adc_get(i16 zeroext %0) {
%2 = shl i16 %0, 7
%3 = and i16 %2, 1920
%4 = or i16 %3, 6208
%5 = zext i16 %4 to i32
%6 = tail call i32 @spi_update(i32 %5)
%7 = trunc i32 %6 to i16
%8 = and i16 %7, 4095
ret i16 %8
}
/* Variables and functions */
int /*<<< orphan*/ stdout_print_strn(int /*<<< orphan*/, char const *, int);
int strlen(char const *);
int puts(const char *s) {
  stdout_print_strn(0, s, strlen(s));
  char chr = '\n';
  stdout_print_strn(0, &chr, 1);
  return 1;
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
xor    %edi,%edi
call   1040 <stdout_print_strn@plt>
movb   $0xa,-0x9(%rbp)
xor    %edi,%edi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1040 <stdout_print_strn@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1030 <strlen@plt>
xor    %edi,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <stdout_print_strn@plt>
movb   $0xa,0xf(%rsp)
lea    0xf(%rsp),%rsi
xor    %edi,%edi
mov    $0x1,%edx
call   1040 <stdout_print_strn@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @puts(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = call i32 @stdout_print_strn(i32 0, i8* %4, i32 %6)
store i8 10, i8* %3
%8 = call i32 @stdout_print_strn(i32 0, i8* %3, i32 1)
ret i32 1
}

LLVM IR (-O2):
define i32 @puts(i8* %0) {
%2 = alloca i8
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @stdout_print_strn(i32 0, i8* %0, i32 %3)
store i8 10, i8* %2
%5 = call i32 @stdout_print_strn(i32 0, i8* %2, i32 1)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ BNCIO2(int, int);
int BNCFrontOn() {
  int ii, stat = 99;
  char com1, data;
  BNCIO2(32, 1);
  return (stat);
}


x86 assembly (clang, -O0):
<BNCFrontOn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x63,-0x8(%rbp)
mov    $0x20,%edi
mov    $0x1,%esi
call   1030 <BNCIO2@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BNCFrontOn>:
push   %rax
mov    $0x20,%edi
mov    $0x1,%esi
call   1030 <BNCIO2@plt>
mov    $0x63,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @BNCFrontOn() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
store i32 99, i32* %2
%5 = call i32 @BNCIO2(i32 32, i32 1)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @BNCFrontOn() {
%1 = tail call i32 @BNCIO2(i32 32, i32 1)
ret i32 99
}
float stbir__support_one(float s) {
  (void)sizeof(s);
  return 1;
}


x86 assembly (clang, -O0):
<stbir__support_one>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<stbir__support_one>:
movss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @stbir__support_one(float %0) {
%2 = alloca float
store float %0, float* %2
ret float 1.000000e+00
}

LLVM IR (-O2):
define float @stbir__support_one(float %0) {
ret float 1.000000e+00
}
/* Variables and functions */
char *strncat(char *, char const *, size_t);
char *strlcat(char *dst, const char *src, size_t n) {
  return strncat(dst, src, n);
}


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

x86 assembly (clang, -O2):
<strlcat>:
jmp    1030 <strncat@plt>

LLVM IR (-O0):
define i8* @strlcat(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i8* @strncat(i8* %7, i8* %8, i64 %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @strlcat(i8* returned %0, i8* nocapture %1, i64 %2) {
%4 = tail call i8* @strncat(i8* dereferenceable(1) %0, i8* %1, i64 %2)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int isquare(int X) {
  printf("Squareing\n");
  return X * X;
}


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

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

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

LLVM IR (-O2):
@str = [10 x i8] c"Squareing\00"
define i32 @isquare(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%3 = mul nsw i32 %0, %0
ret i32 %3
}
void GPIOPinIntDisable(unsigned long ulPort, unsigned long ulPins) {
  ;
  (*((volatile unsigned long *)(0x40010400))) &= ~ulPins;
}


x86 assembly (clang, -O0):
<GPIOPinIntDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
xor    $0xffffffffffffffff,%rax
mov    $0x40010400,%ecx
mov    (%rcx),%rcx
and    %rax,%rcx
mov    $0x40010400,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOPinIntDisable>:
not    %rsi
and    %rsi,0x40010400
40
ret

LLVM IR (-O0):
define void @GPIOPinIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = xor i64 %5, -1
%7 = load volatile i64, i64* inttoptr (i64 1073808384 to i64*)
%8 = and i64 %7, %6
store volatile i64 %8, i64* inttoptr (i64 1073808384 to i64*)
ret void
}

LLVM IR (-O2):
define void @GPIOPinIntDisable(i64 %0, i64 %1) {
%3 = xor i64 %1, -1
%4 = load volatile i64, i64* inttoptr (i64 1073808384 to i64*)
%5 = and i64 %4, %3
store volatile i64 %5, i64* inttoptr (i64 1073808384 to i64*)
ret void
}
void register_irq_proc(unsigned int irq) {}


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

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

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

LLVM IR (-O2):
define void @register_irq_proc(i32 %0) {
ret void
}
/* Type definitions */
struct descriptor {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct descriptor *);
void dsmcc_desc_free(struct descriptor *desc) { free(desc); }


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

LLVM IR (-O0):
%struct.descriptor = type { i32 }
define void @dsmcc_desc_free(%struct.descriptor* %0) {
%2 = alloca %struct.descriptor*
store %struct.descriptor* %0, %struct.descriptor** %2
%3 = load %struct.descriptor*, %struct.descriptor** %2
%4 = call i32 @free(%struct.descriptor* %3)
ret void
}

LLVM IR (-O2):
%struct.descriptor = type { i32 }
define void @dsmcc_desc_free(%struct.descriptor* nocapture %0) {
%2 = tail call i32 @free(%struct.descriptor* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ write(int /*<<< orphan*/, char const *, int /*<<< orphan*/);
int main(int argc, char **argv) {
  const char *text = "first node\n";
  write(STDOUT_FILENO, text, strlen(text));
  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),%rax
mov    %rax,-0x18(%rbp)
mov    0x2ea8(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2ec5(%rip),%rax
mov    (%rax),%ebx
lea    0xecc(%rip),%r14
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [12 x i8] c"first node\0A\00"
@STDOUT_FILENO = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %6
%7 = load i32, i32* @STDOUT_FILENO
%8 = load i8*, i8** %6
%9 = load i8*, i8** %6
%10 = call i32 @strlen(i8* %9)
%11 = call i32 @write(i32 %7, i8* %8, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"first node\0A\00"
@STDOUT_FILENO = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @STDOUT_FILENO
%4 = tail call i32 @strlen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @write(i32 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *realloc(void *, size_t);
int /*<<< orphan*/ stderr;
void *xrealloc(void *ptr, size_t size) {
  ptr = realloc(ptr, size);
  assert(size != 0);
  if (!ptr) {
    fprintf(stderr, "realloc failed - that's not good at all\n");
    exit(-2);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpq   $0x0,-0x8(%rbp)
jne    119d <xrealloc+0x5d>
mov    0x2e5b(%rip),%rax
mov    (%rax),%edi
lea    0xe72(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xfffffffe,%edi
call   1060 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1050 <realloc@plt>
mov    %rax,%r14
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
test   %r14,%r14
je     116d <xrealloc+0x2d>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
lea    0xe83(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xfffffffe,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"realloc failed - that's not good at all\0A\00"
define i8* @xrealloc(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 = load i64, i64* %4
%7 = call i8* @realloc(i8* %5, i64 %6)
store i8* %7, i8** %3
%8 = load i64, i64* %4
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i8*, i8** %3
%13 = icmp ne i8* %12, null
br i1 %13, label %18, label %14
14: ; preds = %2
%15 = load i32, i32* @stderr
%16 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%17 = call i32 @exit(i32 -2)
unreachable
18: ; preds = %2
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"realloc failed - that's not good at all\0A\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp ne i64 %1, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = icmp eq i8* %3, null
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%11 = tail call i32 @exit(i32 -2)
unreachable
12: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ save_done(char *, int /*<<< orphan*/);
void hupped(int sig) {
  save_done("vile.hup", 0);
  _exit(0);
}


x86 assembly (clang, -O0):
<hupped>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
xor    %esi,%esi
call   1040 <save_done@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<hupped>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %esi,%esi
call   1040 <save_done@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"vile.hup\00"
define void @hupped(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @save_done(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 0)
%4 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [9 x i8] c"vile.hup\00"
define void @hupped(i32 %0) {
%2 = tail call i32 @save_done(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 0)
%3 = tail call i32 @_exit(i32 0)
unreachable
}
const char *RocksLogShorterFileName(const char *file) {
  return file +
         (sizeof("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                 "outputs/2022-01-22/02-19-57/repos/fceller/arangodb/refs/"
                 "heads/devel/3rdParty/rocksdb/6.2/util/logging.h") > 15
              ? sizeof(
                    "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/fceller/arangodb/refs/"
                    "heads/devel/3rdParty/rocksdb/6.2/util/logging.h") -
                    15
              : 0);
}


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

x86 assembly (clang, -O2):
<RocksLogShorterFileName>:
lea    0x91(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @RocksLogShorterFileName(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 145
ret i8* %4
}

LLVM IR (-O2):
define i8* @RocksLogShorterFileName(i8* readnone %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 145
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ rotr(int *, int *, int *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, b, c;
  scanf("%d", &a);
  scanf("%d", &b);
  scanf("%d", &c);
  rotr(&a, &b, &c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <scanf@plt>
lea    0xeba(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <scanf@plt>
lea    0xeaa(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <scanf@plt>
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1040 <rotr@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xece(%rip),%rbx
lea    0x14(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <scanf@plt>
lea    0x10(%rsp),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <scanf@plt>
lea    0xc(%rsp),%r12
mov    %rbx,%rdi
mov    %r12,%rsi
call   1030 <scanf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1040 <rotr@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%8 = call i32 @rotr(i32* %2, i32* %3, i32* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%10 = call i32 @rotr(i32* %1, i32* %2, i32* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ str_del_char_ch(char *, char);
int strlen(char *);
void str_del_some_char(char *S, char *del) {
  for (int i = 0; i < strlen(del); i++)
    str_del_char_ch(S, del[i]);
}


x86 assembly (clang, -O0):
<str_del_some_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cmp    %ecx,%eax
jge    1176 <str_del_some_char+0x56>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
call   1040 <str_del_char_ch@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1137 <str_del_some_char+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_del_some_char>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
jle    1160 <str_del_some_char+0x40>
xor    %ebx,%ebx
nopl   0x0(%rax)
movsbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
call   1040 <str_del_char_ch@plt>
add    $0x1,%rbx
mov    %r15,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1140 <str_del_some_char+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @str_del_some_char(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %6, %2
ret void
6: ; preds = %2, %6
%7 = phi i64 [ %11, %6 ], [ 0, %2 ]
%8 = getelementptr inbounds i8, i8* %1, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @str_del_char_ch(i8* %0, i8 signext %9)
%11 = add nuw nsw i64 %7, 1
%12 = tail call i32 @strlen(i8* %1)
%13 = sext i32 %12 to i64
%14 = icmp slt i64 %11, %13
br i1 %14, label %6, label %5
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char const *, char const *);
scalar_t__ system(char *);
unsigned int file_copy(const char *from, const char *to) {
  char command[128];
  snprintf(command, 128, "cp %s %s", from, to);
  return system(command) == 0;
}


x86 assembly (clang, -O0):
<file_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    $0x80,%esi
lea    0xeb2(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x90(%rbp),%rdi
call   1030 <system@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_copy>:
push   %rbx
sub    $0x80,%rsp
mov    %rsi,%r8
mov    %rdi,%rcx
lea    0xecb(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x80,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"cp %s %s\00"
define i32 @file_copy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [128 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @snprintf(i8* %6, i32 128, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8)
%10 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%11 = call i64 @system(i8* %10)
%12 = icmp eq i64 %11, 0
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@.str = [9 x i8] c"cp %s %s\00"
define i32 @file_copy(i8* %0, i8* %1) {
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 128, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%6 = call i64 @system(i8* %4)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
int pwc_get_value(unsigned int gpio) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pwc_get_value(i32 %0) {
ret i32 0
}
int test_imm_ADint64_lowword_mem(long long *val) {
  return ((*val) & (0xAD << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_ADint64_lowword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
and    $0xad,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_ADint64_lowword_mem>:
testb  $0xad,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_ADint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 173
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}