#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_start;
  int l_len;
  int l_pid;
};

/* 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, ", to_show->l_start);
  printf("l_len %d, ", 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    0x8(%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%esi
lea    0xebe(%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    0x8(%rbx),%esi
lea    0xee0(%rip),%rdi
call   1030 <printf@plt>
mov    0xc(%rbx),%esi
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
mov    0x10(%rbx),%esi
lea    0xeda(%rip),%rdi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.flock = type { i32, i32, i32, i32, i32 }
@.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 2
%13 = load i32, i32* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %13)
%15 = load %struct.flock*, %struct.flock** %2
%16 = getelementptr inbounds %struct.flock, %struct.flock* %15, i32 0, i32 3
%17 = load i32, i32* %16
%18 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %17)
%19 = load %struct.flock*, %struct.flock** %2
%20 = getelementptr inbounds %struct.flock, %struct.flock* %19, i32 0, i32 4
%21 = load i32, i32* %20
%22 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %21)
ret void
}

LLVM IR (-O2):
%struct.flock = type { i32, i32, i32, i32, i32 }
@.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 2
%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), i32 %9)
%11 = getelementptr inbounds %struct.flock, %struct.flock* %0, i64 0, i32 3
%12 = load i32, i32* %11
%13 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %12)
%14 = getelementptr inbounds %struct.flock, %struct.flock* %0, i64 0, i32 4
%15 = load i32, i32* %14
%16 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %15)
ret void
}