xunge/DecIR huggingface dataset:
/* Type definitions */
struct DynArr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ popDynArr(struct DynArr *);
int /*<<< orphan*/ pow(double, int);
int /*<<< orphan*/ pushDynArr(struct DynArr *, int /*<<< orphan*/);
double topDynArr(struct DynArr *);
void square(struct DynArr *stack) {
  double i = topDynArr(stack);
  popDynArr(stack);
  pushDynArr(stack, pow(i, 2));
}


x86 assembly (clang, -O0):
<square>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <topDynArr@plt>
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <popDynArr@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1060 <pushDynArr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<square>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1030 <topDynArr@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1040 <popDynArr@plt>
movsd  0x8(%rsp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
mov    %rbx,%rdi
mov    %eax,%esi
add    $0x10,%rsp
pop    %rbx
jmp    1060 <pushDynArr@plt>

LLVM IR (-O0):
%struct.DynArr = type { i32 }
define void @square(%struct.DynArr* %0) {
%2 = alloca %struct.DynArr*
%3 = alloca double
store %struct.DynArr* %0, %struct.DynArr** %2
%4 = load %struct.DynArr*, %struct.DynArr** %2
%5 = call double @topDynArr(%struct.DynArr* %4)
store double %5, double* %3
%6 = load %struct.DynArr*, %struct.DynArr** %2
%7 = call i32 @popDynArr(%struct.DynArr* %6)
%8 = load %struct.DynArr*, %struct.DynArr** %2
%9 = load double, double* %3
%10 = call i32 @pow(double %9, i32 2)
%11 = call i32 @pushDynArr(%struct.DynArr* %8, i32 %10)
ret void
}

LLVM IR (-O2):
%struct.DynArr = type { i32 }
define void @square(%struct.DynArr* %0) {
%2 = tail call double @topDynArr(%struct.DynArr* %0)
%3 = tail call i32 @popDynArr(%struct.DynArr* %0)
%4 = tail call i32 @pow(double %2, i32 2)
%5 = tail call i32 @pushDynArr(%struct.DynArr* %0, i32 %4)
ret void
}
void bitstream_write_byte(char **b, char value) {
  **b = value;
  *b += 1;
}


x86 assembly (clang, -O0):
<bitstream_write_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitstream_write_byte>:
mov    (%rdi),%rax
mov    %sil,(%rax)
addq   $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @bitstream_write_byte(i8** %0, i8 signext %1) {
%3 = alloca i8**
%4 = alloca i8
store i8** %0, i8*** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
store i8 %5, i8* %7
%8 = load i8**, i8*** %3
%9 = load i8*, i8** %8
%10 = getelementptr inbounds i8, i8* %9, i64 1
store i8* %10, i8** %8
ret void
}

LLVM IR (-O2):
define void @bitstream_write_byte(i8** nocapture %0, i8 signext %1) {
%3 = load i8*, i8** %0
store i8 %1, i8* %3
%4 = load i8*, i8** %0
%5 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %5, i8** %0
ret void
}
int neg(int var) { return var ^ 1; }


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

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

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

LLVM IR (-O2):
define i32 @neg(i32 %0) {
%2 = xor i32 %0, 1
ret i32 %2
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ memcpy(char *, char *, int);
int strlen(char *);
char *copy(char *str) {
  int size = strlen(str) + 1;
  char *result = malloc(size);
  memcpy(result, str, size);
  return result;
}


x86 assembly (clang, -O0):
<copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
lea    0x1(%rax),%ebp
mov    %ebp,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @copy(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i8* @malloc(i32 %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = load i8*, i8** %2
%12 = load i32, i32* %3
%13 = call i32 @memcpy(i8* %10, i8* %11, i32 %12)
%14 = load i8*, i8** %4
ret i8* %14
}

LLVM IR (-O2):
define i8* @copy(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i32 %3)
ret i8* %4
}
void task1_smp_v2(int *a) { *a += 2; }


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

x86 assembly (clang, -O2):
<task1_smp_v2>:
addl   $0x2,(%rdi)
ret

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

LLVM IR (-O2):
define void @task1_smp_v2(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add nsw i32 %2, 2
store i32 %3, i32* %0
ret void
}
/* Variables and functions */
scalar_t__ read(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ *strstr(char *, char *);
int isLegit() {
  char buf[1024];
  while (read(0, buf, 1024) > 0) {
    if (strstr(buf, "SPAM") != NULL) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<isLegit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
lea    -0x410(%rbp),%rsi
xor    %edi,%edi
mov    $0x400,%edx
call   1030 <read@plt>
cmp    $0x0,%rax
jle    1176 <isLegit+0x56>
lea    -0x410(%rbp),%rdi
lea    0xeaa(%rip),%rsi
call   1040 <strstr@plt>
cmp    $0x0,%rax
je     1171 <isLegit+0x51>
movl   $0x0,-0x4(%rbp)
jmp    117d <isLegit+0x5d>
jmp    112b <isLegit+0xb>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isLegit>:
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %rsp,%rbx
lea    0xecc(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x400,%edx
call   1030 <read@plt>
test   %rax,%rax
jle    1168 <isLegit+0x48>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strstr@plt>
test   %rax,%rax
je     1140 <isLegit+0x20>
xor    %eax,%eax
jmp    116d <isLegit+0x4d>
mov    $0x1,%eax
add    $0x408,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"SPAM\00"
define i32 @isLegit() {
%1 = alloca i32
%2 = alloca [1024 x i8]
br label %3
3: ; preds = %12, %0
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%5 = call i64 @read(i32 0, i8* %4, i32 1024)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%9 = call i32* @strstr(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%10 = icmp ne i32* %9, null
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 0, i32* %1
br label %14
12: ; preds = %7
br label %3
13: ; preds = %3
store i32 1, i32* %1
br label %14
14: ; preds = %13, %11
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@.str = [5 x i8] c"SPAM\00"
define i32 @isLegit() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %6, %0
%4 = call i64 @read(i32 0, i8* %2, i32 1024)
%5 = icmp sgt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = call i32* @strstr(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i32* %7, null
br i1 %8, label %3, label %9
9: ; preds = %3, %6
%10 = phi i32 [ 0, %6 ], [ 1, %3 ]
ret i32 %10
}
const char *_Locale_full_monthname(struct _Locale_time *__DUMMY_PAR1,
                                   int __DUMMY_PAR2) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct._Locale_time = type opaque
define i8* @_Locale_full_monthname(%struct._Locale_time* %0, i32 %1) {
%3 = alloca %struct._Locale_time*
%4 = alloca i32
store %struct._Locale_time* %0, %struct._Locale_time** %3
store i32 %1, i32* %4
ret i8* null
}

LLVM IR (-O2):
%struct._Locale_time = type opaque
define noalias i8* @_Locale_full_monthname(%struct._Locale_time* nocapture readnone %0, i32 %1) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void tgt_poweroff() { printf("arch does not support poweroff\n"); }


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"arch does not support poweroff\0A\00"
define void @tgt_poweroff() {
%1 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [31 x i8] c"arch does not support poweroff\00"
define void @tgt_poweroff() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret void
}
int colour_to_green(int colour) {
  int return_val = 0;
  switch (colour) {
  case 0:
  case 1:
  case 5:
  case 6:
    return_val = 255;
    break;
  }
  return return_val;
}


x86 assembly (clang, -O0):
<colour_to_green>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x2,%eax
jb     1136 <colour_to_green+0x36>
jmp    1122 <colour_to_green+0x22>
mov    -0xc(%rbp),%eax
add    $0xfffffffb,%eax
sub    $0x1,%eax
ja     113d <colour_to_green+0x3d>
jmp    1136 <colour_to_green+0x36>
movl   $0xff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<colour_to_green>:
xor    %eax,%eax
cmp    $0x6,%edi
ja     1114 <colour_to_green+0x14>
movslq %edi,%rax
lea    0xeef(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @colour_to_green(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
switch i32 %4, label %6 [
i32 0, label %5
i32 1, label %5
i32 5, label %5
i32 6, label %5
]
5: ; preds = %1, %1, %1, %1
store i32 255, i32* %3
br label %6
6: ; preds = %1, %5
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
@switch.table.colour_to_green = [7 x i32] [i32 255, i32 255, i32 0, i32 0, i32 0, i32 255, i32 255]
define i32 @colour_to_green(i32 %0) {
%2 = icmp ult i32 %0, 7
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [7 x i32], [7 x i32]* @switch.table.colour_to_green, i64 0, i64 %4
%6 = load i32, i32* %5
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
RX0AR1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{ (p0[x0]) = (p1[1111111 / 4]); }


x86 assembly (clang, -O0):
<RX0AR1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    0x10f444(%rax),%edx
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RX0AR1>:
mov    0x10f444(%r9),%eax
movslq %edx,%rcx
mov    %eax,(%r8,%rcx,4)
ret

LLVM IR (-O0):
define i32 @RX0AR1(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32*, i32** %13
%15 = getelementptr inbounds i32, i32* %14, i64 277777
%16 = load i32, i32* %15
%17 = load i32*, i32** %12
%18 = load i32, i32* %10
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %17, i64 %19
store i32 %16, i32* %20
%21 = load i32, i32* %7
ret i32 %21
}

LLVM IR (-O2):
define i32 @RX0AR1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture writeonly %4, i32* nocapture %5) {
%7 = getelementptr inbounds i32, i32* %5, i64 277777
%8 = load i32, i32* %7
%9 = sext i32 %2 to i64
%10 = getelementptr inbounds i32, i32* %4, i64 %9
store i32 %8, i32* %10
ret i32 undef
}
/* Variables and functions */
unsigned short permute(unsigned short, int *, int, int);
unsigned short initialP(unsigned short input) {
  unsigned short postIP;
  int iPBox[8] = {2, 6, 3, 1, 4, 8, 5, 7};
  postIP = permute(input, iPBox, 8, 8);
  return postIP;
}


x86 assembly (clang, -O0):
<initialP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed1(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x2(%rbp),%ax
lea    -0x30(%rbp),%rsi
mov    $0x8,%ecx
movzwl %ax,%edi
mov    %ecx,%edx
call   1030 <permute@plt>
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialP>:
sub    $0x28,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x8,%edx
mov    $0x8,%ecx
call   1030 <permute@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.initialP.iPBox = [8 x i32] [i32 2, i32 6, i32 3, i32 1, i32 4, i32 8, i32 5, i32 7]
define zeroext i16 @initialP(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
%4 = alloca [8 x i32]
store i16 %0, i16* %2
%5 = bitcast [8 x i32]* %4 to i8*
%6 = load i16, i16* %2
%7 = getelementptr inbounds [8 x i32], [8 x i32]* %4, i64 0, i64 0
%8 = call zeroext i16 @permute(i16 zeroext %6, i32* %7, i32 8, i32 8)
store i16 %8, i16* %3
%9 = load i16, i16* %3
ret i16 %9
}

LLVM IR (-O2):
@__const.initialP.iPBox = [8 x i32] [i32 2, i32 6, i32 3, i32 1, i32 4, i32 8, i32 5, i32 7]
define zeroext i16 @initialP(i16 zeroext %0) {
%2 = alloca [8 x i32]
%3 = bitcast [8 x i32]* %2 to i8*
%4 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%5 = call zeroext i16 @permute(i16 zeroext %0, i32* %4, i32 8, i32 8)
ret i16 %5
}
char SignF(unsigned char a) { return (a & 128) ? '-' : '+'; }


x86 assembly (clang, -O0):
<SignF>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x80,%edx
mov    $0x2b,%eax
mov    $0x2d,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SignF>:
shr    $0x6,%dil
and    $0x2,%dil
lea    0x2b(%rdi),%eax
ret

LLVM IR (-O0):
define signext i8 @SignF(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 128
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 45, i32 43
%9 = trunc i32 %8 to i8
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @SignF(i8 zeroext %0) {
%2 = icmp sgt i8 %0, -1
%3 = select i1 %2, i8 43, i8 45
ret i8 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ ****plog_buffer;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ ******);
void _destroy_plog_buffers(struct plog_buffer **_arr) {
  int i;
  for (i = 0; i < 100; i++) {
    free(_arr[i]);
  }
  free(_arr);
}


x86 assembly (clang, -O0):
<_destroy_plog_buffers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jge    114c <_destroy_plog_buffers+0x3c>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <_destroy_plog_buffers+0x13>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_destroy_plog_buffers>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    $0x64,%rbx
jne    1120 <_destroy_plog_buffers+0x10>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.plog_buffer = type opaque
define void @_destroy_plog_buffers(%struct.plog_buffer** nocapture %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %8, %2 ]
%4 = getelementptr inbounds %struct.plog_buffer*, %struct.plog_buffer** %0, i64 %3
%5 = bitcast %struct.plog_buffer** %4 to i32*******
%6 = load i32******, i32******* %5
%7 = tail call i32 @free(i32****** %6)
%8 = add nuw nsw i64 %3, 1
%9 = icmp eq i64 %8, 100
br i1 %9, label %10, label %2
10: ; preds = %2
%11 = bitcast %struct.plog_buffer** %0 to i32******
%12 = tail call i32 @free(i32****** %11)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int __wcwidth(int /*<<< orphan*/);
int wcwidth(wchar_t wc) { return (__wcwidth(wc)); }


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

x86 assembly (clang, -O2):
<wcwidth>:
jmp    1030 <__wcwidth@plt>

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

LLVM IR (-O2):
define i32 @wcwidth(i32 %0) {
%2 = tail call i32 @__wcwidth(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ PathDesiredHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void PathDesiredUpdated() { UAVObjUpdated(PathDesiredHandle()); }


x86 assembly (clang, -O0):
<PathDesiredUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <PathDesiredHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PathDesiredUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <PathDesiredHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @PathDesiredUpdated() {
%1 = call i32 (...) @PathDesiredHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @PathDesiredUpdated() {
%1 = tail call i32 (...) @PathDesiredHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
uint32_t volatile_fetch_sub_u32(volatile uint32_t *dest, uint32_t val) {
  uint32_t result = *dest;
  *dest = result - val;
  return result;
}


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

x86 assembly (clang, -O2):
<volatile_fetch_sub_u32>:
mov    %rsi,-0x8(%rsp)
mov    (%rdi),%rax
mov    %rax,-0x10(%rsp)
mov    -0x10(%rsp),%rax
sub    -0x8(%rsp),%rax
mov    %rax,(%rdi)
mov    -0x10(%rsp),%rax
ret

LLVM IR (-O0):
define i64 @volatile_fetch_sub_u32(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i64
store i64* %0, i64** %3
store volatile i64 %1, i64* %4
%6 = load i64*, i64** %3
%7 = load volatile i64, i64* %6
store volatile i64 %7, i64* %5
%8 = load volatile i64, i64* %5
%9 = load volatile i64, i64* %4
%10 = sub nsw i64 %8, %9
%11 = load i64*, i64** %3
store volatile i64 %10, i64* %11
%12 = load volatile i64, i64* %5
ret i64 %12
}

LLVM IR (-O2):
define i64 @volatile_fetch_sub_u32(i64* %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %1, i64* %3
%5 = bitcast i64* %4 to i8*
%6 = load volatile i64, i64* %0
store volatile i64 %6, i64* %4
%7 = load volatile i64, i64* %4
%8 = load volatile i64, i64* %3
%9 = sub nsw i64 %7, %8
store volatile i64 %9, i64* %0
%10 = load volatile i64, i64* %4
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ srandom(int);
void init_rand(void) { srandom(1); }


x86 assembly (clang, -O0):
<init_rand>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <srandom@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_rand>:
mov    $0x1,%edi
jmp    1030 <srandom@plt>

LLVM IR (-O0):
define void @init_rand() {
%1 = call i32 @srandom(i32 1)
ret void
}

LLVM IR (-O2):
define void @init_rand() {
%1 = tail call i32 @srandom(i32 1)
ret void
}
/* Variables and functions */
int strlen(char *);
int /*<<< orphan*/ write(int, char *, int const);
int main(int argc, const char **argv) {
  char *str = "Hello, World!\n";
  const int len = strlen(str);
  write(1, str, len);
  return 0;
}


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)
lea    0xec3(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    $0x1,%edi
call   1030 <write@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"Hello, World!\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @strlen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
float evaluateAtParameterWithCoefficients(float t, float coefficients[]) {
  return coefficients[0] + t * coefficients[1] + t * t * coefficients[2] +
         t * t * t * coefficients[3];
}


x86 assembly (clang, -O0):
<evaluateAtParameterWithCoefficients>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
movss  -0x4(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm2
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  0xc(%rax),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<evaluateAtParameterWithCoefficients>:
movss  0x4(%rdi),%xmm1
mulss  %xmm0,%xmm1
addss  (%rdi),%xmm1
movaps %xmm0,%xmm2
mulss  %xmm0,%xmm2
movss  0x8(%rdi),%xmm3
mulss  %xmm2,%xmm3
addss  %xmm1,%xmm3
mulss  %xmm2,%xmm0
mulss  0xc(%rdi),%xmm0
addss  %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @evaluateAtParameterWithCoefficients(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 = load float, float* %3
%9 = load float*, float** %4
%10 = getelementptr inbounds float, float* %9, i64 1
%11 = load float, float* %10
%12 = call float @llvm.fmuladd.f32(float %8, float %11, float %7)
%13 = load float, float* %3
%14 = load float, float* %3
%15 = fmul float %13, %14
%16 = load float*, float** %4
%17 = getelementptr inbounds float, float* %16, i64 2
%18 = load float, float* %17
%19 = call float @llvm.fmuladd.f32(float %15, float %18, float %12)
%20 = load float, float* %3
%21 = load float, float* %3
%22 = fmul float %20, %21
%23 = load float, float* %3
%24 = fmul float %22, %23
%25 = load float*, float** %4
%26 = getelementptr inbounds float, float* %25, i64 3
%27 = load float, float* %26
%28 = call float @llvm.fmuladd.f32(float %24, float %27, float %19)
ret float %28
}

LLVM IR (-O2):
define float @evaluateAtParameterWithCoefficients(float %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = getelementptr inbounds float, float* %1, i64 1
%5 = load float, float* %4
%6 = tail call float @llvm.fmuladd.f32(float %0, float %5, float %3)
%7 = fmul float %0, %0
%8 = getelementptr inbounds float, float* %1, i64 2
%9 = load float, float* %8
%10 = tail call float @llvm.fmuladd.f32(float %7, float %9, float %6)
%11 = fmul float %7, %0
%12 = getelementptr inbounds float, float* %1, i64 3
%13 = load float, float* %12
%14 = tail call float @llvm.fmuladd.f32(float %11, float %13, float %10)
ret float %14
}
int do_963() { return 963; }


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

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

LLVM IR (-O0):
define i32 @do_963() {
ret i32 963
}

LLVM IR (-O2):
define i32 @do_963() {
ret i32 963
}
void kdba_unsave_running(struct kdba_running_process *k, struct pt_regs *regs) {
}


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

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

LLVM IR (-O0):
%struct.kdba_running_process = type opaque
%struct.pt_regs = type opaque
define void @kdba_unsave_running(%struct.kdba_running_process* %0, %struct.pt_regs* %1) {
%3 = alloca %struct.kdba_running_process*
%4 = alloca %struct.pt_regs*
store %struct.kdba_running_process* %0, %struct.kdba_running_process** %3
store %struct.pt_regs* %1, %struct.pt_regs** %4
ret void
}

LLVM IR (-O2):
%struct.kdba_running_process = type opaque
%struct.pt_regs = type opaque
define void @kdba_unsave_running(%struct.kdba_running_process* nocapture %0, %struct.pt_regs* nocapture %1) {
ret void
}
/* Variables and functions */
int close(int);
int close_(int *filedes) { return (close(*filedes)); }


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

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

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

LLVM IR (-O2):
define i32 @close_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @close(i32 %2)
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t op_lt(uint32_t a, uint32_t b) { return a < b; }


x86 assembly (clang, -O0):
<op_lt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_lt>:
xor    %eax,%eax
cmp    %esi,%edi
setl   %al
ret

LLVM IR (-O0):
define i32 @op_lt(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* %4
%7 = icmp slt i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @op_lt(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int gcd(int a, int b) {
  int temp;
  if (b > a) {
    temp = a;
    a = b;
    b = temp;
  }
  while (b != 0) {
    temp = a % b;
    a = b;
    b = temp;
  }
  return a;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jle    1128 <gcd+0x28>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    112d <gcd+0x2d>
cmpl   $0x0,-0x8(%rbp)
je     1152 <gcd+0x52>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    112d <gcd+0x2d>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %esi,%edx
cmp    %edi,%esi
mov    %edi,%eax
cmovg  %esi,%eax
cmovg  %edi,%edx
test   %edx,%edx
je     111d <gcd+0x1d>
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, %0
%4 = select i1 %3, i32 %1, i32 %0
%5 = select i1 %3, i32 %0, i32 %1
%6 = icmp eq i32 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %2, %7
%8 = phi i32 [ %10, %7 ], [ %5, %2 ]
%9 = phi i32 [ %8, %7 ], [ %4, %2 ]
%10 = srem i32 %9, %8
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %7
12: ; preds = %7, %2
%13 = phi i32 [ %4, %2 ], [ %8, %7 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage() {
  printf("fp Copyright (C) 2011 Matthias Ruester\n"
         "This program comes with ABSOLUTELY NO WARRANTY.\n"
         "This is free software, and you are welcome to redistribute it\n"
         "under certain conditions.\n\n"
         "usage: fp [OPTIONS] FORMULA...\n"
         "possible options:\n"
         "    -f [FILE]         read formulas from file\n"
         "    -p [PRECISION]    set the precision of the output\n"
         "    -n                just print results\n");
}


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

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

LLVM IR (-O0):
@.str = [367 x i8] c"fp Copyright (C) 2011 Matthias Ruester\0AThis program comes with ABSOLUTELY NO WARRANTY.\0AThis is free software, and you are welcome to redistribute it\0Aunder certain conditions.\0A\0Ausage: fp [OPTIONS] FORMULA...\0Apossible options:\0A -f [FILE] read formulas from file\0A -p [PRECISION] set the precision of the output\0A -n just print results\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([367 x i8], [367 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [366 x i8] c"fp Copyright (C) 2011 Matthias Ruester\0AThis program comes with ABSOLUTELY NO WARRANTY.\0AThis is free software, and you are welcome to redistribute it\0Aunder certain conditions.\0A\0Ausage: fp [OPTIONS] FORMULA...\0Apossible options:\0A -f [FILE] read formulas from file\0A -p [PRECISION] set the precision of the output\0A -n just print results\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([366 x i8], [366 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _HibernateWriteComplete();
void HibernateRTCTrimSet(uint32_t ui32Trim) {
  ;
  (*((volatile unsigned long *)(0x400FC024))) = ui32Trim;
  _HibernateWriteComplete();
}


x86 assembly (clang, -O0):
<HibernateRTCTrimSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x400fc024,%eax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateRTCTrimSet>:
mov    %rdi,0x400fc024
40
xor    %eax,%eax
jmp    1030 <_HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateRTCTrimSet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
store volatile i64 %3, i64* inttoptr (i64 1074774052 to i64*)
%4 = call i32 (...) @_HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateRTCTrimSet(i64 %0) {
store volatile i64 %0, i64* inttoptr (i64 1074774052 to i64*)
%2 = tail call i32 (...) @_HibernateWriteComplete()
ret void
}
int c042(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @c042() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const, char *);
char *strrchr(char const *, char const);
int main() {
  const char str[] = "http://www.yiibai.com/html";
  const char ch = '.';
  char *ret;
  ret = strrchr(str, ch);
  printf("String after |%c| is - |%s|\n", ch, ret);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec1(%rip),%ax
mov    %ax,-0x8(%rbp)
mov    0xeb9(%rip),%al
mov    %al,-0x6(%rbp)
movb   $0x2e,-0x21(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x2e,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdx
lea    0xe96(%rip),%rdi
mov    $0x2e,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movups 0xee0(%rip),%xmm0
movups %xmm0,0xb(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x2e,%esi
call   1040 <strrchr@plt>
lea    0xecc(%rip),%rdi
mov    $0x2e,%esi
mov    %rax,%rdx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.str = [27 x i8] c"http://www.yiibai.com/html\00"
@.str = [29 x i8] c"String after |%c| is - |%s|\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [27 x i8]
%3 = alloca i8
%4 = alloca i8*
store i32 0, i32* %1
%5 = bitcast [27 x i8]* %2 to i8*
store i8 46, i8* %3
%6 = getelementptr inbounds [27 x i8], [27 x i8]* %2, i64 0, i64 0
%7 = call i8* @strrchr(i8* %6, i8 signext 46)
store i8* %7, i8** %4
%8 = load i8*, i8** %4
%9 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8 signext 46, i8* %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [27 x i8] c"http://www.yiibai.com/html\00"
@.str = [29 x i8] c"String after |%c| is - |%s|\0A\00"
define i32 @main() {
%1 = alloca [27 x i8]
%2 = getelementptr inbounds [27 x i8], [27 x i8]* %1, i64 0, i64 0
%3 = call i8* @strrchr(i8* %2, i8 signext 46)
%4 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8 signext 46, i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _unsupported();
void _Unwind_GetDataRelBase() { _unsupported(); }


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

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

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

LLVM IR (-O2):
define void @_Unwind_GetDataRelBase() {
%1 = tail call i32 (...) @_unsupported()
ret void
}
void call1b(unsigned short us, unsigned int ui, unsigned long ul,
            unsigned char uc) {
  uc = 5;
  us = 6;
  ui = 7;
  ul = 8;
}


x86 assembly (clang, -O0):
<call1b>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movb   $0x5,-0x11(%rbp)
movw   $0x6,-0x2(%rbp)
movl   $0x7,-0x8(%rbp)
movq   $0x8,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @call1b(i16 zeroext %0, i32 %1, i64 %2, i8 zeroext %3) {
%5 = alloca i16
%6 = alloca i32
%7 = alloca i64
%8 = alloca i8
store i16 %0, i16* %5
store i32 %1, i32* %6
store i64 %2, i64* %7
store i8 %3, i8* %8
store i8 5, i8* %8
store i16 6, i16* %5
store i32 7, i32* %6
store i64 8, i64* %7
ret void
}

LLVM IR (-O2):
define void @call1b(i16 zeroext %0, i32 %1, i64 %2, i8 zeroext %3) {
ret void
}
int F8() {
  int yDb;
  int RuR;
  int C9S4;
  int CY;
}


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

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

LLVM IR (-O0):
define i32 @F8() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
define i32 @F8() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Log(char *);
int /*<<< orphan*/ abort();
void Div0() {
  Log("Divison by zero");
  abort();
}


x86 assembly (clang, -O0):
<Div0>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <Log@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<Div0>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <Log@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Divison by zero\00"
define void @Div0() {
%1 = call i32 @Log(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@.str = [16 x i8] c"Divison by zero\00"
define void @Div0() {
%1 = tail call i32 @Log(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
void *memset(int /*<<< orphan*/, int /*<<< orphan*/, size_t);
int /*<<< orphan*/ xmalloc(size_t);
void *xzmalloc(size_t sz) { return memset(xmalloc(sz), 0, sz); }


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

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

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

LLVM IR (-O2):
define i8* @xzmalloc(i64 %0) {
%2 = tail call i32 @xmalloc(i64 %0)
%3 = tail call i8* @memset(i32 %2, i32 0, i64 %0)
ret i8* %3
}
/* Type definitions */
struct sqlConnection {
  int dummy;
};
struct expRecord {
  int dummy;
};

/* Variables and functions */
struct expRecord *expRecordLoadTable(struct sqlConnection *, char *);
struct sqlConnection *sqlConnect(char *);
int /*<<< orphan*/ sqlDisconnect(struct sqlConnection **);
struct expRecord *expRecordConnectAndLoadTable(char *database, char *table) {
  struct sqlConnection *conn = sqlConnect(database);
  struct expRecord *ers = expRecordLoadTable(conn, table);
  sqlDisconnect(&conn);
  return ers;
}


x86 assembly (clang, -O0):
<expRecordConnectAndLoadTable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <sqlConnect@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <expRecordLoadTable@plt>
mov    %rax,-0x20(%rbp)
lea    -0x18(%rbp),%rdi
call   1040 <sqlDisconnect@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expRecordConnectAndLoadTable>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
call   1030 <sqlConnect@plt>
mov    %rax,0x8(%rsp)
mov    %rax,%rdi
mov    %rbx,%rsi
call   1050 <expRecordLoadTable@plt>
mov    %rax,%rbx
lea    0x8(%rsp),%rdi
call   1040 <sqlDisconnect@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.expRecord = type { i32 }
%struct.sqlConnection = type { i32 }
define %struct.expRecord* @expRecordConnectAndLoadTable(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca %struct.sqlConnection*
%6 = alloca %struct.expRecord*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call %struct.sqlConnection* @sqlConnect(i8* %7)
store %struct.sqlConnection* %8, %struct.sqlConnection** %5
%9 = load %struct.sqlConnection*, %struct.sqlConnection** %5
%10 = load i8*, i8** %4
%11 = call %struct.expRecord* @expRecordLoadTable(%struct.sqlConnection* %9, i8* %10)
store %struct.expRecord* %11, %struct.expRecord** %6
%12 = call i32 @sqlDisconnect(%struct.sqlConnection** %5)
%13 = load %struct.expRecord*, %struct.expRecord** %6
ret %struct.expRecord* %13
}

LLVM IR (-O2):
%struct.expRecord = type { i32 }
%struct.sqlConnection = type { i32 }
define %struct.expRecord* @expRecordConnectAndLoadTable(i8* %0, i8* %1) {
%3 = alloca %struct.sqlConnection*
%4 = bitcast %struct.sqlConnection** %3 to i8*
%5 = tail call %struct.sqlConnection* @sqlConnect(i8* %0)
store %struct.sqlConnection* %5, %struct.sqlConnection** %3
%6 = tail call %struct.expRecord* @expRecordLoadTable(%struct.sqlConnection* %5, i8* %1)
%7 = call i32 @sqlDisconnect(%struct.sqlConnection** %3)
ret %struct.expRecord* %6
}
/* Variables and functions */
double log(double);
double log_base(double value, double base) { return log(value) / log(base); }


x86 assembly (clang, -O0):
<log_base>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_base>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
call   1030 <log@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <log@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define double @log_base(double %0, double %1) {
%3 = tail call double @log(double %0)
%4 = tail call double @log(double %1)
%5 = fdiv double %3, %4
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ return_padded_alloc_size_vector();
int /*<<< orphan*/ take_padded_alloc_size_vector(int /*<<< orphan*/);
void test_padded_alloc_size_vector() {
  take_padded_alloc_size_vector(return_padded_alloc_size_vector());
}


x86 assembly (clang, -O0):
<test_padded_alloc_size_vector>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <return_padded_alloc_size_vector@plt>
mov    %eax,%edi
call   1040 <take_padded_alloc_size_vector@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_padded_alloc_size_vector>:
push   %rax
xor    %eax,%eax
call   1030 <return_padded_alloc_size_vector@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <take_padded_alloc_size_vector@plt>

LLVM IR (-O0):
define void @test_padded_alloc_size_vector() {
%1 = call i32 (...) @return_padded_alloc_size_vector()
%2 = call i32 @take_padded_alloc_size_vector(i32 %1)
ret void
}

LLVM IR (-O2):
define void @test_padded_alloc_size_vector() {
%1 = tail call i32 (...) @return_padded_alloc_size_vector()
%2 = tail call i32 @take_padded_alloc_size_vector(i32 %1)
ret void
}
float InvSqrt(float x) {
  float xhalf = 0.5f * x;
  int i = *(int *)&x;
  i = 0x5f375a86 - (i >> 1);
  x = *(float *)&i;
  x = x * (1.5f - xhalf * x * x);
  return x;
}


x86 assembly (clang, -O0):
<InvSqrt>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xef3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x1,%ecx
mov    $0x5f375a86,%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
movss  -0x4(%rbp),%xmm2
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm1
movss  0xe98(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<InvSqrt>:
movd   %xmm0,%eax
sar    %eax
mov    $0x5f375a86,%ecx
sub    %eax,%ecx
movd   %ecx,%xmm1
mulss  0xee7(%rip),%xmm0
mulss  %xmm1,%xmm0
mulss  %xmm1,%xmm0
addss  0xedb(%rip),%xmm0
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @InvSqrt(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca i32
store float %0, float* %2
%5 = load float, float* %2
%6 = fmul float 5.000000e-01, %5
store float %6, float* %3
%7 = bitcast float* %2 to i32*
%8 = load i32, i32* %7
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = ashr i32 %9, 1
%11 = sub nsw i32 1597463174, %10
store i32 %11, i32* %4
%12 = bitcast i32* %4 to float*
%13 = load float, float* %12
store float %13, float* %2
%14 = load float, float* %2
%15 = load float, float* %3
%16 = load float, float* %2
%17 = fmul float %15, %16
%18 = load float, float* %2
%19 = fneg float %17
%20 = call float @llvm.fmuladd.f32(float %19, float %18, float 1.500000e+00)
%21 = fmul float %14, %20
store float %21, float* %2
%22 = load float, float* %2
ret float %22
}

LLVM IR (-O2):
define float @InvSqrt(float %0) {
%2 = bitcast float %0 to i32
%3 = ashr i32 %2, 1
%4 = sub nsw i32 1597463174, %3
%5 = bitcast i32 %4 to float
%6 = fmul float %0, -5.000000e-01
%7 = fmul float %6, %5
%8 = tail call float @llvm.fmuladd.f32(float %7, float %5, float 1.500000e+00)
%9 = fmul float %8, %5
ret float %9
}
void local_timer_rescale(unsigned long cpu_freq_khz) {}


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

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

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

LLVM IR (-O2):
define void @local_timer_rescale(i64 %0) {
ret void
}
void destroy(void) {}


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

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

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

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