#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 sg_io_hdr {
  int /*<<< orphan*/ sb_len_wr;
  int /*<<< orphan*/ sbp;
  int /*<<< orphan*/ driver_status;
  int /*<<< orphan*/ host_status;
  int /*<<< orphan*/ msg_status;
  int /*<<< orphan*/ status;
};

/* Variables and functions */
int sg_err_category_new(int /*<<< orphan*/, int /*<<< orphan*/,
                        int /*<<< orphan*/, int /*<<< orphan*/,
                        int /*<<< orphan*/, int /*<<< orphan*/);
int sg_err_category3(struct sg_io_hdr *hp) {
  return sg_err_category_new(hp->status, hp->msg_status, hp->host_status,
                             hp->driver_status, hp->sbp, hp->sb_len_wr);
}


x86 assembly (clang, -O0):
<sg_err_category3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%edi
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%esi
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%edx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%r8d
mov    -0x8(%rbp),%rax
mov    (%rax),%r9d
call   1030 <sg_err_category_new@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sg_err_category3>:
mov    0x14(%rdi),%eax
mov    0x10(%rdi),%esi
mov    0xc(%rdi),%edx
mov    0x8(%rdi),%ecx
mov    (%rdi),%r9d
mov    0x4(%rdi),%r8d
mov    %eax,%edi
jmp    1030 <sg_err_category_new@plt>

LLVM IR (-O0):
%struct.sg_io_hdr = type { i32, i32, i32, i32, i32, i32 }
define i32 @sg_err_category3(%struct.sg_io_hdr* %0) {
%2 = alloca %struct.sg_io_hdr*
store %struct.sg_io_hdr* %0, %struct.sg_io_hdr** %2
%3 = load %struct.sg_io_hdr*, %struct.sg_io_hdr** %2
%4 = getelementptr inbounds %struct.sg_io_hdr, %struct.sg_io_hdr* %3, i32 0, i32 5
%5 = load i32, i32* %4
%6 = load %struct.sg_io_hdr*, %struct.sg_io_hdr** %2
%7 = getelementptr inbounds %struct.sg_io_hdr, %struct.sg_io_hdr* %6, i32 0, i32 4
%8 = load i32, i32* %7
%9 = load %struct.sg_io_hdr*, %struct.sg_io_hdr** %2
%10 = getelementptr inbounds %struct.sg_io_hdr, %struct.sg_io_hdr* %9, i32 0, i32 3
%11 = load i32, i32* %10
%12 = load %struct.sg_io_hdr*, %struct.sg_io_hdr** %2
%13 = getelementptr inbounds %struct.sg_io_hdr, %struct.sg_io_hdr* %12, i32 0, i32 2
%14 = load i32, i32* %13
%15 = load %struct.sg_io_hdr*, %struct.sg_io_hdr** %2
%16 = getelementptr inbounds %struct.sg_io_hdr, %struct.sg_io_hdr* %15, i32 0, i32 1
%17 = load i32, i32* %16
%18 = load %struct.sg_io_hdr*, %struct.sg_io_hdr** %2
%19 = getelementptr inbounds %struct.sg_io_hdr, %struct.sg_io_hdr* %18, i32 0, i32 0
%20 = load i32, i32* %19
%21 = call i32 @sg_err_category_new(i32 %5, i32 %8, i32 %11, i32 %14, i32 %17, i32 %20)
ret i32 %21
}

LLVM IR (-O2):
%struct.sg_io_hdr = type { i32, i32, i32, i32, i32, i32 }
define i32 @sg_err_category3(%struct.sg_io_hdr* nocapture %0) {
%2 = getelementptr inbounds %struct.sg_io_hdr, %struct.sg_io_hdr* %0, i64 0, i32 5
%3 = load i32, i32* %2
%4 = getelementptr inbounds %struct.sg_io_hdr, %struct.sg_io_hdr* %0, i64 0, i32 4
%5 = load i32, i32* %4
%6 = getelementptr inbounds %struct.sg_io_hdr, %struct.sg_io_hdr* %0, i64 0, i32 3
%7 = load i32, i32* %6
%8 = getelementptr inbounds %struct.sg_io_hdr, %struct.sg_io_hdr* %0, i64 0, i32 2
%9 = load i32, i32* %8
%10 = getelementptr inbounds %struct.sg_io_hdr, %struct.sg_io_hdr* %0, i64 0, i32 1
%11 = load i32, i32* %10
%12 = getelementptr inbounds %struct.sg_io_hdr, %struct.sg_io_hdr* %0, i64 0, i32 0
%13 = load i32, i32* %12
%14 = tail call i32 @sg_err_category_new(i32 %3, i32 %5, i32 %7, i32 %9, i32 %11, i32 %13)
ret i32 %14
}