#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 */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ a;
typedef int /*<<< orphan*/ A;

/* Variables and functions */
int /*<<< orphan*/ swprintf(int /*<<< orphan*/ *, int, char *,
                            long double const);
scalar_t__ wmemcmp(int /*<<< orphan*/ *, char *, int);
int do_test(void) {
  int result = 0;
  const long double x = 24.5;
  wchar_t a[16];
  swprintf(a, sizeof(a), L"%La\n", x);
  wchar_t A[16];
  swprintf(A, sizeof(A) / sizeof(A[0]), L"%LA\n", x);
  result |=
      (wmemcmp(a, L"0xc.4p+1", 8) == 0 && wmemcmp(A, L"0XC.4P+1", 8) == 0);
  result |=
      (wmemcmp(a, L"0x3.1p+3", 8) == 0 && wmemcmp(A, L"0X3.1P+3", 8) == 0);
  result |=
      (wmemcmp(a, L"0x6.2p+2", 8) == 0 && wmemcmp(A, L"0X6.2P+2", 8) == 0);
  result |=
      (wmemcmp(a, L"0x1.88p+4", 8) == 0 && wmemcmp(A, L"0X1.88P+4", 8) == 0);
  return result != 1;
}


x86 assembly (clang, -O0):
<do_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
flds   0xec8(%rip)
fstpt  -0x20(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xebe(%rip),%rax
mov    %rsp,%rax
flds   0xeb1(%rip)
fstpt  (%rax)
lea    0xeac(%rip),%rdx
mov    $0x40,%esi
call   1030 <swprintf@plt>
lea    -0xa0(%rbp),%rdi
lea    0xea8(%rip),%rax
mov    %rsp,%rax
flds   0xe87(%rip)
fstpt  (%rax)
lea    0xe96(%rip),%rdx
mov    $0x10,%esi
call   1030 <swprintf@plt>
lea    -0x60(%rbp),%rdi
lea    0xe95(%rip),%rsi
mov    $0x8,%edx
call   1040 <wmemcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0xa1(%rbp)
jne    11db <do_test+0xbb>
lea    -0xa0(%rbp),%rdi
lea    0xe8c(%rip),%rsi
mov    $0x8,%edx
call   1040 <wmemcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0xa1(%rbp)
mov    -0xa1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xe7d(%rip),%rsi
mov    $0x8,%edx
call   1040 <wmemcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0xa2(%rbp)
jne    123b <do_test+0x11b>
lea    -0xa0(%rbp),%rdi
lea    0xe74(%rip),%rsi
mov    $0x8,%edx
call   1040 <wmemcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0xa2(%rbp)
mov    -0xa2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xe65(%rip),%rsi
mov    $0x8,%edx
call   1040 <wmemcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0xa3(%rbp)
jne    129b <do_test+0x17b>
lea    -0xa0(%rbp),%rdi
lea    0xe5c(%rip),%rsi
mov    $0x8,%edx
call   1040 <wmemcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0xa3(%rbp)
mov    -0xa3(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xe4d(%rip),%rsi
mov    $0x8,%edx
call   1040 <wmemcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0xa4(%rbp)
jne    12fb <do_test+0x1db>
lea    -0xa0(%rbp),%rdi
lea    0xe48(%rip),%rsi
mov    $0x8,%edx
call   1040 <wmemcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0xa4(%rbp)
mov    -0xa4(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_test>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0xa8,%rsp
flds   0xecd(%rip)
fld    %st(0)
fstpt  0x14(%rsp)
fstpt  (%rsp)
lea    0xec1(%rip),%rdx
lea    0x60(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x40,%esi
call   1030 <swprintf@plt>
fldt   0x14(%rsp)
fstpt  (%rsp)
lea    0xeb5(%rip),%rdx
lea    0x20(%rsp),%rdi
mov    $0x10,%esi
call   1030 <swprintf@plt>
lea    0xeb3(%rip),%rsi
mov    %rbx,%rdi
mov    $0x8,%edx
call   1040 <wmemcmp@plt>
xor    %ebx,%ebx
mov    $0x0,%r14d
test   %rax,%rax
jne    11b3 <do_test+0x93>
lea    0xeb6(%rip),%rsi
lea    0x20(%rsp),%rdi
mov    $0x8,%edx
call   1040 <wmemcmp@plt>
xor    %r14d,%r14d
test   %rax,%rax
sete   %r14b
lea    0xeba(%rip),%rsi
lea    0x60(%rsp),%rdi
mov    $0x8,%edx
call   1040 <wmemcmp@plt>
test   %rax,%rax
jne    11ec <do_test+0xcc>
lea    0xec3(%rip),%rsi
lea    0x20(%rsp),%rdi
mov    $0x8,%edx
call   1040 <wmemcmp@plt>
xor    %ebx,%ebx
test   %rax,%rax
sete   %bl
lea    0xec9(%rip),%rsi
lea    0x60(%rsp),%rdi
mov    $0x8,%edx
call   1040 <wmemcmp@plt>
xor    %r15d,%r15d
mov    $0x0,%ebp
test   %rax,%rax
jne    122e <do_test+0x10e>
lea    0xeca(%rip),%rsi
lea    0x20(%rsp),%rdi
mov    $0x8,%edx
call   1040 <wmemcmp@plt>
xor    %ebp,%ebp
test   %rax,%rax
sete   %bpl
lea    0xecf(%rip),%rsi
lea    0x60(%rsp),%rdi
mov    $0x8,%edx
call   1040 <wmemcmp@plt>
test   %rax,%rax
jne    1269 <do_test+0x149>
lea    0xedc(%rip),%rsi
lea    0x20(%rsp),%rdi
mov    $0x8,%edx
call   1040 <wmemcmp@plt>
xor    %r15d,%r15d
test   %rax,%rax
sete   %r15b
or     %r14d,%ebx
or     %ebp,%ebx
or     %r15d,%ebx
xor    $0x1,%ebx
mov    %ebx,%eax
add    $0xa8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i32] [i32 37, i32 76, i32 97, i32 10, i32 0]
@.str.1 = [5 x i32] [i32 37, i32 76, i32 65, i32 10, i32 0]
@.str.2 = [9 x i32] [i32 48, i32 120, i32 99, i32 46, i32 52, i32 112, i32 43, i32 49, i32 0]
@.str.3 = [9 x i32] [i32 48, i32 88, i32 67, i32 46, i32 52, i32 80, i32 43, i32 49, i32 0]
@.str.4 = [9 x i32] [i32 48, i32 120, i32 51, i32 46, i32 49, i32 112, i32 43, i32 51, i32 0]
@.str.5 = [9 x i32] [i32 48, i32 88, i32 51, i32 46, i32 49, i32 80, i32 43, i32 51, i32 0]
@.str.6 = [9 x i32] [i32 48, i32 120, i32 54, i32 46, i32 50, i32 112, i32 43, i32 50, i32 0]
@.str.7 = [9 x i32] [i32 48, i32 88, i32 54, i32 46, i32 50, i32 80, i32 43, i32 50, i32 0]
@.str.8 = [10 x i32] [i32 48, i32 120, i32 49, i32 46, i32 56, i32 56, i32 112, i32 43, i32 52, i32 0]
@.str.9 = [10 x i32] [i32 48, i32 88, i32 49, i32 46, i32 56, i32 56, i32 80, i32 43, i32 52, i32 0]
define i32 @do_test() {
%1 = alloca i32
%2 = alloca x86_fp80
%3 = alloca [16 x i32]
%4 = alloca [16 x i32]
store i32 0, i32* %1
store x86_fp80 0xK4003C400000000000000, x86_fp80* %2
%5 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 0
%6 = call i32 @swprintf(i32* %5, i32 64, i8* bitcast ([5 x i32]* @.str to i8*), x86_fp80 0xK4003C400000000000000)
%7 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 0
%8 = call i32 @swprintf(i32* %7, i32 16, i8* bitcast ([5 x i32]* @.str.1 to i8*), x86_fp80 0xK4003C400000000000000)
%9 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 0
%10 = call i64 @wmemcmp(i32* %9, i8* bitcast ([9 x i32]* @.str.2 to i8*), i32 8)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %0
%13 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 0
%14 = call i64 @wmemcmp(i32* %13, i8* bitcast ([9 x i32]* @.str.3 to i8*), i32 8)
%15 = icmp eq i64 %14, 0
br label %16
16: ; preds = %12, %0
%17 = phi i1 [ false, %0 ], [ %15, %12 ]
%18 = zext i1 %17 to i32
%19 = load i32, i32* %1
%20 = or i32 %19, %18
store i32 %20, i32* %1
%21 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 0
%22 = call i64 @wmemcmp(i32* %21, i8* bitcast ([9 x i32]* @.str.4 to i8*), i32 8)
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %28
24: ; preds = %16
%25 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 0
%26 = call i64 @wmemcmp(i32* %25, i8* bitcast ([9 x i32]* @.str.5 to i8*), i32 8)
%27 = icmp eq i64 %26, 0
br label %28
28: ; preds = %24, %16
%29 = phi i1 [ false, %16 ], [ %27, %24 ]
%30 = zext i1 %29 to i32
%31 = load i32, i32* %1
%32 = or i32 %31, %30
store i32 %32, i32* %1
%33 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 0
%34 = call i64 @wmemcmp(i32* %33, i8* bitcast ([9 x i32]* @.str.6 to i8*), i32 8)
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %40
36: ; preds = %28
%37 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 0
%38 = call i64 @wmemcmp(i32* %37, i8* bitcast ([9 x i32]* @.str.7 to i8*), i32 8)
%39 = icmp eq i64 %38, 0
br label %40
40: ; preds = %36, %28
%41 = phi i1 [ false, %28 ], [ %39, %36 ]
%42 = zext i1 %41 to i32
%43 = load i32, i32* %1
%44 = or i32 %43, %42
store i32 %44, i32* %1
%45 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 0
%46 = call i64 @wmemcmp(i32* %45, i8* bitcast ([10 x i32]* @.str.8 to i8*), i32 8)
%47 = icmp eq i64 %46, 0
br i1 %47, label %48, label %52
48: ; preds = %40
%49 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 0
%50 = call i64 @wmemcmp(i32* %49, i8* bitcast ([10 x i32]* @.str.9 to i8*), i32 8)
%51 = icmp eq i64 %50, 0
br label %52
52: ; preds = %48, %40
%53 = phi i1 [ false, %40 ], [ %51, %48 ]
%54 = zext i1 %53 to i32
%55 = load i32, i32* %1
%56 = or i32 %55, %54
store i32 %56, i32* %1
%57 = load i32, i32* %1
%58 = icmp ne i32 %57, 1
%59 = zext i1 %58 to i32
ret i32 %59
}

LLVM IR (-O2):
@.str = [5 x i32] [i32 37, i32 76, i32 97, i32 10, i32 0]
@.str.1 = [5 x i32] [i32 37, i32 76, i32 65, i32 10, i32 0]
@.str.2 = [9 x i32] [i32 48, i32 120, i32 99, i32 46, i32 52, i32 112, i32 43, i32 49, i32 0]
@.str.3 = [9 x i32] [i32 48, i32 88, i32 67, i32 46, i32 52, i32 80, i32 43, i32 49, i32 0]
@.str.4 = [9 x i32] [i32 48, i32 120, i32 51, i32 46, i32 49, i32 112, i32 43, i32 51, i32 0]
@.str.5 = [9 x i32] [i32 48, i32 88, i32 51, i32 46, i32 49, i32 80, i32 43, i32 51, i32 0]
@.str.6 = [9 x i32] [i32 48, i32 120, i32 54, i32 46, i32 50, i32 112, i32 43, i32 50, i32 0]
@.str.7 = [9 x i32] [i32 48, i32 88, i32 54, i32 46, i32 50, i32 80, i32 43, i32 50, i32 0]
@.str.8 = [10 x i32] [i32 48, i32 120, i32 49, i32 46, i32 56, i32 56, i32 112, i32 43, i32 52, i32 0]
@.str.9 = [10 x i32] [i32 48, i32 88, i32 49, i32 46, i32 56, i32 56, i32 80, i32 43, i32 52, i32 0]
define i32 @do_test() {
%1 = alloca [16 x i32]
%2 = alloca [16 x i32]
%3 = bitcast [16 x i32]* %1 to i8*
%4 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 0
%5 = call i32 @swprintf(i32* %4, i32 64, i8* bitcast ([5 x i32]* @.str to i8*), x86_fp80 0xK4003C400000000000000)
%6 = bitcast [16 x i32]* %2 to i8*
%7 = getelementptr inbounds [16 x i32], [16 x i32]* %2, i64 0, i64 0
%8 = call i32 @swprintf(i32* %7, i32 16, i8* bitcast ([5 x i32]* @.str.1 to i8*), x86_fp80 0xK4003C400000000000000)
%9 = call i64 @wmemcmp(i32* %4, i8* bitcast ([9 x i32]* @.str.2 to i8*), i32 8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %0
%12 = call i64 @wmemcmp(i32* %7, i8* bitcast ([9 x i32]* @.str.3 to i8*), i32 8)
%13 = icmp eq i64 %12, 0
%14 = zext i1 %13 to i32
br label %15
15: ; preds = %11, %0
%16 = phi i32 [ 0, %0 ], [ %14, %11 ]
%17 = call i64 @wmemcmp(i32* %4, i8* bitcast ([9 x i32]* @.str.4 to i8*), i32 8)
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %23
19: ; preds = %15
%20 = call i64 @wmemcmp(i32* %7, i8* bitcast ([9 x i32]* @.str.5 to i8*), i32 8)
%21 = icmp eq i64 %20, 0
%22 = zext i1 %21 to i32
br label %23
23: ; preds = %19, %15
%24 = phi i32 [ 0, %15 ], [ %22, %19 ]
%25 = call i64 @wmemcmp(i32* %4, i8* bitcast ([9 x i32]* @.str.6 to i8*), i32 8)
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %31
27: ; preds = %23
%28 = call i64 @wmemcmp(i32* %7, i8* bitcast ([9 x i32]* @.str.7 to i8*), i32 8)
%29 = icmp eq i64 %28, 0
%30 = zext i1 %29 to i32
br label %31
31: ; preds = %27, %23
%32 = phi i32 [ 0, %23 ], [ %30, %27 ]
%33 = call i64 @wmemcmp(i32* %4, i8* bitcast ([10 x i32]* @.str.8 to i8*), i32 8)
%34 = icmp eq i64 %33, 0
br i1 %34, label %35, label %39
35: ; preds = %31
%36 = call i64 @wmemcmp(i32* %7, i8* bitcast ([10 x i32]* @.str.9 to i8*), i32 8)
%37 = icmp eq i64 %36, 0
%38 = zext i1 %37 to i32
br label %39
39: ; preds = %35, %31
%40 = phi i32 [ 0, %31 ], [ %38, %35 ]
%41 = or i32 %24, %16
%42 = or i32 %41, %32
%43 = or i32 %42, %40
%44 = xor i32 %43, 1
ret i32 %44
}