#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 LOG_DEBUG;
int LOG_EMERG;
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ syslog(int, char *, char *, int);
int main(int argc, char *argv[]) {
  for (int level = LOG_DEBUG; level != LOG_EMERG; --level)
    syslog(level, "%s is on its way to die ... %d", argv[0], level);
  assert(!"See you in the hell!");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e9b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2e9c(%rip),%rcx
cmp    (%rcx),%eax
je     117b <main+0x5b>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x14(%rbp),%ecx
lea    0xe98(%rip),%rsi
call   1040 <syslog@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1142 <main+0x22>
xor    %edi,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    0x2eaa(%rip),%rax
mov    (%rax),%ebp
mov    0x2eb1(%rip),%r15
cmp    (%r15),%ebp
je     1167 <main+0x47>
mov    %rsi,%rbx
lea    0xeba(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    (%rbx),%rdx
mov    %ebp,%edi
mov    %r14,%rsi
mov    %ebp,%ecx
call   1040 <syslog@plt>
add    $0xffffffff,%ebp
cmp    (%r15),%ebp
jne    1150 <main+0x30>
xor    %edi,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@LOG_DEBUG = global i32 0
@LOG_EMERG = global i32 0
@.str = [31 x i8] c"%s is on its way to die ... %d\00"
@.str.1 = [21 x i8] c"See you in the hell!\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* @LOG_DEBUG
store i32 %7, i32* %6
br label %8
8: ; preds = %19, %2
%9 = load i32, i32* %6
%10 = load i32, i32* @LOG_EMERG
%11 = icmp ne i32 %9, %10
br i1 %11, label %12, label %22
12: ; preds = %8
%13 = load i32, i32* %6
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 0
%16 = load i8*, i8** %15
%17 = load i32, i32* %6
%18 = call i32 @syslog(i32 %13, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %16, i32 %17)
br label %19
19: ; preds = %12
%20 = load i32, i32* %6
%21 = add nsw i32 %20, -1
store i32 %21, i32* %6
br label %8
22: ; preds = %8
%23 = call i32 @assert(i32 0)
ret i32 0
}

LLVM IR (-O2):
@LOG_DEBUG = global i32 0
@LOG_EMERG = global i32 0
@.str = [31 x i8] c"%s is on its way to die ... %d\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i32, i32* @LOG_DEBUG
%4 = load i32, i32* @LOG_EMERG
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %8, %2
%7 = tail call i32 @assert(i32 0)
ret i32 0
8: ; preds = %2, %8
%9 = phi i32 [ %12, %8 ], [ %3, %2 ]
%10 = load i8*, i8** %1
%11 = tail call i32 @syslog(i32 %9, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %9)
%12 = add nsw i32 %9, -1
%13 = load i32, i32* @LOG_EMERG
%14 = icmp eq i32 %12, %13
br i1 %14, label %6, label %8
}