#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_NOTICE;
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *);
int /*<<< orphan*/ usage();
int main(int argc, char *argv[]) {
  if (argc != 2)
    usage();
  if (!strcmp(argv[1], "-l"))
    syslog(LOG_NOTICE, "test\n");
  else if (!strcmp(argv[1], "-c"))
    syslog(LOG_NOTICE, "test 1\t2");
  else
    usage();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1157 <main+0x27>
mov    $0x0,%al
call   1050 <usage@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe9a(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    118e <main+0x5e>
mov    0x2e65(%rip),%rax
mov    (%rax),%edi
lea    0xe7f(%rip),%rsi
call   1040 <syslog@plt>
jmp    11d1 <main+0xa1>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe6c(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    11c5 <main+0x95>
mov    0x2e2e(%rip),%rax
mov    (%rax),%edi
lea    0xe51(%rip),%rsi
call   1040 <syslog@plt>
jmp    11cc <main+0x9c>
mov    $0x0,%al
call   1050 <usage@plt>
jmp    11d1 <main+0xa1>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x2,%edi
je     1140 <main+0x10>
xor    %eax,%eax
call   1050 <usage@plt>
mov    0x8(%rbx),%rbx
lea    0xeb5(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1173 <main+0x43>
lea    0xeab(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1185 <main+0x55>
xor    %eax,%eax
call   1050 <usage@plt>
jmp    119a <main+0x6a>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
lea    0xe80(%rip),%rsi
jmp    1195 <main+0x65>
mov    0x2e54(%rip),%rax
mov    (%rax),%edi
lea    0xe77(%rip),%rsi
call   1040 <syslog@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"-l\00"
@LOG_NOTICE = global i32 0
@.str.1 = [6 x i8] c"test\0A\00"
@.str.2 = [3 x i8] c"-c\00"
@.str.3 = [9 x i8] c"test 1\092\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @usage()
br label %10
10: ; preds = %8, %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @strcmp(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%15 = icmp ne i32 %14, 0
br i1 %15, label %19, label %16
16: ; preds = %10
%17 = load i32, i32* @LOG_NOTICE
%18 = call i32 @syslog(i32 %17, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %31
19: ; preds = %10
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = call i32 @strcmp(i8* %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%24 = icmp ne i32 %23, 0
br i1 %24, label %28, label %25
25: ; preds = %19
%26 = load i32, i32* @LOG_NOTICE
%27 = call i32 @syslog(i32 %26, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
br label %30
28: ; preds = %19
%29 = call i32 (...) @usage()
br label %30
30: ; preds = %28, %25
br label %31
31: ; preds = %30, %16
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"-l\00"
@LOG_NOTICE = global i32 0
@.str.1 = [6 x i8] c"test\0A\00"
@.str.2 = [3 x i8] c"-c\00"
@.str.3 = [9 x i8] c"test 1\092\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @usage()
br label %6
6: ; preds = %4, %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @strcmp(i8* dereferenceable(1) %8, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %6
%12 = load i32, i32* @LOG_NOTICE
%13 = tail call i32 @syslog(i32 %12, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %22
14: ; preds = %6
%15 = tail call i32 @strcmp(i8* dereferenceable(1) %8, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* @LOG_NOTICE
%19 = tail call i32 @syslog(i32 %18, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
br label %22
20: ; preds = %14
%21 = tail call i32 (...) @usage()
br label %22
22: ; preds = %17, %20, %11
ret i32 0
}