#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*/ fexpect(char *, int, int, int);
void test_struct_designator() {
  struct {
    int x;
    int y;
  } v1 = {.y = 1, .x = 5};
  fexpect(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/initializer.c",
      98, 5, v1.x);
  ;
  fexpect(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/initializer.c",
      99, 1, v1.y);
  ;
  struct {
    int x;
    int y;
  } v2 = {.y = 7};
  fexpect(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/initializer.c",
      102, 7, v2.y);
  ;
  struct {
    int x;
    int y;
    int z;
  } v3 = {.y = 12, 17};
  fexpect(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/initializer.c",
      105, 12, v3.y);
  ;
  fexpect(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/initializer.c",
      106, 17, v3.z);
  ;
}


x86 assembly (clang, -O0):
<test_struct_designator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
lea    0xee3(%rip),%rdi
mov    $0x62,%esi
mov    $0x5,%edx
call   1030 <fexpect@plt>
mov    -0x4(%rbp),%ecx
lea    0xeca(%rip),%rdi
mov    $0x63,%esi
mov    $0x1,%edx
call   1030 <fexpect@plt>
mov    0xeac(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
lea    0xea6(%rip),%rdi
mov    $0x66,%esi
mov    $0x7,%edx
call   1030 <fexpect@plt>
mov    0xf18(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xf16(%rip),%eax
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%ecx
lea    0xe79(%rip),%rdi
mov    $0x69,%esi
mov    $0xc,%edx
call   1030 <fexpect@plt>
mov    -0x18(%rbp),%ecx
lea    0xe60(%rip),%rdi
mov    $0x6a,%esi
mov    $0x11,%edx
call   1030 <fexpect@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_struct_designator>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x62,%esi
mov    $0x5,%edx
mov    $0x5,%ecx
call   1030 <fexpect@plt>
mov    %rbx,%rdi
mov    $0x63,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
call   1030 <fexpect@plt>
mov    %rbx,%rdi
mov    $0x66,%esi
mov    $0x7,%edx
mov    $0x7,%ecx
call   1030 <fexpect@plt>
mov    %rbx,%rdi
mov    $0x69,%esi
mov    $0xc,%edx
mov    $0xc,%ecx
call   1030 <fexpect@plt>
mov    %rbx,%rdi
mov    $0x6a,%esi
mov    $0x11,%edx
mov    $0x11,%ecx
pop    %rbx
jmp    1030 <fexpect@plt>

LLVM IR (-O0):
%struct.anon = type { i32, i32 }
%struct.anon.0 = type { i32, i32 }
%struct.anon.1 = type { i32, i32, i32 }
@__const.test_struct_designator.v1 = %struct.anon { i32 5, i32 1 }
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/initializer.c\00"
@__const.test_struct_designator.v2 = %struct.anon.0 { i32 0, i32 7 }
@__const.test_struct_designator.v3 = %struct.anon.1 { i32 0, i32 12, i32 17 }
define void @test_struct_designator() {
%1 = alloca %struct.anon
%2 = alloca %struct.anon.0
%3 = alloca %struct.anon.1
%4 = bitcast %struct.anon* %1 to i8*
%5 = getelementptr inbounds %struct.anon, %struct.anon* %1, i32 0, i32 0
%6 = load i32, i32* %5
%7 = call i32 @fexpect(i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 98, i32 5, i32 %6)
%8 = getelementptr inbounds %struct.anon, %struct.anon* %1, i32 0, i32 1
%9 = load i32, i32* %8
%10 = call i32 @fexpect(i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 99, i32 1, i32 %9)
%11 = bitcast %struct.anon.0* %2 to i8*
%12 = getelementptr inbounds %struct.anon.0, %struct.anon.0* %2, i32 0, i32 1
%13 = load i32, i32* %12
%14 = call i32 @fexpect(i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 102, i32 7, i32 %13)
%15 = bitcast %struct.anon.1* %3 to i8*
%16 = getelementptr inbounds %struct.anon.1, %struct.anon.1* %3, i32 0, i32 1
%17 = load i32, i32* %16
%18 = call i32 @fexpect(i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 105, i32 12, i32 %17)
%19 = getelementptr inbounds %struct.anon.1, %struct.anon.1* %3, i32 0, i32 2
%20 = load i32, i32* %19
%21 = call i32 @fexpect(i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 106, i32 17, i32 %20)
ret void
}

LLVM IR (-O2):
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/initializer.c\00"
define void @test_struct_designator() {
%1 = tail call i32 @fexpect(i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 98, i32 5, i32 5)
%2 = tail call i32 @fexpect(i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 99, i32 1, i32 1)
%3 = tail call i32 @fexpect(i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 102, i32 7, i32 7)
%4 = tail call i32 @fexpect(i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 105, i32 12, i32 12)
%5 = tail call i32 @fexpect(i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 106, i32 17, i32 17)
ret void
}