#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*/ printf(char *, ...);
int main() {
  struct fish {
    const char *name;
    const char *species;
    int teeth;
    int age;
  };
  typedef struct {
    int q1;
    float q2;
  } lolstruct;
  lolstruct lol = {666, 42.42};
  printf("q1=%i, q2=%f\n", lol.q1, lol.q2);
  struct fish snappy = {"Snappy", "qqq", 666, 42};
  printf("Name = %s\n", snappy.name);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xed2(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2cc4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2cc1(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2cbe(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movsd  0xee0(%rip),%xmm0
mov    $0x29a,%esi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xeea(%rip),%rdi
lea    0xedc(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.lolstruct = type { i32, float }
%struct.fish = type { i8*, i8*, i32, i32 }
@__const.main.lol = %struct.lolstruct { i32 666, float 0x404535C280000000 }
@.str = [14 x i8] c"q1=%i, q2=%f\0A\00"
@.str.1 = [7 x i8] c"Snappy\00"
@.str.2 = [4 x i8] c"qqq\00"
@__const.main.snappy = %struct.fish { i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0), i32 666, i32 42 }
@.str.3 = [11 x i8] c"Name = %s\0A\00"
define i32 @main() {
%1 = alloca %struct.lolstruct
%2 = alloca %struct.fish
%3 = bitcast %struct.lolstruct* %1 to i8*
%4 = getelementptr inbounds %struct.lolstruct, %struct.lolstruct* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = getelementptr inbounds %struct.lolstruct, %struct.lolstruct* %1, i32 0, i32 1
%7 = load float, float* %6
%8 = fpext float %7 to double
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %5, double %8)
%10 = bitcast %struct.fish* %2 to i8*
%11 = getelementptr inbounds %struct.fish, %struct.fish* %2, i32 0, i32 0
%12 = load i8*, i8** %11
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8* %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"q1=%i, q2=%f\0A\00"
@.str.1 = [7 x i8] c"Snappy\00"
@.str.3 = [11 x i8] c"Name = %s\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 666, double 0x404535C280000000)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}