xunge/DecIR huggingface dataset:
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int main(const int argc, const char *const *argv) {
  do {
    printf("Hi there!\n");
  } while (0);
  return EXIT_SUCCESS;
}


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 <printf@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"Hi there!\0A\00"
@EXIT_SUCCESS = global i32 0
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
br label %6
6: ; preds = %2
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [10 x i8] c"Hi there!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ print_verbose(char *);
void print_try_external() { print_verbose("Will now try the external host\n"); }


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"Will now try the external host\0A\00"
define void @print_try_external() {
%1 = call i32 @print_verbose(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"Will now try the external host\0A\00"
define void @print_try_external() {
%1 = tail call i32 @print_verbose(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}
void ptrace_sandbox_permit_file_stats(struct pt_sandbox *p_sandbox) {
  (void)p_sandbox;
}


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

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

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

LLVM IR (-O2):
%struct.pt_sandbox = type opaque
define void @ptrace_sandbox_permit_file_stats(%struct.pt_sandbox* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_attr_destroy(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_attr_getguardsize(int /*<<< orphan*/ *, size_t *);
int /*<<< orphan*/ pthread_attr_init(int /*<<< orphan*/ *);
size_t tp_info_sysdefaultguard() {
  pthread_attr_t attr;
  pthread_attr_init(&attr);
  size_t length = 0;
  pthread_attr_getguardsize(&attr, &length);
  pthread_attr_destroy(&attr);
  return length;
}


x86 assembly (clang, -O0):
<tp_info_sysdefaultguard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1030 <pthread_attr_init@plt>
movq   $0x0,-0x10(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <pthread_attr_getguardsize@plt>
lea    -0x4(%rbp),%rdi
call   1050 <pthread_attr_destroy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tp_info_sysdefaultguard>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <pthread_attr_init@plt>
movq   $0x0,(%rsp)
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <pthread_attr_getguardsize@plt>
mov    %rbx,%rdi
call   1050 <pthread_attr_destroy@plt>
mov    (%rsp),%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i64 @tp_info_sysdefaultguard() {
%1 = alloca i32
%2 = alloca i64
%3 = call i32 @pthread_attr_init(i32* %1)
store i64 0, i64* %2
%4 = call i32 @pthread_attr_getguardsize(i32* %1, i64* %2)
%5 = call i32 @pthread_attr_destroy(i32* %1)
%6 = load i64, i64* %2
ret i64 %6
}

LLVM IR (-O2):
define i64 @tp_info_sysdefaultguard() {
%1 = alloca i32
%2 = alloca i64
%3 = bitcast i32* %1 to i8*
%4 = call i32 @pthread_attr_init(i32* %1)
%5 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%6 = call i32 @pthread_attr_getguardsize(i32* %1, i64* %2)
%7 = call i32 @pthread_attr_destroy(i32* %1)
%8 = load i64, i64* %2
ret i64 %8
}
const char *__malidrv_build_info(void) {
  return "malidrv:  API_VERSION=401 REPO_URL=heads/popmetal_base "
         "REVISION=r4p0-00rel0-9880df4 CHANGED_REVISION=9880df4 "
         "CHANGE_DATE=2015-03-26 18:01:58 +0800 BUILD_DATE=2015年 03月 27日 "
         "星期五 11:36:57 CST BUILD=debug TARGET_PLATFORM= MALI_PLATFORM= "
         "KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP=y "
         "USING_PROFILING=y USING_INTERNAL_PROFILING=y USING_GPU_UTILIZATION=1 "
         "USING_POWER_PERFORMANCE_POLICY= MALI_UPPER_HALF_SCHEDULING=1";
}


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

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

LLVM IR (-O0):
@.str = [431 x i8] c"malidrv: API_VERSION=401 REPO_URL=heads/popmetal_base REVISION=r4p0-00rel0-9880df4 CHANGED_REVISION=9880df4 CHANGE_DATE=2015-03-26 18:01:58 +0800 BUILD_DATE=2015\E5\B9\B4 03\E6\9C\88 27\E6\97\A5 \E6\98\9F\E6\9C\9F\E4\BA\94 11:36:57 CST BUILD=debug TARGET_PLATFORM= MALI_PLATFORM= KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP=y USING_PROFILING=y USING_INTERNAL_PROFILING=y USING_GPU_UTILIZATION=1 USING_POWER_PERFORMANCE_POLICY= MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([431 x i8], [431 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [431 x i8] c"malidrv: API_VERSION=401 REPO_URL=heads/popmetal_base REVISION=r4p0-00rel0-9880df4 CHANGED_REVISION=9880df4 CHANGE_DATE=2015-03-26 18:01:58 +0800 BUILD_DATE=2015\E5\B9\B4 03\E6\9C\88 27\E6\97\A5 \E6\98\9F\E6\9C\9F\E4\BA\94 11:36:57 CST BUILD=debug TARGET_PLATFORM= MALI_PLATFORM= KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP=y USING_PROFILING=y USING_INTERNAL_PROFILING=y USING_GPU_UTILIZATION=1 USING_POWER_PERFORMANCE_POLICY= MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([431 x i8], [431 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int quit() {
  exit(0);
  return 0;
}


x86 assembly (clang, -O0):
<quit>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<quit>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @quit() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @quit() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ err(int, char *);
void *xcalloc(size_t nmemb, size_t size) {
  void *p;
  if ((p = calloc(nmemb, size)) == NULL)
    err(1, "xcalloc");
  return p;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    115c <xcalloc+0x3c>
mov    $0x1,%edi
lea    0xea9(%rip),%rsi
call   1040 <err@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %rbx
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113f <xcalloc+0x1f>
lea    0xecb(%rip),%rsi
mov    $0x1,%edi
call   1040 <err@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"xcalloc\00"
define noalias i8* @xcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
scalar_t__ sqrt(int);
int dist(int x1, int y1, int x2, int y2) {
  int xs, ys;
  xs = x1 - x2;
  ys = y1 - y2;
  return (int)sqrt(xs * xs + ys * ys);
}


x86 assembly (clang, -O0):
<dist>:
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    -0x4(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
imul   -0x14(%rbp),%edi
mov    -0x18(%rbp),%eax
imul   -0x18(%rbp),%eax
add    %eax,%edi
call   1030 <sqrt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dist>:
sub    %edx,%edi
sub    %ecx,%esi
imul   %edi,%edi
imul   %esi,%esi
add    %esi,%edi
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define i32 @dist(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %5
%12 = load i32, i32* %7
%13 = sub nsw i32 %11, %12
store i32 %13, i32* %9
%14 = load i32, i32* %6
%15 = load i32, i32* %8
%16 = sub nsw i32 %14, %15
store i32 %16, i32* %10
%17 = load i32, i32* %9
%18 = load i32, i32* %9
%19 = mul nsw i32 %17, %18
%20 = load i32, i32* %10
%21 = load i32, i32* %10
%22 = mul nsw i32 %20, %21
%23 = add nsw i32 %19, %22
%24 = call i64 @sqrt(i32 %23)
%25 = trunc i64 %24 to i32
ret i32 %25
}

LLVM IR (-O2):
define i32 @dist(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub nsw i32 %0, %2
%6 = sub nsw i32 %1, %3
%7 = mul nsw i32 %5, %5
%8 = mul nsw i32 %6, %6
%9 = add nuw nsw i32 %8, %7
%10 = tail call i64 @sqrt(i32 %9)
%11 = trunc i64 %10 to i32
ret i32 %11
}
int setgid(int id) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @setgid(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ setenv(char *, char *, int);
void set_launcher_env() { setenv("TESTLAUNCHER", "1", 1); }


x86 assembly (clang, -O0):
<set_launcher_env>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeeb(%rip),%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_launcher_env>:
lea    0xee9(%rip),%rdi
lea    0xeef(%rip),%rsi
mov    $0x1,%edx
jmp    1030 <setenv@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"TESTLAUNCHER\00"
@.str.1 = [2 x i8] c"1\00"
define void @set_launcher_env() {
%1 = call i32 @setenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"TESTLAUNCHER\00"
@.str.1 = [2 x i8] c"1\00"
define void @set_launcher_env() {
%1 = tail call i32 @setenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}
/* Type definitions */
struct fid_cq {
  int dummy;
};

/* Variables and functions */
int gnix_cq_signal(struct fid_cq *);
int fi_cq_signal(struct fid_cq *cq) { return gnix_cq_signal(cq); }


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

x86 assembly (clang, -O2):
<fi_cq_signal>:
jmp    1030 <gnix_cq_signal@plt>

LLVM IR (-O0):
%struct.fid_cq = type { i32 }
define i32 @fi_cq_signal(%struct.fid_cq* %0) {
%2 = alloca %struct.fid_cq*
store %struct.fid_cq* %0, %struct.fid_cq** %2
%3 = load %struct.fid_cq*, %struct.fid_cq** %2
%4 = call i32 @gnix_cq_signal(%struct.fid_cq* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.fid_cq = type { i32 }
define i32 @fi_cq_signal(%struct.fid_cq* %0) {
%2 = tail call i32 @gnix_cq_signal(%struct.fid_cq* %0)
ret i32 %2
}
/* Variables and functions */
unsigned int sys_call(int, int /*<<< orphan*/, int /*<<< orphan*/,
                      int /*<<< orphan*/, int /*<<< orphan*/);
unsigned int ctx_switch() { return sys_call(0x0D, 0, 0, 0, 0); }


x86 assembly (clang, -O0):
<ctx_switch>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd,%edi
xor    %r8d,%r8d
mov    %r8d,%esi
mov    %r8d,%edx
mov    %r8d,%ecx
call   1030 <sys_call@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctx_switch>:
mov    $0xd,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <sys_call@plt>

LLVM IR (-O0):
define i32 @ctx_switch() {
%1 = call i32 @sys_call(i32 13, i32 0, i32 0, i32 0, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @ctx_switch() {
%1 = tail call i32 @sys_call(i32 13, i32 0, i32 0, i32 0, i32 0)
ret i32 %1
}
int Bematech_FI_LeituraTotalizadoresParciais(Var, Retorno) {
  return Formata("\x1b|27|\x1b", Var, Retorno);
}


x86 assembly (clang, -O0):
<Bematech_FI_LeituraTotalizadoresParciais>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <Formata@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bematech_FI_LeituraTotalizadoresParciais>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
xor    %eax,%eax
jmp    1030 <Formata@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"\1B|27|\1B\00"
define i32 @Bematech_FI_LeituraTotalizadoresParciais(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @Formata to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1B|27|\1B\00"
define i32 @Bematech_FI_LeituraTotalizadoresParciais(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @Formata to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Strcat(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char target[] = "stack ";
  char source[] = "overflow";
  printf("%s\n", target);
  Strcat(target, source);
  printf("%s\n", target);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0xb(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xebd(%rip),%al
mov    %al,-0x5(%rbp)
mov    0xeb4(%rip),%rax
mov    %rax,-0x14(%rbp)
mov    0xeb2(%rip),%al
mov    %al,-0xc(%rbp)
lea    -0xb(%rbp),%rsi
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
lea    -0xb(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <Strcat@plt>
lea    -0xb(%rbp),%rsi
lea    0xe88(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movl   $0x206b63,0x3(%rsp)
movl   $0x63617473,(%rsp)
movabs $0x776f6c667265766f,%rax
6c 6f 77
mov    %rax,0x8(%rsp)
movb   $0x0,0x10(%rsp)
lea    0xebf(%rip),%r14
mov    %rsp,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <Strcat@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.target = [7 x i8] c"stack \00"
@__const.main.source = [9 x i8] c"overflow\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i8]
%3 = alloca [9 x i8]
store i32 0, i32* %1
%4 = bitcast [7 x i8]* %2 to i8*
%5 = bitcast [9 x i8]* %3 to i8*
%6 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%9 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%10 = call i32 @Strcat(i8* %8, i8* %9)
%11 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %11)
ret i32 0
}

LLVM IR (-O2):
@__const.main.target = [7 x i8] c"stack \00"
@__const.main.source = [9 x i8] c"overflow\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [7 x i8]
%2 = alloca [9 x i8]
%3 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = call i32 @Strcat(i8* %3, i8* %4)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
char *next_heap_pos(char *heap) { return heap + 4; }


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

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

LLVM IR (-O0):
define i8* @next_heap_pos(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 4
ret i8* %4
}

LLVM IR (-O2):
define i8* @next_heap_pos(i8* readnone %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 4
ret i8* %2
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
uint32_t strtouint32(const char *s) {
  int32_t i;
  uint8_t b;
  i = 0;
  for (;;) {
    b = (uint8_t)(*s++ - '0');
    if (b >= 10)
      break;
    i = i * 10 + b;
  }
  return i;
}


x86 assembly (clang, -O0):
<strtouint32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
sub    $0x30,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jl     1136 <strtouint32+0x36>
jmp    1145 <strtouint32+0x45>
imul   $0xa,-0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strtouint32+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtouint32>:
mov    (%rdi),%cl
xor    %eax,%eax
cmp    $0x39,%cl
jg     1128 <strtouint32+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nop
movsbl %cl,%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
cmp    $0x3a,%cl
jl     1110 <strtouint32+0x10>
ret

LLVM IR (-O0):
define i32 @strtouint32(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %5
5: ; preds = %14, %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
%10 = sub nsw i32 %9, 48
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = icmp sge i32 %11, 10
br i1 %12, label %13, label %14
13: ; preds = %5
br label %19
14: ; preds = %5
%15 = load i32, i32* %3
%16 = mul nsw i32 %15, 10
%17 = load i32, i32* %4
%18 = add nsw i32 %16, %17
store i32 %18, i32* %3
br label %5
19: ; preds = %13
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @strtouint32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp sgt i8 %2, 57
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %12, %4 ], [ 0, %1 ]
%8 = sext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = mul nsw i32 %7, 10
%11 = add i32 %10, -48
%12 = add i32 %11, %8
%13 = load i8, i8* %9
%14 = icmp sgt i8 %13, 57
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %12, %4 ]
ret i32 %16
}
/* Type definitions */
typedef scalar_t__ uint_least8_t;

/* Variables and functions */
bool SHAREMIND_SET_KEY_LESS_THAN_uint_least8_t(uint_least8_t const k1,
                                               uint_least8_t const k2) {
  return k1 < k2;
}


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

x86 assembly (clang, -O2):
<SHAREMIND_SET_KEY_LESS_THAN_uint_least8_t>:
xor    %eax,%eax
cmp    %rsi,%rdi
setl   %al
ret

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

LLVM IR (-O2):
define i32 @SHAREMIND_SET_KEY_LESS_THAN_uint_least8_t(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ mgetchar();
unsigned long mgetuleb128();
int /*<<< orphan*/ mputchar(int /*<<< orphan*/);
int /*<<< orphan*/ mputuleb128(unsigned long);
scalar_t__ msynch();
long local_entry(void) {
  unsigned long count;
  long delta = 0;
  mputuleb128(count = mgetuleb128());
  delta += msynch();
  mputchar(mgetchar());
  delta += msynch();
  return delta;
}


x86 assembly (clang, -O0):
<local_entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1040 <mgetuleb128@plt>
mov    %rax,%rdi
mov    %rdi,-0x8(%rbp)
call   1060 <mputuleb128@plt>
mov    $0x0,%al
call   1070 <msynch@plt>
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <mgetchar@plt>
mov    %eax,%edi
call   1050 <mputchar@plt>
mov    $0x0,%al
call   1070 <msynch@plt>
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<local_entry>:
push   %rbx
xor    %eax,%eax
call   1040 <mgetuleb128@plt>
mov    %rax,%rdi
call   1060 <mputuleb128@plt>
xor    %eax,%eax
call   1070 <msynch@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <mgetchar@plt>
mov    %eax,%edi
call   1050 <mputchar@plt>
xor    %eax,%eax
call   1070 <msynch@plt>
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @local_entry() {
%1 = alloca i64
%2 = alloca i64
store i64 0, i64* %2
%3 = call i64 (...) @mgetuleb128()
store i64 %3, i64* %1
%4 = call i32 @mputuleb128(i64 %3)
%5 = call i64 (...) @msynch()
%6 = load i64, i64* %2
%7 = add nsw i64 %6, %5
store i64 %7, i64* %2
%8 = call i32 (...) @mgetchar()
%9 = call i32 @mputchar(i32 %8)
%10 = call i64 (...) @msynch()
%11 = load i64, i64* %2
%12 = add nsw i64 %11, %10
store i64 %12, i64* %2
%13 = load i64, i64* %2
ret i64 %13
}

LLVM IR (-O2):
define i64 @local_entry() {
%1 = tail call i64 (...) @mgetuleb128()
%2 = tail call i32 @mputuleb128(i64 %1)
%3 = tail call i64 (...) @msynch()
%4 = tail call i32 (...) @mgetchar()
%5 = tail call i32 @mputchar(i32 %4)
%6 = tail call i64 (...) @msynch()
%7 = add nsw i64 %6, %3
ret i64 %7
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
int UINT64_C(int);
uint64_t vid_to_btree_oid(uint32_t vid, uint32_t btreeid) {
  return ((uint64_t)vid << 32) | (UINT64_C(1) << 60) | btreeid;
}


x86 assembly (clang, -O0):
<vid_to_btree_oid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    $0x1,%edi
call   1030 <UINT64_C@plt>
mov    %eax,%edx
mov    -0xc(%rbp),%eax
mov    $0x3c,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
or     -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @vid_to_btree_oid(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = shl i32 %5, 32
%7 = call i32 @UINT64_C(i32 1)
%8 = shl i32 %7, 60
%9 = or i32 %6, %8
%10 = load i32, i32* %4
%11 = or i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @vid_to_btree_oid(i32 %0, i32 %1) {
%3 = tail call i32 @UINT64_C(i32 1)
ret i32 poison
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ __sulong_thread_self();
pthread_t pthread_self() { return (pthread_t)__sulong_thread_self(); }


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

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

LLVM IR (-O0):
define i32 @pthread_self() {
%1 = call i32 (...) @__sulong_thread_self()
ret i32 %1
}

LLVM IR (-O2):
define i32 @pthread_self() {
%1 = tail call i32 (...) @__sulong_thread_self()
ret i32 %1
}
void elv_put_request(struct request_queue *x, struct request *y) { return; }


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

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

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

LLVM IR (-O2):
%struct.request_queue = type opaque
%struct.request = type opaque
define void @elv_put_request(%struct.request_queue* nocapture %0, %struct.request* nocapture %1) {
ret void
}
/* Variables and functions */
double const cos(int /*<<< orphan*/);
int /*<<< orphan*/ f_seal_DegreesToRadians(double const);
double f_seal_YComponentOfVector(const double p_direction,
                                 const double p_magnitude) {
  return cos(f_seal_DegreesToRadians(p_direction)) * p_magnitude;
}


x86 assembly (clang, -O0):
<f_seal_YComponentOfVector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <f_seal_DegreesToRadians@plt>
mov    %eax,%edi
call   1040 <cos@plt>
mulsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_seal_YComponentOfVector>:
push   %rax
movsd  %xmm1,(%rsp)
call   1030 <f_seal_DegreesToRadians@plt>
mov    %eax,%edi
call   1040 <cos@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f_seal_YComponentOfVector(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = call i32 @f_seal_DegreesToRadians(double %5)
%7 = call double @cos(i32 %6)
%8 = load double, double* %4
%9 = fmul double %7, %8
ret double %9
}

LLVM IR (-O2):
define double @f_seal_YComponentOfVector(double %0, double %1) {
%3 = tail call i32 @f_seal_DegreesToRadians(double %0)
%4 = tail call double @cos(i32 %3)
%5 = fmul double %4, %1
ret double %5
}
long long r9(void *x) { return *(long long *)(x + 32759); }


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

x86 assembly (clang, -O2):
<r9>:
mov    0x7ff7(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @r9(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr i8, i8* %3, i64 32759
%5 = bitcast i8* %4 to i64*
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @r9(i8* nocapture %0) {
%2 = getelementptr i8, i8* %0, i64 32759
%3 = bitcast i8* %2 to i64*
%4 = load i64, i64* %3
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_storeh_pd(void *, int /*<<< orphan*/);
void test_storeh_pd(__m128d x, void *y) { _mm_storeh_pd(y, x); }


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

x86 assembly (clang, -O2):
<test_storeh_pd>:
mov    %edi,%eax
mov    %rsi,%rdi
mov    %eax,%esi
jmp    1030 <_mm_storeh_pd@plt>

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

LLVM IR (-O2):
define void @test_storeh_pd(i32 %0, i8* %1) {
%3 = tail call i32 @_mm_storeh_pd(i8* %1, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DO(int);
int /*<<< orphan*/ RE(int);
int main() {
  int a, b;
  DO(a + b);
  RE(a + b + a);
#pragma omp taskwait
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <DO@plt>
call   1040 <RE@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = add nsw i32 %3, %4
%6 = call i32 @DO(i32 %5)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %1
%11 = add nsw i32 %9, %10
%12 = call i32 @RE(i32 %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @DO(i32 undef)
%2 = tail call i32 @RE(i32 undef)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_char(unsigned char);
void print_emerg_char(unsigned char byte) { __console_tx_char(byte); }


x86 assembly (clang, -O0):
<print_emerg_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <__console_tx_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_emerg_char>:
jmp    1030 <__console_tx_char@plt>

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

LLVM IR (-O2):
define void @print_emerg_char(i8 zeroext %0) {
%2 = tail call i32 @__console_tx_char(i8 zeroext %0)
ret void
}
void main() { static int z = 100; }


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

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

LLVM IR (-O0):
@main.z = internal global i32 100
define void @main() {
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
int clearbits_msb(int num, int i) {
  int mask = (1 << i) - 1;
  return num & mask;
}


x86 assembly (clang, -O0):
<clearbits_msb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearbits_msb>:
mov    %esi,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
and    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @clearbits_msb(i32 %0, i32 %1) {
%3 = shl nsw i32 -1, %1
%4 = xor i32 %3, -1
%5 = and i32 %4, %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ SHM_RDONLY;
void *shmat(int, void *, int /*<<< orphan*/);
void *get_shmem(int shmid, int readonly) {
  void *addr;
  if (readonly) {
    addr = shmat(shmid, (void *)0, SHM_RDONLY);
  } else {
    addr = shmat(shmid, (void *)0, 0);
  }
  if (addr == (void *)-1) {
    return NULL;
  }
  return addr;
}


x86 assembly (clang, -O0):
<get_shmem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1146 <get_shmem+0x36>
mov    -0xc(%rbp),%edi
mov    0x2eae(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1030 <shmat@plt>
mov    %rax,-0x18(%rbp)
jmp    1158 <get_shmem+0x48>
mov    -0xc(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <shmat@plt>
mov    %rax,-0x18(%rbp)
mov    $0xffffffffffffffff,%rax
cmp    %rax,-0x18(%rbp)
jne    1176 <get_shmem+0x66>
movq   $0x0,-0x8(%rbp)
jmp    117e <get_shmem+0x6e>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_shmem>:
push   %rbx
mov    %esi,%edx
test   %esi,%esi
je     1120 <get_shmem+0x10>
mov    0x2ec2(%rip),%rax
mov    (%rax),%edx
xor    %ebx,%ebx
xor    %esi,%esi
call   1030 <shmat@plt>
cmp    $0xffffffffffffffff,%rax
cmove  %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@SHM_RDONLY = global i32 0
define i8* @get_shmem(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = load i32, i32* @SHM_RDONLY
%5 = select i1 %3, i32 0, i32 %4
%6 = tail call i8* @shmat(i32 %0, i8* null, i32 %5)
%7 = icmp eq i8* %6, inttoptr (i64 -1 to i8*)
%8 = select i1 %7, i8* null, i8* %6
ret i8* %8
}
/* Variables and functions */
unsigned char *gg_deflate(const char *in, size_t *out_lenp) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @gg_deflate(i8* nocapture readnone %0, i64* nocapture readnone %1) {
ret i8* null
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;
typedef int /*<<< orphan*/ dev_t;

/* Variables and functions */
int /*<<< orphan*/ _MKNOD_VER;
int true_xmknod(int /*<<< orphan*/, char const *, int /*<<< orphan*/,
                int /*<<< orphan*/ *);
int true_mknod(const char *pathname, mode_t mode, dev_t dev) {
  return true_xmknod(_MKNOD_VER, pathname, mode, &dev);
}


x86 assembly (clang, -O0):
<true_mknod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    -0x10(%rbp),%rcx
call   1030 <true_xmknod@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<true_mknod>:
push   %rax
mov    %esi,%eax
mov    %rdi,%rsi
mov    %edx,0x4(%rsp)
mov    0x2ec7(%rip),%rcx
mov    (%rcx),%edi
lea    0x4(%rsp),%rcx
mov    %eax,%edx
call   1030 <true_xmknod@plt>
pop    %rcx
ret

LLVM IR (-O0):
@_MKNOD_VER = global i32 0
define i32 @true_mknod(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* @_MKNOD_VER
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = call i32 @true_xmknod(i32 %7, i8* %8, i32 %9, i32* %6)
ret i32 %10
}

LLVM IR (-O2):
@_MKNOD_VER = global i32 0
define i32 @true_mknod(i8* %0, i32 %1, i32 %2) {
%4 = alloca i32
store i32 %2, i32* %4
%5 = load i32, i32* @_MKNOD_VER
%6 = call i32 @true_xmknod(i32 %5, i8* %0, i32 %1, i32* %4)
ret i32 %6
}
void __attribute__((cold)) external_cold_function() {}


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

x86 assembly (clang, -O2):
<external_cold_function>:
ret
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)

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

LLVM IR (-O2):
define void @external_cold_function() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int k(int p) {
  printf("p=%d\n", p);
  return 0;
}


x86 assembly (clang, -O0):
<k>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"p=%d\0A\00"
define i32 @k(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void Crlf_Real(void) { puts(""); }


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

x86 assembly (clang, -O2):
<Crlf_Real>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @Crlf_Real() {
%1 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @Crlf_Real() {
%1 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_key_t;

/* Variables and functions */
void *pthread_getspecific(int /*<<< orphan*/);
void *bglpth_pthread_getspecific(pthread_key_t key) {
  return pthread_getspecific(key);
}


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

x86 assembly (clang, -O2):
<bglpth_pthread_getspecific>:
jmp    1030 <pthread_getspecific@plt>

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

LLVM IR (-O2):
define i8* @bglpth_pthread_getspecific(i32 %0) {
%2 = tail call i8* @pthread_getspecific(i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x64() {
  Assert_real((isdigit(100) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isdigit.c",
              505, ("isdigit should be 0 for d"));
}


x86 assembly (clang, -O0):
<t_isdigit_0x64>:
push   %rbp
mov    %rsp,%rbp
mov    $0x64,%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x1f9,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isdigit_0x64>:
push   %rax
mov    $0x64,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x1f9,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for d\00"
define void @t_isdigit_0x64() {
%1 = call i64 @isdigit(i32 100)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 505, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for d\00"
define void @t_isdigit_0x64() {
%1 = tail call i64 @isdigit(i32 100)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 505, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void end_syntax_same_line_block(void) { printf("</div>"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"</div>\00"
define void @end_syntax_same_line_block() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"</div>\00"
define void @end_syntax_same_line_block() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned char i2cavailable(void) {}


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

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

LLVM IR (-O0):
define zeroext i8 @i2cavailable() {
%1 = alloca i8
%2 = load i8, i8* %1
ret i8 %2
}

LLVM IR (-O2):
define zeroext i8 @i2cavailable() {
ret i8 undef
}
int cairo_code_draw_pwrstarttLabel_get_height() { return 25; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_pwrstarttLabel_get_height() {
ret i32 25
}

LLVM IR (-O2):
define i32 @cairo_code_draw_pwrstarttLabel_get_height() {
ret i32 25
}
/* Variables and functions */
int /*<<< orphan*/ Msp430AlarmC__2__Alarm__fired();
int /*<<< orphan*/ Msp430AlarmC__2__Msp430TimerControl__disableEvents();
void Msp430AlarmC__2__Msp430Compare__fired(void) {
  Msp430AlarmC__2__Msp430TimerControl__disableEvents();
  Msp430AlarmC__2__Alarm__fired();
}


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

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

LLVM IR (-O0):
define void @Msp430AlarmC__2__Msp430Compare__fired() {
%1 = call i32 (...) @Msp430AlarmC__2__Msp430TimerControl__disableEvents()
%2 = call i32 (...) @Msp430AlarmC__2__Alarm__fired()
ret void
}

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

/* Variables and functions */
void lapic_write(uint32_t reg, uint32_t value) {
  *((volatile uint32_t *)reg) = value;
}


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

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

LLVM IR (-O0):
define void @lapic_write(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 = inttoptr i64 %6 to i64*
store volatile i64 %5, i64* %7
ret void
}

LLVM IR (-O2):
define void @lapic_write(i64 %0, i64 %1) {
%3 = inttoptr i64 %0 to i64*
store volatile i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int main(void) {
  foo();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ vuln();
int main() { vuln(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @vuln()
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t rotl(const uint64_t x, int k) { return (x << k) | (x >> (64 - k)); }


x86 assembly (clang, -O0):
<rotl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x40,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotl>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
sar    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rotl(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 64, %9
%11 = ashr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rotl(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub nsw i32 64, %1
%5 = ashr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}