#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);
int main(void) {
  struct entry {
    int value;
    struct entry *next;
  };
  struct entry n1, n2, n3;
  int i;
  n1.value = 100;
  n2.value = 200;
  n3.value = 300;
  n1.next = &n2;
  n2.next = &n3;
  i = n1.next->value;
  printf("%i  ", i);
  printf("%i\n", n2.next->value);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x18(%rbp)
movl   $0xc8,-0x28(%rbp)
movl   $0x12c,-0x38(%rbp)
lea    -0x28(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x38(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%esi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0xc8,%esi
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
mov    $0x12c,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.entry = type { i32, %struct.entry* }
@.str = [5 x i8] c"%i \00"
@.str.1 = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.entry
%3 = alloca %struct.entry
%4 = alloca %struct.entry
%5 = alloca i32
store i32 0, i32* %1
%6 = getelementptr inbounds %struct.entry, %struct.entry* %2, i32 0, i32 0
store i32 100, i32* %6
%7 = getelementptr inbounds %struct.entry, %struct.entry* %3, i32 0, i32 0
store i32 200, i32* %7
%8 = getelementptr inbounds %struct.entry, %struct.entry* %4, i32 0, i32 0
store i32 300, i32* %8
%9 = getelementptr inbounds %struct.entry, %struct.entry* %2, i32 0, i32 1
store %struct.entry* %3, %struct.entry** %9
%10 = getelementptr inbounds %struct.entry, %struct.entry* %3, i32 0, i32 1
store %struct.entry* %4, %struct.entry** %10
%11 = getelementptr inbounds %struct.entry, %struct.entry* %2, i32 0, i32 1
%12 = load %struct.entry*, %struct.entry** %11
%13 = getelementptr inbounds %struct.entry, %struct.entry* %12, i32 0, i32 0
%14 = load i32, i32* %13
store i32 %14, i32* %5
%15 = load i32, i32* %5
%16 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = getelementptr inbounds %struct.entry, %struct.entry* %3, i32 0, i32 1
%18 = load %struct.entry*, %struct.entry** %17
%19 = getelementptr inbounds %struct.entry, %struct.entry* %18, i32 0, i32 0
%20 = load i32, i32* %19
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %20)
ret i32 0
}

LLVM IR (-O2):
%struct.entry = type { i32, %struct.entry* }
@.str = [5 x i8] c"%i \00"
@.str.1 = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 200)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 300)
ret i32 0
}