#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 */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned int _fileno;
  scalar_t__ _flags;
};
typedef TYPE_1__ FILE;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, unsigned int);
void show_struct(FILE *fp) {
  if (NULL == fp) {
    return;
  }
  printf("%15s = [%X]\n", "_flags", (unsigned int)fp->_flags);
  printf("%15s = [%d]\n", "_fileno", fp->_fileno);
}


x86 assembly (clang, -O0):
<show_struct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
jne    112d <show_struct+0x1d>
jmp    1163 <show_struct+0x53>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %eax,%edx
lea    0xec2(%rip),%rdi
lea    0xec8(%rip),%rsi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
lea    0xebd(%rip),%rdi
lea    0xec3(%rip),%rsi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_struct>:
test   %rdi,%rdi
je     1145 <show_struct+0x35>
push   %rbx
mov    %rdi,%rbx
mov    0x8(%rdi),%edx
lea    0xedd(%rip),%rdi
lea    0xee3(%rip),%rsi
call   1030 <printf@plt>
mov    (%rbx),%edx
lea    0xedc(%rip),%rdi
lea    0xee2(%rip),%rsi
pop    %rbx
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i64 }
@.str = [13 x i8] c"%15s = [%X]\0A\00"
@.str.1 = [7 x i8] c"_flags\00"
@.str.2 = [13 x i8] c"%15s = [%d]\0A\00"
@.str.3 = [8 x i8] c"_fileno\00"
define void @show_struct(%struct.TYPE_3__* %0) {
%2 = alloca %struct.TYPE_3__*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %2
%3 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%4 = icmp eq %struct.TYPE_3__* null, %3
br i1 %4, label %5, label %6
5: ; preds = %1
br label %16
6: ; preds = %1
%7 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%8 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %7, i32 0, i32 1
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%13 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %12, i32 0, i32 0
%14 = load i32, i32* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32, i64 }
@.str = [13 x i8] c"%15s = [%X]\0A\00"
@.str.1 = [7 x i8] c"_flags\00"
@.str.2 = [13 x i8] c"%15s = [%d]\0A\00"
@.str.3 = [8 x i8] c"_fileno\00"
define void @show_struct(%struct.TYPE_3__* %0) {
%2 = icmp eq %struct.TYPE_3__* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %1, %3
ret void
}