xunge/DecIR huggingface dataset:
/* Variables and functions */
int is_valid_in_Party(size_t __tag) {
  switch (__tag) {
  case 448:
  case 447:
  case 452:
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_valid_in_Party>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
add    $0xfffffffffffffe41,%rax
sub    $0x2,%rax
jb     113a <is_valid_in_Party+0x3a>
jmp    1125 <is_valid_in_Party+0x25>
mov    -0x18(%rbp),%rax
sub    $0x1c4,%rax
jne    1146 <is_valid_in_Party+0x46>
jmp    113a <is_valid_in_Party+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    114d <is_valid_in_Party+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_in_Party>:
lea    -0x1bf(%rdi),%rcx
xor    %eax,%eax
cmp    $0x5,%rcx
ja     111d <is_valid_in_Party+0x1d>
lea    0xeea(%rip),%rax
mov    -0x6fc(%rax,%rdi,4),%eax
ret

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

LLVM IR (-O2):
@switch.table.is_valid_in_Party = [6 x i32] [i32 1, i32 1, i32 0, i32 0, i32 0, i32 1]
define i32 @is_valid_in_Party(i64 %0) {
%2 = add i64 %0, -447
%3 = icmp ult i64 %2, 6
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = getelementptr inbounds [6 x i32], [6 x i32]* @switch.table.is_valid_in_Party, i64 0, i64 %2
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ mock_push(int /*<<< orphan*/);
int /*<<< orphan*/ pack_glXSwapIntervalSGI(int /*<<< orphan*/ *, int);
int glXSwapIntervalSGI(int interval) {
  { mock_push(pack_glXSwapIntervalSGI(NULL, interval)); };
  return (int)0;
}


x86 assembly (clang, -O0):
<glXSwapIntervalSGI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pack_glXSwapIntervalSGI@plt>
mov    %eax,%edi
call   1030 <mock_push@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glXSwapIntervalSGI>:
push   %rax
mov    %edi,%esi
xor    %edi,%edi
call   1040 <pack_glXSwapIntervalSGI@plt>
mov    %eax,%edi
call   1030 <mock_push@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @glXSwapIntervalSGI(i32 %0) {
%2 = tail call i32 @pack_glXSwapIntervalSGI(i32* null, i32 %0)
%3 = tail call i32 @mock_push(i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int main() {
  double s = 0, t = 1;
  int n;
  for (n = 1; n <= 20; n++) {
    t = t * n;
    s = s + t;
  }
  printf("1!+2!+...+20!=%22.15e\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xed1(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
cmpl   $0x14,-0x1c(%rbp)
jg     1175 <main+0x65>
movsd  -0x18(%rbp),%xmm0
cvtsi2sdl -0x1c(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113b <main+0x2b>
movsd  -0x10(%rbp),%xmm0
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [23 x i8] c"1!+2!+...+20!=%22.15e\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca i32
store i32 0, i32* %1
store double 0.000000e+00, double* %2
store double 1.000000e+00, double* %3
store i32 1, i32* %4
br label %5
5: ; preds = %16, %0
%6 = load i32, i32* %4
%7 = icmp sle i32 %6, 20
br i1 %7, label %8, label %19
8: ; preds = %5
%9 = load double, double* %3
%10 = load i32, i32* %4
%11 = sitofp i32 %10 to double
%12 = fmul double %9, %11
store double %12, double* %3
%13 = load double, double* %2
%14 = load double, double* %3
%15 = fadd double %13, %14
store double %15, double* %2
br label %16
16: ; preds = %8
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %5
19: ; preds = %5
%20 = load double, double* %2
%21 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), double %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"1!+2!+...+20!=%22.15e\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), double 0x43C1C5D4E487FCFD)
ret i32 0
}
/* Variables and functions */
char const *weak_s1();
const char *call_weak_s1(void) { return weak_s1() + 1; }


x86 assembly (clang, -O0):
<call_weak_s1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <weak_s1@plt>
add    $0x1,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @call_weak_s1() {
%1 = call i8* (...) @weak_s1()
%2 = getelementptr inbounds i8, i8* %1, i64 1
ret i8* %2
}

LLVM IR (-O2):
define i8* @call_weak_s1() {
%1 = tail call i8* (...) @weak_s1()
%2 = getelementptr inbounds i8, i8* %1, i64 1
ret i8* %2
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ y;
};
struct TYPE_4__ {
  TYPE_1__ xexpose;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xexpose_y(void *_p) { return (int)((XEvent *)_p)->xexpose.y; }


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

x86 assembly (clang, -O2):
<get_XEvent_xexpose_y>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @get_XEvent_xexpose_y(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int x;
  int y = (x = 3) + (x = 4);
  printf("%d %d\n", x, y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x4,-0x8(%rbp)
movl   $0x7,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 4, i32 7)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ si_pid;
};
typedef TYPE_1__ siginfo_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void sig_handler_usr2(int sig, siginfo_t *siginfo, void *context) {
  int pid = (int)siginfo->si_pid;
  printf("SIGUSR2 %d ", pid);
}


x86 assembly (clang, -O0):
<sig_handler_usr2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_handler_usr2>:
mov    (%rsi),%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64 }
@.str = [12 x i8] c"SIGUSR2 %d \00"
define void @sig_handler_usr2(i32 %0, %struct.TYPE_3__* %1, i8* %2) {
%4 = alloca i32
%5 = alloca %struct.TYPE_3__*
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %4
store %struct.TYPE_3__* %1, %struct.TYPE_3__** %5
store i8* %2, i8** %6
%8 = load %struct.TYPE_3__*, %struct.TYPE_3__** %5
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %12)
ret void
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i64 }
@.str = [12 x i8] c"SIGUSR2 %d \00"
define void @sig_handler_usr2(i32 %0, %struct.TYPE_3__* nocapture %1, i8* nocapture readnone %2) {
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 0
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int os_procfs_psinfo_get(pid_t pid __attribute__((unused)),
                         void *info __attribute__((unused))) {
  return (0);
}


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

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

LLVM IR (-O0):
define i32 @os_procfs_psinfo_get(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 @os_procfs_psinfo_get(i32 %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
void hanger(void) { getchar(); }


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

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

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

LLVM IR (-O2):
define void @hanger() {
%1 = tail call i32 (...) @getchar()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_dword(char *);
char *strtok(int /*<<< orphan*/ *, char *);
void cmdPrintDWord(void) {
  char *token = strtok(NULL, " ");
  if (token != NULL) {
    print_dword(token);
  }
}


x86 assembly (clang, -O0):
<cmdPrintDWord>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
lea    0xecd(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1150 <cmdPrintDWord+0x30>
mov    -0x8(%rbp),%rdi
call   1030 <print_dword@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmdPrintDWord>:
push   %rax
lea    0xed8(%rip),%rsi
xor    %edi,%edi
call   1040 <strtok@plt>
test   %rax,%rax
je     113d <cmdPrintDWord+0x1d>
mov    %rax,%rdi
pop    %rax
jmp    1030 <print_dword@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define void @cmdPrintDWord() {
%1 = alloca i8*
%2 = call i8* @strtok(i32* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load i8*, i8** %1
%7 = call i32 @print_dword(i8* %6)
br label %8
8: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define void @cmdPrintDWord() {
%1 = tail call i8* @strtok(i32* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @print_dword(i8* %1)
br label %5
5: ; preds = %3, %0
ret void
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *, int);
char *strerror(int);
void nofork() {
  int e = errno;
  printf("Fork failed: %s (%d)\n", strerror(e), e);
  exit(1);
}


x86 assembly (clang, -O0):
<nofork>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <strerror@plt>
mov    %rax,%rsi
mov    -0x4(%rbp),%edx
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<nofork>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   1050 <strerror@plt>
lea    0xeb8(%rip),%rdi
mov    %rax,%rsi
mov    %ebx,%edx
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@errno = global i32 0
@.str = [22 x i8] c"Fork failed: %s (%d)\0A\00"
define void @nofork() {
%1 = alloca i32
%2 = load i32, i32* @errno
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i8* @strerror(i32 %3)
%5 = load i32, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %4, i32 %5)
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@errno = global i32 0
@.str = [22 x i8] c"Fork failed: %s (%d)\0A\00"
define void @nofork() {
%1 = load i32, i32* @errno
%2 = tail call i8* @strerror(i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %1)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int atoi(char *);
char *read_key(char const *, char const *, int /*<<< orphan*/);
int textfile_get_int(const char *pathname, const char *key, int default_key) {
  char *ret_key = read_key(pathname, key, 0);
  if (ret_key != NULL)
    return atoi(ret_key);
  else
    return default_key;
}


x86 assembly (clang, -O0):
<textfile_get_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
xor    %edx,%edx
call   1030 <read_key@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1162 <textfile_get_int+0x42>
mov    -0x28(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x4(%rbp)
jmp    1168 <textfile_get_int+0x48>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<textfile_get_int>:
push   %rbx
mov    %edx,%ebx
xor    %edx,%edx
call   1030 <read_key@plt>
test   %rax,%rax
je     1138 <textfile_get_int+0x18>
mov    %rax,%rdi
pop    %rbx
jmp    1040 <atoi@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @textfile_get_int(i8* %0, i8* %1, i32 %2) {
%4 = tail call i8* @read_key(i8* %0, i8* %1, i32 0)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @atoi(i8* %4)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %7, %6 ], [ %2, %3 ]
ret i32 %9
}
void relax(void) { asm volatile("hlt"); }


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

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

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

LLVM IR (-O2):
define void @relax() {
tail call void asm sideeffect "hlt", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int l3mdev_master_ifindex(struct net_device *dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.net_device = type opaque
define i32 @l3mdev_master_ifindex(%struct.net_device* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void runtimeError(char error_text[]) {
  fprintf(stderr, "ERROR: %s \n", error_text);
  fprintf(stderr, "Aborting !! \n");
  fflush(stdout);
  fflush(stderr);
  exit(1);
}


x86 assembly (clang, -O0):
<runtimeError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
lea    0xea5(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e63(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e5d(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<runtimeError>:
push   %rbx
mov    %rdi,%rdx
mov    0x2ea5(%rip),%rbx
mov    (%rbx),%edi
lea    0xebc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeb8(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"ERROR: %s \0A\00"
@.str.1 = [14 x i8] c"Aborting !! \0A\00"
@stdout = global i32 0
define void @runtimeError(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @stdout
%9 = call i32 @fflush(i32 %8)
%10 = load i32, i32* @stderr
%11 = call i32 @fflush(i32 %10)
%12 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"ERROR: %s \0A\00"
@.str.1 = [14 x i8] c"Aborting !! \0A\00"
@stdout = global i32 0
define void @runtimeError(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @stdout
%7 = tail call i32 @fflush(i32 %6)
%8 = load i32, i32* @stderr
%9 = tail call i32 @fflush(i32 %8)
%10 = tail call i32 @exit(i32 1)
unreachable
}
unsigned long hashit(char *str) {
  unsigned long hash = 0;
  int c;
  while ((c = *str++))
    hash = c + (hash << 6) + (hash << 16) - hash;
  return hash;
}


x86 assembly (clang, -O0):
<hashit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1155 <hashit+0x55>
movslq -0x14(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x6,%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%rcx
shl    $0x10,%rcx
add    %rcx,%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hashit+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashit>:
mov    (%rdi),%cl
test   %cl,%cl
je     112a <hashit+0x2a>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbq %cl,%rcx
imul   $0x1003f,%rax,%rax
add    %rcx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hashit+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @hashit(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 0, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = sext i8 %5 to i64
%10 = mul i64 %7, 65599
%11 = add i64 %10, %9
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 0, %1 ], [ %11, %4 ]
ret i64 %15
}
int vowel(int i) {
  switch (i) {
  case 'a':
  case 'A':
  case 'e':
  case 'E':
  case 'i':
  case 'I':
  case 'o':
  case 'O':
  case 'u':
  case 'U':
  case 'y':
  case 'Y':
    return (1);
  default:
    return (0);
  }
}


x86 assembly (clang, -O0):
<vowel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x41,%eax
je     11d6 <vowel+0xd6>
jmp    111b <vowel+0x1b>
mov    -0xc(%rbp),%eax
sub    $0x45,%eax
je     11d6 <vowel+0xd6>
jmp    112c <vowel+0x2c>
mov    -0xc(%rbp),%eax
sub    $0x49,%eax
je     11d6 <vowel+0xd6>
jmp    113d <vowel+0x3d>
mov    -0xc(%rbp),%eax
sub    $0x4f,%eax
je     11d6 <vowel+0xd6>
jmp    114e <vowel+0x4e>
mov    -0xc(%rbp),%eax
sub    $0x55,%eax
je     11d6 <vowel+0xd6>
jmp    115f <vowel+0x5f>
mov    -0xc(%rbp),%eax
sub    $0x59,%eax
je     11d6 <vowel+0xd6>
jmp    1170 <vowel+0x70>
mov    -0xc(%rbp),%eax
sub    $0x61,%eax
je     11d6 <vowel+0xd6>
jmp    1181 <vowel+0x81>
mov    -0xc(%rbp),%eax
sub    $0x65,%eax
je     11d6 <vowel+0xd6>
jmp    1192 <vowel+0x92>
mov    -0xc(%rbp),%eax
sub    $0x69,%eax
je     11d6 <vowel+0xd6>
jmp    11a3 <vowel+0xa3>
mov    -0xc(%rbp),%eax
sub    $0x6f,%eax
je     11d6 <vowel+0xd6>
jmp    11b4 <vowel+0xb4>
mov    -0xc(%rbp),%eax
sub    $0x75,%eax
je     11d6 <vowel+0xd6>
jmp    11c5 <vowel+0xc5>
mov    -0xc(%rbp),%eax
sub    $0x79,%eax
jne    11e2 <vowel+0xe2>
jmp    11d6 <vowel+0xd6>
movl   $0x1,-0x4(%rbp)
jmp    11e9 <vowel+0xe9>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vowel>:
add    $0xffffffbf,%edi
ror    %edi
xor    %eax,%eax
cmp    $0x1c,%edi
ja     1119 <vowel+0x19>
movslq %edi,%rax
lea    0xeea(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @vowel(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 97, label %5
i32 65, label %5
i32 101, label %5
i32 69, label %5
i32 105, label %5
i32 73, label %5
i32 111, label %5
i32 79, label %5
i32 117, label %5
i32 85, label %5
i32 121, label %5
i32 89, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
@switch.table.vowel = [29 x i32] [i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 0, i32 1, i32 0, i32 0, i32 1, i32 0, i32 1, i32 0, i32 0, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 0, i32 1, i32 0, i32 0, i32 1, i32 0, i32 1]
define i32 @vowel(i32 %0) {
%2 = add i32 %0, -65
%3 = tail call i32 @llvm.fshl.i32(i32 %2, i32 %2, i32 31)
%4 = icmp ult i32 %3, 29
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds [29 x i32], [29 x i32]* @switch.table.vowel, i64 0, i64 %6
%8 = load i32, i32* %7
br label %9
9: ; preds = %1, %5
%10 = phi i32 [ %8, %5 ], [ 0, %1 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ get_year_day_number(int /*<<< orphan*/, int /*<<< orphan*/,
                                       int /*<<< orphan*/);
int /*<<< orphan*/ to_century_day_number(int /*<<< orphan*/,
                                         int /*<<< orphan*/);
int /*<<< orphan*/ to_minutes(int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/);
uint32_t to_minutes_since_2000(uint16_t y, uint8_t mo, uint8_t d, uint8_t h,
                               uint8_t mi) {
  uint16_t ydn = get_year_day_number(y, mo, d);
  uint16_t cdn = to_century_day_number(y, ydn);
  return to_minutes(cdn, h, mi);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <get_year_day_number@plt>
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1030 <to_century_day_number@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1050 <to_minutes@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbp
push   %r14
push   %rbx
mov    %r8d,%r14d
mov    %ecx,%ebp
mov    %edi,%ebx
call   1040 <get_year_day_number@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1030 <to_century_day_number@plt>
mov    %eax,%edi
mov    %ebp,%esi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <to_minutes@plt>

LLVM IR (-O0):
define i32 @to_minutes_since_2000(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = load i32, i32* %8
%16 = call i32 @get_year_day_number(i32 %13, i32 %14, i32 %15)
store i32 %16, i32* %11
%17 = load i32, i32* %6
%18 = load i32, i32* %11
%19 = call i32 @to_century_day_number(i32 %17, i32 %18)
store i32 %19, i32* %12
%20 = load i32, i32* %12
%21 = load i32, i32* %9
%22 = load i32, i32* %10
%23 = call i32 @to_minutes(i32 %20, i32 %21, i32 %22)
ret i32 %23
}

LLVM IR (-O2):
define i32 @to_minutes_since_2000(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @get_year_day_number(i32 %0, i32 %1, i32 %2)
%7 = tail call i32 @to_century_day_number(i32 %0, i32 %6)
%8 = tail call i32 @to_minutes(i32 %7, i32 %3, i32 %4)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ IntEnable(unsigned long);
int /*<<< orphan*/ IntRegister(unsigned long, void (*)());
void QEIIntRegister(unsigned long ulBase, void (*pfnHandler)(void)) {
  unsigned long ulInt;
  ;
  ulInt = (ulBase == 0x4002C000) ? 29 : 54;
  IntRegister(ulInt, pfnHandler);
  IntEnable(ulInt);
}


x86 assembly (clang, -O0):
<QEIIntRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x36,%eax
mov    $0x1d,%ecx
cmp    $0x4002c000,%rdx
cmove  %ecx,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <IntRegister@plt>
mov    -0x18(%rbp),%rdi
call   1030 <IntEnable@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QEIIntRegister>:
push   %rbx
cmp    $0x4002c000,%rdi
mov    $0x1d,%eax
mov    $0x36,%ebx
cmove  %rax,%rbx
mov    %rbx,%rdi
call   1040 <IntRegister@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <IntEnable@plt>

LLVM IR (-O0):
define void @QEIIntRegister(i64 %0, void ()* %1) {
%3 = alloca i64
%4 = alloca void ()*
%5 = alloca i64
store i64 %0, i64* %3
store void ()* %1, void ()** %4
%6 = load i64, i64* %3
%7 = icmp eq i64 %6, 1073922048
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 29, i32 54
%10 = sext i32 %9 to i64
store i64 %10, i64* %5
%11 = load i64, i64* %5
%12 = load void ()*, void ()** %4
%13 = bitcast void ()* %12 to void (...)*
%14 = call i32 @IntRegister(i64 %11, void (...)* %13)
%15 = load i64, i64* %5
%16 = call i32 @IntEnable(i64 %15)
ret void
}

LLVM IR (-O2):
define void @QEIIntRegister(i64 %0, void ()* %1) {
%3 = icmp eq i64 %0, 1073922048
%4 = select i1 %3, i64 29, i64 54
%5 = bitcast void ()* %1 to void (...)*
%6 = tail call i32 @IntRegister(i64 %4, void (...)* %5)
%7 = tail call i32 @IntEnable(i64 %4)
ret void
}
int do_624() { return 624; }


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

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

LLVM IR (-O0):
define i32 @do_624() {
ret i32 624
}

LLVM IR (-O2):
define i32 @do_624() {
ret i32 624
}
/* Variables and functions */
void *new (void *, size_t);
void *newr(void *heap, void *begin, void *end, size_t size) {
  return new (heap, size);
}


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

x86 assembly (clang, -O2):
<newr>:
mov    %rcx,%rsi
jmp    1030 <new@plt>

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

LLVM IR (-O2):
define i8* @newr(i8* %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i64 %3) {
%5 = tail call i8* @new(i8* %0, i64 %3)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void deinit() {
  fprintf(stderr, "[LDM] ");
  fprintf(stderr, "[LockWatcher] Deinitializing LockWatcher Plugin!\n");
}


x86 assembly (clang, -O0):
<deinit>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xece(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<deinit>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xed8(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [7 x i8] c"[LDM] \00"
@.str.1 = [50 x i8] c"[LockWatcher] Deinitializing LockWatcher Plugin!\0A\00"
define void @deinit() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [7 x i8] c"[LDM] \00"
@.str.1 = [50 x i8] c"[LockWatcher] Deinitializing LockWatcher Plugin!\0A\00"
define void @deinit() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nop();
void infinite_loop_bad() {
  while (1) {
    nop();
  }
}


x86 assembly (clang, -O0):
<infinite_loop_bad>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <infinite_loop_bad+0x9>
mov    $0x0,%al
call   1030 <nop@plt>
jmp    1119 <infinite_loop_bad+0x9>

x86 assembly (clang, -O2):
<infinite_loop_bad>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <nop@plt>
jmp    1120 <infinite_loop_bad+0x10>

LLVM IR (-O0):
define void @infinite_loop_bad() {
br label %1
1: ; preds = %0, %1
%2 = call i32 (...) @nop()
br label %1
}

LLVM IR (-O2):
define void @infinite_loop_bad() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @nop()
br label %1
}
int securestore_key_verify(char *keyname, unsigned int *query_return,
                           char *hashval, int hashlen) {
  return -1;
}


x86 assembly (clang, -O0):
<securestore_key_verify>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @securestore_key_verify(i8* nocapture readnone %0, i32* nocapture readnone %1, i8* nocapture readnone %2, i32 %3) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ ft_max(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ ft_strlen(char const *);
int ft_strnequ(char const *, char const *, int /*<<< orphan*/);
int ft_strequ(const char *s1, const char *s2) {
  return (ft_strnequ(s1, s2, ft_max(ft_strlen(s1), ft_strlen(s2))));
}


x86 assembly (clang, -O0):
<ft_strequ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ft_strlen@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <ft_strlen@plt>
mov    -0x24(%rbp),%edi
mov    %eax,%esi
call   1030 <ft_max@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1050 <ft_strnequ@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strequ>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <ft_strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1040 <ft_strlen@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1030 <ft_max@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <ft_strnequ@plt>

LLVM IR (-O0):
define i32 @ft_strequ(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 = load i8*, i8** %3
%8 = call i32 @ft_strlen(i8* %7)
%9 = load i8*, i8** %4
%10 = call i32 @ft_strlen(i8* %9)
%11 = call i32 @ft_max(i32 %8, i32 %10)
%12 = call i32 @ft_strnequ(i8* %5, i8* %6, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @ft_strequ(i8* %0, i8* %1) {
%3 = tail call i32 @ft_strlen(i8* %0)
%4 = tail call i32 @ft_strlen(i8* %1)
%5 = tail call i32 @ft_max(i32 %3, i32 %4)
%6 = tail call i32 @ft_strnequ(i8* %0, i8* %1, i32 %5)
ret i32 %6
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t count_bits32(uint32_t x) {
  x -= (x >> 1) & 0x55555555;
  x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
  x = (x + (x >> 4)) & 0x0f0f0f0f;
  x += x >> 8;
  x += x >> 16;
  return x & 0x3F;
}


x86 assembly (clang, -O0):
<count_bits32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
sar    $0x1,%ecx
and    $0x55555555,%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x33333333,%eax
mov    -0x4(%rbp),%ecx
sar    $0x2,%ecx
and    $0x33333333,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x4,%ecx
add    %ecx,%eax
and    $0xf0f0f0f,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_bits32>:
mov    %edi,%eax
shr    %eax
and    $0x55555555,%eax
sub    %eax,%edi
mov    %edi,%eax
and    $0x33333333,%eax
shr    $0x2,%edi
and    $0x33333333,%edi
add    %eax,%edi
mov    %edi,%eax
shr    $0x4,%eax
add    %edi,%eax
and    $0xf0f0f0f,%eax
mov    %eax,%ecx
shr    $0x8,%ecx
add    %eax,%ecx
mov    %ecx,%eax
shr    $0x10,%eax
add    %ecx,%eax
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @count_bits32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 1
%5 = and i32 %4, 1431655765
%6 = load i32, i32* %2
%7 = sub nsw i32 %6, %5
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = and i32 %8, 858993459
%10 = load i32, i32* %2
%11 = ashr i32 %10, 2
%12 = and i32 %11, 858993459
%13 = add nsw i32 %9, %12
store i32 %13, i32* %2
%14 = load i32, i32* %2
%15 = load i32, i32* %2
%16 = ashr i32 %15, 4
%17 = add nsw i32 %14, %16
%18 = and i32 %17, 252645135
store i32 %18, i32* %2
%19 = load i32, i32* %2
%20 = ashr i32 %19, 8
%21 = load i32, i32* %2
%22 = add nsw i32 %21, %20
store i32 %22, i32* %2
%23 = load i32, i32* %2
%24 = ashr i32 %23, 16
%25 = load i32, i32* %2
%26 = add nsw i32 %25, %24
store i32 %26, i32* %2
%27 = load i32, i32* %2
%28 = and i32 %27, 63
ret i32 %28
}

LLVM IR (-O2):
define i32 @count_bits32(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, 1431655765
%4 = sub nsw i32 %0, %3
%5 = and i32 %4, 858993459
%6 = lshr i32 %4, 2
%7 = and i32 %6, 858993459
%8 = add nuw nsw i32 %7, %5
%9 = lshr i32 %8, 4
%10 = add nuw nsw i32 %9, %8
%11 = and i32 %10, 252645135
%12 = lshr i32 %11, 8
%13 = add nuw nsw i32 %12, %11
%14 = lshr i32 %13, 16
%15 = add nuw nsw i32 %14, %13
%16 = and i32 %15, 63
ret i32 %16
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
__attribute__((visibility("default"))) void
osal_search_dir_close(void *dir_handle) {
  closedir((DIR *)dir_handle);
}


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

x86 assembly (clang, -O2):
<osal_search_dir_close>:
jmp    1030 <closedir@plt>

LLVM IR (-O0):
define void @osal_search_dir_close(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = call i32 @closedir(i32* %4)
ret void
}

LLVM IR (-O2):
define void @osal_search_dir_close(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @closedir(i32* %2)
ret void
}
/* Type definitions */
struct resman {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct resman *);
int /*<<< orphan*/ resman_destroy(struct resman *);
void resman_free(struct resman *rman) {
  resman_destroy(rman);
  free(rman);
}


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

x86 assembly (clang, -O2):
<resman_free>:
push   %rbx
mov    %rdi,%rbx
call   1040 <resman_destroy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.resman = type { i32 }
define void @resman_free(%struct.resman* %0) {
%2 = tail call i32 @resman_destroy(%struct.resman* %0)
%3 = tail call i32 @free(%struct.resman* %0)
ret void
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void PWMSyncTimeBase(uint32_t ui32Base, uint32_t ui32GenBits) {
  ;

  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000004))) = ui32GenBits;
}


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

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

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

LLVM IR (-O2):
define void @PWMSyncTimeBase(i64 %0, i64 %1) {
%3 = add i64 %0, 4
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ haptic_hal_write8(int, int);
void enable_ac_coulping() { haptic_hal_write8(0x1B, 0xB3); }


x86 assembly (clang, -O0):
<enable_ac_coulping>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1b,%edi
mov    $0xb3,%esi
call   1030 <haptic_hal_write8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<enable_ac_coulping>:
mov    $0x1b,%edi
mov    $0xb3,%esi
jmp    1030 <haptic_hal_write8@plt>

LLVM IR (-O0):
define void @enable_ac_coulping() {
%1 = call i32 @haptic_hal_write8(i32 27, i32 179)
ret void
}

LLVM IR (-O2):
define void @enable_ac_coulping() {
%1 = tail call i32 @haptic_hal_write8(i32 27, i32 179)
ret void
}
int getMaxCharsIn16Bit() { return 6; }


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

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

LLVM IR (-O0):
define i32 @getMaxCharsIn16Bit() {
ret i32 6
}

LLVM IR (-O2):
define i32 @getMaxCharsIn16Bit() {
ret i32 6
}
const char *db_list_jes_report_sql(void) {
  static const char *query = "SELECT"
                             "  j.id AS 'JE',"
                             "  j.source AS 'Source',"
                             "  e.shortname AS 'Entity',"
                             "  j.memo AS 'Memo',"
                             "  j.posted AS 'Posting Time'"
                             "  FROM jes j"
                             "  INNER JOIN entities e"
                             "    ON j.entity = e.id"
                             "  ORDER BY j.id";
  return query;
}


x86 assembly (clang, -O0):
<db_list_jes_report_sql>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f15(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<db_list_jes_report_sql>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@db_list_jes_report_sql.query = internal global i8* getelementptr inbounds ([190 x i8], [190 x i8]* @.str, i32 0, i32 0)
@.str = [190 x i8] c"SELECT j.id AS 'JE', j.source AS 'Source', e.shortname AS 'Entity', j.memo AS 'Memo', j.posted AS 'Posting Time' FROM jes j INNER JOIN entities e ON j.entity = e.id ORDER BY j.id\00"
define i8* @db_list_jes_report_sql() {
%1 = load i8*, i8** @db_list_jes_report_sql.query
ret i8* %1
}

LLVM IR (-O2):
@.str = [190 x i8] c"SELECT j.id AS 'JE', j.source AS 'Source', e.shortname AS 'Entity', j.memo AS 'Memo', j.posted AS 'Posting Time' FROM jes j INNER JOIN entities e ON j.entity = e.id ORDER BY j.id\00"
define i8* @db_list_jes_report_sql() {
ret i8* getelementptr inbounds ([190 x i8], [190 x i8]* @.str, i64 0, i64 0)
}
int fib(int n) {
  if (n >> 1)
    return fib(n - 1) + fib(n - 2);
  return n;
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
cmp    $0x0,%eax
je     1152 <fib+0x42>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <fib+0x48>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jb     1132 <fib+0x22>
xor    %ebp,%ebp
xchg   %ax,%ax
lea    -0x1(%rbx),%edi
call   1030 <fib@plt>
add    $0xfffffffe,%ebx
add    %eax,%ebp
cmp    $0x1,%ebx
ja     1120 <fib+0x10>
add    %ebx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fib(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = ashr i32 %4, 1
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 1
%10 = call i32 @fib(i32 %9)
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 2
%13 = call i32 @fib(i32 %12)
%14 = add nsw i32 %10, %13
store i32 %14, i32* %2
br label %17
15: ; preds = %1
%16 = load i32, i32* %3
store i32 %16, i32* %2
br label %17
17: ; preds = %15, %7
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fib(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %8, 2
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %9, %3 ]
%13 = phi i32 [ %0, %1 ], [ %8, %3 ]
%14 = add nsw i32 %13, %12
ret i32 %14
}
int ld_ble_rr2(long double a1, long double a2) {
  return !(__builtin_islessequal(a1, a2));
}


x86 assembly (clang, -O0):
<ld_ble_rr2>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fucomip %st(1),%st
fstp   %st(0)
setae  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_ble_rr2>:
fldt   0x8(%rsp)
fldt   0x18(%rsp)
xor    %eax,%eax
fucomip %st(1),%st
fstp   %st(0)
setb   %al
ret

LLVM IR (-O0):
define i32 @ld_ble_rr2(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = fcmp ole x86_fp80 %5, %6
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @ld_ble_rr2(x86_fp80 %0, x86_fp80 %1) {
%3 = fcmp ugt x86_fp80 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
char *stdc_C5C09834(char const *, char const *);
char *strstr(const char *str1, const char *str2) {
  return stdc_C5C09834(str1, str2);
}


x86 assembly (clang, -O0):
<strstr>:
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 <stdc_C5C09834@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strstr>:
jmp    1030 <stdc_C5C09834@plt>

LLVM IR (-O0):
define i8* @strstr(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 i8* @stdc_C5C09834(i8* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @strstr(i8* %0, i8* %1) {
%3 = tail call i8* @stdc_C5C09834(i8* %0, i8* %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ boom();
void two() { boom(); }


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

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

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

LLVM IR (-O2):
define void @two() {
%1 = tail call i32 (...) @boom()
ret void
}