#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 ipc_perm {
  int __key;
  int uid;
  int gid;
  int cuid;
  int cgid;
  int __seq;
  int /*<<< orphan*/ mode;
};

/* Variables and functions */
int /*<<< orphan*/ print_permisos(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void ipc_perm_info(struct ipc_perm *p) {
  printf("\nsemafore permises info:");
  printf("\n\t key: %i", p->__key);
  printf("\n\t UID owner: %i", p->uid);
  printf("\n\t GID owner: %i", p->gid);
  printf("\n\t UID creator: %i", p->cuid);
  printf("\n\t GID creator: %i", p->cgid);
  print_permisos(p->mode);
  printf("\n\t seq: %u", p->__seq);
}


x86 assembly (clang, -O0):
<ipc_perm_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%esi
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%esi
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%esi
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%esi
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%edi
call   1040 <print_permisos@plt>
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%esi
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipc_perm_info>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rbx),%esi
lea    0xede(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rbx),%esi
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rbx),%esi
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rbx),%esi
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x10(%rbx),%esi
lea    0xeda(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x18(%rbx),%edi
call   1040 <print_permisos@plt>
mov    0x14(%rbx),%esi
lea    0xed4(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.ipc_perm = type { i32, i32, i32, i32, i32, i32, i32 }
@.str = [25 x i8] c"\0Asemafore permises info:\00"
@.str.1 = [11 x i8] c"\0A\09 key: %i\00"
@.str.2 = [17 x i8] c"\0A\09 UID owner: %i\00"
@.str.3 = [17 x i8] c"\0A\09 GID owner: %i\00"
@.str.4 = [19 x i8] c"\0A\09 UID creator: %i\00"
@.str.5 = [19 x i8] c"\0A\09 GID creator: %i\00"
@.str.6 = [11 x i8] c"\0A\09 seq: %u\00"
define void @ipc_perm_info(%struct.ipc_perm* %0) {
%2 = alloca %struct.ipc_perm*
store %struct.ipc_perm* %0, %struct.ipc_perm** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = load %struct.ipc_perm*, %struct.ipc_perm** %2
%5 = getelementptr inbounds %struct.ipc_perm, %struct.ipc_perm* %4, i32 0, i32 0
%6 = load i32, i32* %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load %struct.ipc_perm*, %struct.ipc_perm** %2
%9 = getelementptr inbounds %struct.ipc_perm, %struct.ipc_perm* %8, i32 0, i32 1
%10 = load i32, i32* %9
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %10)
%12 = load %struct.ipc_perm*, %struct.ipc_perm** %2
%13 = getelementptr inbounds %struct.ipc_perm, %struct.ipc_perm* %12, i32 0, i32 2
%14 = load i32, i32* %13
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %14)
%16 = load %struct.ipc_perm*, %struct.ipc_perm** %2
%17 = getelementptr inbounds %struct.ipc_perm, %struct.ipc_perm* %16, i32 0, i32 3
%18 = load i32, i32* %17
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i32 %18)
%20 = load %struct.ipc_perm*, %struct.ipc_perm** %2
%21 = getelementptr inbounds %struct.ipc_perm, %struct.ipc_perm* %20, i32 0, i32 4
%22 = load i32, i32* %21
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i32 %22)
%24 = load %struct.ipc_perm*, %struct.ipc_perm** %2
%25 = getelementptr inbounds %struct.ipc_perm, %struct.ipc_perm* %24, i32 0, i32 6
%26 = load i32, i32* %25
%27 = call i32 @print_permisos(i32 %26)
%28 = load %struct.ipc_perm*, %struct.ipc_perm** %2
%29 = getelementptr inbounds %struct.ipc_perm, %struct.ipc_perm* %28, i32 0, i32 5
%30 = load i32, i32* %29
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i32 %30)
ret void
}

LLVM IR (-O2):
%struct.ipc_perm = type { i32, i32, i32, i32, i32, i32, i32 }
@.str = [25 x i8] c"\0Asemafore permises info:\00"
@.str.1 = [11 x i8] c"\0A\09 key: %i\00"
@.str.2 = [17 x i8] c"\0A\09 UID owner: %i\00"
@.str.3 = [17 x i8] c"\0A\09 GID owner: %i\00"
@.str.4 = [19 x i8] c"\0A\09 UID creator: %i\00"
@.str.5 = [19 x i8] c"\0A\09 GID creator: %i\00"
@.str.6 = [11 x i8] c"\0A\09 seq: %u\00"
define void @ipc_perm_info(%struct.ipc_perm* nocapture %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds %struct.ipc_perm, %struct.ipc_perm* %0, i64 0, i32 0
%4 = load i32, i32* %3
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = getelementptr inbounds %struct.ipc_perm, %struct.ipc_perm* %0, i64 0, i32 1
%7 = load i32, i32* %6
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %7)
%9 = getelementptr inbounds %struct.ipc_perm, %struct.ipc_perm* %0, i64 0, i32 2
%10 = load i32, i32* %9
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %10)
%12 = getelementptr inbounds %struct.ipc_perm, %struct.ipc_perm* %0, i64 0, i32 3
%13 = load i32, i32* %12
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i32 %13)
%15 = getelementptr inbounds %struct.ipc_perm, %struct.ipc_perm* %0, i64 0, i32 4
%16 = load i32, i32* %15
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i32 %16)
%18 = getelementptr inbounds %struct.ipc_perm, %struct.ipc_perm* %0, i64 0, i32 6
%19 = load i32, i32* %18
%20 = tail call i32 @print_permisos(i32 %19)
%21 = getelementptr inbounds %struct.ipc_perm, %struct.ipc_perm* %0, i64 0, i32 5
%22 = load i32, i32* %21
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i32 %22)
ret void
}