#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_RDWR;
int /*<<< orphan*/ daemon(int /*<<< orphan*/, int /*<<< orphan*/);
int open(char *, int);
int /*<<< orphan*/ write(int, char *, int);
int main() {
  int fd;
  char ch = 'A';
  fd = open("/root/temp.log", O_CREAT | O_RDWR);
  daemon(0, 0);
  write(fd, &ch, 1);
  write(fd, &ch, 1);
  write(fd, &ch, 1);
  write(fd, &ch, 1);
  write(fd, &ch, 1);
  write(fd, &ch, 1);
  write(fd, &ch, 1);
  write(fd, &ch, 1);
  write(fd, &ch, 1);
  write(fd, &ch, 1);
  write(fd, &ch, 1);
  write(fd, &ch, 1);
  write(fd, &ch, 1);
  write(fd, &ch, 1);
  write(fd, &ch, 1);
  write(fd, &ch, 1);
  write(fd, &ch, 1);
  write(fd, &ch, 1);
  write(fd, &ch, 1);
  write(fd, &ch, 1);
  write(fd, &ch, 1);
  write(fd, &ch, 1);
  write(fd, &ch, 1);
  write(fd, &ch, 1);
  write(fd, &ch, 1);
  write(fd, &ch, 1);
  write(fd, &ch, 1);
  write(fd, &ch, 1);
  write(fd, &ch, 1);
  write(fd, &ch, 1);
  write(fd, &ch, 1);
  write(fd, &ch, 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x41,-0x5(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
mov    0x2e94(%rip),%rax
or     (%rax),%esi
lea    0xeab(%rip),%rdi
call   1050 <open@plt>
mov    %eax,-0x4(%rbp)
xor    %esi,%esi
mov    %esi,%edi
call   1040 <daemon@plt>
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movb   $0x41,0x7(%rsp)
mov    0x2eb8(%rip),%rax
mov    0x2e99(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
lea    0xeae(%rip),%rdi
call   1050 <open@plt>
mov    %eax,%ebx
xor    %edi,%edi
xor    %esi,%esi
call   1040 <daemon@plt>
lea    0x7(%rsp),%r14
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [15 x i8] c"/root/temp.log\00"
@O_CREAT = global i32 0
@O_RDWR = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i8 65, i8* %2
%3 = load i32, i32* @O_CREAT
%4 = load i32, i32* @O_RDWR
%5 = or i32 %3, %4
%6 = call i32 @open(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %5)
store i32 %6, i32* %1
%7 = call i32 @daemon(i32 0, i32 0)
%8 = load i32, i32* %1
%9 = call i32 @write(i32 %8, i8* %2, i32 1)
%10 = load i32, i32* %1
%11 = call i32 @write(i32 %10, i8* %2, i32 1)
%12 = load i32, i32* %1
%13 = call i32 @write(i32 %12, i8* %2, i32 1)
%14 = load i32, i32* %1
%15 = call i32 @write(i32 %14, i8* %2, i32 1)
%16 = load i32, i32* %1
%17 = call i32 @write(i32 %16, i8* %2, i32 1)
%18 = load i32, i32* %1
%19 = call i32 @write(i32 %18, i8* %2, i32 1)
%20 = load i32, i32* %1
%21 = call i32 @write(i32 %20, i8* %2, i32 1)
%22 = load i32, i32* %1
%23 = call i32 @write(i32 %22, i8* %2, i32 1)
%24 = load i32, i32* %1
%25 = call i32 @write(i32 %24, i8* %2, i32 1)
%26 = load i32, i32* %1
%27 = call i32 @write(i32 %26, i8* %2, i32 1)
%28 = load i32, i32* %1
%29 = call i32 @write(i32 %28, i8* %2, i32 1)
%30 = load i32, i32* %1
%31 = call i32 @write(i32 %30, i8* %2, i32 1)
%32 = load i32, i32* %1
%33 = call i32 @write(i32 %32, i8* %2, i32 1)
%34 = load i32, i32* %1
%35 = call i32 @write(i32 %34, i8* %2, i32 1)
%36 = load i32, i32* %1
%37 = call i32 @write(i32 %36, i8* %2, i32 1)
%38 = load i32, i32* %1
%39 = call i32 @write(i32 %38, i8* %2, i32 1)
%40 = load i32, i32* %1
%41 = call i32 @write(i32 %40, i8* %2, i32 1)
%42 = load i32, i32* %1
%43 = call i32 @write(i32 %42, i8* %2, i32 1)
%44 = load i32, i32* %1
%45 = call i32 @write(i32 %44, i8* %2, i32 1)
%46 = load i32, i32* %1
%47 = call i32 @write(i32 %46, i8* %2, i32 1)
%48 = load i32, i32* %1
%49 = call i32 @write(i32 %48, i8* %2, i32 1)
%50 = load i32, i32* %1
%51 = call i32 @write(i32 %50, i8* %2, i32 1)
%52 = load i32, i32* %1
%53 = call i32 @write(i32 %52, i8* %2, i32 1)
%54 = load i32, i32* %1
%55 = call i32 @write(i32 %54, i8* %2, i32 1)
%56 = load i32, i32* %1
%57 = call i32 @write(i32 %56, i8* %2, i32 1)
%58 = load i32, i32* %1
%59 = call i32 @write(i32 %58, i8* %2, i32 1)
%60 = load i32, i32* %1
%61 = call i32 @write(i32 %60, i8* %2, i32 1)
%62 = load i32, i32* %1
%63 = call i32 @write(i32 %62, i8* %2, i32 1)
%64 = load i32, i32* %1
%65 = call i32 @write(i32 %64, i8* %2, i32 1)
%66 = load i32, i32* %1
%67 = call i32 @write(i32 %66, i8* %2, i32 1)
%68 = load i32, i32* %1
%69 = call i32 @write(i32 %68, i8* %2, i32 1)
%70 = load i32, i32* %1
%71 = call i32 @write(i32 %70, i8* %2, i32 1)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"/root/temp.log\00"
@O_CREAT = global i32 0
@O_RDWR = global i32 0
define i32 @main() {
%1 = alloca i8
store i8 65, i8* %1
%2 = load i32, i32* @O_CREAT
%3 = load i32, i32* @O_RDWR
%4 = or i32 %3, %2
%5 = tail call i32 @open(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 @daemon(i32 0, i32 0)
%7 = call i32 @write(i32 %5, i8* %1, i32 1)
%8 = call i32 @write(i32 %5, i8* %1, i32 1)
%9 = call i32 @write(i32 %5, i8* %1, i32 1)
%10 = call i32 @write(i32 %5, i8* %1, i32 1)
%11 = call i32 @write(i32 %5, i8* %1, i32 1)
%12 = call i32 @write(i32 %5, i8* %1, i32 1)
%13 = call i32 @write(i32 %5, i8* %1, i32 1)
%14 = call i32 @write(i32 %5, i8* %1, i32 1)
%15 = call i32 @write(i32 %5, i8* %1, i32 1)
%16 = call i32 @write(i32 %5, i8* %1, i32 1)
%17 = call i32 @write(i32 %5, i8* %1, i32 1)
%18 = call i32 @write(i32 %5, i8* %1, i32 1)
%19 = call i32 @write(i32 %5, i8* %1, i32 1)
%20 = call i32 @write(i32 %5, i8* %1, i32 1)
%21 = call i32 @write(i32 %5, i8* %1, i32 1)
%22 = call i32 @write(i32 %5, i8* %1, i32 1)
%23 = call i32 @write(i32 %5, i8* %1, i32 1)
%24 = call i32 @write(i32 %5, i8* %1, i32 1)
%25 = call i32 @write(i32 %5, i8* %1, i32 1)
%26 = call i32 @write(i32 %5, i8* %1, i32 1)
%27 = call i32 @write(i32 %5, i8* %1, i32 1)
%28 = call i32 @write(i32 %5, i8* %1, i32 1)
%29 = call i32 @write(i32 %5, i8* %1, i32 1)
%30 = call i32 @write(i32 %5, i8* %1, i32 1)
%31 = call i32 @write(i32 %5, i8* %1, i32 1)
%32 = call i32 @write(i32 %5, i8* %1, i32 1)
%33 = call i32 @write(i32 %5, i8* %1, i32 1)
%34 = call i32 @write(i32 %5, i8* %1, i32 1)
%35 = call i32 @write(i32 %5, i8* %1, i32 1)
%36 = call i32 @write(i32 %5, i8* %1, i32 1)
%37 = call i32 @write(i32 %5, i8* %1, i32 1)
%38 = call i32 @write(i32 %5, i8* %1, i32 1)
ret i32 0
}