#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 EXIT_SUCCESS;
int /*<<< orphan*/ example_whithinFct();
int /*<<< orphan*/ log_debug(char *, ...);
int /*<<< orphan*/ log_error(char *);
int /*<<< orphan*/ log_info(char *);
int /*<<< orphan*/ log_init();
int /*<<< orphan*/ log_warning(char *);
int /*<<< orphan*/ sleep(int);
int main(int argc, char **argv) {
  int i = 0;
  (void)argc;
  (void)argv;
  log_init();
  log_debug("This is a debug message without extra arguments");
  log_info("This is a info message without extra arguments");
  log_warning("This is a warning message without extra arguments");
  log_error("This is a error message without extra arguments");
  example_whithinFct();
  for (i = 0; i < 6; i++) {
    log_debug("Loop count: %d", i);
    sleep(1);
  }
  return (EXIT_SUCCESS);
}


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)
movl   $0x0,-0x14(%rbp)
mov    $0x0,%al
call   1030 <log_init@plt>
lea    0xe65(%rip),%rdi
mov    $0x0,%al
call   1060 <log_debug@plt>
lea    0xe87(%rip),%rdi
call   1040 <log_info@plt>
lea    0xeaa(%rip),%rdi
call   1070 <log_warning@plt>
lea    0xed0(%rip),%rdi
call   1050 <log_error@plt>
mov    $0x0,%al
call   1090 <example_whithinFct@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x6,-0x14(%rbp)
jge    1207 <main+0x97>
mov    -0x14(%rbp),%esi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1060 <log_debug@plt>
mov    $0x1,%edi
call   1080 <sleep@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11d4 <main+0x64>
mov    0x2dd2(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <log_init@plt>
lea    0xe81(%rip),%rdi
xor    %eax,%eax
call   1060 <log_debug@plt>
lea    0xea3(%rip),%rdi
call   1040 <log_info@plt>
lea    0xec6(%rip),%rdi
call   1070 <log_warning@plt>
lea    0xeec(%rip),%rdi
call   1050 <log_error@plt>
xor    %eax,%eax
call   1090 <example_whithinFct@plt>
lea    0xf09(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1060 <log_debug@plt>
mov    $0x1,%edi
call   1080 <sleep@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1060 <log_debug@plt>
mov    $0x1,%edi
call   1080 <sleep@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1060 <log_debug@plt>
mov    $0x1,%edi
call   1080 <sleep@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1060 <log_debug@plt>
mov    $0x1,%edi
call   1080 <sleep@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1060 <log_debug@plt>
mov    $0x1,%edi
call   1080 <sleep@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1060 <log_debug@plt>
mov    $0x1,%edi
call   1080 <sleep@plt>
mov    0x2d8e(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [48 x i8] c"This is a debug message without extra arguments\00"
@.str.1 = [47 x i8] c"This is a info message without extra arguments\00"
@.str.2 = [50 x i8] c"This is a warning message without extra arguments\00"
@.str.3 = [48 x i8] c"This is a error message without extra arguments\00"
@.str.4 = [15 x i8] c"Loop count: %d\00"
@EXIT_SUCCESS = global i32 0
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
store i32 0, i32* %6
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = call i32 (...) @log_init()
%10 = call i32 (i8*, ...) @log_debug(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @log_info(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 @log_warning(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 @log_error(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 (...) @example_whithinFct()
store i32 0, i32* %6
br label %15
15: ; preds = %22, %2
%16 = load i32, i32* %6
%17 = icmp slt i32 %16, 6
br i1 %17, label %18, label %25
18: ; preds = %15
%19 = load i32, i32* %6
%20 = call i32 (i8*, ...) @log_debug(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 %19)
%21 = call i32 @sleep(i32 1)
br label %22
22: ; preds = %18
%23 = load i32, i32* %6
%24 = add nsw i32 %23, 1
store i32 %24, i32* %6
br label %15
25: ; preds = %15
%26 = load i32, i32* @EXIT_SUCCESS
ret i32 %26
}

LLVM IR (-O2):
@.str = [48 x i8] c"This is a debug message without extra arguments\00"
@.str.1 = [47 x i8] c"This is a info message without extra arguments\00"
@.str.2 = [50 x i8] c"This is a warning message without extra arguments\00"
@.str.3 = [48 x i8] c"This is a error message without extra arguments\00"
@.str.4 = [15 x i8] c"Loop count: %d\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @log_init()
%4 = tail call i32 (i8*, ...) @log_debug(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @log_info(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @log_warning(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 @log_error(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0))
%8 = tail call i32 (...) @example_whithinFct()
%9 = tail call i32 (i8*, ...) @log_debug(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 0)
%10 = tail call i32 @sleep(i32 1)
%11 = tail call i32 (i8*, ...) @log_debug(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 1)
%12 = tail call i32 @sleep(i32 1)
%13 = tail call i32 (i8*, ...) @log_debug(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 2)
%14 = tail call i32 @sleep(i32 1)
%15 = tail call i32 (i8*, ...) @log_debug(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 3)
%16 = tail call i32 @sleep(i32 1)
%17 = tail call i32 (i8*, ...) @log_debug(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 4)
%18 = tail call i32 @sleep(i32 1)
%19 = tail call i32 (i8*, ...) @log_debug(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 5)
%20 = tail call i32 @sleep(i32 1)
%21 = load i32, i32* @EXIT_SUCCESS
ret i32 %21
}