#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_1__;

/* Type definitions */
typedef int /*<<< orphan*/ XtPointer;
typedef TYPE_1__ *XrmValuePtr;
typedef int /*<<< orphan*/ *XPointer;
struct TYPE_5__ {
  scalar_t__ size;
  int /*<<< orphan*/ *addr;
};
typedef char *String;
typedef int /*<<< orphan*/ Display;
typedef scalar_t__ Cardinal;
typedef int /*<<< orphan*/ Boolean;

/* Variables and functions */
#define Always 130
int /*<<< orphan*/ False;
#define NotUseful 129
int /*<<< orphan*/ True;
#define WhenMapped 128
int /*<<< orphan*/ XtWarning(char *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
Boolean XmuCvtBackingStoreToString(Display *dpy, XrmValuePtr args,
                                   Cardinal *num_args, XrmValuePtr fromVal,
                                   XrmValuePtr toVal, XtPointer *data) {
  static String buffer;
  Cardinal size;
  switch (*(int *)fromVal->addr) {
  case NotUseful:
    buffer = "notUseful";
    break;
  case WhenMapped:
    buffer = "whenMapped";
    break;
  case Always:
    buffer = "always";
    break;
  case (Always + WhenMapped + NotUseful):
    buffer = "default";
    break;
  default:
    XtWarning("Cannot convert BackingStore to String");
    toVal->addr = NULL;
    toVal->size = 0;
    return (False);
  }
  size = strlen(buffer) + 1;
  if (toVal->addr != NULL) {
    if (toVal->size < size) {
      toVal->size = size;
      return (False);
    }
    strcpy((char *)toVal->addr, buffer);
  } else
    toVal->addr = (XPointer)buffer;
  toVal->size = sizeof(String);
  return (True);
}


x86 assembly (clang, -O0):
<XmuCvtBackingStoreToString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    -0x28(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%eax
mov    %eax,-0x44(%rbp)
sub    $0x80,%eax
je     11b9 <XmuCvtBackingStoreToString+0x89>
jmp    116d <XmuCvtBackingStoreToString+0x3d>
mov    -0x44(%rbp),%eax
sub    $0x81,%eax
je     11a6 <XmuCvtBackingStoreToString+0x76>
jmp    1180 <XmuCvtBackingStoreToString+0x50>
mov    -0x44(%rbp),%eax
sub    $0x82,%eax
je     11cc <XmuCvtBackingStoreToString+0x9c>
jmp    1193 <XmuCvtBackingStoreToString+0x63>
mov    -0x44(%rbp),%eax
sub    $0x183,%eax
je     11df <XmuCvtBackingStoreToString+0xaf>
jmp    11f2 <XmuCvtBackingStoreToString+0xc2>
lea    0xe53(%rip),%rax
mov    %rax,0x2e8c(%rip)
jmp    1226 <XmuCvtBackingStoreToString+0xf6>
lea    0xe4a(%rip),%rax
mov    %rax,0x2e79(%rip)
jmp    1226 <XmuCvtBackingStoreToString+0xf6>
lea    0xe42(%rip),%rax
mov    %rax,0x2e66(%rip)
jmp    1226 <XmuCvtBackingStoreToString+0xf6>
lea    0xe36(%rip),%rax
mov    %rax,0x2e53(%rip)
jmp    1226 <XmuCvtBackingStoreToString+0xf6>
lea    0xe2b(%rip),%rdi
call   1050 <XtWarning@plt>
mov    -0x30(%rbp),%rax
movq   $0x0,0x8(%rax)
mov    -0x30(%rbp),%rax
movq   $0x0,(%rax)
mov    0x2dcc(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12b5 <XmuCvtBackingStoreToString+0x185>
mov    0x2e13(%rip),%rdi
call   1040 <strlen@plt>
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
mov    -0x30(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     128f <XmuCvtBackingStoreToString+0x15f>
mov    -0x30(%rbp),%rax
mov    (%rax),%rax
cmp    -0x40(%rbp),%rax
jge    1276 <XmuCvtBackingStoreToString+0x146>
mov    -0x40(%rbp),%rcx
mov    -0x30(%rbp),%rax
mov    %rcx,(%rax)
mov    0x2d7c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12b5 <XmuCvtBackingStoreToString+0x185>
mov    -0x30(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2dbb(%rip),%rsi
call   1030 <strcpy@plt>
jmp    129e <XmuCvtBackingStoreToString+0x16e>
mov    0x2daa(%rip),%rcx
mov    -0x30(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x30(%rbp),%rax
movq   $0x8,(%rax)
mov    0x2d30(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XmuCvtBackingStoreToString>:
push   %r14
push   %rbx
push   %rax
mov    %r8,%r14
mov    0x8(%rcx),%rax
mov    (%rax),%eax
cmp    $0x81,%eax
jg     115b <XmuCvtBackingStoreToString+0x2b>
cmp    $0x80,%eax
je     1187 <XmuCvtBackingStoreToString+0x57>
cmp    $0x81,%eax
jne    1172 <XmuCvtBackingStoreToString+0x42>
lea    0xea7(%rip),%rbx
jmp    1197 <XmuCvtBackingStoreToString+0x67>
cmp    $0x82,%eax
je     1190 <XmuCvtBackingStoreToString+0x60>
cmp    $0x183,%eax
jne    1172 <XmuCvtBackingStoreToString+0x42>
lea    0xeac(%rip),%rbx
jmp    1197 <XmuCvtBackingStoreToString+0x67>
lea    0xeab(%rip),%rdi
call   1050 <XtWarning@plt>
xorps  %xmm0,%xmm0
movups %xmm0,(%r14)
jmp    11d9 <XmuCvtBackingStoreToString+0xa9>
lea    0xe7c(%rip),%rbx
jmp    1197 <XmuCvtBackingStoreToString+0x67>
lea    0xe7e(%rip),%rbx
mov    %rbx,0x2ea2(%rip)
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    0x8(%r14),%rdi
test   %rdi,%rdi
je     11be <XmuCvtBackingStoreToString+0x8e>
cmp    %rax,(%r14)
jle    11d2 <XmuCvtBackingStoreToString+0xa2>
mov    %rbx,%rsi
call   1030 <strcpy@plt>
jmp    11c2 <XmuCvtBackingStoreToString+0x92>
mov    %rbx,0x8(%r14)
movq   $0x8,(%r14)
mov    0x2e10(%rip),%rax
jmp    11e0 <XmuCvtBackingStoreToString+0xb0>
add    $0x1,%rax
mov    %rax,(%r14)
mov    0x2e08(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.TYPE_5__ = type { i64, i32* }
@XmuCvtBackingStoreToString.buffer = internal global i8* null
@.str = [10 x i8] c"notUseful\00"
@.str.1 = [11 x i8] c"whenMapped\00"
@.str.2 = [7 x i8] c"always\00"
@.str.3 = [8 x i8] c"default\00"
@.str.4 = [38 x i8] c"Cannot convert BackingStore to String\00"
@False = global i32 0
@True = global i32 0
define i32 @XmuCvtBackingStoreToString(i32* %0, %struct.TYPE_5__* %1, i64* %2, %struct.TYPE_5__* %3, %struct.TYPE_5__* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32*
%9 = alloca %struct.TYPE_5__*
%10 = alloca i64*
%11 = alloca %struct.TYPE_5__*
%12 = alloca %struct.TYPE_5__*
%13 = alloca i32*
%14 = alloca i64
store i32* %0, i32** %8
store %struct.TYPE_5__* %1, %struct.TYPE_5__** %9
store i64* %2, i64** %10
store %struct.TYPE_5__* %3, %struct.TYPE_5__** %11
store %struct.TYPE_5__* %4, %struct.TYPE_5__** %12
store i32* %5, i32** %13
%15 = load %struct.TYPE_5__*, %struct.TYPE_5__** %11
%16 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %15, i32 0, i32 1
%17 = load i32*, i32** %16
%18 = load i32, i32* %17
switch i32 %18, label %23 [
i32 129, label %19
i32 128, label %20
i32 130, label %21
i32 387, label %22
]
19: ; preds = %6
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** @XmuCvtBackingStoreToString.buffer
br label %30
20: ; preds = %6
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8** @XmuCvtBackingStoreToString.buffer
br label %30
21: ; preds = %6
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8** @XmuCvtBackingStoreToString.buffer
br label %30
22: ; preds = %6
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8** @XmuCvtBackingStoreToString.buffer
br label %30
23: ; preds = %6
%24 = call i32 @XtWarning(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0))
%25 = load %struct.TYPE_5__*, %struct.TYPE_5__** %12
%26 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %25, i32 0, i32 1
store i32* null, i32** %26
%27 = load %struct.TYPE_5__*, %struct.TYPE_5__** %12
%28 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %27, i32 0, i32 0
store i64 0, i64* %28
%29 = load i32, i32* @False
store i32 %29, i32* %7
br label %65
30: ; preds = %22, %21, %20, %19
%31 = load i8*, i8** @XmuCvtBackingStoreToString.buffer
%32 = call i64 @strlen(i8* %31)
%33 = add nsw i64 %32, 1
store i64 %33, i64* %14
%34 = load %struct.TYPE_5__*, %struct.TYPE_5__** %12
%35 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %34, i32 0, i32 1
%36 = load i32*, i32** %35
%37 = icmp ne i32* %36, null
br i1 %37, label %38, label %56
38: ; preds = %30
%39 = load %struct.TYPE_5__*, %struct.TYPE_5__** %12
%40 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %39, i32 0, i32 0
%41 = load i64, i64* %40
%42 = load i64, i64* %14
%43 = icmp slt i64 %41, %42
br i1 %43, label %44, label %49
44: ; preds = %38
%45 = load i64, i64* %14
%46 = load %struct.TYPE_5__*, %struct.TYPE_5__** %12
%47 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %46, i32 0, i32 0
store i64 %45, i64* %47
%48 = load i32, i32* @False
store i32 %48, i32* %7
br label %65
49: ; preds = %38
%50 = load %struct.TYPE_5__*, %struct.TYPE_5__** %12
%51 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %50, i32 0, i32 1
%52 = load i32*, i32** %51
%53 = bitcast i32* %52 to i8*
%54 = load i8*, i8** @XmuCvtBackingStoreToString.buffer
%55 = call i32 @strcpy(i8* %53, i8* %54)
br label %61
56: ; preds = %30
%57 = load i8*, i8** @XmuCvtBackingStoreToString.buffer
%58 = bitcast i8* %57 to i32*
%59 = load %struct.TYPE_5__*, %struct.TYPE_5__** %12
%60 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %59, i32 0, i32 1
store i32* %58, i32** %60
br label %61
61: ; preds = %56, %49
%62 = load %struct.TYPE_5__*, %struct.TYPE_5__** %12
%63 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %62, i32 0, i32 0
store i64 8, i64* %63
%64 = load i32, i32* @True
store i32 %64, i32* %7
br label %65
65: ; preds = %61, %44, %23
%66 = load i32, i32* %7
ret i32 %66
}

LLVM IR (-O2):
%struct.TYPE_5__ = type { i64, i32* }
@XmuCvtBackingStoreToString.buffer = internal unnamed_addr global i8* null
@.str = [10 x i8] c"notUseful\00"
@.str.1 = [11 x i8] c"whenMapped\00"
@.str.2 = [7 x i8] c"always\00"
@.str.3 = [8 x i8] c"default\00"
@.str.4 = [38 x i8] c"Cannot convert BackingStore to String\00"
@False = global i32 0
@True = global i32 0
define i32 @XmuCvtBackingStoreToString(i32* nocapture readnone %0, %struct.TYPE_5__* nocapture readnone %1, i64* nocapture readnone %2, %struct.TYPE_5__* nocapture %3, %struct.TYPE_5__* nocapture %4, i32* nocapture readnone %5) {
%7 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %3, i64 0, i32 1
%8 = load i32*, i32** %7
%9 = load i32, i32* %8
switch i32 %9, label %13 [
i32 129, label %16
i32 128, label %10
i32 130, label %11
i32 387, label %12
]
10: ; preds = %6
br label %16
11: ; preds = %6
br label %16
12: ; preds = %6
br label %16
13: ; preds = %6
%14 = tail call i32 @XtWarning(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0))
%15 = bitcast %struct.TYPE_5__* %4 to i8*
br label %35
16: ; preds = %6, %12, %11, %10
%17 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), %12 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), %11 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), %10 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), %6 ]
store i8* %17, i8** @XmuCvtBackingStoreToString.buffer
%18 = tail call i64 @strlen(i8* dereferenceable(1) %17)
%19 = add nsw i64 %18, 1
%20 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %4, i64 0, i32 1
%21 = load i32*, i32** %20
%22 = icmp eq i32* %21, null
br i1 %22, label %31, label %23
23: ; preds = %16
%24 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %4, i64 0, i32 0
%25 = load i64, i64* %24
%26 = icmp sgt i64 %25, %18
br i1 %26, label %28, label %27
27: ; preds = %23
store i64 %19, i64* %24
br label %35
28: ; preds = %23
%29 = bitcast i32* %21 to i8*
%30 = tail call i32 @strcpy(i8* %29, i8* %17)
br label %33
31: ; preds = %16
%32 = bitcast i32** %20 to i8**
store i8* %17, i8** %32
br label %33
33: ; preds = %31, %28
%34 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %4, i64 0, i32 0
store i64 8, i64* %34
br label %35
35: ; preds = %33, %27, %13
%36 = phi i32* [ @False, %13 ], [ @False, %27 ], [ @True, %33 ]
%37 = load i32, i32* %36
ret i32 %37
}