#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 flock {
  int l_type;
  int l_whence;
  int l_pid;
  scalar_t__ l_len;
  scalar_t__ l_start;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void show_lock_info(struct flock *to_show) {
  printf("\tl_type %d, ", to_show->l_type);
  printf("l_whence %d, ", to_show->l_whence);
  printf("l_start %d, ", (int)to_show->l_start);
  printf("l_len %d, ", (int)to_show->l_len);
  printf("l_pid %d\n", to_show->l_pid);
}


x86 assembly (clang, -O0):
<show_lock_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%esi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rax
mov    %eax,%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rax
mov    %eax,%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_lock_info>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%esi
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
mov    0x4(%rbx),%esi
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    0x18(%rbx),%esi
lea    0xee0(%rip),%rdi
call   1030 <printf@plt>
mov    0x10(%rbx),%esi
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
mov    0x8(%rbx),%esi
lea    0xeda(%rip),%rdi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.flock = type { i32, i32, i32, i64, i64 }
@.str = [13 x i8] c"\09l_type %d, \00"
@.str.1 = [14 x i8] c"l_whence %d, \00"
@.str.2 = [13 x i8] c"l_start %d, \00"
@.str.3 = [11 x i8] c"l_len %d, \00"
@.str.4 = [10 x i8] c"l_pid %d\0A\00"
define void @show_lock_info(%struct.flock* %0) {
%2 = alloca %struct.flock*
store %struct.flock* %0, %struct.flock** %2
%3 = load %struct.flock*, %struct.flock** %2
%4 = getelementptr inbounds %struct.flock, %struct.flock* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load %struct.flock*, %struct.flock** %2
%8 = getelementptr inbounds %struct.flock, %struct.flock* %7, i32 0, i32 1
%9 = load i32, i32* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = load %struct.flock*, %struct.flock** %2
%12 = getelementptr inbounds %struct.flock, %struct.flock* %11, i32 0, i32 4
%13 = load i64, i64* %12
%14 = trunc i64 %13 to i32
%15 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %14)
%16 = load %struct.flock*, %struct.flock** %2
%17 = getelementptr inbounds %struct.flock, %struct.flock* %16, i32 0, i32 3
%18 = load i64, i64* %17
%19 = trunc i64 %18 to i32
%20 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %19)
%21 = load %struct.flock*, %struct.flock** %2
%22 = getelementptr inbounds %struct.flock, %struct.flock* %21, i32 0, i32 2
%23 = load i32, i32* %22
%24 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %23)
ret void
}

LLVM IR (-O2):
%struct.flock = type { i32, i32, i32, i64, i64 }
@.str = [13 x i8] c"\09l_type %d, \00"
@.str.1 = [14 x i8] c"l_whence %d, \00"
@.str.2 = [13 x i8] c"l_start %d, \00"
@.str.3 = [11 x i8] c"l_len %d, \00"
@.str.4 = [10 x i8] c"l_pid %d\0A\00"
define void @show_lock_info(%struct.flock* nocapture %0) {
%2 = getelementptr inbounds %struct.flock, %struct.flock* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = getelementptr inbounds %struct.flock, %struct.flock* %0, i64 0, i32 1
%6 = load i32, i32* %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds %struct.flock, %struct.flock* %0, i64 0, i32 4
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %10)
%12 = getelementptr inbounds %struct.flock, %struct.flock* %0, i64 0, i32 3
%13 = load i64, i64* %12
%14 = trunc i64 %13 to i32
%15 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %14)
%16 = getelementptr inbounds %struct.flock, %struct.flock* %0, i64 0, i32 2
%17 = load i32, i32* %16
%18 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %17)
ret void
}