#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 /*<<< orphan*/ LOG_ALERT;
int /*<<< orphan*/ LOG_CRIT;
int /*<<< orphan*/ LOG_DEBUG;
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ LOG_INFO;
int LOG_LOCAL0;
int /*<<< orphan*/ LOG_NOTICE;
int LOG_PID;
int /*<<< orphan*/ LOG_WARNING;
int /*<<< orphan*/ openlog(char const *, int, int);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, int /*<<< orphan*/,
                          char *, int);
int main(int argc, char **argv) {
  const char *ident = argv[0];
  int option = LOG_PID;
  int facility = LOG_LOCAL0;
  openlog(ident, option, facility);
  int i = 0;
  while (1) {
    i++;
    syslog(LOG_DEBUG, "LOG_DEBUG:%u:%s,%d", LOG_DEBUG, argv[1], i);
    syslog(LOG_INFO, "LOG_INFO:%u:%s,%d", LOG_INFO, argv[1], i);
    syslog(LOG_NOTICE, "LOG_NOTICE:%u:%s,%d", LOG_NOTICE, argv[1], i);
    syslog(LOG_WARNING, "LOG_WARNING:%u:%s,%d", LOG_WARNING, argv[1], i);
    syslog(LOG_ERR, "LOG_ERR:%u:%s,%d", LOG_ERR, argv[1], i);
    syslog(LOG_CRIT, "LOG_CRIT:%u:%s,%d", LOG_CRIT, argv[1], i);
    syslog(LOG_ALERT, "LOG_ALERT:%u:%s,%d", LOG_ALERT, argv[1], i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e78(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    0x2e84(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
call   1040 <openlog@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    %eax,-0x24(%rbp)
mov    0x2e2e(%rip),%rax
mov    (%rax),%edi
mov    0x2e25(%rip),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
mov    -0x24(%rbp),%r8d
lea    0xe60(%rip),%rsi
call   1030 <syslog@plt>
mov    0x2dfc(%rip),%rax
mov    (%rax),%edi
mov    0x2df3(%rip),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
mov    -0x24(%rbp),%r8d
lea    0xe49(%rip),%rsi
call   1030 <syslog@plt>
mov    0x2de2(%rip),%rax
mov    (%rax),%edi
mov    0x2dd9(%rip),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
mov    -0x24(%rbp),%r8d
lea    0xe31(%rip),%rsi
call   1030 <syslog@plt>
mov    0x2dd0(%rip),%rax
mov    (%rax),%edi
mov    0x2dc7(%rip),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
mov    -0x24(%rbp),%r8d
lea    0xe1b(%rip),%rsi
call   1030 <syslog@plt>
mov    0x2d6e(%rip),%rax
mov    (%rax),%edi
mov    0x2d65(%rip),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
mov    -0x24(%rbp),%r8d
lea    0xe06(%rip),%rsi
call   1030 <syslog@plt>
mov    0x2d8c(%rip),%rax
mov    (%rax),%edi
mov    0x2d83(%rip),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
mov    -0x24(%rbp),%r8d
lea    0xded(%rip),%rsi
call   1030 <syslog@plt>
mov    0x2d6a(%rip),%rax
mov    (%rax),%edi
mov    0x2d61(%rip),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
mov    -0x24(%rbp),%r8d
lea    0xdd5(%rip),%rsi
call   1030 <syslog@plt>
jmp    116f <main+0x4f>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    (%rsi),%rdi
mov    0x2e88(%rip),%rax
mov    (%rax),%esi
mov    0x2e97(%rip),%rax
mov    (%rax),%edx
call   1040 <openlog@plt>
mov    $0x1,%ebp
lea    0xefa(%rip),%r14
lea    0xf04(%rip),%r15
mov    0x2e86(%rip),%r13
lea    0xf08(%rip),%r12
nopl   0x0(%rax)
mov    0x2e39(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rbx),%rcx
lea    0xe7c(%rip),%rsi
mov    %edi,%edx
mov    %ebp,%r8d
call   1030 <syslog@plt>
mov    0x2e13(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rbx),%rcx
lea    0xe71(%rip),%rsi
mov    %edi,%edx
mov    %ebp,%r8d
call   1030 <syslog@plt>
mov    0x2e05(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rbx),%rcx
lea    0xe65(%rip),%rsi
mov    %edi,%edx
mov    %ebp,%r8d
call   1030 <syslog@plt>
mov    0x2dff(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rbx),%rcx
lea    0xe5b(%rip),%rsi
mov    %edi,%edx
mov    %ebp,%r8d
call   1030 <syslog@plt>
mov    0x2da9(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rbx),%rcx
mov    %r14,%rsi
mov    %edi,%edx
mov    %ebp,%r8d
call   1030 <syslog@plt>
mov    0x2dd7(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rbx),%rcx
mov    %r15,%rsi
mov    %edi,%edx
mov    %ebp,%r8d
call   1030 <syslog@plt>
mov    0x0(%r13),%edi
mov    0x8(%rbx),%rcx
mov    %r12,%rsi
mov    %edi,%edx
mov    %ebp,%r8d
call   1030 <syslog@plt>
add    $0x1,%ebp
jmp    1170 <main+0x50>

LLVM IR (-O0):
@LOG_PID = global i32 0
@LOG_LOCAL0 = global i32 0
@LOG_DEBUG = global i32 0
@.str = [19 x i8] c"LOG_DEBUG:%u:%s,%d\00"
@LOG_INFO = global i32 0
@.str.1 = [18 x i8] c"LOG_INFO:%u:%s,%d\00"
@LOG_NOTICE = global i32 0
@.str.2 = [20 x i8] c"LOG_NOTICE:%u:%s,%d\00"
@LOG_WARNING = global i32 0
@.str.3 = [21 x i8] c"LOG_WARNING:%u:%s,%d\00"
@LOG_ERR = global i32 0
@.str.4 = [17 x i8] c"LOG_ERR:%u:%s,%d\00"
@LOG_CRIT = global i32 0
@.str.5 = [18 x i8] c"LOG_CRIT:%u:%s,%d\00"
@LOG_ALERT = global i32 0
@.str.6 = [19 x i8] c"LOG_ALERT:%u:%s,%d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
store i8* %12, i8** %6
%13 = load i32, i32* @LOG_PID
store i32 %13, i32* %7
%14 = load i32, i32* @LOG_LOCAL0
store i32 %14, i32* %8
%15 = load i8*, i8** %6
%16 = load i32, i32* %7
%17 = load i32, i32* %8
%18 = call i32 @openlog(i8* %15, i32 %16, i32 %17)
store i32 0, i32* %9
br label %19
19: ; preds = %2, %19
%20 = load i32, i32* %9
%21 = add nsw i32 %20, 1
store i32 %21, i32* %9
%22 = load i32, i32* @LOG_DEBUG
%23 = load i32, i32* @LOG_DEBUG
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = load i32, i32* %9
%28 = call i32 @syslog(i32 %22, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %23, i8* %26, i32 %27)
%29 = load i32, i32* @LOG_INFO
%30 = load i32, i32* @LOG_INFO
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 1
%33 = load i8*, i8** %32
%34 = load i32, i32* %9
%35 = call i32 @syslog(i32 %29, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %30, i8* %33, i32 %34)
%36 = load i32, i32* @LOG_NOTICE
%37 = load i32, i32* @LOG_NOTICE
%38 = load i8**, i8*** %5
%39 = getelementptr inbounds i8*, i8** %38, i64 1
%40 = load i8*, i8** %39
%41 = load i32, i32* %9
%42 = call i32 @syslog(i32 %36, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %37, i8* %40, i32 %41)
%43 = load i32, i32* @LOG_WARNING
%44 = load i32, i32* @LOG_WARNING
%45 = load i8**, i8*** %5
%46 = getelementptr inbounds i8*, i8** %45, i64 1
%47 = load i8*, i8** %46
%48 = load i32, i32* %9
%49 = call i32 @syslog(i32 %43, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 %44, i8* %47, i32 %48)
%50 = load i32, i32* @LOG_ERR
%51 = load i32, i32* @LOG_ERR
%52 = load i8**, i8*** %5
%53 = getelementptr inbounds i8*, i8** %52, i64 1
%54 = load i8*, i8** %53
%55 = load i32, i32* %9
%56 = call i32 @syslog(i32 %50, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 %51, i8* %54, i32 %55)
%57 = load i32, i32* @LOG_CRIT
%58 = load i32, i32* @LOG_CRIT
%59 = load i8**, i8*** %5
%60 = getelementptr inbounds i8*, i8** %59, i64 1
%61 = load i8*, i8** %60
%62 = load i32, i32* %9
%63 = call i32 @syslog(i32 %57, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 %58, i8* %61, i32 %62)
%64 = load i32, i32* @LOG_ALERT
%65 = load i32, i32* @LOG_ALERT
%66 = load i8**, i8*** %5
%67 = getelementptr inbounds i8*, i8** %66, i64 1
%68 = load i8*, i8** %67
%69 = load i32, i32* %9
%70 = call i32 @syslog(i32 %64, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i32 %65, i8* %68, i32 %69)
br label %19
}

LLVM IR (-O2):
@LOG_PID = global i32 0
@LOG_LOCAL0 = global i32 0
@LOG_DEBUG = global i32 0
@.str = [19 x i8] c"LOG_DEBUG:%u:%s,%d\00"
@LOG_INFO = global i32 0
@.str.1 = [18 x i8] c"LOG_INFO:%u:%s,%d\00"
@LOG_NOTICE = global i32 0
@.str.2 = [20 x i8] c"LOG_NOTICE:%u:%s,%d\00"
@LOG_WARNING = global i32 0
@.str.3 = [21 x i8] c"LOG_WARNING:%u:%s,%d\00"
@LOG_ERR = global i32 0
@.str.4 = [17 x i8] c"LOG_ERR:%u:%s,%d\00"
@LOG_CRIT = global i32 0
@.str.5 = [18 x i8] c"LOG_CRIT:%u:%s,%d\00"
@LOG_ALERT = global i32 0
@.str.6 = [19 x i8] c"LOG_ALERT:%u:%s,%d\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = load i32, i32* @LOG_PID
%5 = load i32, i32* @LOG_LOCAL0
%6 = tail call i32 @openlog(i8* %3, i32 %4, i32 %5)
%7 = getelementptr inbounds i8*, i8** %1, i64 1
br label %8
8: ; preds = %8, %2
%9 = phi i32 [ 0, %2 ], [ %10, %8 ]
%10 = add nuw nsw i32 %9, 1
%11 = load i32, i32* @LOG_DEBUG
%12 = load i8*, i8** %7
%13 = tail call i32 @syslog(i32 %11, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %11, i8* %12, i32 %10)
%14 = load i32, i32* @LOG_INFO
%15 = load i8*, i8** %7
%16 = tail call i32 @syslog(i32 %14, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %14, i8* %15, i32 %10)
%17 = load i32, i32* @LOG_NOTICE
%18 = load i8*, i8** %7
%19 = tail call i32 @syslog(i32 %17, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %17, i8* %18, i32 %10)
%20 = load i32, i32* @LOG_WARNING
%21 = load i8*, i8** %7
%22 = tail call i32 @syslog(i32 %20, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 %20, i8* %21, i32 %10)
%23 = load i32, i32* @LOG_ERR
%24 = load i8*, i8** %7
%25 = tail call i32 @syslog(i32 %23, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 %23, i8* %24, i32 %10)
%26 = load i32, i32* @LOG_CRIT
%27 = load i8*, i8** %7
%28 = tail call i32 @syslog(i32 %26, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 %26, i8* %27, i32 %10)
%29 = load i32, i32* @LOG_ALERT
%30 = load i8*, i8** %7
%31 = tail call i32 @syslog(i32 %29, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i32 %29, i8* %30, i32 %10)
br label %8
}