xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int n = 100;
  int sum1 = ((n * (n + 1)) / 2) * ((n * (n + 1)) / 2);
  int sum2 = (n * (n + 1) * (2 * n + 1)) / 6;
  printf("%d\n", (sum1 - sum2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    $0x6,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%esi
sub    -0x10(%rbp),%esi
lea    0xe74(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 100, i32* %2
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
%8 = mul nsw i32 %5, %7
%9 = sdiv i32 %8, 2
%10 = load i32, i32* %2
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
%13 = mul nsw i32 %10, %12
%14 = sdiv i32 %13, 2
%15 = mul nsw i32 %9, %14
store i32 %15, i32* %3
%16 = load i32, i32* %2
%17 = load i32, i32* %2
%18 = add nsw i32 %17, 1
%19 = mul nsw i32 %16, %18
%20 = load i32, i32* %2
%21 = mul nsw i32 2, %20
%22 = add nsw i32 %21, 1
%23 = mul nsw i32 %19, %22
%24 = sdiv i32 %23, 6
store i32 %24, i32* %4
%25 = load i32, i32* %3
%26 = load i32, i32* %4
%27 = sub nsw i32 %25, %26
%28 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %27)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 25164150)
ret i32 0
}
/* Variables and functions */
bool WatchdogLockState(void) {
  return (
      ((*((volatile unsigned long *)(0x40080000 + 0x00000C00))) == 0x00000001)
          ? true
          : false);
}


x86 assembly (clang, -O0):
<WatchdogLockState>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40080c00,%eax
mov    (%rax),%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x1,%rdx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<WatchdogLockState>:
mov    0x40080c00,%rcx
40
xor    %eax,%eax
cmp    $0x1,%rcx
sete   %al
ret

LLVM IR (-O0):
define i32 @WatchdogLockState() {
%1 = load volatile i64, i64* inttoptr (i64 1074269184 to i64*)
%2 = icmp eq i64 %1, 1
%3 = zext i1 %2 to i64
%4 = select i1 %2, i32 1, i32 0
ret i32 %4
}

LLVM IR (-O2):
define i32 @WatchdogLockState() {
%1 = load volatile i64, i64* inttoptr (i64 1074269184 to i64*)
%2 = icmp eq i64 %1, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void cat(char param[]) {
  printf("cat command \n");
  printf("parameters = %s \n", param);
  return;
}


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

x86 assembly (clang, -O2):
<cat>:
push   %rbx
mov    %rdi,%rbx
lea    0xee7(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str.1 = [18 x i8] c"parameters = %s \0A\00"
@str = [13 x i8] c"cat command \00"
define void @cat(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
void jac_chain_nm5_incref(void) {}


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

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

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

LLVM IR (-O2):
define void @jac_chain_nm5_incref() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _dgr(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _f2d(int);
int _fgeq(int a, int b) { return !_dgr(_f2d(b), _f2d(a)); }


x86 assembly (clang, -O0):
<_fgeq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <_f2d@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <_f2d@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
call   1030 <_dgr@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fgeq>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %esi,%edi
call   1040 <_f2d@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <_f2d@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1030 <_dgr@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @_fgeq(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 = call i32 @_f2d(i32 %5)
%7 = load i32, i32* %3
%8 = call i32 @_f2d(i32 %7)
%9 = call i32 @_dgr(i32 %6, i32 %8)
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @_fgeq(i32 %0, i32 %1) {
%3 = tail call i32 @_f2d(i32 %1)
%4 = tail call i32 @_f2d(i32 %0)
%5 = tail call i32 @_dgr(i32 %3, i32 %4)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
double GSL_MIN_DBL(double a, double b) { return ((a) < (b) ? (a) : (b)); }


x86 assembly (clang, -O0):
<GSL_MIN_DBL>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <GSL_MIN_DBL+0x31>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    113b <GSL_MIN_DBL+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<GSL_MIN_DBL>:
minsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @GSL_MIN_DBL(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 = load double, double* %4
%7 = fcmp olt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @GSL_MIN_DBL(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int send(int, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void say(int socket, char *s) {
  if (send(socket, s, strlen(s), 0) == -1) {
    puts("Error sending message");
  }
}


x86 assembly (clang, -O0):
<say>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1050 <send@plt>
cmp    $0xffffffff,%eax
jne    117b <say+0x4b>
lea    0xe8a(%rip),%rdi
call   1030 <puts@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<say>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1050 <send@plt>
cmp    $0xffffffff,%eax
je     115a <say+0x2a>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xe9f(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Error sending message\00"
define void @say(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @send(i32 %5, i8* %6, i32 %8, i32 0)
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Error sending message\00"
define void @say(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @send(i32 %0, i8* %1, i32 %3, i32 0)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void die(const char *msg) {
  fputs(msg, stderr);
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stderr
%5 = call i32 @fputs(i8* %3, i32 %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
define void @die(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* %0, i32 %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
void g_mem_chunk_info() {}


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

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

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

LLVM IR (-O2):
define void @g_mem_chunk_info() {
ret void
}
double nullstelleLineareFunktion(double x1, double y1, double x2, double y2) {
  return -1 * ((x2 - x1) / (y2 - y1)) * y1 + x1;
}


x86 assembly (clang, -O0):
<nullstelleLineareFunktion>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm1
subsd  -0x8(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
divsd  %xmm0,%xmm1
movsd  0xec8(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<nullstelleLineareFunktion>:
subsd  %xmm0,%xmm2
subsd  %xmm1,%xmm3
divsd  %xmm3,%xmm2
mulsd  %xmm1,%xmm2
subsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @nullstelleLineareFunktion(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %7
%10 = load double, double* %5
%11 = fsub double %9, %10
%12 = load double, double* %8
%13 = load double, double* %6
%14 = fsub double %12, %13
%15 = fdiv double %11, %14
%16 = fmul double -1.000000e+00, %15
%17 = load double, double* %6
%18 = load double, double* %5
%19 = call double @llvm.fmuladd.f64(double %16, double %17, double %18)
ret double %19
}

LLVM IR (-O2):
define double @nullstelleLineareFunktion(double %0, double %1, double %2, double %3) {
%5 = fsub double %2, %0
%6 = fsub double %3, %1
%7 = fneg double %5
%8 = fdiv double %7, %6
%9 = tail call double @llvm.fmuladd.f64(double %8, double %1, double %0)
ret double %9
}
/* Type definitions */
struct expr {
  int dummy;
};

/* Variables and functions */
struct expr *ModAndDupParse(void *, struct expr *, char const *, char *);
struct expr *ModifyParse(void *theEnv, struct expr *top,
                         const char *logicalName) {
  return (ModAndDupParse(theEnv, top, logicalName, "modify"));
}


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

x86 assembly (clang, -O2):
<ModifyParse>:
lea    0xee9(%rip),%rcx
jmp    1030 <ModAndDupParse@plt>

LLVM IR (-O0):
%struct.expr = type { i32 }
@.str = [7 x i8] c"modify\00"
define %struct.expr* @ModifyParse(i8* %0, %struct.expr* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca %struct.expr*
%6 = alloca i8*
store i8* %0, i8** %4
store %struct.expr* %1, %struct.expr** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load %struct.expr*, %struct.expr** %5
%9 = load i8*, i8** %6
%10 = call %struct.expr* @ModAndDupParse(i8* %7, %struct.expr* %8, i8* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret %struct.expr* %10
}

LLVM IR (-O2):
%struct.expr = type { i32 }
@.str = [7 x i8] c"modify\00"
define %struct.expr* @ModifyParse(i8* %0, %struct.expr* %1, i8* %2) {
%4 = tail call %struct.expr* @ModAndDupParse(i8* %0, %struct.expr* %1, i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret %struct.expr* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ stackBuffer;

/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
void radar10978247(int myValueSize) {
  char stackBuffer[128];
  char *buffer;
  if (myValueSize <= sizeof(stackBuffer))
    buffer = stackBuffer;
  else
    buffer = malloc(myValueSize);
  if (buffer != stackBuffer)
    free(buffer);
}


x86 assembly (clang, -O0):
<radar10978247>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
cmp    $0x80,%rax
ja     1151 <radar10978247+0x31>
lea    -0x90(%rbp),%rax
mov    %rax,-0x98(%rbp)
jmp    1160 <radar10978247+0x40>
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x98(%rbp)
mov    -0x98(%rbp),%rax
lea    -0x90(%rbp),%rcx
cmp    %rcx,%rax
je     1183 <radar10978247+0x63>
mov    -0x98(%rbp),%rdi
call   1030 <free@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<radar10978247>:
cmp    $0x81,%edi
jae    1129 <radar10978247+0x9>
ret
push   %rax
call   1040 <malloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @radar10978247(i32 %0) {
%2 = alloca i32
%3 = alloca [128 x i8]
%4 = alloca i8*
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = icmp ule i64 %6, 128
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
store i8* %9, i8** %4
br label %13
10: ; preds = %1
%11 = load i32, i32* %2
%12 = call i8* @malloc(i32 %11)
store i8* %12, i8** %4
br label %13
13: ; preds = %10, %8
%14 = load i8*, i8** %4
%15 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%16 = icmp ne i8* %14, %15
br i1 %16, label %17, label %20
17: ; preds = %13
%18 = load i8*, i8** %4
%19 = call i32 @free(i8* %18)
br label %20
20: ; preds = %17, %13
ret void
}

LLVM IR (-O2):
define void @radar10978247(i32 %0) {
%2 = icmp ult i32 %0, 129
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i8* @malloc(i32 %0)
%5 = tail call i32 @free(i8* %4)
br label %6
6: ; preds = %1, %3
ret void
}
void security_bprm_post_apply_creds(struct linux_binprm *bprm) { return; }


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

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

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

LLVM IR (-O2):
%struct.linux_binprm = type opaque
define void @security_bprm_post_apply_creds(%struct.linux_binprm* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void padding(char ch, int n) {
  int i;
  for (i = 0; i < n; i++)
    putchar(ch);
}


x86 assembly (clang, -O0):
<padding>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    114b <padding+0x3b>
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1128 <padding+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<padding>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
jle    112c <padding+0x1c>
mov    %esi,%ebx
movsbl %dil,%ebp
nopl   (%rax)
mov    %ebp,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <padding+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @padding(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
%5 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %13, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i8, i8* %3
%12 = call i32 @putchar(i8 signext %11)
br label %13
13: ; preds = %10
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
store i32 %15, i32* %5
br label %6
16: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @padding(i8 signext %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i32 @putchar(i8 signext %0)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
int sum(int x, int y) {
  int result = x + y;
  return result;
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @sum(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* %3
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @sum(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
int do_380() { return 380; }


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

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

LLVM IR (-O0):
define i32 @do_380() {
ret i32 380
}

LLVM IR (-O2):
define i32 @do_380() {
ret i32 380
}
/* Variables and functions */
unsigned long flsl(unsigned long);
unsigned long roundup_pow_of_two(unsigned long x) {
  return (1UL << flsl(x - 1));
}


x86 assembly (clang, -O0):
<roundup_pow_of_two>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
sub    $0x1,%rdi
call   1030 <flsl@plt>
mov    %rax,%rcx
mov    $0x1,%eax
shl    %cl,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundup_pow_of_two>:
push   %rax
add    $0xffffffffffffffff,%rdi
call   1030 <flsl@plt>
mov    $0x1,%edx
mov    %eax,%ecx
shl    %cl,%rdx
mov    %rdx,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @roundup_pow_of_two(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sub i64 %3, 1
%5 = call i64 @flsl(i64 %4)
%6 = shl i64 1, %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @roundup_pow_of_two(i64 %0) {
%2 = add i64 %0, -1
%3 = tail call i64 @flsl(i64 %2)
%4 = shl nuw i64 1, %3
ret i64 %4
}
int csm_htdc_eq(int *a, int *b) { return ((*a) == (*b)); }


x86 assembly (clang, -O0):
<csm_htdc_eq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<csm_htdc_eq>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
sete   %al
ret

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

LLVM IR (-O2):
define i32 @csm_htdc_eq(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long target;
};
struct TYPE_4__ {
  TYPE_1__ xselectionrequest;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xselectionrequest_target(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xselectionrequest.target = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xselectionrequest_target>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define void @set_XEvent_xselectionrequest_target(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i64 %5, i64* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xselectionrequest_target(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OPM_FPrint(long long *, long long);
void OPM_FPrintSet(long long *fp, unsigned long long set) {
  OPM_FPrint(&*fp, (long long)set);
}


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

x86 assembly (clang, -O2):
<OPM_FPrintSet>:
jmp    1030 <OPM_FPrint@plt>

LLVM IR (-O0):
define void @OPM_FPrintSet(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%5 = load i64*, i64** %3
%6 = load i64, i64* %4
%7 = call i32 @OPM_FPrint(i64* %5, i64 %6)
ret void
}

LLVM IR (-O2):
define void @OPM_FPrintSet(i64* %0, i64 %1) {
%3 = tail call i32 @OPM_FPrint(i64* %0, i64 %1)
ret void
}
int __FSTestDiv0(int iTest) { return iTest; }


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

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

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

LLVM IR (-O2):
define i32 @__FSTestDiv0(i32 returned %0) {
ret i32 %0
}
void foo375() {}


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

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

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

LLVM IR (-O2):
define void @foo375() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void poke(char arg, char value) { assert(arg == value); }


x86 assembly (clang, -O0):
<poke>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<poke>:
xor    %eax,%eax
cmp    %sil,%dil
sete   %al
mov    %eax,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @poke(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %6, %8
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
ret void
}

LLVM IR (-O2):
define void @poke(i8 signext %0, i8 signext %1) {
%3 = icmp eq i8 %0, %1
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GL_FILL;
int /*<<< orphan*/ GL_FRONT_AND_BACK;
int /*<<< orphan*/ GL_LINE;
int /*<<< orphan*/ glPolygonMode(int /*<<< orphan*/, int /*<<< orphan*/);
void wfunc(void) {
  static int state;
  glPolygonMode(GL_FRONT_AND_BACK, (state ^= 1) ? GL_LINE : GL_FILL);
}


x86 assembly (clang, -O0):
<wfunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    0x2f02(%rip),%eax
xor    $0x1,%eax
mov    %eax,0x2ef9(%rip)
cmp    $0x0,%eax
je     114d <wfunc+0x3d>
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
jmp    1159 <wfunc+0x49>
mov    0x2e7c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <glPolygonMode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wfunc>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
xorl   $0x1,0x2f0c(%rip)
jne    1130 <wfunc+0x20>
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
jmp    1030 <glPolygonMode@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <glPolygonMode@plt>

LLVM IR (-O0):
@wfunc.state = internal global i32 0
@GL_FRONT_AND_BACK = global i32 0
@GL_LINE = global i32 0
@GL_FILL = global i32 0
define void @wfunc() {
%1 = load i32, i32* @GL_FRONT_AND_BACK
%2 = load i32, i32* @wfunc.state
%3 = xor i32 %2, 1
store i32 %3, i32* @wfunc.state
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = load i32, i32* @GL_LINE
br label %9
7: ; preds = %0
%8 = load i32, i32* @GL_FILL
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
%11 = call i32 @glPolygonMode(i32 %1, i32 %10)
ret void
}

LLVM IR (-O2):
@wfunc.state = internal unnamed_addr global i32 0
@GL_FRONT_AND_BACK = global i32 0
@GL_LINE = global i32 0
@GL_FILL = global i32 0
define void @wfunc() {
%1 = load i32, i32* @GL_FRONT_AND_BACK
%2 = load i32, i32* @wfunc.state
%3 = xor i32 %2, 1
store i32 %3, i32* @wfunc.state
%4 = icmp eq i32 %3, 0
%5 = load i32, i32* @GL_LINE
%6 = load i32, i32* @GL_FILL
%7 = select i1 %4, i32 %6, i32 %5
%8 = tail call i32 @glPolygonMode(i32 %1, i32 %7)
ret void
}
/* Variables and functions */
int print(char **, int *);
int _sprintf_cdnopsuxX(char *out, const char *format, ...) {
  register int *varg = (int *)(&format);
  return print(&out, varg);
}


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

x86 assembly (clang, -O2):
<_sprintf_cdnopsuxX>:
sub    $0x18,%rsp
mov    %rdi,0x10(%rsp)
mov    %rsi,0x8(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <print@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @_sprintf_cdnopsuxX(i8* %0, i8* %1, ...) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = bitcast i8** %4 to i32*
store i32* %6, i32** %5
%7 = load i32*, i32** %5
%8 = call i32 @print(i8** %3, i32* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @_sprintf_cdnopsuxX(i8* %0, i8* %1, ...) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = bitcast i8** %4 to i32*
%6 = call i32 @print(i8** %3, i32* %5)
ret i32 %6
}
/* Type definitions */
struct UPnPService {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
void RNDResponseSink_ContentDirectory_CreateReference(
    struct UPnPService *Service, int ErrorCode, void *User, char *NewID) {
  printf("RND Invoke Response: "
         "ContentDirectory/CreateReference[ErrorCode:%d](%s)\r\n",
         ErrorCode, NewID);
}


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

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

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
@.str = [74 x i8] c"RND Invoke Response: ContentDirectory/CreateReference[ErrorCode:%d](%s)\0D\0A\00"
define void @RNDResponseSink_ContentDirectory_CreateReference(%struct.UPnPService* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca %struct.UPnPService*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store %struct.UPnPService* %0, %struct.UPnPService** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i32, i32* %6
%10 = load i8*, i8** %8
%11 = call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %10)
ret void
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [74 x i8] c"RND Invoke Response: ContentDirectory/CreateReference[ErrorCode:%d](%s)\0D\0A\00"
define void @RNDResponseSink_ContentDirectory_CreateReference(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i8* %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %3)
ret void
}
int c023(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @c023() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ doTopDown(int, int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main() {
  printf("Enter Three Sides of Triangle: ");
  int a, b, c;
  scanf("%d %d %d", &a, &b, &c);
  doTopDown(a, b, c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1050 <doTopDown@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%edx
call   1050 <doTopDown@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Enter Three Sides of Triangle: \00"
@.str.1 = [9 x i8] c"%d %d %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @doTopDown(i32 %7, i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"Enter Three Sides of Triangle: \00"
@.str.1 = [9 x i8] c"%d %d %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = call i32 @doTopDown(i32 %9, i32 %10, i32 %11)
ret i32 0
}
int test_imm_08uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x08 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_08uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 8
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void foo(int *x[]) { **x = 3; }


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

x86 assembly (clang, -O2):
<foo>:
mov    (%rdi),%rax
movl   $0x3,(%rax)
ret

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

LLVM IR (-O2):
define void @foo(i32** nocapture %0) {
%2 = load i32*, i32** %0
store i32 3, i32* %2
ret void
}
/* Variables and functions */
scalar_t__ strcmp(void const *, void const *);
int g_str_equal(const void *str1, const void *str2) {
  return strcmp(str1, str2) == 0;
}


x86 assembly (clang, -O0):
<g_str_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_str_equal>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @g_str_equal(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ drv_generic_serial_write(char *, int);
void drv_MI_clear(void) { drv_generic_serial_write("\376\001", 2); }


x86 assembly (clang, -O0):
<drv_MI_clear>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x2,%esi
call   1030 <drv_generic_serial_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<drv_MI_clear>:
lea    0xee9(%rip),%rdi
mov    $0x2,%esi
jmp    1030 <drv_generic_serial_write@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\FE\01\00"
define void @drv_MI_clear() {
%1 = call i32 @drv_generic_serial_write(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\FE\01\00"
define void @drv_MI_clear() {
%1 = tail call i32 @drv_generic_serial_write(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
ret void
}
float fv(__attribute__((vector_size(16))) float a) { return a[0]; }


x86 assembly (clang, -O0):
<fv>:
push   %rbp
mov    %rsp,%rbp
movaps %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @fv(<4 x float> %0) {
%2 = alloca <4 x float>
store <4 x float> %0, <4 x float>* %2
%3 = load <4 x float>, <4 x float>* %2
%4 = extractelement <4 x float> %3, i32 0
ret float %4
}

LLVM IR (-O2):
define float @fv(<4 x float> %0) {
%2 = extractelement <4 x float> %0, i64 0
ret float %2
}
/* Variables and functions */
void v16_ntoh(void *);
void v16_hton(void *p) { return v16_ntoh(p); }


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

x86 assembly (clang, -O2):
<v16_hton>:
jmp    1030 <v16_ntoh@plt>

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

LLVM IR (-O2):
define void @v16_hton(i8* %0) {
tail call void @v16_ntoh(i8* %0)
ret void
}
void __hv_mul_i(int bIn0, int bIn1, int *bOut) { *bOut = bIn0 * bIn1; }


x86 assembly (clang, -O0):
<__hv_mul_i>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
imul   -0x8(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__hv_mul_i>:
imul   %esi,%edi
mov    %edi,(%rdx)
ret

LLVM IR (-O0):
define void @__hv_mul_i(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = mul nsw i32 %7, %8
%10 = load i32*, i32** %6
store i32 %9, i32* %10
ret void
}

LLVM IR (-O2):
define void @__hv_mul_i(i32 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = mul nsw i32 %1, %0
store i32 %4, i32* %2
ret void
}
int fun1117() { return 1117; }


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

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

LLVM IR (-O0):
define i32 @fun1117() {
ret i32 1117
}

LLVM IR (-O2):
define i32 @fun1117() {
ret i32 1117
}
long long foo(long long x) { return x + 1; }


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

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

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

LLVM IR (-O2):
define i64 @foo(i64 %0) {
%2 = add nsw i64 %0, 1
ret i64 %2
}
/* Variables and functions */
char *getSeparator(char const *);
const char *getBaseName(const char *szFilename) {
  const char *pSeparator = getSeparator(szFilename);
  if (!pSeparator) {
    return szFilename;
  }
  return pSeparator;
}


x86 assembly (clang, -O0):
<getBaseName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getSeparator@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1141 <getBaseName+0x31>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1149 <getBaseName+0x39>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getBaseName>:
push   %rbx
mov    %rdi,%rbx
call   1030 <getSeparator@plt>
test   %rax,%rax
cmove  %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @getBaseName(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @getSeparator(i8* %5)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = load i8*, i8** %3
store i8* %10, i8** %2
br label %13
11: ; preds = %1
%12 = load i8*, i8** %4
store i8* %12, i8** %2
br label %13
13: ; preds = %11, %9
%14 = load i8*, i8** %2
ret i8* %14
}

LLVM IR (-O2):
define i8* @getBaseName(i8* %0) {
%2 = tail call i8* @getSeparator(i8* %0)
%3 = icmp eq i8* %2, null
%4 = select i1 %3, i8* %0, i8* %2
ret i8* %4
}
void swap(float **a, float **b) {
  float *temp = *b;
  *b = *a;
  *a = temp;
}


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

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

LLVM IR (-O0):
define void @swap(float** %0, float** %1) {
%3 = alloca float**
%4 = alloca float**
%5 = alloca float*
store float** %0, float*** %3
store float** %1, float*** %4
%6 = load float**, float*** %4
%7 = load float*, float** %6
store float* %7, float** %5
%8 = load float**, float*** %3
%9 = load float*, float** %8
%10 = load float**, float*** %4
store float* %9, float** %10
%11 = load float*, float** %5
%12 = load float**, float*** %3
store float* %11, float** %12
ret void
}

LLVM IR (-O2):
define void @swap(float** nocapture %0, float** nocapture %1) {
%3 = load float*, float** %1
%4 = load float*, float** %0
store float* %4, float** %1
store float* %3, float** %0
ret void
}
int bkl_eng_mode2_write(void *buf, unsigned int size) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @bkl_eng_mode2_write(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
void exit_data_2(int *X) {
#pragma omp target exit data map(from : var2) map(release : X[:N], sum)
}


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

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

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

LLVM IR (-O2):
define void @exit_data_2(i32* nocapture %0) {
ret void
}
void CommandNull(unsigned int arg) {}


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

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

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

LLVM IR (-O2):
define void @CommandNull(i32 %0) {
ret void
}
unsigned char set_bitmask(void) { return 0b10001010; }


x86 assembly (clang, -O0):
<set_bitmask>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8a,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bitmask>:
mov    $0x8a,%al
ret

LLVM IR (-O0):
define zeroext i8 @set_bitmask() {
ret i8 -118
}

LLVM IR (-O2):
define zeroext i8 @set_bitmask() {
ret i8 -118
}
int sound_data_in(struct stream *s, int chan_id, int chan_flags, int length,
                  int total_length) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.stream = type opaque
define i32 @sound_data_in(%struct.stream* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.stream*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store %struct.stream* %0, %struct.stream** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
ret i32 0
}

LLVM IR (-O2):
%struct.stream = type opaque
define i32 @sound_data_in(%struct.stream* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4) {
ret i32 0
}
/* Variables and functions */
size_t PtrHash(const void *const p) {
  size_t y = (size_t)p;
  return (y >> 4u) | (y << (8u * sizeof(void *) - 4u));
}


x86 assembly (clang, -O0):
<PtrHash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x4,%rax
mov    -0x10(%rbp),%rcx
shl    $0x3c,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PtrHash>:
mov    %rdi,%rax
rol    $0x3c,%rax
ret

LLVM IR (-O0):
define i64 @PtrHash(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = lshr i64 %6, 4
%8 = load i64, i64* %3
%9 = shl i64 %8, 60
%10 = or i64 %7, %9
ret i64 %10
}

LLVM IR (-O2):
define i64 @PtrHash(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = tail call i64 @llvm.fshl.i64(i64 %2, i64 %2, i64 60)
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ nombre;
typedef int /*<<< orphan*/ apellido;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  char nombre[] = {'J', 'a', 'c', 'h', '\0'};
  char *apellido = "Anriq";
  printf("The size of nombre[] : %ld\n", sizeof(nombre));
  printf("The size of apellido : %ld\n", sizeof(apellido));
  printf("The size of *apellido : %ld\n", sizeof(*apellido));
  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)
mov    0xed4(%rip),%eax
mov    %eax,-0x15(%rbp)
mov    0xecf(%rip),%al
mov    %al,-0x11(%rbp)
lea    0xec6(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xec1(%rip),%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
lea    0xef3(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
lea    0xefe(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.nombre = [5 x i8] c"Jach\00"
@.str = [6 x i8] c"Anriq\00"
@.str.1 = [28 x i8] c"The size of nombre[] : %ld\0A\00"
@.str.2 = [28 x i8] c"The size of apellido : %ld\0A\00"
@.str.3 = [29 x i8] c"The size of *apellido : %ld\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [5 x i8]
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [5 x i8]* %6 to i8*
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %7
%9 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 5)
%10 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 8)
%11 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 1)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [28 x i8] c"The size of nombre[] : %ld\0A\00"
@.str.2 = [28 x i8] c"The size of apellido : %ld\0A\00"
@.str.3 = [29 x i8] c"The size of *apellido : %ld\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 5)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 8)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 1)
ret i32 0
}