#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*/ PrintFloats(int, double, double, double);
char *fmtmsg(char *, char *, char *, int, char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  PrintFloats(3, 3.14159, 2.71828, 1.41421);
  char *msg;
  char msgbuf[80];
  msg = fmtmsg(msgbuf, "%s %d %s %s", "Failed", 100, "times", "haha");
  printf("%s\n", msg);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%edi
movsd  0xeb4(%rip),%xmm0
movsd  0xeb4(%rip),%xmm1
movsd  0xeb4(%rip),%xmm2
call   1050 <PrintFloats@plt>
lea    -0x60(%rbp),%rdi
lea    0xeac(%rip),%rsi
lea    0xeb1(%rip),%rdx
mov    $0x64,%ecx
lea    0xeac(%rip),%r8
lea    0xeab(%rip),%r9
call   1040 <fmtmsg@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
movsd  0xec4(%rip),%xmm0
movsd  0xec4(%rip),%xmm1
movsd  0xec4(%rip),%xmm2
mov    $0x3,%edi
call   1050 <PrintFloats@plt>
lea    0xebb(%rip),%rsi
lea    0xec0(%rip),%rdx
lea    0xec0(%rip),%r8
lea    0xebf(%rip),%r9
mov    %rsp,%rdi
mov    $0x64,%ecx
call   1040 <fmtmsg@plt>
lea    0xeb0(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x58,%rsp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%s %d %s %s\00"
@.str.1 = [7 x i8] c"Failed\00"
@.str.2 = [6 x i8] c"times\00"
@.str.3 = [5 x i8] c"haha\00"
@.str.4 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca [80 x i8]
store i32 0, i32* %1
%4 = call i32 @PrintFloats(i32 3, double 3.141590e+00, double 2.718280e+00, double 1.414210e+00)
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%6 = call i8* @fmtmsg(i8* %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 100, 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))
store i8* %6, i8** %2
%7 = load i8*, i8** %2
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"%s %d %s %s\00"
@.str.1 = [7 x i8] c"Failed\00"
@.str.2 = [6 x i8] c"times\00"
@.str.3 = [5 x i8] c"haha\00"
@.str.4 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = tail call i32 @PrintFloats(i32 3, double 3.141590e+00, double 2.718280e+00, double 1.414210e+00)
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%4 = call i8* @fmtmsg(i8* %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 100, 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 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %4)
ret i32 0
}