#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 */
typedef int int32_t;

/* Variables and functions */
int funge_stack_pop(int /*<<< orphan*/, int *);
int funge_stack_push(int /*<<< orphan*/, int *);
int /*<<< orphan*/ funge_thread_stack();
int32_t funge_stack_greater_than(int32_t funge_char __attribute__((unused))) {
  int32_t vala;
  int32_t valb;
  int32_t rc;
  rc = funge_stack_pop(funge_thread_stack(), &valb);
  rc = funge_stack_pop(funge_thread_stack(), &vala);
  vala = vala > valb ? 1 : 0;
  rc = funge_stack_push(funge_thread_stack(), &vala);
  return rc;
}


x86 assembly (clang, -O0):
<funge_stack_greater_than>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <funge_thread_stack@plt>
mov    %eax,%edi
lea    -0xc(%rbp),%rsi
call   1050 <funge_stack_pop@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <funge_thread_stack@plt>
mov    %eax,%edi
lea    -0x8(%rbp),%rsi
call   1050 <funge_stack_pop@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmovg  %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <funge_thread_stack@plt>
mov    %eax,%edi
lea    -0x8(%rbp),%rsi
call   1030 <funge_stack_push@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funge_stack_greater_than>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1040 <funge_thread_stack@plt>
lea    0xc(%rsp),%rsi
mov    %eax,%edi
call   1050 <funge_stack_pop@plt>
xor    %eax,%eax
call   1040 <funge_thread_stack@plt>
lea    0x8(%rsp),%rbx
mov    %eax,%edi
mov    %rbx,%rsi
call   1050 <funge_stack_pop@plt>
mov    0x8(%rsp),%eax
xor    %ecx,%ecx
cmp    0xc(%rsp),%eax
setg   %cl
mov    %ecx,0x8(%rsp)
xor    %eax,%eax
call   1040 <funge_thread_stack@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1030 <funge_stack_push@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @funge_stack_greater_than(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = call i32 (...) @funge_thread_stack()
%7 = call i32 @funge_stack_pop(i32 %6, i32* %4)
store i32 %7, i32* %5
%8 = call i32 (...) @funge_thread_stack()
%9 = call i32 @funge_stack_pop(i32 %8, i32* %3)
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = icmp sgt i32 %10, %11
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 1, i32 0
store i32 %14, i32* %3
%15 = call i32 (...) @funge_thread_stack()
%16 = call i32 @funge_stack_push(i32 %15, i32* %3)
store i32 %16, i32* %5
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
define i32 @funge_stack_greater_than(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = tail call i32 (...) @funge_thread_stack()
%7 = call i32 @funge_stack_pop(i32 %6, i32* %3)
%8 = call i32 (...) @funge_thread_stack()
%9 = call i32 @funge_stack_pop(i32 %8, i32* %2)
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = icmp sgt i32 %10, %11
%13 = zext i1 %12 to i32
store i32 %13, i32* %2
%14 = call i32 (...) @funge_thread_stack()
%15 = call i32 @funge_stack_push(i32 %14, i32* %2)
ret i32 %15
}