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

/* Variables and functions */
int cli_exit(struct cli_def *, char const *, char **, int);
int cli_int_exit(struct cli_def *cli, const char *command, char *argv[],
                 int argc) {
  return cli_exit(cli, command, argv, argc);
}


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

x86 assembly (clang, -O2):
<cli_int_exit>:
jmp    1030 <cli_exit@plt>

LLVM IR (-O0):
%struct.cli_def = type { i32 }
define i32 @cli_int_exit(%struct.cli_def* %0, i8* %1, i8** %2, i32 %3) {
%5 = alloca %struct.cli_def*
%6 = alloca i8*
%7 = alloca i8**
%8 = alloca i32
store %struct.cli_def* %0, %struct.cli_def** %5
store i8* %1, i8** %6
store i8** %2, i8*** %7
store i32 %3, i32* %8
%9 = load %struct.cli_def*, %struct.cli_def** %5
%10 = load i8*, i8** %6
%11 = load i8**, i8*** %7
%12 = load i32, i32* %8
%13 = call i32 @cli_exit(%struct.cli_def* %9, i8* %10, i8** %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.cli_def = type { i32 }
define i32 @cli_int_exit(%struct.cli_def* %0, i8* %1, i8** %2, i32 %3) {
%5 = tail call i32 @cli_exit(%struct.cli_def* %0, i8* %1, i8** %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ help();
int /*<<< orphan*/ stderr;
void error(void) {
  fputs("Error: Selected option not recognized.\n\n", stderr);
  help();
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x0,%al
call   1040 <help@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <help@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"Error: Selected option not recognized.\0A\0A\00"
@stderr = global i32 0
define void @error() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 (...) @help()
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"Error: Selected option not recognized.\0A\0A\00"
@stderr = global i32 0
define void @error() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @help()
ret void
}
/* Type definitions */
struct dirent {
  char *d_name;
};
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
struct dirent *readdir(int /*<<< orphan*/ *);
char *octave_readdir_wrapper(void *dir) {
  struct dirent *d_ent = readdir((DIR *)dir);
  return d_ent ? d_ent->d_name : 0;
}


x86 assembly (clang, -O0):
<octave_readdir_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <readdir@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1144 <octave_readdir_wrapper+0x34>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    114f <octave_readdir_wrapper+0x3f>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    114f <octave_readdir_wrapper+0x3f>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<octave_readdir_wrapper>:
push   %rax
call   1030 <readdir@plt>
test   %rax,%rax
je     1120 <octave_readdir_wrapper+0x10>
mov    (%rax),%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.dirent = type { i8* }
define i8* @octave_readdir_wrapper(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.dirent*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = call %struct.dirent* @readdir(i32* %5)
store %struct.dirent* %6, %struct.dirent** %3
%7 = load %struct.dirent*, %struct.dirent** %3
%8 = icmp ne %struct.dirent* %7, null
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load %struct.dirent*, %struct.dirent** %3
%11 = getelementptr inbounds %struct.dirent, %struct.dirent* %10, i32 0, i32 0
%12 = load i8*, i8** %11
br label %14
13: ; preds = %1
br label %14
14: ; preds = %13, %9
%15 = phi i8* [ %12, %9 ], [ null, %13 ]
ret i8* %15
}

LLVM IR (-O2):
%struct.dirent = type { i8* }
define i8* @octave_readdir_wrapper(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call %struct.dirent* @readdir(i32* %2)
%4 = icmp eq %struct.dirent* %3, null
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = getelementptr inbounds %struct.dirent, %struct.dirent* %3, i64 0, i32 0
%7 = load i8*, i8** %6
br label %8
8: ; preds = %1, %5
%9 = phi i8* [ %7, %5 ], [ null, %1 ]
ret i8* %9
}
unsigned int IsDefaultFd(int fd) {
  return (fd <= 2) && (fd >= 0);
  __builtin_unreachable();
}


x86 assembly (clang, -O0):
<IsDefaultFd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x2,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jg     1120 <IsDefaultFd+0x20>
cmpl   $0x0,-0x4(%rbp)
setge  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsDefaultFd>:
xor    %eax,%eax
cmp    $0x3,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @IsDefaultFd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 %3, 2
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sge i32 %6, 0
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @IsDefaultFd(i32 %0) {
%2 = icmp ult i32 %0, 3
%3 = zext i1 %2 to i32
ret i32 %3
}
void Swap(a, b) {
  int temp;
  temp = a;
  b = a;
  a = temp;
}


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

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

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

LLVM IR (-O2):
define void @Swap(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
scalar_t__ getegid();
long GETEGID() { return ((long)getegid()); }


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

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

LLVM IR (-O0):
define i64 @GETEGID() {
%1 = call i64 (...) @getegid()
ret i64 %1
}

LLVM IR (-O2):
define i64 @GETEGID() {
%1 = tail call i64 (...) @getegid()
ret i64 %1
}
void LK_LED1_init(void) {}


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

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

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

LLVM IR (-O2):
define void @LK_LED1_init() {
ret void
}
/* Variables and functions */
float sqrtf(float const);
float c_vector3_magnitude(const float *vector) {
  return sqrtf(vector[0] * vector[0] + vector[1] * vector[1] +
               vector[2] * vector[2]);
}


x86 assembly (clang, -O0):
<c_vector3_magnitude>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulss  0x4(%rax),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrtf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_vector3_magnitude>:
movss  (%rdi),%xmm1
movss  0x4(%rdi),%xmm0
mulss  %xmm0,%xmm0
mulss  %xmm1,%xmm1
addss  %xmm0,%xmm1
movss  0x8(%rdi),%xmm0
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     113f <c_vector3_magnitude+0x2f>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrtf@plt>

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

LLVM IR (-O2):
define float @c_vector3_magnitude(float* nocapture %0) {
%2 = load float, float* %0
%3 = getelementptr inbounds float, float* %0, i64 1
%4 = load float, float* %3
%5 = fmul float %4, %4
%6 = tail call float @llvm.fmuladd.f32(float %2, float %2, float %5)
%7 = getelementptr inbounds float, float* %0, i64 2
%8 = load float, float* %7
%9 = tail call float @llvm.fmuladd.f32(float %8, float %8, float %6)
%10 = tail call float @sqrtf(float %9)
ret float %10
}
/* Variables and functions */
int mountCommandWrapper(int, int /*<<< orphan*/ *, char *, int /*<<< orphan*/ *,
                        int /*<<< orphan*/ *, char **);
int doPwUmount(char *where, char **err) {
  return mountCommandWrapper(2, NULL, where, NULL, NULL, err);
}


x86 assembly (clang, -O0):
<doPwUmount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%r9
mov    $0x2,%edi
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rsi
mov    %r8,%rcx
call   1030 <mountCommandWrapper@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doPwUmount>:
mov    %rsi,%r9
mov    %rdi,%rdx
mov    $0x2,%edi
xor    %esi,%esi
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <mountCommandWrapper@plt>

LLVM IR (-O0):
define i32 @doPwUmount(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 i32 @mountCommandWrapper(i32 2, i32* null, i8* %5, i32* null, i32* null, i8** %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @doPwUmount(i8* %0, i8** %1) {
%3 = tail call i32 @mountCommandWrapper(i32 2, i32* null, i8* %0, i32* null, i32* null, i8** %1)
ret i32 %3
}
int aaip_make_aaip_perms(int r, int w, int x) {
  int perms;
  perms = 0;
  if (r)
    perms |= 4;
  if (w)
    perms |= 2;
  if (x)
    perms |= 1;
  return (perms);
}


x86 assembly (clang, -O0):
<aaip_make_aaip_perms>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1127 <aaip_make_aaip_perms+0x27>
mov    -0x10(%rbp),%eax
or     $0x4,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     113a <aaip_make_aaip_perms+0x3a>
mov    -0x10(%rbp),%eax
or     $0x2,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114d <aaip_make_aaip_perms+0x4d>
mov    -0x10(%rbp),%eax
or     $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<aaip_make_aaip_perms>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
lea    0x0(,%rax,4),%ecx
test   %esi,%esi
lea    0x2(,%rax,4),%esi
cmove  %ecx,%esi
xor    %eax,%eax
test   %edx,%edx
setne  %al
or     %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @aaip_make_aaip_perms(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i32 0, i32 4
%6 = icmp eq i32 %1, 0
%7 = or i32 %5, 2
%8 = select i1 %6, i32 %5, i32 %7
%9 = icmp ne i32 %2, 0
%10 = zext i1 %9 to i32
%11 = or i32 %8, %10
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ DEC_();
int /*<<< orphan*/ c64_memAbsoluteAddrX();
void DEC_absx(void) {
  c64_memAbsoluteAddrX();
  DEC_();
}


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

x86 assembly (clang, -O2):
<DEC_absx>:
push   %rax
xor    %eax,%eax
call   1040 <c64_memAbsoluteAddrX@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <DEC_@plt>

LLVM IR (-O0):
define void @DEC_absx() {
%1 = call i32 (...) @c64_memAbsoluteAddrX()
%2 = call i32 (...) @DEC_()
ret void
}

LLVM IR (-O2):
define void @DEC_absx() {
%1 = tail call i32 (...) @c64_memAbsoluteAddrX()
%2 = tail call i32 (...) @DEC_()
ret void
}
int main() {
  unsigned long a = 7;
  unsigned long b = 3;
  return a % b;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movq   $0x7,-0x10(%rbp)
movq   $0x3,-0x18(%rbp)
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
mov    %edx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
store i32 0, i32* %1
store i64 7, i64* %2
store i64 3, i64* %3
%4 = load i64, i64* %2
%5 = load i64, i64* %3
%6 = urem i64 %4, %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ writeMessageToSyslogd(char *);
int main(int argc, char *argv[]) {
  writeMessageToSyslogd("Blair is writing to syslog");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"Blair is writing to syslog\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @writeMessageToSyslogd(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Blair is writing to syslog\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @writeMessageToSyslogd(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ call7i(unsigned long, unsigned int, char, int, short, long,
                          float, unsigned char, double, unsigned short);
void call7h(unsigned short us, unsigned long ul, unsigned int ui, char c, int i,
            short s, long l, float f, unsigned char uc, double d) {
  call7i(ul, ui, c, i, s, l, f, uc, d, us);
}


x86 assembly (clang, -O0):
<call7h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %r9w,%ax
mov    0x18(%rbp),%r9b
mov    0x10(%rbp),%r9
mov    %di,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %cl,-0x15(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %ax,-0x1e(%rbp)
movss  %xmm0,-0x24(%rbp)
movsd  %xmm1,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x15(%rbp),%dl
mov    -0x1c(%rbp),%ecx
mov    -0x1e(%rbp),%r8w
mov    0x10(%rbp),%r9
movss  -0x24(%rbp),%xmm0
mov    0x18(%rbp),%al
movsd  -0x30(%rbp),%xmm1
movsbl %dl,%edx
movswl %r8w,%r8d
movzbl %al,%eax
mov    %eax,(%rsp)
movzwl -0x2(%rbp),%eax
mov    %eax,0x8(%rsp)
call   1030 <call7i@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call7h>:
push   %rax
mov    %r9d,%r10d
mov    %edi,%eax
mov    0x10(%rsp),%r9
movzbl 0x18(%rsp),%r11d
mov    %rsi,%rdi
mov    %edx,%esi
mov    %ecx,%edx
mov    %r8d,%ecx
mov    %r10d,%r8d
push   %rax
push   %r11
call   1030 <call7i@plt>
add    $0x10,%rsp
pop    %rax
ret

LLVM IR (-O0):
define void @call7h(i16 zeroext %0, i64 %1, i32 %2, i8 signext %3, i32 %4, i16 signext %5, i64 %6, float %7, i8 zeroext %8, double %9) {
%11 = alloca i16
%12 = alloca i64
%13 = alloca i32
%14 = alloca i8
%15 = alloca i32
%16 = alloca i16
%17 = alloca i64
%18 = alloca float
%19 = alloca i8
%20 = alloca double
store i16 %0, i16* %11
store i64 %1, i64* %12
store i32 %2, i32* %13
store i8 %3, i8* %14
store i32 %4, i32* %15
store i16 %5, i16* %16
store i64 %6, i64* %17
store float %7, float* %18
store i8 %8, i8* %19
store double %9, double* %20
%21 = load i64, i64* %12
%22 = load i32, i32* %13
%23 = load i8, i8* %14
%24 = load i32, i32* %15
%25 = load i16, i16* %16
%26 = load i64, i64* %17
%27 = load float, float* %18
%28 = load i8, i8* %19
%29 = load double, double* %20
%30 = load i16, i16* %11
%31 = call i32 @call7i(i64 %21, i32 %22, i8 signext %23, i32 %24, i16 signext %25, i64 %26, float %27, i8 zeroext %28, double %29, i16 zeroext %30)
ret void
}

LLVM IR (-O2):
define void @call7h(i16 zeroext %0, i64 %1, i32 %2, i8 signext %3, i32 %4, i16 signext %5, i64 %6, float %7, i8 zeroext %8, double %9) {
%11 = tail call i32 @call7i(i64 %1, i32 %2, i8 signext %3, i32 %4, i16 signext %5, i64 %6, float %7, i8 zeroext %8, double %9, i16 zeroext %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ Display;
typedef int /*<<< orphan*/ Bool;

/* Variables and functions */
int /*<<< orphan*/ XNVCTRLQueryTargetStringAttribute(int /*<<< orphan*/ *,
                                                     int /*<<< orphan*/, int,
                                                     unsigned int, unsigned int,
                                                     char **);
Bool XNVCTRLQueryStringAttribute(Display *dpy, int screen,
                                 unsigned int display_mask,
                                 unsigned int attribute, char **ptr) {
  return XNVCTRLQueryTargetStringAttribute(dpy, 0, screen, display_mask,
                                           attribute, ptr);
}


x86 assembly (clang, -O0):
<XNVCTRLQueryStringAttribute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x20(%rbp),%r9
xor    %esi,%esi
call   1030 <XNVCTRLQueryTargetStringAttribute@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XNVCTRLQueryStringAttribute>:
mov    %r8,%r9
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <XNVCTRLQueryTargetStringAttribute@plt>

LLVM IR (-O0):
define i32 @XNVCTRLQueryStringAttribute(i32* %0, i32 %1, i32 %2, i32 %3, i8** %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8**
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i8** %4, i8*** %10
%11 = load i32*, i32** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i8**, i8*** %10
%16 = call i32 @XNVCTRLQueryTargetStringAttribute(i32* %11, i32 0, i32 %12, i32 %13, i32 %14, i8** %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @XNVCTRLQueryStringAttribute(i32* %0, i32 %1, i32 %2, i32 %3, i8** %4) {
%6 = tail call i32 @XNVCTRLQueryTargetStringAttribute(i32* %0, i32 0, i32 %1, i32 %2, i32 %3, i8** %4)
ret i32 %6
}
int feclearexcept(int excepts) { return (excepts != 0); }


x86 assembly (clang, -O0):
<feclearexcept>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<feclearexcept>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @feclearexcept(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @feclearexcept(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
int test_imm_53uint16_reg(unsigned short val) {
  return ((val) & (0x53 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_53uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x53,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_53uint16_reg>:
test   $0x53,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_53uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 83
%6 = icmp ne i32 %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_53uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 83
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ mdaq_rpc_init();
int mdaq_net_init(void) {
  mdaq_rpc_init();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @mdaq_net_init() {
%1 = tail call i32 (...) @mdaq_rpc_init()
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ FloorLog2(scalar_t__);
uint32_t BitsRequired(uint32_t value) { return 1 + FloorLog2(value); }


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

x86 assembly (clang, -O2):
<BitsRequired>:
push   %rax
call   1030 <FloorLog2@plt>
add    $0x1,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
define i64 @BitsRequired(i64 %0) {
%2 = tail call i64 @FloorLog2(i64 %0)
%3 = add nsw i64 %2, 1
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void missing_segment(char *segment_name) {
  printf("Info file missing segment %s, exiting.\n", segment_name);
  exit(1);
}


x86 assembly (clang, -O0):
<missing_segment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<missing_segment>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"Info file missing segment %s, exiting.\0A\00"
define void @missing_segment(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [40 x i8] c"Info file missing segment %s, exiting.\0A\00"
define void @missing_segment(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct pevent {
  int dummy;
};

/* Variables and functions */
char *find_cmdline(struct pevent *, int);
const char *pevent_data_comm_from_pid(struct pevent *pevent, int pid) {
  const char *comm;
  comm = find_cmdline(pevent, pid);
  return comm;
}


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

x86 assembly (clang, -O2):
<pevent_data_comm_from_pid>:
jmp    1030 <find_cmdline@plt>

LLVM IR (-O0):
%struct.pevent = type { i32 }
define i8* @pevent_data_comm_from_pid(%struct.pevent* %0, i32 %1) {
%3 = alloca %struct.pevent*
%4 = alloca i32
%5 = alloca i8*
store %struct.pevent* %0, %struct.pevent** %3
store i32 %1, i32* %4
%6 = load %struct.pevent*, %struct.pevent** %3
%7 = load i32, i32* %4
%8 = call i8* @find_cmdline(%struct.pevent* %6, i32 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
ret i8* %9
}

LLVM IR (-O2):
%struct.pevent = type { i32 }
define i8* @pevent_data_comm_from_pid(%struct.pevent* %0, i32 %1) {
%3 = tail call i8* @find_cmdline(%struct.pevent* %0, i32 %1)
ret i8* %3
}
void splitIntoDigit(int digitArr[], int n) {
  int ind = 3 - 1;
  while (ind >= 0) {
    digitArr[ind] = n % 10;
    n /= 10;
    ind--;
  }
}


x86 assembly (clang, -O0):
<splitIntoDigit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     114e <splitIntoDigit+0x4e>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <splitIntoDigit+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<splitIntoDigit>:
movslq %esi,%rcx
imul   $0x66666667,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rax
add    %edx,%eax
lea    (%rax,%rax,1),%edx
lea    (%rdx,%rdx,4),%edx
imul   $0x51eb851f,%rcx,%rsi
sub    %edx,%ecx
mov    %ecx,0x8(%rdi)
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
mov    %eax,0x4(%rdi)
mov    %rsi,%rax
shr    $0x3f,%rax
sar    $0x25,%rsi
add    %eax,%esi
movslq %esi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
mov    %eax,(%rdi)
ret

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

LLVM IR (-O2):
define void @splitIntoDigit(i32* nocapture writeonly %0, i32 %1) {
%3 = srem i32 %1, 10
%4 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %3, i32* %4
%5 = sdiv i32 %1, 10
%6 = srem i32 %5, 10
%7 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %6, i32* %7
%8 = sdiv i32 %1, 100
%9 = srem i32 %8, 10
store i32 %9, i32* %0
ret void
}
void test_ar_2_SCHAR(void *d, signed char n) {
  if (0x7f - 2 <= n && n <= 0x7f - 1)
    n = 0x7f - 3;
  __builtin_memset(d, 0, n);
}


x86 assembly (clang, -O0):
<test_ar_2_SCHAR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%ecx
mov    $0x7d,%eax
cmp    %ecx,%eax
jg     1144 <test_ar_2_SCHAR+0x34>
movsbl -0x9(%rbp),%eax
cmp    $0x7e,%eax
jg     1144 <test_ar_2_SCHAR+0x34>
movb   $0x7c,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
movsbq -0x9(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ar_2_SCHAR>:
lea    -0x7d(%rsi),%eax
cmp    $0x2,%al
mov    $0x7c,%eax
cmovae %esi,%eax
movslq %eax,%rdx
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @test_ar_2_SCHAR(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 = sext i8 %5 to i32
%7 = icmp sle i32 125, %6
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8, i8* %4
%10 = sext i8 %9 to i32
%11 = icmp sle i32 %10, 126
br i1 %11, label %12, label %13
12: ; preds = %8
store i8 124, i8* %4
br label %13
13: ; preds = %12, %8, %2
%14 = load i8*, i8** %3
%15 = load i8, i8* %4
%16 = sext i8 %15 to i64
ret void
}

LLVM IR (-O2):
define void @test_ar_2_SCHAR(i8* nocapture writeonly %0, i8 signext %1) {
%3 = add i8 %1, -125
%4 = icmp ult i8 %3, 2
%5 = select i1 %4, i8 124, i8 %1
%6 = sext i8 %5 to i64
tail call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 %6, i1 false)
ret void
}
int GridY(int y) { return (y >> 4) << 4; }


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

x86 assembly (clang, -O2):
<GridY>:
mov    %edi,%eax
and    $0xfffffff0,%eax
ret

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

LLVM IR (-O2):
define i32 @GridY(i32 %0) {
%2 = and i32 %0, -16
ret i32 %2
}
main() {
  int i = 0;
  while (i < 5) {
    printf(i);
    i++;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1149 <main+0x39>
movslq -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x2,%edi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x3,%edi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x4,%edi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 5
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
%10 = call i32 (i8*, ...) @printf(i8* %9)
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %3
13: ; preds = %3
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) null)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) inttoptr (i64 1 to i8*))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) inttoptr (i64 2 to i8*))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) inttoptr (i64 3 to i8*))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) inttoptr (i64 4 to i8*))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
int /*<<< orphan*/ g(int *);
void blort() {
  int x = 0;
  f(x);
  g(&x);
}


x86 assembly (clang, -O0):
<blort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <f@plt>
lea    -0x4(%rbp),%rdi
call   1040 <g@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blort>:
push   %rax
movl   $0x0,0x4(%rsp)
xor    %edi,%edi
call   1030 <f@plt>
lea    0x4(%rsp),%rdi
call   1040 <g@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @blort() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @f(i32 0)
%4 = call i32 @g(i32* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ bswap_32(int /*<<< orphan*/);
uint32_t htobe32(uint32_t host_32bits) { return bswap_32(host_32bits); }


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

x86 assembly (clang, -O2):
<htobe32>:
jmp    1030 <bswap_32@plt>

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

LLVM IR (-O2):
define i32 @htobe32(i32 %0) {
%2 = tail call i32 @bswap_32(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ OCSP_CERTID;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ OCSP_CERTID_it;
int i2d_OCSP_CERTID(OCSP_CERTID *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &OCSP_CERTID_it);
}


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

x86 assembly (clang, -O2):
<i2d_OCSP_CERTID>:
mov    0x2ee1(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

LLVM IR (-O0):
@OCSP_CERTID_it = global i32 0
define i32 @i2d_OCSP_CERTID(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 = call i32 @ASN1_item_i2d(i32* %5, i8** %6, i32* @OCSP_CERTID_it)
ret i32 %7
}

LLVM IR (-O2):
@OCSP_CERTID_it = global i32 0
define i32 @i2d_OCSP_CERTID(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @OCSP_CERTID_it)
ret i32 %3
}
int unregister_blkdev(unsigned int major, char const *name) {
  { return (0); }
}


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

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

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

LLVM IR (-O2):
define i32 @unregister_blkdev(i32 %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_slli_epi32(int /*<<< orphan*/, int);
__m128i __attribute__((no, unused)) testneg1(__m128i s1) {
  return _mm_slli_epi32(s1, -1);
}


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

x86 assembly (clang, -O2):
<testneg1>:
mov    $0xffffffff,%esi
jmp    1030 <_mm_slli_epi32@plt>

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

LLVM IR (-O2):
define i32 @testneg1(i32 %0) {
%2 = tail call i32 @_mm_slli_epi32(i32 %0, i32 -1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ strncat(char *, char *, size_t);
void uninitvar_strncat(char *Ct, char *S, size_t N) {
  char *ct;
  char *s;
  size_t n;
  (void)strncat(ct, s, n);
  (void)strncat(ct, S, N);
  (void)strncat(Ct, s, N);
  (void)strncat(Ct, S, n);
  (void)strncat(Ct, S, N);
}


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

x86 assembly (clang, -O2):
<uninitvar_strncat>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1030 <strncat@plt>
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <strncat@plt>
mov    %rbx,%rdi
mov    %r14,%rdx
call   1030 <strncat@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <strncat@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <strncat@plt>

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

LLVM IR (-O2):
define void @uninitvar_strncat(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @strncat(i8* undef, i8* undef, i64 undef)
%5 = tail call i32 @strncat(i8* undef, i8* %1, i64 %2)
%6 = tail call i32 @strncat(i8* %0, i8* undef, i64 %2)
%7 = tail call i32 @strncat(i8* %0, i8* %1, i64 undef)
%8 = tail call i32 @strncat(i8* %0, i8* %1, i64 %2)
ret void
}
/* Type definitions */
struct btf_type {
  int dummy;
};

/* Variables and functions */
scalar_t__ BTF_KIND_FUNC_PROTO;
scalar_t__ btf_kind(struct btf_type const *);
bool btf_is_func_proto(const struct btf_type *t) {
  return btf_kind(t) == BTF_KIND_FUNC_PROTO;
}


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

x86 assembly (clang, -O2):
<btf_is_func_proto>:
push   %rax
call   1030 <btf_kind@plt>
mov    0x2ec3(%rip),%rdx
xor    %ecx,%ecx
cmp    (%rdx),%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.btf_type = type { i32 }
@BTF_KIND_FUNC_PROTO = global i64 0
define i32 @btf_is_func_proto(%struct.btf_type* %0) {
%2 = alloca %struct.btf_type*
store %struct.btf_type* %0, %struct.btf_type** %2
%3 = load %struct.btf_type*, %struct.btf_type** %2
%4 = call i64 @btf_kind(%struct.btf_type* %3)
%5 = load i64, i64* @BTF_KIND_FUNC_PROTO
%6 = icmp eq i64 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.btf_type = type { i32 }
@BTF_KIND_FUNC_PROTO = global i64 0
define i32 @btf_is_func_proto(%struct.btf_type* %0) {
%2 = tail call i64 @btf_kind(%struct.btf_type* %0)
%3 = load i64, i64* @BTF_KIND_FUNC_PROTO
%4 = icmp eq i64 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
void func3(int x) {
  if (x > 5) {
    while (x >= 9) {
      return;
      --x;
    }
    int i = 0;
  }
  int j = 0;
}


x86 assembly (clang, -O0):
<func3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jle    112c <func3+0x2c>
jmp    1116 <func3+0x16>
cmpl   $0x9,-0x4(%rbp)
jl     1125 <func3+0x25>
jmp    1133 <func3+0x33>
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @func3(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 5
br i1 %6, label %7, label %13
7: ; preds = %1
br label %8
8: ; preds = %7
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 9
br i1 %10, label %11, label %12
11: ; preds = %8
br label %14
12: ; preds = %8
store i32 0, i32* %3
br label %13
13: ; preds = %12, %1
store i32 0, i32* %4
br label %14
14: ; preds = %13, %11
ret void
}

LLVM IR (-O2):
define void @func3(i32 %0) {
ret void
}
double g1(double x, double y) { return x + y; }


x86 assembly (clang, -O0):
<g1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<g1>:
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @g1(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 = fadd double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @g1(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
float max(float a, float b) {
  if (a >= b)
    return a;
  return b;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jb     112c <max+0x2c>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1136 <max+0x36>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
movaps %xmm1,%xmm2
cmpless %xmm0,%xmm2
andps  %xmm2,%xmm0
andnps %xmm1,%xmm2
orps   %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @max(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = load float, float* %5
%8 = fcmp oge float %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load float, float* %4
store float %10, float* %3
br label %13
11: ; preds = %2
%12 = load float, float* %5
store float %12, float* %3
br label %13
13: ; preds = %11, %9
%14 = load float, float* %3
ret float %14
}

LLVM IR (-O2):
define float @max(float %0, float %1) {
%3 = fcmp oge float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Type definitions */
typedef int /*<<< orphan*/ SSL;

/* Variables and functions */
int custom_ext_0_cli_parse_cb(SSL *s, unsigned int ext_type,
                              const unsigned char *in, size_t inlen, int *al,
                              void *arg) {
  return 1;
}


x86 assembly (clang, -O0):
<custom_ext_0_cli_parse_cb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @custom_ext_0_cli_parse_cb(i32* %0, i32 %1, i8* %2, i64 %3, i32* %4, i8* %5) {
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i32*
%12 = alloca i8*
store i32* %0, i32** %7
store i32 %1, i32* %8
store i8* %2, i8** %9
store i64 %3, i64* %10
store i32* %4, i32** %11
store i8* %5, i8** %12
ret i32 1
}

LLVM IR (-O2):
define i32 @custom_ext_0_cli_parse_cb(i32* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i64 %3, i32* nocapture readnone %4, i8* nocapture readnone %5) {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int input_assign_inv(int /*<<< orphan*/ *, char *, int, int *);
int input_assign_normal(int /*<<< orphan*/ *, char *, int, int *);
int input_assign(FILE *finassign, char *inassignname, int nvtxs,
                 int *assignment) {
  extern int IN_ASSIGN_INV;
  int i;
  if (IN_ASSIGN_INV) {
    i = input_assign_inv(finassign, inassignname, nvtxs, assignment);
  } else {
    i = input_assign_normal(finassign, inassignname, nvtxs, assignment);
  }
  return (i);
}


x86 assembly (clang, -O0):
<input_assign>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2eaa(%rip),%rax
cmpl   $0x0,(%rax)
je     1163 <input_assign+0x43>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
call   1040 <input_assign_inv@plt>
mov    %eax,-0x24(%rbp)
jmp    117a <input_assign+0x5a>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
call   1030 <input_assign_normal@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<input_assign>:
mov    0x2ec1(%rip),%rax
cmpl   $0x0,(%rax)
je     1131 <input_assign+0x11>
jmp    1040 <input_assign_inv@plt>
jmp    1030 <input_assign_normal@plt>

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

LLVM IR (-O2):
@IN_ASSIGN_INV = external global i32
define i32 @input_assign(i32* %0, i8* %1, i32 %2, i32* %3) {
%5 = load i32, i32* @IN_ASSIGN_INV
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @input_assign_inv(i32* %0, i8* %1, i32 %2, i32* %3)
br label %11
9: ; preds = %4
%10 = tail call i32 @input_assign_normal(i32* %0, i8* %1, i32 %2, i32* %3)
br label %11
11: ; preds = %9, %7
%12 = phi i32 [ %8, %7 ], [ %10, %9 ]
ret i32 %12
}
int main() {
  char buf[(1 << 30)];
  char c = buf[0];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3fffff90,%rsp
mov    -0x40000000(%rbp),%al
mov    %al,-0x40000001(%rbp)
xor    %eax,%eax
add    $0x3fffff90,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [1073741824 x i8]
%2 = alloca i8
%3 = getelementptr inbounds [1073741824 x i8], [1073741824 x i8]* %1, i64 0, i64 0
%4 = load i8, i8* %3
store i8 %4, i8* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int Section2Fourth(int number) { return number % 10; }


x86 assembly (clang, -O0):
<Section2Fourth>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Section2Fourth>:
movslq %edi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @Section2Fourth(i32 %0) {
%2 = srem i32 %0, 10
ret i32 %2
}