#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*/ ngx_log_error_core(int /*<<< orphan*/, int /*<<< orphan*/,
                                      char *, char *, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
int main() {
  printf("hello world\n");
  ngx_log_error_core(stdout, 0, "%s#%s", "hello", "haha");
  ngx_log_error_core(stdout, 0, "%s#%s", "hello", "haha");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
lea    0xec0(%rip),%rdx
lea    0xebf(%rip),%rcx
lea    0xebe(%rip),%r8
call   1040 <ngx_log_error_core@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
lea    0xe9b(%rip),%rdx
lea    0xe9a(%rip),%rcx
lea    0xe99(%rip),%r8
call   1040 <ngx_log_error_core@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ea5(%rip),%rbx
mov    (%rbx),%edi
lea    0xebc(%rip),%r12
lea    0xebb(%rip),%r14
lea    0xeba(%rip),%r15
xor    %esi,%esi
mov    %r12,%rdx
mov    %r14,%rcx
mov    %r15,%r8
call   1040 <ngx_log_error_core@plt>
mov    (%rbx),%edi
xor    %esi,%esi
mov    %r12,%rdx
mov    %r14,%rcx
mov    %r15,%r8
call   1040 <ngx_log_error_core@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [13 x i8] c"hello world\0A\00"
@stdout = global i32 0
@.str.1 = [6 x i8] c"%s#%s\00"
@.str.2 = [6 x i8] c"hello\00"
@.str.3 = [5 x i8] c"haha\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = call i32 @ngx_log_error_core(i32 %3, i32 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%5 = load i32, i32* @stdout
%6 = call i32 @ngx_log_error_core(i32 %5, i32 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str.1 = [6 x i8] c"%s#%s\00"
@.str.2 = [6 x i8] c"hello\00"
@.str.3 = [5 x i8] c"haha\00"
@str = [12 x i8] c"hello world\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @ngx_log_error_core(i32 %2, i32 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = tail call i32 @ngx_log_error_core(i32 %4, i32 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}