#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 member_0;
  int member_1;
  int member_2;
  int member_3;
  int member_4;
  int l_start;
  int l_len;
  int l_type;
  int l_whence;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  struct flock lock = {1, 2, 3, 4, 5};
  if (lock.l_start == 1 && lock.l_len == 2 && lock.l_type == 4 &&
      lock.l_whence == 5) {
    printf("flock_type=bsd\n");
    return 0;
  }
  if (lock.l_type == 1 && lock.l_whence == 2 && lock.l_start == 3 &&
      lock.l_len == 4) {
    printf("flock_type=linux\n");
    return 0;
  }
  printf("flock_type=unknown\n");
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x38(%rbp),%rdi
xor    %esi,%esi
mov    $0x24,%edx
call   1040 <memset@plt>
movl   $0x1,-0x38(%rbp)
movl   $0x2,-0x34(%rbp)
movl   $0x3,-0x30(%rbp)
movl   $0x4,-0x2c(%rbp)
movl   $0x5,-0x28(%rbp)
cmpl   $0x1,-0x24(%rbp)
jne    11a9 <main+0x89>
cmpl   $0x2,-0x20(%rbp)
jne    11a9 <main+0x89>
cmpl   $0x4,-0x1c(%rbp)
jne    11a9 <main+0x89>
cmpl   $0x5,-0x18(%rbp)
jne    11a9 <main+0x89>
lea    0xe68(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11fc <main+0xdc>
cmpl   $0x1,-0x1c(%rbp)
jne    11e9 <main+0xc9>
cmpl   $0x2,-0x18(%rbp)
jne    11e9 <main+0xc9>
cmpl   $0x3,-0x24(%rbp)
jne    11e9 <main+0xc9>
cmpl   $0x4,-0x20(%rbp)
jne    11e9 <main+0xc9>
lea    0xe38(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11fc <main+0xdc>
lea    0xe32(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.flock = type { i32, i32, i32, i32, i32, i32, i32, i32, i32 }
@.str = [16 x i8] c"flock_type=bsd\0A\00"
@.str.1 = [18 x i8] c"flock_type=linux\0A\00"
@.str.2 = [20 x i8] c"flock_type=unknown\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.flock
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast %struct.flock* %6 to i8*
%8 = bitcast i8* %7 to %struct.flock*
%9 = getelementptr inbounds %struct.flock, %struct.flock* %8, i32 0, i32 0
store i32 1, i32* %9
%10 = getelementptr inbounds %struct.flock, %struct.flock* %8, i32 0, i32 1
store i32 2, i32* %10
%11 = getelementptr inbounds %struct.flock, %struct.flock* %8, i32 0, i32 2
store i32 3, i32* %11
%12 = getelementptr inbounds %struct.flock, %struct.flock* %8, i32 0, i32 3
store i32 4, i32* %12
%13 = getelementptr inbounds %struct.flock, %struct.flock* %8, i32 0, i32 4
store i32 5, i32* %13
%14 = getelementptr inbounds %struct.flock, %struct.flock* %6, i32 0, i32 5
%15 = load i32, i32* %14
%16 = icmp eq i32 %15, 1
br i1 %16, label %17, label %31
17: ; preds = %2
%18 = getelementptr inbounds %struct.flock, %struct.flock* %6, i32 0, i32 6
%19 = load i32, i32* %18
%20 = icmp eq i32 %19, 2
br i1 %20, label %21, label %31
21: ; preds = %17
%22 = getelementptr inbounds %struct.flock, %struct.flock* %6, i32 0, i32 7
%23 = load i32, i32* %22
%24 = icmp eq i32 %23, 4
br i1 %24, label %25, label %31
25: ; preds = %21
%26 = getelementptr inbounds %struct.flock, %struct.flock* %6, i32 0, i32 8
%27 = load i32, i32* %26
%28 = icmp eq i32 %27, 5
br i1 %28, label %29, label %31
29: ; preds = %25
%30 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %51
31: ; preds = %25, %21, %17, %2
%32 = getelementptr inbounds %struct.flock, %struct.flock* %6, i32 0, i32 7
%33 = load i32, i32* %32
%34 = icmp eq i32 %33, 1
br i1 %34, label %35, label %49
35: ; preds = %31
%36 = getelementptr inbounds %struct.flock, %struct.flock* %6, i32 0, i32 8
%37 = load i32, i32* %36
%38 = icmp eq i32 %37, 2
br i1 %38, label %39, label %49
39: ; preds = %35
%40 = getelementptr inbounds %struct.flock, %struct.flock* %6, i32 0, i32 5
%41 = load i32, i32* %40
%42 = icmp eq i32 %41, 3
br i1 %42, label %43, label %49
43: ; preds = %39
%44 = getelementptr inbounds %struct.flock, %struct.flock* %6, i32 0, i32 6
%45 = load i32, i32* %44
%46 = icmp eq i32 %45, 4
br i1 %46, label %47, label %49
47: ; preds = %43
%48 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %51
49: ; preds = %43, %39, %35, %31
%50 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %3
br label %51
51: ; preds = %49, %47, %29
%52 = load i32, i32* %3
ret i32 %52
}

LLVM IR (-O2):
@str = [19 x i8] c"flock_type=unknown\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret i32 1
}