#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 tipc_portid {
  int ref;
  int /*<<< orphan*/ node;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int);
int tipc_cluster(int /*<<< orphan*/);
int tipc_node(int /*<<< orphan*/);
int tipc_zone(int /*<<< orphan*/);
void print_portid(struct tipc_portid *pid) {
  printf("<%d.%d.%d:%u>", tipc_zone(pid->node), tipc_cluster(pid->node),
         tipc_node(pid->node), pid->ref);
}


x86 assembly (clang, -O0):
<print_portid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edi
call   1050 <tipc_zone@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edi
call   1060 <tipc_cluster@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edi
call   1040 <tipc_node@plt>
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%r8d
lea    0xe74(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_portid>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    0x4(%rdi),%edi
call   1050 <tipc_zone@plt>
mov    %eax,%r14d
mov    0x4(%rbx),%edi
call   1060 <tipc_cluster@plt>
mov    %eax,%ebp
mov    0x4(%rbx),%edi
call   1040 <tipc_node@plt>
mov    (%rbx),%r8d
lea    0xe92(%rip),%rdi
mov    %r14d,%esi
mov    %ebp,%edx
mov    %eax,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.tipc_portid = type { i32, i32 }
@.str = [14 x i8] c"<%d.%d.%d:%u>\00"
define void @print_portid(%struct.tipc_portid* %0) {
%2 = alloca %struct.tipc_portid*
store %struct.tipc_portid* %0, %struct.tipc_portid** %2
%3 = load %struct.tipc_portid*, %struct.tipc_portid** %2
%4 = getelementptr inbounds %struct.tipc_portid, %struct.tipc_portid* %3, i32 0, i32 1
%5 = load i32, i32* %4
%6 = call i32 @tipc_zone(i32 %5)
%7 = load %struct.tipc_portid*, %struct.tipc_portid** %2
%8 = getelementptr inbounds %struct.tipc_portid, %struct.tipc_portid* %7, i32 0, i32 1
%9 = load i32, i32* %8
%10 = call i32 @tipc_cluster(i32 %9)
%11 = load %struct.tipc_portid*, %struct.tipc_portid** %2
%12 = getelementptr inbounds %struct.tipc_portid, %struct.tipc_portid* %11, i32 0, i32 1
%13 = load i32, i32* %12
%14 = call i32 @tipc_node(i32 %13)
%15 = load %struct.tipc_portid*, %struct.tipc_portid** %2
%16 = getelementptr inbounds %struct.tipc_portid, %struct.tipc_portid* %15, i32 0, i32 0
%17 = load i32, i32* %16
%18 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %10, i32 %14, i32 %17)
ret void
}

LLVM IR (-O2):
%struct.tipc_portid = type { i32, i32 }
@.str = [14 x i8] c"<%d.%d.%d:%u>\00"
define void @print_portid(%struct.tipc_portid* nocapture %0) {
%2 = getelementptr inbounds %struct.tipc_portid, %struct.tipc_portid* %0, i64 0, i32 1
%3 = load i32, i32* %2
%4 = tail call i32 @tipc_zone(i32 %3)
%5 = load i32, i32* %2
%6 = tail call i32 @tipc_cluster(i32 %5)
%7 = load i32, i32* %2
%8 = tail call i32 @tipc_node(i32 %7)
%9 = getelementptr inbounds %struct.tipc_portid, %struct.tipc_portid* %0, i64 0, i32 0
%10 = load i32, i32* %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %6, i32 %8, i32 %10)
ret void
}