#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
struct fus_runtime_t {
  int dummy;
};
struct fus_arr_t {
  int dummy;
};

/* Variables and functions */
struct fus_arr_t *fus_arr_create(int);
int /*<<< orphan*/ fus_arr_set(struct fus_arr_t *, int /*<<< orphan*/,
                               int /*<<< orphan*/);
int fus_runtime_push_frame_detailed(struct fus_runtime_t *, struct fus_arr_t *,
                                    int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ fus_value_arr(struct fus_arr_t *);
int fus_runtime_push_frame(struct fus_runtime_t *runtime,
                           struct fus_arr_t *code) {
  struct fus_arr_t *codestack = fus_arr_create(1);
  if (codestack == NULL)
    return 1;
  fus_arr_set(codestack, 0, fus_value_arr(code));
  return fus_runtime_push_frame_detailed(runtime, codestack, NULL, NULL);
}


x86 assembly (clang, -O0):
<fus_runtime_push_frame>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    $0x1,%edi
call   1050 <fus_arr_create@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1175 <fus_runtime_push_frame+0x35>
movl   $0x1,-0x4(%rbp)
jmp    11aa <fus_runtime_push_frame+0x6a>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <fus_value_arr@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%edx
xor    %esi,%esi
call   1040 <fus_arr_set@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rdx
call   1060 <fus_runtime_push_frame_detailed@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fus_runtime_push_frame>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    $0x1,%edi
call   1050 <fus_arr_create@plt>
test   %rax,%rax
je     1185 <fus_runtime_push_frame+0x45>
mov    %rax,%rbx
mov    %r15,%rdi
call   1030 <fus_value_arr@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %eax,%edx
call   1040 <fus_arr_set@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
pop    %rbx
pop    %r14
pop    %r15
jmp    1060 <fus_runtime_push_frame_detailed@plt>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.fus_runtime_t = type { i32 }
%struct.fus_arr_t = type { i32 }
define i32 @fus_runtime_push_frame(%struct.fus_runtime_t* %0, %struct.fus_arr_t* %1) {
%3 = alloca i32
%4 = alloca %struct.fus_runtime_t*
%5 = alloca %struct.fus_arr_t*
%6 = alloca %struct.fus_arr_t*
store %struct.fus_runtime_t* %0, %struct.fus_runtime_t** %4
store %struct.fus_arr_t* %1, %struct.fus_arr_t** %5
%7 = call %struct.fus_arr_t* @fus_arr_create(i32 1)
store %struct.fus_arr_t* %7, %struct.fus_arr_t** %6
%8 = load %struct.fus_arr_t*, %struct.fus_arr_t** %6
%9 = icmp eq %struct.fus_arr_t* %8, null
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 1, i32* %3
br label %19
11: ; preds = %2
%12 = load %struct.fus_arr_t*, %struct.fus_arr_t** %6
%13 = load %struct.fus_arr_t*, %struct.fus_arr_t** %5
%14 = call i32 @fus_value_arr(%struct.fus_arr_t* %13)
%15 = call i32 @fus_arr_set(%struct.fus_arr_t* %12, i32 0, i32 %14)
%16 = load %struct.fus_runtime_t*, %struct.fus_runtime_t** %4
%17 = load %struct.fus_arr_t*, %struct.fus_arr_t** %6
%18 = call i32 @fus_runtime_push_frame_detailed(%struct.fus_runtime_t* %16, %struct.fus_arr_t* %17, i32* null, i32* null)
store i32 %18, i32* %3
br label %19
19: ; preds = %11, %10
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
%struct.fus_runtime_t = type { i32 }
%struct.fus_arr_t = type { i32 }
define i32 @fus_runtime_push_frame(%struct.fus_runtime_t* %0, %struct.fus_arr_t* %1) {
%3 = tail call %struct.fus_arr_t* @fus_arr_create(i32 1)
%4 = icmp eq %struct.fus_arr_t* %3, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @fus_value_arr(%struct.fus_arr_t* %1)
%7 = tail call i32 @fus_arr_set(%struct.fus_arr_t* %3, i32 0, i32 %6)
%8 = tail call i32 @fus_runtime_push_frame_detailed(%struct.fus_runtime_t* %0, %struct.fus_arr_t* %3, i32* null, i32* null)
br label %9
9: ; preds = %2, %5
%10 = phi i32 [ %8, %5 ], [ 1, %2 ]
ret i32 %10
}