#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 out {
  int dummy;
};
struct node {
  int dummy;
};
struct module {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pf(struct out *, char *);
int /*<<< orphan*/ print_deffield_name(struct out *, struct module const *,
                                       struct node const *);
int /*<<< orphan*/ print_deftype_name(struct out *, struct module const *,
                                      struct node const *);
void print_defchoice_path(struct out *out, const struct module *mod,
                          const struct node *deft, const struct node *ch) {
  print_deftype_name(out, mod, deft);
  if (ch == deft) {
    return;
  }
  pf(out, "$");
  print_deffield_name(out, mod, ch);
}


x86 assembly (clang, -O0):
<print_defchoice_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <print_deftype_name@plt>
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    116c <print_defchoice_path+0x3c>
jmp    118d <print_defchoice_path+0x5d>
mov    -0x8(%rbp),%rdi
lea    0xe89(%rip),%rsi
call   1030 <pf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1050 <print_deffield_name@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_defchoice_path>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %rsi,%r15
mov    %rdi,%r12
call   1040 <print_deftype_name@plt>
cmp    %rbx,%r14
je     1176 <print_defchoice_path+0x46>
lea    0xeab(%rip),%rsi
mov    %r12,%rdi
call   1030 <pf@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1050 <print_deffield_name@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.out = type { i32 }
%struct.module = type { i32 }
%struct.node = type { i32 }
@.str = [2 x i8] c"$\00"
define void @print_defchoice_path(%struct.out* %0, %struct.module* %1, %struct.node* %2, %struct.node* %3) {
%5 = alloca %struct.out*
%6 = alloca %struct.module*
%7 = alloca %struct.node*
%8 = alloca %struct.node*
store %struct.out* %0, %struct.out** %5
store %struct.module* %1, %struct.module** %6
store %struct.node* %2, %struct.node** %7
store %struct.node* %3, %struct.node** %8
%9 = load %struct.out*, %struct.out** %5
%10 = load %struct.module*, %struct.module** %6
%11 = load %struct.node*, %struct.node** %7
%12 = call i32 @print_deftype_name(%struct.out* %9, %struct.module* %10, %struct.node* %11)
%13 = load %struct.node*, %struct.node** %8
%14 = load %struct.node*, %struct.node** %7
%15 = icmp eq %struct.node* %13, %14
br i1 %15, label %16, label %17
16: ; preds = %4
br label %24
17: ; preds = %4
%18 = load %struct.out*, %struct.out** %5
%19 = call i32 @pf(%struct.out* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%20 = load %struct.out*, %struct.out** %5
%21 = load %struct.module*, %struct.module** %6
%22 = load %struct.node*, %struct.node** %8
%23 = call i32 @print_deffield_name(%struct.out* %20, %struct.module* %21, %struct.node* %22)
br label %24
24: ; preds = %17, %16
ret void
}

LLVM IR (-O2):
%struct.out = type { i32 }
%struct.module = type { i32 }
%struct.node = type { i32 }
@.str = [2 x i8] c"$\00"
define void @print_defchoice_path(%struct.out* %0, %struct.module* %1, %struct.node* %2, %struct.node* %3) {
%5 = tail call i32 @print_deftype_name(%struct.out* %0, %struct.module* %1, %struct.node* %2)
%6 = icmp eq %struct.node* %3, %2
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = tail call i32 @pf(%struct.out* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @print_deffield_name(%struct.out* %0, %struct.module* %1, %struct.node* %3)
br label %10
10: ; preds = %4, %7
ret void
}