#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 */
struct airport {
  int dummy;
};

/* Variables and functions */
struct airport *a2;
struct airport *head;
int /*<<< orphan*/ insertAirport(struct airport *, struct airport *,
                                 int /*<<< orphan*/ *);
struct airport *newAirport(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ toString(struct airport *);
int main() {
  struct airport *head = newAirport(head, "O'Hare", "Chicago", 8);
  struct airport *a2 = newAirport(a2, "MCO", "Orlando", 4);
  insertAirport(head, a2, NULL);
  toString(head);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%edi
lea    0xeb4(%rip),%rsi
lea    0xeb4(%rip),%rdx
mov    $0x8,%ecx
call   1030 <newAirport@plt>
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %eax,%edi
lea    0xea1(%rip),%rsi
lea    0xe9e(%rip),%rdx
mov    $0x4,%ecx
call   1030 <newAirport@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1050 <insertAirport@plt>
mov    -0x10(%rbp),%rdi
call   1040 <toString@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rsi
lea    0xec8(%rip),%rdx
mov    $0x8,%ecx
call   1030 <newAirport@plt>
mov    %rax,%rbx
lea    0xebc(%rip),%rsi
lea    0xeb9(%rip),%rdx
mov    $0x4,%ecx
call   1030 <newAirport@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
xor    %edx,%edx
call   1050 <insertAirport@plt>
mov    %rbx,%rdi
call   1040 <toString@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.airport = type { i32 }
@.str = [7 x i8] c"O'Hare\00"
@.str.1 = [8 x i8] c"Chicago\00"
@.str.2 = [4 x i8] c"MCO\00"
@.str.3 = [8 x i8] c"Orlando\00"
@a2 = global %struct.airport* null
@head = global %struct.airport* null
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.airport*
%3 = alloca %struct.airport*
store i32 0, i32* %1
%4 = load %struct.airport*, %struct.airport** %2
%5 = ptrtoint %struct.airport* %4 to i32
%6 = call %struct.airport* @newAirport(i32 %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 8)
store %struct.airport* %6, %struct.airport** %2
%7 = load %struct.airport*, %struct.airport** %3
%8 = ptrtoint %struct.airport* %7 to i32
%9 = call %struct.airport* @newAirport(i32 %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 4)
store %struct.airport* %9, %struct.airport** %3
%10 = load %struct.airport*, %struct.airport** %2
%11 = load %struct.airport*, %struct.airport** %3
%12 = call i32 @insertAirport(%struct.airport* %10, %struct.airport* %11, i32* null)
%13 = load %struct.airport*, %struct.airport** %2
%14 = call i32 @toString(%struct.airport* %13)
ret i32 0
}

LLVM IR (-O2):
%struct.airport = type { i32 }
@.str = [7 x i8] c"O'Hare\00"
@.str.1 = [8 x i8] c"Chicago\00"
@.str.2 = [4 x i8] c"MCO\00"
@.str.3 = [8 x i8] c"Orlando\00"
@a2 = global %struct.airport* null
@head = global %struct.airport* null
define i32 @main() {
%1 = tail call %struct.airport* @newAirport(i32 undef, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 8)
%2 = tail call %struct.airport* @newAirport(i32 undef, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 4)
%3 = tail call i32 @insertAirport(%struct.airport* %1, %struct.airport* %2, i32* null)
%4 = tail call i32 @toString(%struct.airport* %1)
ret i32 0
}