#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 */

/* Variables and functions */
scalar_t__ trio_equal(char const *, char *);
int *trio_get_argument(void *);
char *trio_get_format(void *);
int /*<<< orphan*/ trio_print_int(void *, int);
int number_writer(void *ref) {
  const char *format;
  int *data;
  format = trio_get_format(ref);
  if ((format) && trio_equal(format, "integer")) {
    data = trio_get_argument(ref);
    if (data) {
      trio_print_int(ref, *data);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<number_writer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <trio_get_format@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     11aa <number_writer+0x6a>
mov    -0x10(%rbp),%rdi
lea    0xe91(%rip),%rsi
call   1060 <trio_equal@plt>
cmp    $0x0,%rax
je     11aa <number_writer+0x6a>
mov    -0x8(%rbp),%rdi
call   1050 <trio_get_argument@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     11a5 <number_writer+0x65>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
call   1030 <trio_print_int@plt>
jmp    11aa <number_writer+0x6a>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<number_writer>:
push   %rbx
mov    %rdi,%rbx
call   1040 <trio_get_format@plt>
test   %rax,%rax
je     1179 <number_writer+0x39>
lea    0xeab(%rip),%rsi
mov    %rax,%rdi
call   1060 <trio_equal@plt>
test   %rax,%rax
je     1179 <number_writer+0x39>
mov    %rbx,%rdi
call   1050 <trio_get_argument@plt>
test   %rax,%rax
je     1179 <number_writer+0x39>
mov    (%rax),%esi
mov    %rbx,%rdi
call   1030 <trio_print_int@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"integer\00"
define i32 @number_writer(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @trio_get_format(i8* %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %24
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i64 @trio_equal(i8* %10, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %24
13: ; preds = %9
%14 = load i8*, i8** %2
%15 = call i32* @trio_get_argument(i8* %14)
store i32* %15, i32** %4
%16 = load i32*, i32** %4
%17 = icmp ne i32* %16, null
br i1 %17, label %18, label %23
18: ; preds = %13
%19 = load i8*, i8** %2
%20 = load i32*, i32** %4
%21 = load i32, i32* %20
%22 = call i32 @trio_print_int(i8* %19, i32 %21)
br label %23
23: ; preds = %18, %13
br label %24
24: ; preds = %23, %9, %1
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"integer\00"
define i32 @number_writer(i8* %0) {
%2 = tail call i8* @trio_get_format(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %13, label %4
4: ; preds = %1
%5 = tail call i64 @trio_equal(i8* %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %4
%8 = tail call i32* @trio_get_argument(i8* %0)
%9 = icmp eq i32* %8, null
br i1 %9, label %13, label %10
10: ; preds = %7
%11 = load i32, i32* %8
%12 = tail call i32 @trio_print_int(i8* %0, i32 %11)
br label %13
13: ; preds = %7, %10, %4, %1
ret i32 0
}