#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 stat {
  int /*<<< orphan*/ st_rdev;
  int /*<<< orphan*/ st_dev;
};

/* Variables and functions */
int /*<<< orphan*/ LOG_INFO;
int O_CREAT;
int O_EXCL;
int O_WRONLY;
scalar_t__ check_lock_status(char const *);
int /*<<< orphan*/ close(int);
scalar_t__ major(int /*<<< orphan*/);
scalar_t__ minor(int /*<<< orphan*/);
int open(char *, int, int);
int /*<<< orphan*/ sprintf(char *, char *, ...);
scalar_t__ stat(char const *, struct stat *);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *);
int /*<<< orphan*/ write(int, char *, int);
int uucp_lock(const char *filename, int pid) {
  char lockfilename[80], lockinfo[12], message[80];
  char name[80];
  int fd;
  struct stat buf;
  sprintf(message, "uucp_lock( %s );\n", filename);
  syslog(LOG_INFO, message);
  if (check_lock_status(filename)) {
    syslog(LOG_INFO, "RXTX uucp check_lock_status true\n");
    return 1;
  }
  if (stat("/var/lock", &buf) != 0) {
    syslog(LOG_INFO, "RXTX uucp_lock() could not find lock directory.\n");
    return 1;
  }
  if (stat(filename, &buf) != 0) {
    syslog(LOG_INFO, "RXTX uucp_lock() could not find device.\n");
    sprintf(message, "uucp_lock: device was %s\n", name);
    syslog(LOG_INFO, message);
    sprintf(message, "Filename is : %s \n", filename);
    syslog(LOG_INFO, message);
    return 1;
  }
  sprintf(lockfilename, "%s/LK.%03d.%03d.%03d", "/var/lock",
          (int)major(buf.st_dev), (int)major(buf.st_rdev),
          (int)minor(buf.st_rdev));
  sprintf(lockinfo, "%10d\n", pid);
  if (stat(lockfilename, &buf) == 0) {
    sprintf(message, "RXTX uucp_lock() %s is there\n", lockfilename);
    syslog(LOG_INFO, message);
    syslog(LOG_INFO, message);
    return 1;
  }
  fd = open(lockfilename, O_CREAT | O_WRONLY | O_EXCL, 0444);
  if (fd < 0) {
    sprintf(message, "RXTX uucp_lock() Error: creating lock file: %s\n",
            lockfilename);
    syslog(LOG_INFO, message);
    return 1;
  }
  write(fd, lockinfo, 11);
  close(fd);
  return 0;
}


x86 assembly (clang, -O0):
<uucp_lock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
lea    -0xd0(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe4c(%rip),%rsi
mov    $0x0,%al
call   10b0 <sprintf@plt>
mov    0x2e0e(%rip),%rax
mov    (%rax),%edi
lea    -0xd0(%rbp),%rsi
call   1090 <syslog@plt>
mov    -0x10(%rbp),%rdi
call   1060 <check_lock_status@plt>
cmp    $0x0,%rax
je     1204 <uucp_lock+0x74>
mov    0x2de6(%rip),%rax
mov    (%rax),%edi
lea    0xe1f(%rip),%rsi
call   1090 <syslog@plt>
movl   $0x1,-0x4(%rbp)
jmp    145a <uucp_lock+0x2ca>
lea    0xe29(%rip),%rdi
lea    -0x130(%rbp),%rsi
call   1080 <stat@plt>
cmp    $0x0,%rax
je     1242 <uucp_lock+0xb2>
mov    0x2da8(%rip),%rax
mov    (%rax),%edi
lea    0xe0d(%rip),%rsi
call   1090 <syslog@plt>
movl   $0x1,-0x4(%rbp)
jmp    145a <uucp_lock+0x2ca>
mov    -0x10(%rbp),%rdi
lea    -0x130(%rbp),%rsi
call   1080 <stat@plt>
cmp    $0x0,%rax
je     12dc <uucp_lock+0x14c>
mov    0x2d6d(%rip),%rax
mov    (%rax),%edi
lea    0xe03(%rip),%rsi
call   1090 <syslog@plt>
lea    -0xd0(%rbp),%rdi
lea    -0x120(%rbp),%rdx
lea    0xe12(%rip),%rsi
mov    $0x0,%al
call   10b0 <sprintf@plt>
mov    0x2d3c(%rip),%rax
mov    (%rax),%edi
lea    -0xd0(%rbp),%rsi
call   1090 <syslog@plt>
lea    -0xd0(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xdfe(%rip),%rsi
mov    $0x0,%al
call   10b0 <sprintf@plt>
mov    0x2d0e(%rip),%rax
mov    (%rax),%edi
lea    -0xd0(%rbp),%rsi
call   1090 <syslog@plt>
movl   $0x1,-0x4(%rbp)
jmp    145a <uucp_lock+0x2ca>
lea    -0x70(%rbp),%rax
mov    %rax,-0x140(%rbp)
mov    -0x12c(%rbp),%edi
call   1050 <major@plt>
mov    %eax,-0x138(%rbp)
mov    -0x130(%rbp),%edi
call   1050 <major@plt>
mov    %eax,-0x134(%rbp)
mov    -0x130(%rbp),%edi
call   1040 <minor@plt>
mov    -0x140(%rbp),%rdi
mov    -0x138(%rbp),%ecx
mov    -0x134(%rbp),%r8d
mov    %eax,%r9d
lea    0xd93(%rip),%rsi
lea    0xcfb(%rip),%rdx
mov    $0x0,%al
call   10b0 <sprintf@plt>
lea    -0x7c(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xd8c(%rip),%rsi
mov    $0x0,%al
call   10b0 <sprintf@plt>
lea    -0x70(%rbp),%rdi
lea    -0x130(%rbp),%rsi
call   1080 <stat@plt>
cmp    $0x0,%rax
jne    13be <uucp_lock+0x22e>
lea    -0xd0(%rbp),%rdi
lea    -0x70(%rbp),%rdx
lea    0xd5f(%rip),%rsi
mov    $0x0,%al
call   10b0 <sprintf@plt>
mov    0x2c41(%rip),%rax
mov    (%rax),%edi
lea    -0xd0(%rbp),%rsi
call   1090 <syslog@plt>
mov    0x2c2c(%rip),%rax
mov    (%rax),%edi
lea    -0xd0(%rbp),%rsi
call   1090 <syslog@plt>
movl   $0x1,-0x4(%rbp)
jmp    145a <uucp_lock+0x2ca>
lea    -0x70(%rbp),%rdi
mov    0x2c2f(%rip),%rax
mov    (%rax),%esi
mov    0x2bee(%rip),%rax
or     (%rax),%esi
mov    0x2bfd(%rip),%rax
or     (%rax),%esi
mov    $0x124,%edx
call   10a0 <open@plt>
mov    %eax,-0x124(%rbp)
cmpl   $0x0,-0x124(%rbp)
jge    1434 <uucp_lock+0x2a4>
lea    -0xd0(%rbp),%rdi
lea    -0x70(%rbp),%rdx
lea    0xcf2(%rip),%rsi
mov    $0x0,%al
call   10b0 <sprintf@plt>
mov    0x2bb6(%rip),%rax
mov    (%rax),%edi
lea    -0xd0(%rbp),%rsi
call   1090 <syslog@plt>
movl   $0x1,-0x4(%rbp)
jmp    145a <uucp_lock+0x2ca>
mov    -0x124(%rbp),%edi
lea    -0x7c(%rbp),%rsi
mov    $0xb,%edx
call   1030 <write@plt>
mov    -0x124(%rbp),%edi
call   1070 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uucp_lock>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xc0,%rsp
mov    %esi,%r14d
mov    %rdi,%rbx
lea    0xe54(%rip),%rsi
lea    0x70(%rsp),%rbp
mov    %rbp,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   10b0 <sprintf@plt>
mov    0x2e0b(%rip),%r12
mov    (%r12),%edi
mov    %rbp,%rsi
call   1090 <syslog@plt>
mov    %rbx,%rdi
call   1060 <check_lock_status@plt>
test   %rax,%rax
je     11ee <uucp_lock+0x5e>
mov    (%r12),%edi
lea    0xe29(%rip),%rsi
jmp    1382 <uucp_lock+0x1f2>
lea    0xe3f(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1080 <stat@plt>
test   %rax,%rax
je     1214 <uucp_lock+0x84>
mov    (%r12),%edi
lea    0xe2f(%rip),%rsi
jmp    1382 <uucp_lock+0x1f2>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1080 <stat@plt>
test   %rax,%rax
je     127d <uucp_lock+0xed>
mov    (%r12),%edi
lea    0xe3e(%rip),%rsi
call   1090 <syslog@plt>
lea    0xe5b(%rip),%rsi
lea    0x70(%rsp),%rbp
lea    0x20(%rsp),%rdx
mov    %rbp,%rdi
xor    %eax,%eax
call   10b0 <sprintf@plt>
mov    (%r12),%edi
mov    %rbp,%rsi
call   1090 <syslog@plt>
lea    0xe4e(%rip),%rsi
mov    %rbp,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   10b0 <sprintf@plt>
mov    (%r12),%edi
mov    %rbp,%rsi
jmp    1382 <uucp_lock+0x1f2>
mov    0xc(%rsp),%edi
call   1050 <major@plt>
mov    %rax,%rbx
mov    0x8(%rsp),%edi
call   1050 <major@plt>
mov    %rax,%rbp
mov    0x8(%rsp),%edi
call   1040 <minor@plt>
lea    0xe20(%rip),%rsi
lea    0xd88(%rip),%rdx
lea    0x20(%rsp),%r15
mov    %r15,%rdi
mov    %ebx,%ecx
mov    %ebp,%r8d
mov    %eax,%r9d
xor    %eax,%eax
call   10b0 <sprintf@plt>
lea    0xe10(%rip),%rsi
lea    0x14(%rsp),%rdi
mov    %r14d,%edx
xor    %eax,%eax
call   10b0 <sprintf@plt>
lea    0x8(%rsp),%rsi
mov    %r15,%rdi
call   1080 <stat@plt>
test   %rax,%rax
je     1337 <uucp_lock+0x1a7>
mov    0x2d06(%rip),%rax
mov    0x2cc7(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2cd4(%rip),%rax
or     (%rax),%esi
lea    0x20(%rsp),%rdi
mov    $0x124,%edx
call   10a0 <open@plt>
test   %eax,%eax
js     1360 <uucp_lock+0x1d0>
mov    %eax,%ebx
lea    0x14(%rsp),%rsi
mov    %eax,%edi
mov    $0xb,%edx
call   1030 <write@plt>
mov    %ebx,%edi
call   1070 <close@plt>
xor    %eax,%eax
jmp    138c <uucp_lock+0x1fc>
lea    0xda2(%rip),%rsi
lea    0x70(%rsp),%rbx
lea    0x20(%rsp),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   10b0 <sprintf@plt>
mov    (%r12),%edi
mov    %rbx,%rsi
call   1090 <syslog@plt>
jmp    137b <uucp_lock+0x1eb>
lea    0xd97(%rip),%rsi
lea    0x70(%rsp),%rbx
lea    0x20(%rsp),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   10b0 <sprintf@plt>
mov    (%r12),%edi
mov    %rbx,%rsi
call   1090 <syslog@plt>
mov    $0x1,%eax
add    $0xc0,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.stat = type { i32, i32 }
@.str = [18 x i8] c"uucp_lock( %s );\0A\00"
@LOG_INFO = global i32 0
@.str.1 = [34 x i8] c"RXTX uucp check_lock_status true\0A\00"
@.str.2 = [10 x i8] c"/var/lock\00"
@.str.3 = [49 x i8] c"RXTX uucp_lock() could not find lock directory.\0A\00"
@.str.4 = [41 x i8] c"RXTX uucp_lock() could not find device.\0A\00"
@.str.5 = [26 x i8] c"uucp_lock: device was %s\0A\00"
@.str.6 = [19 x i8] c"Filename is : %s \0A\00"
@.str.7 = [21 x i8] c"%s/LK.%03d.%03d.%03d\00"
@.str.8 = [6 x i8] c"%10d\0A\00"
@.str.9 = [30 x i8] c"RXTX uucp_lock() %s is there\0A\00"
@O_CREAT = global i32 0
@O_WRONLY = global i32 0
@O_EXCL = global i32 0
@.str.10 = [48 x i8] c"RXTX uucp_lock() Error: creating lock file: %s\0A\00"
define i32 @uucp_lock(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca [80 x i8]
%7 = alloca [12 x i8]
%8 = alloca [80 x i8]
%9 = alloca [80 x i8]
%10 = alloca i32
%11 = alloca %struct.stat
store i8* %0, i8** %4
store i32 %1, i32* %5
%12 = getelementptr inbounds [80 x i8], [80 x i8]* %8, i64 0, i64 0
%13 = load i8*, i8** %4
%14 = call i32 (i8*, i8*, ...) @sprintf(i8* %12, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = load i32, i32* @LOG_INFO
%16 = getelementptr inbounds [80 x i8], [80 x i8]* %8, i64 0, i64 0
%17 = call i32 @syslog(i32 %15, i8* %16)
%18 = load i8*, i8** %4
%19 = call i64 @check_lock_status(i8* %18)
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %2
%22 = load i32, i32* @LOG_INFO
%23 = call i32 @syslog(i32 %22, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
br label %103
24: ; preds = %2
%25 = call i64 @stat(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), %struct.stat* %11)
%26 = icmp ne i64 %25, 0
br i1 %26, label %27, label %30
27: ; preds = %24
%28 = load i32, i32* @LOG_INFO
%29 = call i32 @syslog(i32 %28, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %3
br label %103
30: ; preds = %24
%31 = load i8*, i8** %4
%32 = call i64 @stat(i8* %31, %struct.stat* %11)
%33 = icmp ne i64 %32, 0
br i1 %33, label %34, label %49
34: ; preds = %30
%35 = load i32, i32* @LOG_INFO
%36 = call i32 @syslog(i32 %35, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0))
%37 = getelementptr inbounds [80 x i8], [80 x i8]* %8, i64 0, i64 0
%38 = getelementptr inbounds [80 x i8], [80 x i8]* %9, i64 0, i64 0
%39 = call i32 (i8*, i8*, ...) @sprintf(i8* %37, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i8* %38)
%40 = load i32, i32* @LOG_INFO
%41 = getelementptr inbounds [80 x i8], [80 x i8]* %8, i64 0, i64 0
%42 = call i32 @syslog(i32 %40, i8* %41)
%43 = getelementptr inbounds [80 x i8], [80 x i8]* %8, i64 0, i64 0
%44 = load i8*, i8** %4
%45 = call i32 (i8*, i8*, ...) @sprintf(i8* %43, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i8* %44)
%46 = load i32, i32* @LOG_INFO
%47 = getelementptr inbounds [80 x i8], [80 x i8]* %8, i64 0, i64 0
%48 = call i32 @syslog(i32 %46, i8* %47)
store i32 1, i32* %3
br label %103
49: ; preds = %30
%50 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%51 = getelementptr inbounds %struct.stat, %struct.stat* %11, i32 0, i32 1
%52 = load i32, i32* %51
%53 = call i64 @major(i32 %52)
%54 = trunc i64 %53 to i32
%55 = getelementptr inbounds %struct.stat, %struct.stat* %11, i32 0, i32 0
%56 = load i32, i32* %55
%57 = call i64 @major(i32 %56)
%58 = trunc i64 %57 to i32
%59 = getelementptr inbounds %struct.stat, %struct.stat* %11, i32 0, i32 0
%60 = load i32, i32* %59
%61 = call i64 @minor(i32 %60)
%62 = trunc i64 %61 to i32
%63 = call i32 (i8*, i8*, ...) @sprintf(i8* %50, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %54, i32 %58, i32 %62)
%64 = getelementptr inbounds [12 x i8], [12 x i8]* %7, i64 0, i64 0
%65 = load i32, i32* %5
%66 = call i32 (i8*, i8*, ...) @sprintf(i8* %64, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i32 %65)
%67 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%68 = call i64 @stat(i8* %67, %struct.stat* %11)
%69 = icmp eq i64 %68, 0
br i1 %69, label %70, label %80
70: ; preds = %49
%71 = getelementptr inbounds [80 x i8], [80 x i8]* %8, i64 0, i64 0
%72 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%73 = call i32 (i8*, i8*, ...) @sprintf(i8* %71, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.9, i64 0, i64 0), i8* %72)
%74 = load i32, i32* @LOG_INFO
%75 = getelementptr inbounds [80 x i8], [80 x i8]* %8, i64 0, i64 0
%76 = call i32 @syslog(i32 %74, i8* %75)
%77 = load i32, i32* @LOG_INFO
%78 = getelementptr inbounds [80 x i8], [80 x i8]* %8, i64 0, i64 0
%79 = call i32 @syslog(i32 %77, i8* %78)
store i32 1, i32* %3
br label %103
80: ; preds = %49
%81 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%82 = load i32, i32* @O_CREAT
%83 = load i32, i32* @O_WRONLY
%84 = or i32 %82, %83
%85 = load i32, i32* @O_EXCL
%86 = or i32 %84, %85
%87 = call i32 @open(i8* %81, i32 %86, i32 292)
store i32 %87, i32* %10
%88 = load i32, i32* %10
%89 = icmp slt i32 %88, 0
br i1 %89, label %90, label %97
90: ; preds = %80
%91 = getelementptr inbounds [80 x i8], [80 x i8]* %8, i64 0, i64 0
%92 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%93 = call i32 (i8*, i8*, ...) @sprintf(i8* %91, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.10, i64 0, i64 0), i8* %92)
%94 = load i32, i32* @LOG_INFO
%95 = getelementptr inbounds [80 x i8], [80 x i8]* %8, i64 0, i64 0
%96 = call i32 @syslog(i32 %94, i8* %95)
store i32 1, i32* %3
br label %103
97: ; preds = %80
%98 = load i32, i32* %10
%99 = getelementptr inbounds [12 x i8], [12 x i8]* %7, i64 0, i64 0
%100 = call i32 @write(i32 %98, i8* %99, i32 11)
%101 = load i32, i32* %10
%102 = call i32 @close(i32 %101)
store i32 0, i32* %3
br label %103
103: ; preds = %97, %90, %70, %34, %27, %21
%104 = load i32, i32* %3
ret i32 %104
}

LLVM IR (-O2):
%struct.stat = type { i32, i32 }
@.str = [18 x i8] c"uucp_lock( %s );\0A\00"
@LOG_INFO = global i32 0
@.str.1 = [34 x i8] c"RXTX uucp check_lock_status true\0A\00"
@.str.2 = [10 x i8] c"/var/lock\00"
@.str.3 = [49 x i8] c"RXTX uucp_lock() could not find lock directory.\0A\00"
@.str.4 = [41 x i8] c"RXTX uucp_lock() could not find device.\0A\00"
@.str.5 = [26 x i8] c"uucp_lock: device was %s\0A\00"
@.str.6 = [19 x i8] c"Filename is : %s \0A\00"
@.str.7 = [21 x i8] c"%s/LK.%03d.%03d.%03d\00"
@.str.8 = [6 x i8] c"%10d\0A\00"
@.str.9 = [30 x i8] c"RXTX uucp_lock() %s is there\0A\00"
@O_CREAT = global i32 0
@O_WRONLY = global i32 0
@O_EXCL = global i32 0
@.str.10 = [48 x i8] c"RXTX uucp_lock() Error: creating lock file: %s\0A\00"
define i32 @uucp_lock(i8* %0, i32 %1) {
%3 = alloca [80 x i8]
%4 = alloca [12 x i8]
%5 = alloca [80 x i8]
%6 = alloca [80 x i8]
%7 = alloca %struct.stat
%8 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%9 = getelementptr inbounds [12 x i8], [12 x i8]* %4, i64 0, i64 0
%10 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%11 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%12 = bitcast %struct.stat* %7 to i8*
%13 = call i32 (i8*, i8*, ...) @sprintf(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
%14 = load i32, i32* @LOG_INFO
%15 = call i32 @syslog(i32 %14, i8* %10)
%16 = call i64 @check_lock_status(i8* %0)
%17 = icmp eq i64 %16, 0
br i1 %17, label %21, label %18
18: ; preds = %2
%19 = load i32, i32* @LOG_INFO
%20 = call i32 @syslog(i32 %19, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
br label %76
21: ; preds = %2
%22 = call i64 @stat(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), %struct.stat* %7)
%23 = icmp eq i64 %22, 0
br i1 %23, label %27, label %24
24: ; preds = %21
%25 = load i32, i32* @LOG_INFO
%26 = call i32 @syslog(i32 %25, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0))
br label %76
27: ; preds = %21
%28 = call i64 @stat(i8* %0, %struct.stat* %7)
%29 = icmp eq i64 %28, 0
br i1 %29, label %39, label %30
30: ; preds = %27
%31 = load i32, i32* @LOG_INFO
%32 = call i32 @syslog(i32 %31, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0))
%33 = call i32 (i8*, i8*, ...) @sprintf(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i8* %11)
%34 = load i32, i32* @LOG_INFO
%35 = call i32 @syslog(i32 %34, i8* %10)
%36 = call i32 (i8*, i8*, ...) @sprintf(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i8* %0)
%37 = load i32, i32* @LOG_INFO
%38 = call i32 @syslog(i32 %37, i8* %10)
br label %76
39: ; preds = %27
%40 = getelementptr inbounds %struct.stat, %struct.stat* %7, i64 0, i32 1
%41 = load i32, i32* %40
%42 = call i64 @major(i32 %41)
%43 = trunc i64 %42 to i32
%44 = getelementptr inbounds %struct.stat, %struct.stat* %7, i64 0, i32 0
%45 = load i32, i32* %44
%46 = call i64 @major(i32 %45)
%47 = trunc i64 %46 to i32
%48 = load i32, i32* %44
%49 = call i64 @minor(i32 %48)
%50 = trunc i64 %49 to i32
%51 = call i32 (i8*, i8*, ...) @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %43, i32 %47, i32 %50)
%52 = call i32 (i8*, i8*, ...) @sprintf(i8* %9, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i32 %1)
%53 = call i64 @stat(i8* %8, %struct.stat* %7)
%54 = icmp eq i64 %53, 0
br i1 %54, label %55, label %61
55: ; preds = %39
%56 = call i32 (i8*, i8*, ...) @sprintf(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.9, i64 0, i64 0), i8* %8)
%57 = load i32, i32* @LOG_INFO
%58 = call i32 @syslog(i32 %57, i8* %10)
%59 = load i32, i32* @LOG_INFO
%60 = call i32 @syslog(i32 %59, i8* %10)
br label %76
61: ; preds = %39
%62 = load i32, i32* @O_CREAT
%63 = load i32, i32* @O_WRONLY
%64 = or i32 %63, %62
%65 = load i32, i32* @O_EXCL
%66 = or i32 %64, %65
%67 = call i32 @open(i8* %8, i32 %66, i32 292)
%68 = icmp slt i32 %67, 0
br i1 %68, label %69, label %73
69: ; preds = %61
%70 = call i32 (i8*, i8*, ...) @sprintf(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.10, i64 0, i64 0), i8* %8)
%71 = load i32, i32* @LOG_INFO
%72 = call i32 @syslog(i32 %71, i8* %10)
br label %76
73: ; preds = %61
%74 = call i32 @write(i32 %67, i8* %9, i32 11)
%75 = call i32 @close(i32 %67)
br label %76
76: ; preds = %73, %69, %55, %30, %24, %18
%77 = phi i32 [ 1, %18 ], [ 1, %24 ], [ 1, %30 ], [ 1, %55 ], [ 1, %69 ], [ 0, %73 ]
ret i32 %77
}