int main(int argc, char *argv[]) {
  ctx_set_log("output.c.ctxt", 0);
  ctx_log_msg(__FUNCTION__, "running program", "START");
  hello();
  world();
  ctx_log_msg(__FUNCTION__, "running program", "ENDOK");
  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)
lea    0xea3(%rip),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1040 <ctx_set_log@plt>
lea    0xea1(%rip),%rdi
lea    0xe9f(%rip),%rsi
lea    0xea8(%rip),%rdx
mov    $0x0,%al
call   1060 <ctx_log_msg@plt>
mov    $0x0,%al
call   1050 <hello@plt>
mov    $0x0,%al
call   1030 <world@plt>
lea    0xe77(%rip),%rdi
lea    0xe75(%rip),%rsi
lea    0xe84(%rip),%rdx
mov    $0x0,%al
call   1060 <ctx_log_msg@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xeb5(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <ctx_set_log@plt>
lea    0xeb3(%rip),%rbx
lea    0xeb1(%rip),%r14
lea    0xeba(%rip),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <ctx_log_msg@plt>
xor    %eax,%eax
call   1050 <hello@plt>
xor    %eax,%eax
call   1030 <world@plt>
lea    0xe9e(%rip),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <ctx_log_msg@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 x i8] c"output.c.ctxt\00"
@__FUNCTION__.main = [5 x i8] c"main\00"
@.str.1 = [16 x i8] c"running program\00"
@.str.2 = [6 x i8] c"START\00"
@.str.3 = [6 x i8] c"ENDOK\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 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @ctx_set_log to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 0)
%7 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @ctx_log_msg to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.main, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 (...) @hello()
%9 = call i32 (...) @world()
%10 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @ctx_log_msg to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.main, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"output.c.ctxt\00"
@__FUNCTION__.main = [5 x i8] c"main\00"
@.str.1 = [16 x i8] c"running program\00"
@.str.2 = [6 x i8] c"START\00"
@.str.3 = [6 x i8] c"ENDOK\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @ctx_set_log to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 0)
%4 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @ctx_log_msg to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.main, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 (...) @hello()
%6 = tail call i32 (...) @world()
%7 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @ctx_log_msg to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.main, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}