#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 */
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ x;
struct TYPE_4__ {
  int id;
  int x;
  int y;
  int z;
  int bstate;
};
typedef TYPE_1__ MEVENT;

/* Variables and functions */
int /*<<< orphan*/ memset(TYPE_1__ *, int /*<<< orphan*/, int);
int /*<<< orphan*/ mrep_rep(char *, TYPE_1__ *);
int /*<<< orphan*/ printf(char *, ...);
void gen_mrep_rep(const char *name) {
  MEVENT x;
  printf("   for %s use\n      record\n", name);
  memset(&x, 0, sizeof(x));
  x.id = -1;
  mrep_rep("Id", &x);
  memset(&x, 0, sizeof(x));
  x.x = -1;
  mrep_rep("X", &x);
  memset(&x, 0, sizeof(x));
  x.y = -1;
  mrep_rep("Y", &x);
  memset(&x, 0, sizeof(x));
  x.z = -1;
  mrep_rep("Z", &x);
  memset(&x, 0, sizeof(x));
  x.bstate = -1;
  mrep_rep("Bstate", &x);
  printf("      end record;\n");
  printf("      --  Please note: this rep. clause is generated and may be\n");
  printf("      --               different on your system.\n");
}


x86 assembly (clang, -O0):
<gen_mrep_rep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
movl   $0xffffffff,-0x20(%rbp)
lea    0xeb0(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1050 <mrep_rep@plt>
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
movl   $0xffffffff,-0x1c(%rbp)
lea    0xe8c(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1050 <mrep_rep@plt>
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
movl   $0xffffffff,-0x18(%rbp)
lea    0xe67(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1050 <mrep_rep@plt>
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
movl   $0xffffffff,-0x14(%rbp)
lea    0xe42(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1050 <mrep_rep@plt>
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
movl   $0xffffffff,-0x10(%rbp)
lea    0xe1d(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1050 <mrep_rep@plt>
lea    0xe14(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe19(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe4c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_mrep_rep>:
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rsi
lea    0xeb1(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1050 <memset@plt>
movl   $0xffffffff,0x8(%rsp)
ff
lea    0xea3(%rip),%rdi
mov    %rbx,%rsi
call   1060 <mrep_rep@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1050 <memset@plt>
movl   $0xffffffff,0xc(%rsp)
ff
lea    0xe80(%rip),%rdi
mov    %rbx,%rsi
call   1060 <mrep_rep@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1050 <memset@plt>
movl   $0xffffffff,0x10(%rsp)
ff
lea    0xe5c(%rip),%rdi
mov    %rbx,%rsi
call   1060 <mrep_rep@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1050 <memset@plt>
movl   $0xffffffff,0x14(%rsp)
ff
lea    0xe38(%rip),%rdi
mov    %rbx,%rsi
call   1060 <mrep_rep@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1050 <memset@plt>
movl   $0xffffffff,0x18(%rsp)
ff
lea    0xe14(%rip),%rdi
mov    %rbx,%rsi
call   1060 <mrep_rep@plt>
lea    0xe0c(%rip),%rdi
call   1030 <puts@plt>
lea    0xe12(%rip),%rdi
call   1030 <puts@plt>
lea    0xe46(%rip),%rdi
call   1030 <puts@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { i32, i32, i32, i32, i32 }
@.str = [28 x i8] c" for %s use\0A record\0A\00"
@.str.1 = [3 x i8] c"Id\00"
@.str.2 = [2 x i8] c"X\00"
@.str.3 = [2 x i8] c"Y\00"
@.str.4 = [2 x i8] c"Z\00"
@.str.5 = [7 x i8] c"Bstate\00"
@.str.6 = [19 x i8] c" end record;\0A\00"
@.str.7 = [65 x i8] c" -- Please note: this rep. clause is generated and may be\0A\00"
@.str.8 = [50 x i8] c" -- different on your system.\0A\00"
define void @gen_mrep_rep(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.TYPE_4__
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @memset(%struct.TYPE_4__* %3, i32 0, i32 20)
%7 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %3, i32 0, i32 0
store i32 -1, i32* %7
%8 = call i32 @mrep_rep(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %struct.TYPE_4__* %3)
%9 = call i32 @memset(%struct.TYPE_4__* %3, i32 0, i32 20)
%10 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %3, i32 0, i32 1
store i32 -1, i32* %10
%11 = call i32 @mrep_rep(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), %struct.TYPE_4__* %3)
%12 = call i32 @memset(%struct.TYPE_4__* %3, i32 0, i32 20)
%13 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %3, i32 0, i32 2
store i32 -1, i32* %13
%14 = call i32 @mrep_rep(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), %struct.TYPE_4__* %3)
%15 = call i32 @memset(%struct.TYPE_4__* %3, i32 0, i32 20)
%16 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %3, i32 0, i32 3
store i32 -1, i32* %16
%17 = call i32 @mrep_rep(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), %struct.TYPE_4__* %3)
%18 = call i32 @memset(%struct.TYPE_4__* %3, i32 0, i32 20)
%19 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %3, i32 0, i32 4
store i32 -1, i32* %19
%20 = call i32 @mrep_rep(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), %struct.TYPE_4__* %3)
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.7, i64 0, i64 0))
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.8, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { i32, i32, i32, i32, i32 }
@.str = [28 x i8] c" for %s use\0A record\0A\00"
@.str.1 = [3 x i8] c"Id\00"
@.str.2 = [2 x i8] c"X\00"
@.str.3 = [2 x i8] c"Y\00"
@.str.4 = [2 x i8] c"Z\00"
@.str.5 = [7 x i8] c"Bstate\00"
@str = [18 x i8] c" end record;\00"
@str.9 = [64 x i8] c" -- Please note: this rep. clause is generated and may be\00"
@str.10 = [49 x i8] c" -- different on your system.\00"
define void @gen_mrep_rep(i8* %0) {
%2 = alloca %struct.TYPE_4__
%3 = bitcast %struct.TYPE_4__* %2 to i8*
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @memset(%struct.TYPE_4__* %2, i32 0, i32 20)
%6 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %2, i64 0, i32 0
store i32 -1, i32* %6
%7 = call i32 @mrep_rep(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %struct.TYPE_4__* %2)
%8 = call i32 @memset(%struct.TYPE_4__* %2, i32 0, i32 20)
%9 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %2, i64 0, i32 1
store i32 -1, i32* %9
%10 = call i32 @mrep_rep(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), %struct.TYPE_4__* %2)
%11 = call i32 @memset(%struct.TYPE_4__* %2, i32 0, i32 20)
%12 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %2, i64 0, i32 2
store i32 -1, i32* %12
%13 = call i32 @mrep_rep(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), %struct.TYPE_4__* %2)
%14 = call i32 @memset(%struct.TYPE_4__* %2, i32 0, i32 20)
%15 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %2, i64 0, i32 3
store i32 -1, i32* %15
%16 = call i32 @mrep_rep(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), %struct.TYPE_4__* %2)
%17 = call i32 @memset(%struct.TYPE_4__* %2, i32 0, i32 20)
%18 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %2, i64 0, i32 4
store i32 -1, i32* %18
%19 = call i32 @mrep_rep(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), %struct.TYPE_4__* %2)
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str.9, i64 0, i64 0))
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.10, i64 0, i64 0))
ret void
}