#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 */

/* Variables and functions */
int O_CREAT;
int O_TRUNC;
int O_WRONLY;
int S_IROTH;
int S_IRUSR;
int S_IWOTH;
int S_IWUSR;
int /*<<< orphan*/ close(int);
int getZVMLogLevel();
int open(char *, int, int);
int /*<<< orphan*/ printf(char *, ...);
int write(int, char *, int);
void sendConfigOK() {
  int fd = open("/dev/out/xmlpipecreator", O_WRONLY | O_CREAT | O_TRUNC,
                S_IROTH | S_IWOTH | S_IRUSR | S_IWUSR);
  int bytewrite = 0;
  if (fd < 0) {
    return;
  }
  if ((bytewrite = write(fd, "OK", 2)) != 2) {
    printf("***Error write to CHECK_INDEXER_IND_DEV_NAME\n");
    close(fd);
    return;
  }
  if (getZVMLogLevel() >= 1) {
    printf("%s [LogLevel=%d] [%s], \t%"
           "s"
           " \n",
           "***ZVMLog", 1, "send OK to xmlpipe", "OK");
  };
  close(fd);
  return;
}


x86 assembly (clang, -O0):
<sendConfigOK>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2e51(%rip),%rax
mov    (%rax),%esi
mov    0x2e90(%rip),%rax
or     (%rax),%esi
mov    0x2e7f(%rip),%rax
or     (%rax),%esi
mov    0x2e4e(%rip),%rax
mov    (%rax),%edx
mov    0x2e25(%rip),%rax
or     (%rax),%edx
mov    0x2e34(%rip),%rax
or     (%rax),%edx
mov    0x2e43(%rip),%rax
or     (%rax),%edx
lea    0xe62(%rip),%rdi
call   1060 <open@plt>
mov    %eax,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    11bc <sendConfigOK+0x6c>
jmp    1237 <sendConfigOK+0xe7>
mov    -0x4(%rbp),%edi
lea    0xe52(%rip),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x2,%eax
je     11f7 <sendConfigOK+0xa7>
lea    0xe38(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
call   1050 <close@plt>
jmp    1237 <sendConfigOK+0xe7>
mov    $0x0,%al
call   1070 <getZVMLogLevel@plt>
cmp    $0x1,%eax
jl     122f <sendConfigOK+0xdf>
lea    0xe3b(%rip),%rdi
lea    0xe51(%rip),%rsi
mov    $0x1,%edx
lea    0xe4f(%rip),%rcx
lea    0xdf0(%rip),%r8
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
call   1050 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendConfigOK>:
push   %rbx
mov    0x2e48(%rip),%rax
mov    0x2e89(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2e76(%rip),%rax
or     (%rax),%esi
mov    0x2e45(%rip),%rax
mov    0x2e1e(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    0x2e2b(%rip),%rax
or     (%rax),%edx
mov    0x2e3a(%rip),%rax
or     (%rax),%edx
lea    0xe59(%rip),%rdi
call   1070 <open@plt>
test   %eax,%eax
js     11ff <sendConfigOK+0x9f>
mov    %eax,%ebx
lea    0xe5f(%rip),%rsi
mov    %eax,%edi
mov    $0x2,%edx
call   1040 <write@plt>
cmp    $0x2,%eax
jne    1201 <sendConfigOK+0xa1>
xor    %eax,%eax
call   1080 <getZVMLogLevel@plt>
test   %eax,%eax
jle    120d <sendConfigOK+0xad>
lea    0xe3f(%rip),%rdi
lea    0xe55(%rip),%rsi
lea    0xe58(%rip),%rcx
lea    0xe27(%rip),%r8
mov    $0x1,%edx
xor    %eax,%eax
call   1050 <printf@plt>
jmp    120d <sendConfigOK+0xad>
pop    %rbx
ret
lea    0xe4d(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1060 <close@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"/dev/out/xmlpipecreator\00"
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@O_TRUNC = global i32 0
@S_IROTH = global i32 0
@S_IWOTH = global i32 0
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@.str.1 = [3 x i8] c"OK\00"
@.str.2 = [46 x i8] c"***Error write to CHECK_INDEXER_IND_DEV_NAME\0A\00"
@.str.3 = [29 x i8] c"%s [LogLevel=%d] [%s], \09%s \0A\00"
@.str.4 = [10 x i8] c"***ZVMLog\00"
@.str.5 = [19 x i8] c"send OK to xmlpipe\00"
define void @sendConfigOK() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @O_WRONLY
%4 = load i32, i32* @O_CREAT
%5 = or i32 %3, %4
%6 = load i32, i32* @O_TRUNC
%7 = or i32 %5, %6
%8 = load i32, i32* @S_IROTH
%9 = load i32, i32* @S_IWOTH
%10 = or i32 %8, %9
%11 = load i32, i32* @S_IRUSR
%12 = or i32 %10, %11
%13 = load i32, i32* @S_IWUSR
%14 = or i32 %12, %13
%15 = call i32 @open(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %14)
store i32 %15, i32* %1
store i32 0, i32* %2
%16 = load i32, i32* %1
%17 = icmp slt i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %0
br label %35
19: ; preds = %0
%20 = load i32, i32* %1
%21 = call i32 @write(i32 %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 2)
store i32 %21, i32* %2
%22 = icmp ne i32 %21, 2
br i1 %22, label %23, label %27
23: ; preds = %19
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0))
%25 = load i32, i32* %1
%26 = call i32 @close(i32 %25)
br label %35
27: ; preds = %19
%28 = call i32 (...) @getZVMLogLevel()
%29 = icmp sge i32 %28, 1
br i1 %29, label %30, label %32
30: ; preds = %27
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %32
32: ; preds = %30, %27
%33 = load i32, i32* %1
%34 = call i32 @close(i32 %33)
br label %35
35: ; preds = %32, %23, %18
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"/dev/out/xmlpipecreator\00"
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@O_TRUNC = global i32 0
@S_IROTH = global i32 0
@S_IWOTH = global i32 0
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@.str.1 = [3 x i8] c"OK\00"
@.str.3 = [29 x i8] c"%s [LogLevel=%d] [%s], \09%s \0A\00"
@.str.4 = [10 x i8] c"***ZVMLog\00"
@.str.5 = [19 x i8] c"send OK to xmlpipe\00"
@str = [45 x i8] c"***Error write to CHECK_INDEXER_IND_DEV_NAME\00"
define void @sendConfigOK() {
%1 = load i32, i32* @O_WRONLY
%2 = load i32, i32* @O_CREAT
%3 = or i32 %2, %1
%4 = load i32, i32* @O_TRUNC
%5 = or i32 %3, %4
%6 = load i32, i32* @S_IROTH
%7 = load i32, i32* @S_IWOTH
%8 = or i32 %7, %6
%9 = load i32, i32* @S_IRUSR
%10 = or i32 %8, %9
%11 = load i32, i32* @S_IWUSR
%12 = or i32 %10, %11
%13 = tail call i32 @open(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %12)
%14 = icmp slt i32 %13, 0
br i1 %14, label %27, label %15
15: ; preds = %0
%16 = tail call i32 @write(i32 %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 2)
%17 = icmp eq i32 %16, 2
br i1 %17, label %20, label %18
18: ; preds = %15
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
br label %25
20: ; preds = %15
%21 = tail call i32 (...) @getZVMLogLevel()
%22 = icmp sgt i32 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %25
25: ; preds = %20, %23, %18
%26 = tail call i32 @close(i32 %13)
br label %27
27: ; preds = %25, %0
ret void
}