int main() {
  const char *bitSize = GetBitSize();
  const char *config = GetConfiguration();
  printf("Hello world, C, in %s (%s)\n", bitSize, config);
  printf("From library, '%s'\n", libraryFunction());
  printf("From library2, '%d'\n", library2Function());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <GetBitSize@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <GetConfiguration@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1070 <libraryFunction@plt>
mov    %eax,%esi
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <library2Function@plt>
mov    %eax,%esi
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <GetBitSize@plt>
movslq %eax,%rbx
xor    %eax,%eax
call   1060 <GetConfiguration@plt>
movslq %eax,%rdx
lea    0xe94(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1070 <libraryFunction@plt>
lea    0xe98(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1030 <library2Function@plt>
lea    0xe95(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Hello world, C, in %s (%s)\0A\00"
@.str.1 = [20 x i8] c"From library, '%s'\0A\00"
@.str.2 = [21 x i8] c"From library2, '%d'\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
%4 = call i32 (...) @GetBitSize()
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %2
%7 = call i32 (...) @GetConfiguration()
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %3
%10 = load i8*, i8** %2
%11 = load i8*, i8** %3
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11)
%13 = call i32 (...) @libraryFunction()
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %13)
%15 = call i32 (...) @library2Function()
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"Hello world, C, in %s (%s)\0A\00"
@.str.1 = [20 x i8] c"From library, '%s'\0A\00"
@.str.2 = [21 x i8] c"From library2, '%d'\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @GetBitSize()
%2 = sext i32 %1 to i64
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 (...) @GetConfiguration()
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %6)
%8 = tail call i32 (...) @libraryFunction()
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = tail call i32 (...) @library2Function()
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %10)
ret i32 0
}