#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*/ LC_ALL;
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ *setlocale(int /*<<< orphan*/, char *);
int test_strtod();
int test_strtof();
int test_strtold();
int do_test(void) {
  if (setlocale(LC_ALL, "tr_TR.UTF-8") == NULL) {
    puts("cannot set locale");
    return 0;
  }
  return ({
    int result = 0;
    result |= test_strtof();
    result |= test_strtod();
    result |= test_strtold();
    result;
  });
}


x86 assembly (clang, -O0):
<do_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
lea    0xe98(%rip),%rsi
call   1070 <setlocale@plt>
cmp    $0x0,%rax
jne    118f <do_test+0x3f>
lea    0xe8e(%rip),%rdi
call   1030 <puts@plt>
movl   $0x0,-0x4(%rbp)
jmp    11c9 <do_test+0x79>
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1050 <test_strtof@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <test_strtod@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1060 <test_strtold@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_test>:
push   %rbp
push   %rbx
push   %rax
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
lea    0xe9d(%rip),%rsi
call   1070 <setlocale@plt>
test   %rax,%rax
je     118c <do_test+0x3c>
xor    %eax,%eax
call   1050 <test_strtof@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <test_strtod@plt>
mov    %eax,%ebp
or     %ebx,%ebp
xor    %eax,%eax
call   1060 <test_strtold@plt>
or     %ebp,%eax
jmp    119a <do_test+0x4a>
lea    0xe79(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [12 x i8] c"tr_TR.UTF-8\00"
@.str.1 = [18 x i8] c"cannot set locale\00"
define i32 @do_test() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = load i32, i32* @LC_ALL
%5 = call i32* @setlocale(i32 %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %1
br label %21
9: ; preds = %0
store i32 0, i32* %2
%10 = call i32 (...) @test_strtof()
%11 = load i32, i32* %2
%12 = or i32 %11, %10
store i32 %12, i32* %2
%13 = call i32 (...) @test_strtod()
%14 = load i32, i32* %2
%15 = or i32 %14, %13
store i32 %15, i32* %2
%16 = call i32 (...) @test_strtold()
%17 = load i32, i32* %2
%18 = or i32 %17, %16
store i32 %18, i32* %2
%19 = load i32, i32* %2
store i32 %19, i32* %3
%20 = load i32, i32* %3
store i32 %20, i32* %1
br label %21
21: ; preds = %9, %7
%22 = load i32, i32* %1
ret i32 %22
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [12 x i8] c"tr_TR.UTF-8\00"
@.str.1 = [18 x i8] c"cannot set locale\00"
define i32 @do_test() {
%1 = load i32, i32* @LC_ALL
%2 = tail call i32* @setlocale(i32 %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %12
6: ; preds = %0
%7 = tail call i32 (...) @test_strtof()
%8 = tail call i32 (...) @test_strtod()
%9 = or i32 %8, %7
%10 = tail call i32 (...) @test_strtold()
%11 = or i32 %9, %10
br label %12
12: ; preds = %6, %4
%13 = phi i32 [ 0, %4 ], [ %11, %6 ]
ret i32 %13
}