xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint32_t;
typedef int volatile int32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ _UARTBaseValid(int);
int32_t UARTCharGetNonBlocking(uint32_t ui32Base) {
  ASSERT(_UARTBaseValid(ui32Base));
  if (!((*((volatile uint32_t *)(ui32Base + 0x00000018))) & 0x00000010)) {
    return ((*((volatile uint32_t *)(ui32Base + 0x00000000))));
  } else {
    return (-1);
  }
}


x86 assembly (clang, -O0):
<UARTCharGetNonBlocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <_UARTBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
mov    -0x8(%rbp),%eax
add    $0x18,%eax
cltq
mov    (%rax),%eax
and    $0x10,%eax
cmp    $0x0,%eax
jne    1162 <UARTCharGetNonBlocking+0x42>
mov    -0x8(%rbp),%eax
add    $0x0,%eax
cltq
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1169 <UARTCharGetNonBlocking+0x49>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTCharGetNonBlocking>:
push   %rbx
mov    %edi,%ebx
call   1030 <_UARTBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
movslq %ebx,%rcx
mov    $0xffffffff,%eax
testl  $0x10,0x18(%rcx)
jne    1142 <UARTCharGetNonBlocking+0x22>
mov    (%rcx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @UARTCharGetNonBlocking(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @_UARTBaseValid(i32 %4)
%6 = call i32 @ASSERT(i32 %5)
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 24
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
%12 = and i32 %11, 16
%13 = icmp ne i32 %12, 0
br i1 %13, label %20, label %14
14: ; preds = %1
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 0
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i32*
%19 = load volatile i32, i32* %18
store i32 %19, i32* %2
br label %21
20: ; preds = %1
store i32 -1, i32* %2
br label %21
21: ; preds = %20, %14
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @UARTCharGetNonBlocking(i32 %0) {
%2 = tail call i32 @_UARTBaseValid(i32 %0)
%3 = tail call i32 @ASSERT(i32 %2)
%4 = add nsw i32 %0, 24
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, 16
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = sext i32 %0 to i64
%12 = inttoptr i64 %11 to i32*
%13 = load volatile i32, i32* %12
br label %14
14: ; preds = %1, %10
%15 = phi i32 [ %13, %10 ], [ -1, %1 ]
ret i32 %15
}
void caseConvert(char *inStr) {
  int ii = 0;
  while (*(inStr + ii) != '\0') {
    if (*(inStr + ii) > 90)
      *(inStr + ii) = *(inStr + ii) - 32;
    ii++;
  }
}


x86 assembly (clang, -O0):
<caseConvert>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1163 <caseConvert+0x63>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5a,%eax
jle    1155 <caseConvert+0x55>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
sub    $0x20,%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <caseConvert+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<caseConvert>:
mov    (%rdi),%al
test   %al,%al
je     1126 <caseConvert+0x26>
add    $0x1,%rdi
jmp    111b <caseConvert+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     1126 <caseConvert+0x26>
cmp    $0x5b,%al
jl     1110 <caseConvert+0x10>
add    $0xe0,%al
mov    %al,-0x1(%rdi)
jmp    1110 <caseConvert+0x10>
ret

LLVM IR (-O0):
define void @caseConvert(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %33, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %36
12: ; preds = %4
%13 = load i8*, i8** %2
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp sgt i32 %18, 90
br i1 %19, label %20, label %33
20: ; preds = %12
%21 = load i8*, i8** %2
%22 = load i32, i32* %3
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = sub nsw i32 %26, 32
%28 = trunc i32 %27 to i8
%29 = load i8*, i8** %2
%30 = load i32, i32* %3
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8, i8* %29, i64 %31
store i8 %28, i8* %32
br label %33
33: ; preds = %20, %12
%34 = load i32, i32* %3
%35 = add nsw i32 %34, 1
store i32 %35, i32* %3
br label %4
36: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @caseConvert(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %11
%5 = phi i64 [ %12, %11 ], [ 0, %1 ]
%6 = phi i8 [ %14, %11 ], [ %2, %1 ]
%7 = phi i8* [ %13, %11 ], [ %0, %1 ]
%8 = icmp sgt i8 %6, 90
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nsw i8 %6, -32
store i8 %10, i8* %7
br label %11
11: ; preds = %9, %4
%12 = add nuw i64 %5, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %11, %1
ret void
}
_Bool not_b2(_Bool v) { return !v; }


x86 assembly (clang, -O0):
<not_b2>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
and    $0x1,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<not_b2>:
mov    %edi,%eax
xor    $0x1,%al
ret

LLVM IR (-O0):
define zeroext i1 @not_b2(i1 zeroext %0) {
%2 = alloca i8
%3 = zext i1 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = trunc i8 %4 to i1
%6 = xor i1 %5, true
ret i1 %6
}

LLVM IR (-O2):
define zeroext i1 @not_b2(i1 zeroext %0) {
%2 = xor i1 %0, true
ret i1 %2
}
/* Variables and functions */
int CHAR_BIT;
int max(int x, int y) {
  return x - ((x - y) & ((x - y) >> (sizeof(int) * CHAR_BIT - 1)));
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    -0x8(%rbp),%ecx
mov    %ecx,-0xc(%rbp)
mov    -0x4(%rbp),%edx
sub    -0x8(%rbp),%edx
mov    0x2ebd(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x2,%rcx
sub    $0x1,%rcx
sar    %cl,%edx
mov    -0xc(%rbp),%ecx
and    %edx,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %edi,%eax
mov    %edi,%edx
sub    %esi,%edx
mov    0x2ed3(%rip),%rcx
mov    (%rcx),%cl
shl    $0x2,%cl
add    $0xff,%cl
mov    %edx,%esi
sar    %cl,%esi
and    %edx,%esi
sub    %esi,%eax
ret

LLVM IR (-O0):
@CHAR_BIT = global i32 0
define i32 @max(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = sub nsw i32 %6, %7
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = sub nsw i32 %9, %10
%12 = load i32, i32* @CHAR_BIT
%13 = sext i32 %12 to i64
%14 = mul i64 4, %13
%15 = sub i64 %14, 1
%16 = trunc i64 %15 to i32
%17 = ashr i32 %11, %16
%18 = and i32 %8, %17
%19 = sub nsw i32 %5, %18
ret i32 %19
}

LLVM IR (-O2):
@CHAR_BIT = global i32 0
define i32 @max(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
%4 = load i32, i32* @CHAR_BIT
%5 = shl i32 %4, 2
%6 = add i32 %5, -1
%7 = ashr i32 %3, %6
%8 = and i32 %7, %3
%9 = sub nsw i32 %0, %8
ret i32 %9
}
void doOldDebugMethods() {}


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

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

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

LLVM IR (-O2):
define void @doOldDebugMethods() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t wt_bits(size_t n) {
  uint32_t b = 0;
  while (n) {
    b++;
    n >>= 1;
  }
  return b;
}


x86 assembly (clang, -O0):
<wt_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <wt_bits+0x38>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <wt_bits+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wt_bits>:
xor    %eax,%eax
test   %rdi,%rdi
je     1120 <wt_bits+0x20>
mov    %rdi,%rcx
nopw   0x0(%rax,%rax,1)
add    $0x1,%rax
shr    %rcx
cmp    $0x1,%rdi
mov    %rcx,%rdi
ja     1110 <wt_bits+0x10>
ret

LLVM IR (-O0):
define i64 @wt_bits(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 0, i64* %3
br label %4
4: ; preds = %7, %1
%5 = load i64, i64* %2
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load i64, i64* %3
%9 = add nsw i64 %8, 1
store i64 %9, i64* %3
%10 = load i64, i64* %2
%11 = lshr i64 %10, 1
store i64 %11, i64* %2
br label %4
12: ; preds = %4
%13 = load i64, i64* %3
ret i64 %13
}

LLVM IR (-O2):
define i64 @wt_bits(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %6, %3 ], [ 0, %1 ]
%5 = phi i64 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i64 %4, 1
%7 = lshr i64 %5, 1
%8 = icmp ult i64 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i64 [ 0, %1 ], [ %6, %3 ]
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ fun(int);
int /*<<< orphan*/ scanf(char *, int *);
void main() {
  int n;
  scanf("%d", &n);
  fun(n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1030 <fun@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <fun@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @fun(i32 %4)
ret void
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int num2string_validate(int32_t num, char *buf, int len) {
  if (num < 0)
    return -1;
  if (!buf)
    return -2;
  if (len < 2)
    return -3;
  return 0;
}


x86 assembly (clang, -O0):
<num2string_validate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    1126 <num2string_validate+0x26>
movl   $0xffffffff,-0x4(%rbp)
jmp    115a <num2string_validate+0x5a>
cmpq   $0x0,-0x18(%rbp)
jne    113d <num2string_validate+0x3d>
movl   $0xfffffffe,-0x4(%rbp)
jmp    115a <num2string_validate+0x5a>
cmpl   $0x2,-0x1c(%rbp)
jge    1153 <num2string_validate+0x53>
movl   $0xfffffffd,-0x4(%rbp)
jmp    115a <num2string_validate+0x5a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<num2string_validate>:
test   %rdi,%rdi
js     1119 <num2string_validate+0x19>
test   %rsi,%rsi
je     111f <num2string_validate+0x1f>
xor    %eax,%eax
cmp    $0x2,%edx
setge  %al
lea    (%rax,%rax,2),%eax
add    $0xfffffffd,%eax
ret
mov    $0xffffffff,%eax
ret
mov    $0xfffffffe,%eax
ret

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

LLVM IR (-O2):
define i32 @num2string_validate(i64 %0, i8* readnone %1, i32 %2) {
%4 = icmp slt i64 %0, 0
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = icmp eq i8* %1, null
br i1 %6, label %10, label %7
7: ; preds = %5
%8 = icmp slt i32 %2, 2
%9 = select i1 %8, i32 -3, i32 0
br label %10
10: ; preds = %7, %5, %3
%11 = phi i32 [ -1, %3 ], [ -2, %5 ], [ %9, %7 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void datestr(char str[], int len) {
  time_t time_val;
  struct tm *all_times;
  time_val = time(NULL);
  all_times = localtime((time_t *)&time_val);
  strftime(str, len, "%b %d, %Y", all_times);
}


x86 assembly (clang, -O0):
<datestr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rcx
lea    0xe96(%rip),%rdx
call   1050 <strftime@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<datestr>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xeac(%rip),%rdx
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %rax,%rcx
call   1050 <strftime@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [10 x i8] c"%b %d, %Y\00"
define void @datestr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.tm*
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = call i32 @time(i32* null)
store i32 %7, i32* %5
%8 = call %struct.tm* @localtime(i32* %5)
store %struct.tm* %8, %struct.tm** %6
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = load %struct.tm*, %struct.tm** %6
%12 = call i32 @strftime(i8* %9, i32 %10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), %struct.tm* %11)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [10 x i8] c"%b %d, %Y\00"
define void @datestr(i8* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @time(i32* null)
store i32 %5, i32* %3
%6 = call %struct.tm* @localtime(i32* %3)
%7 = call i32 @strftime(i8* %0, i32 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), %struct.tm* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ newline();
int end_verbatum(void) {
  newline();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @end_verbatum() {
%1 = call i32 (...) @newline()
ret i32 0
}

LLVM IR (-O2):
define i32 @end_verbatum() {
%1 = tail call i32 (...) @newline()
ret i32 0
}
int lolo(int x) { return 4 + x; }


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

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

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

LLVM IR (-O2):
define i32 @lolo(i32 %0) {
%2 = add nsw i32 %0, 4
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ inter_accreg_save();
int /*<<< orphan*/ inter_guild_save();
int /*<<< orphan*/ inter_guild_storage_save();
int /*<<< orphan*/ inter_party_save();
int /*<<< orphan*/ inter_pet_save();
int /*<<< orphan*/ inter_storage_save();
int inter_save() {
  inter_party_save();
  inter_guild_save();
  inter_storage_save();
  inter_guild_storage_save();
  inter_pet_save();
  inter_accreg_save();
  return 0;
}


x86 assembly (clang, -O0):
<inter_save>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1080 <inter_party_save@plt>
mov    $0x0,%al
call   1070 <inter_guild_save@plt>
mov    $0x0,%al
call   1030 <inter_storage_save@plt>
mov    $0x0,%al
call   1060 <inter_guild_storage_save@plt>
mov    $0x0,%al
call   1050 <inter_pet_save@plt>
mov    $0x0,%al
call   1040 <inter_accreg_save@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inter_save>:
push   %rax
xor    %eax,%eax
call   1080 <inter_party_save@plt>
xor    %eax,%eax
call   1070 <inter_guild_save@plt>
xor    %eax,%eax
call   1030 <inter_storage_save@plt>
xor    %eax,%eax
call   1060 <inter_guild_storage_save@plt>
xor    %eax,%eax
call   1050 <inter_pet_save@plt>
xor    %eax,%eax
call   1040 <inter_accreg_save@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @inter_save() {
%1 = call i32 (...) @inter_party_save()
%2 = call i32 (...) @inter_guild_save()
%3 = call i32 (...) @inter_storage_save()
%4 = call i32 (...) @inter_guild_storage_save()
%5 = call i32 (...) @inter_pet_save()
%6 = call i32 (...) @inter_accreg_save()
ret i32 0
}

LLVM IR (-O2):
define i32 @inter_save() {
%1 = tail call i32 (...) @inter_party_save()
%2 = tail call i32 (...) @inter_guild_save()
%3 = tail call i32 (...) @inter_storage_save()
%4 = tail call i32 (...) @inter_guild_storage_save()
%5 = tail call i32 (...) @inter_pet_save()
%6 = tail call i32 (...) @inter_accreg_save()
ret i32 0
}
long long fl(long long x) { return x * x; }


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

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

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

LLVM IR (-O2):
define i64 @fl(i64 %0) {
%2 = mul nsw i64 %0, %0
ret i64 %2
}
void libport_dummy_function() { return; }


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

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

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

LLVM IR (-O2):
define void @libport_dummy_function() {
ret void
}
void i2d_ASN1_PRINTABLE(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_ASN1_PRINTABLE() {
ret void
}
/* Variables and functions */
int hideme(int);
int rand();
int main(int argc, char **argv) {
  int r = rand();
  int s = hideme(r);
  return (r == s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <hideme@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <rand@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <hideme@plt>
xor    %ecx,%ecx
cmp    %eax,%ebx
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (...) @rand()
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = call i32 @hideme(i32 %9)
store i32 %10, i32* %7
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = icmp eq i32 %11, %12
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @rand()
%4 = tail call i32 @hideme(i32 %3)
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int,
                           char *);
int /*<<< orphan*/ stderr;
char *strerror(int);
void errno_exit(const char *s) {
  fprintf(stderr, "%s error %d, %s\n", s, errno, strerror(errno));
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<errno_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e81(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    %rax,%r8
lea    0xe82(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e46(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<errno_exit>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
mov    0x2ea2(%rip),%rax
mov    (%rax),%ebp
mov    0x2e91(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   1050 <strerror@plt>
lea    0xea9(%rip),%rsi
mov    %ebp,%edi
mov    %r14,%rdx
mov    %ebx,%ecx
mov    %rax,%r8
call   1030 <fprintf@plt>
mov    0x2e63(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"%s error %d, %s\0A\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define void @errno_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = load i32, i32* @errno
%6 = load i32, i32* @errno
%7 = call i8* @strerror(i32 %6)
%8 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %4, i32 %5, i8* %7)
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"%s error %d, %s\0A\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define void @errno_exit(i8* %0) {
%2 = load i32, i32* @stderr
%3 = load i32, i32* @errno
%4 = tail call i8* @strerror(i32 %3)
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %3, i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ dhcp_packet(int, char *, int /*<<< orphan*/ *, char *,
                               char *);
void dhcp_leasequery(char *ipaddr, char *gwaddr, char *hardware) {
  dhcp_packet(13, ipaddr, NULL, gwaddr, hardware);
}


x86 assembly (clang, -O0):
<dhcp_leasequery>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    $0xd,%edi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <dhcp_packet@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dhcp_leasequery>:
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rsi
mov    $0xd,%edi
xor    %edx,%edx
jmp    1030 <dhcp_packet@plt>

LLVM IR (-O0):
define void @dhcp_leasequery(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
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @dhcp_packet(i32 13, i8* %7, i32* null, i8* %8, i8* %9)
ret void
}

LLVM IR (-O2):
define void @dhcp_leasequery(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @dhcp_packet(i32 13, i8* %0, i32* null, i8* %1, i8* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ i;

/* Variables and functions */
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, int);
int main(void) {
  int i = -1;
  ((memset(&((i)), 0, (sizeof(i)))));
  return ((i == 0) ? 0 : 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0xffffffff,0x4(%rsp)
ff
lea    0x4(%rsp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
xor    %eax,%eax
cmpl   $0x0,0x4(%rsp)
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 -1, i32* %2
%3 = call i32 @memset(i32* %2, i32 0, i32 4)
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 0, i32 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 -1, i32* %1
%3 = call i32 @memset(i32* %1, i32 0, i32 4)
%4 = load i32, i32* %1
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Put_Buffer(char *, int, int);
void prt_winner() { Put_Buffer(("*Winner*"), (23) - 1, (1) - 1); }


x86 assembly (clang, -O0):
<prt_winner>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x16,%esi
xor    %edx,%edx
call   1030 <Put_Buffer@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<prt_winner>:
lea    0xee9(%rip),%rdi
mov    $0x16,%esi
xor    %edx,%edx
jmp    1030 <Put_Buffer@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"*Winner*\00"
define void @prt_winner() {
%1 = call i32 @Put_Buffer(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 22, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"*Winner*\00"
define void @prt_winner() {
%1 = tail call i32 @Put_Buffer(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 22, i32 0)
ret void
}
/* Variables and functions */
void SNDDMA_BeginPainting(void) {}


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

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

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

LLVM IR (-O2):
define void @SNDDMA_BeginPainting() {
ret void
}
void empty_handler(__attribute__((unused)) int signum) {}


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

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

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

LLVM IR (-O2):
define void @empty_handler(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stdout;
void app_fatal(const char *err_msg) {
  fprintf(stdout, "%s\n", err_msg);
  exit(2);
}


x86 assembly (clang, -O0):
<app_fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<app_fatal>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @app_fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @app_fatal(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 2)
unreachable
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t myle32toh(void *le) {
  uint8_t *p = (uint8_t *)le;
  return ((uint32_t)p[3] << 24) | ((uint32_t)p[2] << 16) |
         ((uint32_t)p[1] << 8) | (uint32_t)p[0];
}


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

x86 assembly (clang, -O2):
<myle32toh>:
mov    0x18(%rdi),%ecx
shl    $0x18,%ecx
mov    0x8(%rdi),%eax
mov    0x10(%rdi),%edx
shl    $0x10,%edx
or     %ecx,%edx
shl    $0x8,%eax
or     %edx,%eax
or     (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @myle32toh(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 3
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
%10 = shl i32 %9, 24
%11 = load i64*, i64** %3
%12 = getelementptr inbounds i64, i64* %11, i64 2
%13 = load i64, i64* %12
%14 = trunc i64 %13 to i32
%15 = shl i32 %14, 16
%16 = or i32 %10, %15
%17 = load i64*, i64** %3
%18 = getelementptr inbounds i64, i64* %17, i64 1
%19 = load i64, i64* %18
%20 = trunc i64 %19 to i32
%21 = shl i32 %20, 8
%22 = or i32 %16, %21
%23 = load i64*, i64** %3
%24 = getelementptr inbounds i64, i64* %23, i64 0
%25 = load i64, i64* %24
%26 = trunc i64 %25 to i32
%27 = or i32 %22, %26
ret i32 %27
}

LLVM IR (-O2):
define i32 @myle32toh(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = getelementptr inbounds i8, i8* %0, i64 24
%4 = bitcast i8* %3 to i64*
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 24
%8 = getelementptr inbounds i8, i8* %0, i64 16
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = shl i32 %11, 16
%13 = or i32 %12, %7
%14 = getelementptr inbounds i8, i8* %0, i64 8
%15 = bitcast i8* %14 to i64*
%16 = load i64, i64* %15
%17 = trunc i64 %16 to i32
%18 = shl i32 %17, 8
%19 = or i32 %13, %18
%20 = load i64, i64* %2
%21 = trunc i64 %20 to i32
%22 = or i32 %19, %21
ret i32 %22
}
int cmpxchg(int *ptr, int old, int new) {
  int prev;
  asm volatile("lock cmpxchgl %k1,%2"
               : "=a"(prev)
               : "r"(new), "m"(*ptr), "0"(old)
               : "memory");
  return prev;
}


x86 assembly (clang, -O0):
<cmpxchg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%eax
lock cmpxchg %ecx,(%rdx)
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmpxchg>:
mov    %esi,%eax
lock cmpxchg %edx,(%rdi)
ret

LLVM IR (-O0):
define i32 @cmpxchg(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = load i32*, i32** %4
%10 = load i32, i32* %5
%11 = call i32 asm sideeffect "lock cmpxchgl ${1:k},$2", "={ax},r,*m,0,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 %8, i32* elementtype(i32) %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
ret i32 %12
}

LLVM IR (-O2):
define i32 @cmpxchg(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 asm sideeffect "lock cmpxchgl ${1:k},$2", "={ax},r,*m,0,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 %2, i32* elementtype(i32) %0, i32 %1)
ret i32 %4
}
double sign(x, y)
double x, y;
{
  if (y >= 0.0)
    return (fabs(x));
  return (-fabs(x));
}


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     113a <sign+0x3a>
movsd  -0x10(%rbp),%xmm0
movaps 0xed4(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1166 <sign+0x66>
movsd  -0x10(%rbp),%xmm0
movaps 0xeba(%rip),%xmm1
pand   %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign>:
movapd 0xef8(%rip),%xmm2
andpd  %xmm0,%xmm2
orpd   0xefc(%rip),%xmm0
xorpd  %xmm3,%xmm3
cmpnlesd %xmm1,%xmm3
andpd  %xmm3,%xmm0
andnpd %xmm2,%xmm3
orpd   %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @sign(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %5
%7 = fcmp oge double %6, 0.000000e+00
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load double, double* %4
%10 = call double @llvm.fabs.f64(double %9)
store double %10, double* %3
br label %15
11: ; preds = %2
%12 = load double, double* %4
%13 = call double @llvm.fabs.f64(double %12)
%14 = fneg double %13
store double %14, double* %3
br label %15
15: ; preds = %11, %8
%16 = load double, double* %3
ret double %16
}

LLVM IR (-O2):
define double @sign(double %0, double %1) {
%3 = fcmp ult double %1, 0.000000e+00
%4 = tail call double @llvm.fabs.f64(double %0)
%5 = fneg double %4
%6 = select i1 %3, double %5, double %4
ret double %6
}
void ff_hevc_put_hevc_epel_v32_10_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_epel_v32_10_avx2() {
ret void
}
void exit_rcu(void) {}


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

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

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

LLVM IR (-O2):
define void @exit_rcu() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IPC_RMID;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ shmctl(int, int /*<<< orphan*/, int /*<<< orphan*/);
removeshm(int shmid) {
  shmctl(shmid, IPC_RMID, 0);
  printf("Shared memory segment marked for deletion\n");
}


x86 assembly (clang, -O0):
<removeshm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <shmctl@plt>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<removeshm>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <shmctl@plt>
lea    0xec8(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@IPC_RMID = global i32 0
@.str = [43 x i8] c"Shared memory segment marked for deletion\0A\00"
define i32 @removeshm(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* @IPC_RMID
%6 = call i32 @shmctl(i32 %4, i32 %5, i32 0)
%7 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
@IPC_RMID = global i32 0
@str = [42 x i8] c"Shared memory segment marked for deletion\00"
define i32 @removeshm(i32 %0) {
%2 = load i32, i32* @IPC_RMID
%3 = tail call i32 @shmctl(i32 %0, i32 %2, i32 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void bitwise(void) {
  unsigned x = 0;
  x = ~1u;
  x = 1u & 1u;
  x = 1u | 2u;
  x = 2u ^ 1u;
  x = 2u >> 1;
  x = 2u << 1;
}


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

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

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

LLVM IR (-O2):
define void @bitwise() {
ret void
}
int main() {
  if (1)
    return 3;
  else
    return 2;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ prinf(char *, int);
void imprimeArray(int *arr, int n) {
  if (n == 0)
    return;
  prinf("%d ", arr[n]);
  return imprimeArray(arr, n - 1);
}


x86 assembly (clang, -O0):
<imprimeArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    113e <imprimeArray+0x1e>
jmp    1164 <imprimeArray+0x44>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeb0(%rip),%rdi
call   1030 <prinf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1040 <imprimeArray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprimeArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
je     1155 <imprimeArray+0x45>
mov    %esi,%r12d
movslq %esi,%rax
lea    (%rdi,%rax,4),%r15
neg    %r12d
xor    %ebx,%ebx
lea    0xece(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <prinf@plt>
add    $0xffffffffffffffff,%rbx
cmp    %ebx,%r12d
jne    1140 <imprimeArray+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
define void @imprimeArray(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, 0
br i1 %6, label %7, label %8
7: ; preds = %2
br label %18
8: ; preds = %2
%9 = load i32*, i32** %3
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %9, i64 %11
%13 = load i32, i32* %12
%14 = call i32 @prinf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = load i32*, i32** %3
%16 = load i32, i32* %4
%17 = sub nsw i32 %16, 1
br label %18
18: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @imprimeArray(i32* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %14, label %4
4: ; preds = %2
%5 = sext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @prinf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nsw i64 %7, -1
%12 = trunc i64 %11 to i32
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void bones_free_128(void *bones_pointer) {
  int *bones_pointer2 = (int *)bones_pointer - 1;
  bones_pointer = (char *)bones_pointer - *bones_pointer2;
  free(bones_pointer);
}


x86 assembly (clang, -O0):
<bones_free_128>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bones_free_128>:
movslq -0x4(%rdi),%rax
sub    %rax,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @bones_free_128(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = getelementptr inbounds i32, i32* %5, i64 -1
store i32* %6, i32** %3
%7 = load i8*, i8** %2
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = sext i32 %9 to i64
%11 = sub i64 0, %10
%12 = getelementptr inbounds i8, i8* %7, i64 %11
store i8* %12, i8** %2
%13 = load i8*, i8** %2
%14 = call i32 @free(i8* %13)
ret void
}

LLVM IR (-O2):
define void @bones_free_128(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -4
%3 = bitcast i8* %2 to i32*
%4 = load i32, i32* %3
%5 = sext i32 %4 to i64
%6 = sub nsw i64 0, %5
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = tail call i32 @free(i8* %7)
ret void
}
double erf(double x) { return 4; }


x86 assembly (clang, -O0):
<erf>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @erf(double %0) {
%2 = alloca double
store double %0, double* %2
ret double 4.000000e+00
}

LLVM IR (-O2):
define double @erf(double %0) {
ret double 4.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void std_error() { fprintf(stderr, "Error: %s\n", strerror(errno)); }


x86 assembly (clang, -O0):
<std_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rdx
lea    0xeb1(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<std_error>:
push   %rbx
mov    0x2eb8(%rip),%rax
mov    (%rax),%ebx
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xec1(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"Error: %s\0A\00"
@errno = global i32 0
define void @std_error() {
%1 = load i32, i32* @stderr
%2 = load i32, i32* @errno
%3 = call i8* @strerror(i32 %2)
%4 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"Error: %s\0A\00"
@errno = global i32 0
define void @std_error() {
%1 = load i32, i32* @stderr
%2 = load i32, i32* @errno
%3 = tail call i8* @strerror(i32 %2)
%4 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
double ipow(int base, unsigned exp) {
  long long res = 1;
  while (exp) {
    if (exp & 1)
      res *= base;
    exp >>= 1;
    base *= base;
  }
  return (double)res;
}


x86 assembly (clang, -O0):
<ipow>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1150 <ipow+0x50>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1138 <ipow+0x38>
movslq -0x4(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1112 <ipow+0x12>
cvtsi2sdq -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipow>:
test   %esi,%esi
je     1143 <ipow+0x43>
mov    $0x1,%eax
mov    $0x1,%r8d
mov    %esi,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
test   $0x1,%sil
mov    %edi,%ecx
cmove  %r8d,%ecx
movslq %ecx,%rcx
imul   %rcx,%rax
shr    %edx
imul   %edi,%edi
cmp    $0x1,%esi
mov    %edx,%esi
ja     1120 <ipow+0x20>
cvtsi2sd %rax,%xmm0
ret
movsd  0xeb5(%rip),%xmm0
ret

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

LLVM IR (-O2):
define double @ipow(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %18, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %12, %4 ], [ 1, %2 ]
%6 = phi i32 [ %13, %4 ], [ %1, %2 ]
%7 = phi i32 [ %14, %4 ], [ %0, %2 ]
%8 = and i32 %6, 1
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i32 1, i32 %7
%11 = sext i32 %10 to i64
%12 = mul nsw i64 %5, %11
%13 = lshr i32 %6, 1
%14 = mul nsw i32 %7, %7
%15 = icmp ult i32 %6, 2
br i1 %15, label %16, label %4
16: ; preds = %4
%17 = sitofp i64 %12 to double
br label %18
18: ; preds = %16, %2
%19 = phi double [ 1.000000e+00, %2 ], [ %17, %16 ]
ret double %19
}
/* Variables and functions */
int /*<<< orphan*/ fb_GfxPrintBufferEx(char const *, int /*<<< orphan*/, int);
int /*<<< orphan*/ strlen(char const *);
void fb_GfxPrintBuffer(const char *buffer, int mask) {
  fb_GfxPrintBufferEx(buffer, strlen(buffer), mask);
}


x86 assembly (clang, -O0):
<fb_GfxPrintBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
mov    -0xc(%rbp),%edx
call   1040 <fb_GfxPrintBufferEx@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_GfxPrintBuffer>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <fb_GfxPrintBufferEx@plt>

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

LLVM IR (-O2):
define void @fb_GfxPrintBuffer(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @fb_GfxPrintBufferEx(i8* %0, i32 %3, i32 %1)
ret void
}