#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_5__ TYPE_2__;
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  void *rid;
  void *ip;
  void *dirn;
  void *ia5;
  void *otherName;
  void *other;
};
struct TYPE_5__ {
  int type;
  TYPE_1__ d;
};
typedef TYPE_2__ GENERAL_NAME;

/* Variables and functions */
#define GEN_DIRNAME 136
#define GEN_DNS 135
#define GEN_EDIPARTY 134
#define GEN_EMAIL 133
#define GEN_IPADD 132
#define GEN_OTHERNAME 131
#define GEN_RID 130
#define GEN_URI 129
#define GEN_X400 128
void GENERAL_NAME_set0_value(GENERAL_NAME *a, int type, void *value) {
  switch (type) {
  case GEN_X400:
  case GEN_EDIPARTY:
    a->d.other = value;
    break;
  case GEN_OTHERNAME:
    a->d.otherName = value;
    break;
  case GEN_EMAIL:
  case GEN_DNS:
  case GEN_URI:
    a->d.ia5 = value;
    break;
  case GEN_DIRNAME:
    a->d.dirn = value;
    break;
  case GEN_IPADD:
    a->d.ip = value;
    break;
  case GEN_RID:
    a->d.rid = value;
    break;
  }
  a->type = type;
}


x86 assembly (clang, -O0):
<GENERAL_NAME_set0_value>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0x8,%eax
ja     1199 <GENERAL_NAME_set0_value+0x99>
mov    -0x20(%rbp),%rax
lea    0xed1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x30(%rax)
jmp    1199 <GENERAL_NAME_set0_value+0x99>
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x28(%rax)
jmp    1199 <GENERAL_NAME_set0_value+0x99>
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x20(%rax)
jmp    1199 <GENERAL_NAME_set0_value+0x99>
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x18(%rax)
jmp    1199 <GENERAL_NAME_set0_value+0x99>
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x10(%rax)
jmp    1199 <GENERAL_NAME_set0_value+0x99>
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GENERAL_NAME_set0_value>:
lea    -0x80(%rsi),%eax
cmp    $0x8,%eax
ja     113d <GENERAL_NAME_set0_value+0x3d>
lea    0xef1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0x20(%rdi),%rax
jmp    113a <GENERAL_NAME_set0_value+0x3a>
lea    0x30(%rdi),%rax
jmp    113a <GENERAL_NAME_set0_value+0x3a>
lea    0x8(%rdi),%rax
jmp    113a <GENERAL_NAME_set0_value+0x3a>
lea    0x28(%rdi),%rax
jmp    113a <GENERAL_NAME_set0_value+0x3a>
lea    0x10(%rdi),%rax
jmp    113a <GENERAL_NAME_set0_value+0x3a>
lea    0x18(%rdi),%rax
mov    %rdx,(%rax)
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_5__ = type { i32, %struct.TYPE_4__ }
%struct.TYPE_4__ = type { i8*, i8*, i8*, i8*, i8*, i8* }
define void @GENERAL_NAME_set0_value(%struct.TYPE_5__* %0, i32 %1, i8* %2) {
%4 = alloca %struct.TYPE_5__*
%5 = alloca i32
%6 = alloca i8*
store %struct.TYPE_5__* %0, %struct.TYPE_5__** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
switch i32 %7, label %38 [
i32 128, label %8
i32 134, label %8
i32 131, label %13
i32 133, label %18
i32 135, label %18
i32 129, label %18
i32 136, label %23
i32 132, label %28
i32 130, label %33
]
8: ; preds = %3, %3
%9 = load i8*, i8** %6
%10 = load %struct.TYPE_5__*, %struct.TYPE_5__** %4
%11 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %10, i32 0, i32 1
%12 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %11, i32 0, i32 5
store i8* %9, i8** %12
br label %38
13: ; preds = %3
%14 = load i8*, i8** %6
%15 = load %struct.TYPE_5__*, %struct.TYPE_5__** %4
%16 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %15, i32 0, i32 1
%17 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %16, i32 0, i32 4
store i8* %14, i8** %17
br label %38
18: ; preds = %3, %3, %3
%19 = load i8*, i8** %6
%20 = load %struct.TYPE_5__*, %struct.TYPE_5__** %4
%21 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %20, i32 0, i32 1
%22 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %21, i32 0, i32 3
store i8* %19, i8** %22
br label %38
23: ; preds = %3
%24 = load i8*, i8** %6
%25 = load %struct.TYPE_5__*, %struct.TYPE_5__** %4
%26 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %25, i32 0, i32 1
%27 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %26, i32 0, i32 2
store i8* %24, i8** %27
br label %38
28: ; preds = %3
%29 = load i8*, i8** %6
%30 = load %struct.TYPE_5__*, %struct.TYPE_5__** %4
%31 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %30, i32 0, i32 1
%32 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %31, i32 0, i32 1
store i8* %29, i8** %32
br label %38
33: ; preds = %3
%34 = load i8*, i8** %6
%35 = load %struct.TYPE_5__*, %struct.TYPE_5__** %4
%36 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %35, i32 0, i32 1
%37 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %36, i32 0, i32 0
store i8* %34, i8** %37
br label %38
38: ; preds = %3, %33, %28, %23, %18, %13, %8
%39 = load i32, i32* %5
%40 = load %struct.TYPE_5__*, %struct.TYPE_5__** %4
%41 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %40, i32 0, i32 0
store i32 %39, i32* %41
ret void
}

LLVM IR (-O2):
%struct.TYPE_5__ = type { i32, %struct.TYPE_4__ }
%struct.TYPE_4__ = type { i8*, i8*, i8*, i8*, i8*, i8* }
define void @GENERAL_NAME_set0_value(%struct.TYPE_5__* nocapture writeonly %0, i32 %1, i8* %2) {
switch i32 %1, label %18 [
i32 128, label %4
i32 134, label %4
i32 131, label %6
i32 133, label %8
i32 135, label %8
i32 129, label %8
i32 136, label %10
i32 132, label %12
i32 130, label %14
]
4: ; preds = %3, %3
%5 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %0, i64 0, i32 1, i32 5
br label %16
6: ; preds = %3
%7 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %0, i64 0, i32 1, i32 4
br label %16
8: ; preds = %3, %3, %3
%9 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %0, i64 0, i32 1, i32 3
br label %16
10: ; preds = %3
%11 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %0, i64 0, i32 1, i32 2
br label %16
12: ; preds = %3
%13 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %0, i64 0, i32 1, i32 1
br label %16
14: ; preds = %3
%15 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %0, i64 0, i32 1, i32 0
br label %16
16: ; preds = %4, %6, %8, %10, %12, %14
%17 = phi i8** [ %15, %14 ], [ %13, %12 ], [ %11, %10 ], [ %9, %8 ], [ %7, %6 ], [ %5, %4 ]
store i8* %2, i8** %17
br label %18
18: ; preds = %16, %3
%19 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %0, i64 0, i32 0
store i32 %1, i32* %19
ret void
}