#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 ell_v {
  int dummy;
};
struct ell {
  int dummy;
};

/* Variables and functions */
struct ell_v *ell_boolean(int);
int ell_check(struct ell *, struct ell_v *);
int ell_error(struct ell *, char *);
int /*<<< orphan*/ ell_truthy(struct ell_v *);
bool ell_fn_not(struct ell *ell, struct ell_v *args, struct ell_v **result) {
  if (!args)
    return ell_error(ell, "missing argument");
  return ell_check(ell, (*result = ell_boolean(!ell_truthy(args))));
}


x86 assembly (clang, -O0):
<ell_fn_not>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1177 <ell_fn_not+0x37>
mov    -0x10(%rbp),%rdi
lea    0xe96(%rip),%rsi
call   1050 <ell_error@plt>
mov    %eax,-0x4(%rbp)
jmp    11b0 <ell_fn_not+0x70>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <ell_truthy@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1060 <ell_boolean@plt>
mov    -0x28(%rbp),%rdi
mov    %rax,%rsi
mov    -0x20(%rbp),%rax
mov    %rsi,(%rax)
call   1030 <ell_check@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ell_fn_not>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
test   %rsi,%rsi
je     1179 <ell_fn_not+0x39>
mov    %rdx,%r14
mov    %rsi,%rdi
call   1040 <ell_truthy@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1060 <ell_boolean@plt>
mov    %rax,(%r14)
mov    %rbx,%rdi
mov    %rax,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <ell_check@plt>
lea    0xe80(%rip),%rsi
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <ell_error@plt>

LLVM IR (-O0):
%struct.ell = type { i32 }
%struct.ell_v = type { i32 }
@.str = [17 x i8] c"missing argument\00"
define i32 @ell_fn_not(%struct.ell* %0, %struct.ell_v* %1, %struct.ell_v** %2) {
%4 = alloca i32
%5 = alloca %struct.ell*
%6 = alloca %struct.ell_v*
%7 = alloca %struct.ell_v**
store %struct.ell* %0, %struct.ell** %5
store %struct.ell_v* %1, %struct.ell_v** %6
store %struct.ell_v** %2, %struct.ell_v*** %7
%8 = load %struct.ell_v*, %struct.ell_v** %6
%9 = icmp ne %struct.ell_v* %8, null
br i1 %9, label %13, label %10
10: ; preds = %3
%11 = load %struct.ell*, %struct.ell** %5
%12 = call i32 @ell_error(%struct.ell* %11, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
store i32 %12, i32* %4
br label %23
13: ; preds = %3
%14 = load %struct.ell*, %struct.ell** %5
%15 = load %struct.ell_v*, %struct.ell_v** %6
%16 = call i32 @ell_truthy(%struct.ell_v* %15)
%17 = icmp ne i32 %16, 0
%18 = xor i1 %17, true
%19 = zext i1 %18 to i32
%20 = call %struct.ell_v* @ell_boolean(i32 %19)
%21 = load %struct.ell_v**, %struct.ell_v*** %7
store %struct.ell_v* %20, %struct.ell_v** %21
%22 = call i32 @ell_check(%struct.ell* %14, %struct.ell_v* %20)
store i32 %22, i32* %4
br label %23
23: ; preds = %13, %10
%24 = load i32, i32* %4
ret i32 %24
}

LLVM IR (-O2):
%struct.ell = type { i32 }
%struct.ell_v = type { i32 }
@.str = [17 x i8] c"missing argument\00"
define i32 @ell_fn_not(%struct.ell* %0, %struct.ell_v* %1, %struct.ell_v** nocapture writeonly %2) {
%4 = icmp eq %struct.ell_v* %1, null
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @ell_error(%struct.ell* %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %13
7: ; preds = %3
%8 = tail call i32 @ell_truthy(%struct.ell_v* %1)
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
%11 = tail call %struct.ell_v* @ell_boolean(i32 %10)
store %struct.ell_v* %11, %struct.ell_v** %2
%12 = tail call i32 @ell_check(%struct.ell* %0, %struct.ell_v* %11)
br label %13
13: ; preds = %7, %5
%14 = phi i32 [ %12, %7 ], [ %6, %5 ]
ret i32 %14
}