#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*/ free(char *);
int /*<<< orphan*/ printf(char *, char volatile, int volatile, float volatile,
                          char *);
char *strdup(char const *);
int main() {
  volatile char c = '0';
  volatile int x = 12;
  volatile float f = 1.239;
  volatile char s[] = "34";
  char *p = strdup((const char *)s);
  free(p);
  printf("%c %d %.3f %s\n", c, x, f, p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x30,-0x5(%rbp)
movl   $0xc,-0xc(%rbp)
movss  0xeae(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
lea    -0x13(%rbp),%rax
mov    0xea5(%rip),%cl
mov    %cl,0x2(%rax)
mov    0xe99(%rip),%cx
mov    %cx,(%rax)
lea    -0x13(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x5(%rbp),%al
mov    -0xc(%rbp),%edx
movss  -0x10(%rbp),%xmm0
mov    -0x20(%rbp),%rcx
lea    0xe6d(%rip),%rdi
movsbl %al,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movb   $0x30,0x3(%rsp)
movl   $0xc,0xc(%rsp)
movl   $0x3f9e978d,0x8(%rsp)
3f
mov    0xeb2(%rip),%al
mov    %al,0x6(%rsp)
movzwl 0xea5(%rip),%eax
mov    %ax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1050 <strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <free@plt>
movsbl 0x3(%rsp),%esi
mov    0xc(%rsp),%edx
movss  0x8(%rsp),%xmm0
lea    0xe78(%rip),%rdi
mov    %rbx,%rcx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s = [3 x i8] c"34\00"
@.str = [15 x i8] c"%c %d %.3f %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
%4 = alloca float
%5 = alloca [3 x i8]
%6 = alloca i8*
store i32 0, i32* %1
store volatile i8 48, i8* %2
store volatile i32 12, i32* %3
store volatile float 0x3FF3D2F1A0000000, float* %4
%7 = bitcast [3 x i8]* %5 to i8*
%8 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
%9 = call i8* @strdup(i8* %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = call i32 @free(i8* %10)
%12 = load volatile i8, i8* %2
%13 = load volatile i32, i32* %3
%14 = load volatile float, float* %4
%15 = load i8*, i8** %6
%16 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8 signext %12, i32 %13, float %14, i8* %15)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [3 x i8] c"34\00"
@.str = [15 x i8] c"%c %d %.3f %s\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i32
%3 = alloca float
%4 = alloca [3 x i8]
store volatile i8 48, i8* %1
%5 = bitcast i32* %2 to i8*
store volatile i32 12, i32* %2
%6 = bitcast float* %3 to i8*
store volatile float 0x3FF3D2F1A0000000, float* %3
%7 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 0
%8 = call i8* @strdup(i8* %7)
%9 = tail call i32 @free(i8* %8)
%10 = load volatile i8, i8* %1
%11 = load volatile i32, i32* %2
%12 = load volatile float, float* %3
%13 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8 signext %10, i32 %11, float %12, i8* %8)
ret i32 0
}