#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 udev {
  int dummy;
};
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(struct udev *, int /*<<< orphan*/, int /*<<< orphan*/,
                        int /*<<< orphan*/, int /*<<< orphan*/,
                        int /*<<< orphan*/, int /*<<< orphan*/);
int sg_err_category3(struct udev *udev, struct sg_io_hdr *hp) {
  return sg_err_category_new(udev, 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    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x14(%rax),%esi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%edx
mov    -0x10(%rbp),%rax
mov    0xc(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%r8d
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%r9d
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,(%rsp)
call   1030 <sg_err_category_new@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sg_err_category3>:
push   %rax
mov    0x14(%rsi),%r10d
mov    0x10(%rsi),%edx
mov    0xc(%rsi),%ecx
mov    0x8(%rsi),%r8d
mov    (%rsi),%eax
mov    0x4(%rsi),%r9d
mov    %eax,(%rsp)
mov    %r10d,%esi
call   1030 <sg_err_category_new@plt>
pop    %rcx
ret

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

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