void hello() {
  ctx_log_msg(__FUNCTION__, "saying hello", "START");
  printf("hello ");
  sleep(1);
  ctx_log_msg(__FUNCTION__, "saying hello", "ENDOK");
}


x86 assembly (clang, -O0):
<hello>:
push   %rbp
mov    %rsp,%rbp
lea    0xecc(%rip),%rdi
lea    0xebe(%rip),%rsi
lea    0xec4(%rip),%rdx
mov    $0x0,%al
call   1040 <ctx_log_msg@plt>
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
mov    $0x0,%al
call   1050 <sleep@plt>
lea    0xe96(%rip),%rdi
lea    0xe88(%rip),%rsi
lea    0xe9b(%rip),%rdx
mov    $0x0,%al
call   1040 <ctx_log_msg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hello>:
push   %r14
push   %rbx
push   %rax
lea    0xecc(%rip),%rbx
lea    0xebe(%rip),%r14
lea    0xec4(%rip),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <ctx_log_msg@plt>
lea    0xeb6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1050 <sleep@plt>
lea    0xea3(%rip),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <ctx_log_msg@plt>

LLVM IR (-O0):
@__FUNCTION__.hello = [6 x i8] c"hello\00"
@.str = [13 x i8] c"saying hello\00"
@.str.1 = [6 x i8] c"START\00"
@.str.2 = [7 x i8] c"hello \00"
@.str.3 = [6 x i8] c"ENDOK\00"
define void @hello() {
%1 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @ctx_log_msg to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__FUNCTION__.hello, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 (i32, ...) bitcast (i32 (...)* @sleep to i32 (i32, ...)*)(i32 1)
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @ctx_log_msg to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__FUNCTION__.hello, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.hello = [6 x i8] c"hello\00"
@.str = [13 x i8] c"saying hello\00"
@.str.1 = [6 x i8] c"START\00"
@.str.2 = [7 x i8] c"hello \00"
@.str.3 = [6 x i8] c"ENDOK\00"
define void @hello() {
%1 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @ctx_log_msg to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__FUNCTION__.hello, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @sleep to i32 (i32, ...)*)(i32 1)
%4 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @ctx_log_msg to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__FUNCTION__.hello, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret void
}