// File: /workspace/github_c_makefile_star2_O3/stetre[P]moonglfw/src/utils.c
// Function: moonglfw_pushgamepadbuttons
int pushgamepadbuttons(lua_State *L, const GLFWgamepadstate *state)
    {
    lua_newtable(L);
#define Setfield(x, name) do {  \
    lua_pushstring(L, state->buttons[GLFW_GAMEPAD_BUTTON_##x]==GLFW_PRESS ? "press" : "release"); \
    lua_setfield(L, -2, name);  \
} while(0)
    Setfield(A, "a");
    Setfield(A, "a");
    Setfield(B, "b");
    Setfield(X, "x");
    Setfield(Y, "y");
    Setfield(LEFT_BUMPER, "left_bumper");
    Setfield(RIGHT_BUMPER, "right_bumper");
    Setfield(BACK, "back");
    Setfield(START, "start");
    Setfield(GUIDE, "guide");
    Setfield(LEFT_THUMB, "left_thumb");
    Setfield(RIGHT_THUMB, "right_thumb");
    Setfield(DPAD_UP, "dpad_up");
    Setfield(DPAD_RIGHT, "dpad_right");
    Setfield(DPAD_DOWN, "dpad_down");
    Setfield(DPAD_LEFT, "dpad_left");
#undef Setfield
    return 1;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
xorl %esi, %esi
xorl %edx, %edx
callq 0x5210
cmpb $0x1, (%r14)
leaq 0x3647(%rip), %r13      # 0x133c5
leaq 0x364d(%rip), %r15      # 0x133d2
movq %r15, %rsi
cmoveq %r13, %rsi
movq %rbx, %rdi
callq 0x5690
leaq 0x4893(%rip), %r12      # 0x1462e
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %r12, %rdx
callq 0x52d0
cmpb $0x1, (%r14)
movq %r15, %rsi
cmoveq %r13, %rsi
movq %rbx, %rdi
callq 0x5690
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq %r12, %rdx
callq 0x52d0
cmpb $0x1, 0x1(%r14)
movq %r15, %rsi
cmoveq %r13, %rsi
movq %rbx, %rdi
callq 0x5690
leaq 0x36a8(%rip), %rdx      # 0x13491
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x52d0
cmpb $0x1, 0x2(%r14)
movq %r15, %rsi
cmoveq %r13, %rsi
movq %rbx, %rdi
callq 0x5690
leaq 0x3a4b(%rip), %rdx      # 0x1385c
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x52d0
cmpb $0x1, 0x3(%r14)
movq %r15, %rsi
cmoveq %r13, %rsi
movq %rbx, %rdi
callq 0x5690
leaq 0x3a2e(%rip), %rdx      # 0x13867
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x52d0
cmpb $0x1, 0x4(%r14)
movq %r15, %rsi
cmoveq %r13, %rsi
movq %rbx, %rdi
callq 0x5690
leaq 0x5f18(%rip), %rdx      # 0x15d79
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x52d0
cmpb $0x1, 0x5(%r14)
movq %r15, %rsi
cmoveq %r13, %rsi
movq %rbx, %rdi
callq 0x5690
leaq 0x5efc(%rip), %rdx      # 0x15d85
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x52d0
cmpb $0x1, 0x6(%r14)
movq %r15, %rsi
cmoveq %r13, %rsi
movq %rbx, %rdi
callq 0x5690
leaq 0x4891(%rip), %rdx      # 0x14742
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x52d0
cmpb $0x1, 0x7(%r14)
movq %r15, %rsi
cmoveq %r13, %rsi
movq %rbx, %rdi
callq 0x5690
leaq 0x5eb9(%rip), %rdx      # 0x15d92
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x52d0
cmpb $0x1, 0x8(%r14)
movq %r15, %rsi
cmoveq %r13, %rsi
movq %rbx, %rdi
callq 0x5690
leaq 0x5e97(%rip), %rdx      # 0x15d98
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x52d0
cmpb $0x1, 0x9(%r14)
movq %r15, %rsi
cmoveq %r13, %rsi
movq %rbx, %rdi
callq 0x5690
leaq 0x5e75(%rip), %rdx      # 0x15d9e
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x52d0
cmpb $0x1, 0xa(%r14)
movq %r15, %rsi
cmoveq %r13, %rsi
movq %rbx, %rdi
callq 0x5690
leaq 0x5e58(%rip), %rdx      # 0x15da9
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x52d0
cmpb $0x1, 0xb(%r14)
movq %r15, %rsi
cmoveq %r13, %rsi
movq %rbx, %rdi
callq 0x5690
leaq 0x5e3c(%rip), %rdx      # 0x15db5
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x52d0
cmpb $0x1, 0xc(%r14)
movq %r15, %rsi
cmoveq %r13, %rsi
movq %rbx, %rdi
callq 0x5690
leaq 0x5e1c(%rip), %rdx      # 0x15dbd
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x52d0
cmpb $0x1, 0xd(%r14)
movq %r15, %rsi
cmoveq %r13, %rsi
movq %rbx, %rdi
callq 0x5690
leaq 0x5dff(%rip), %rdx      # 0x15dc8
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x52d0
cmpb $0x1, 0xe(%r14)
cmoveq %r13, %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5690
leaq 0x5de1(%rip), %rdx      # 0x15dd2
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x52d0
movl $0x1, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq