#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*/ test_CHAR_PROMOTES_TO_SIGNED_TYPE();
int /*<<< orphan*/ test_SIGNED_LONGLONG_PROMOTES_TO_SIGNED_TYPE();
int /*<<< orphan*/ test_SIGNED_NONLONG_PROMOTES_TO_SIGNED_TYPE();
int /*<<< orphan*/ test_UNSIGNED_INT_NOT_PROMOTES_TO_SIGNED_TYPE();
int /*<<< orphan*/ test_UNSIGNED_LONGLONG_NOT_PROMOTES_TO_SIGNED_TYPE();
int /*<<< orphan*/ test_UNSIGNED_LONG_NOT_PROMOTES_TO_SIGNED_TYPE();
int test_PROMOTES_TO_SIGNED_TYPE() {
  if (!test_CHAR_PROMOTES_TO_SIGNED_TYPE()) {
    return 0;
  }
  if (!test_SIGNED_NONLONG_PROMOTES_TO_SIGNED_TYPE()) {
    return 0;
  }
  if (!test_UNSIGNED_INT_NOT_PROMOTES_TO_SIGNED_TYPE()) {
    return 0;
  }
  if (!test_UNSIGNED_LONG_NOT_PROMOTES_TO_SIGNED_TYPE()) {
    return 0;
  }
  if (!test_UNSIGNED_LONGLONG_NOT_PROMOTES_TO_SIGNED_TYPE()) {
    return 0;
  }
  if (!test_SIGNED_LONGLONG_PROMOTES_TO_SIGNED_TYPE()) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<test_PROMOTES_TO_SIGNED_TYPE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <test_CHAR_PROMOTES_TO_SIGNED_TYPE@plt>
cmp    $0x0,%eax
jne    1184 <test_PROMOTES_TO_SIGNED_TYPE+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1217 <test_PROMOTES_TO_SIGNED_TYPE+0xb7>
mov    $0x0,%al
call   1070 <test_SIGNED_NONLONG_PROMOTES_TO_SIGNED_TYPE@plt>
cmp    $0x0,%eax
jne    11a0 <test_PROMOTES_TO_SIGNED_TYPE+0x40>
movl   $0x0,-0x4(%rbp)
jmp    1217 <test_PROMOTES_TO_SIGNED_TYPE+0xb7>
mov    $0x0,%al
call   1050 <test_UNSIGNED_INT_NOT_PROMOTES_TO_SIGNED_TYPE@plt>
cmp    $0x0,%eax
jne    11bc <test_PROMOTES_TO_SIGNED_TYPE+0x5c>
movl   $0x0,-0x4(%rbp)
jmp    1217 <test_PROMOTES_TO_SIGNED_TYPE+0xb7>
mov    $0x0,%al
call   1080 <test_UNSIGNED_LONG_NOT_PROMOTES_TO_SIGNED_TYPE@plt>
cmp    $0x0,%eax
jne    11d8 <test_PROMOTES_TO_SIGNED_TYPE+0x78>
movl   $0x0,-0x4(%rbp)
jmp    1217 <test_PROMOTES_TO_SIGNED_TYPE+0xb7>
mov    $0x0,%al
call   1030 <test_UNSIGNED_LONGLONG_NOT_PROMOTES_TO_SIGNED_TYPE@plt>
cmp    $0x0,%eax
jne    11f4 <test_PROMOTES_TO_SIGNED_TYPE+0x94>
movl   $0x0,-0x4(%rbp)
jmp    1217 <test_PROMOTES_TO_SIGNED_TYPE+0xb7>
mov    $0x0,%al
call   1060 <test_SIGNED_LONGLONG_PROMOTES_TO_SIGNED_TYPE@plt>
cmp    $0x0,%eax
jne    1210 <test_PROMOTES_TO_SIGNED_TYPE+0xb0>
movl   $0x0,-0x4(%rbp)
jmp    1217 <test_PROMOTES_TO_SIGNED_TYPE+0xb7>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_PROMOTES_TO_SIGNED_TYPE>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <test_CHAR_PROMOTES_TO_SIGNED_TYPE@plt>
test   %eax,%eax
je     11b0 <test_PROMOTES_TO_SIGNED_TYPE+0x50>
xor    %ebx,%ebx
xor    %eax,%eax
call   1070 <test_SIGNED_NONLONG_PROMOTES_TO_SIGNED_TYPE@plt>
test   %eax,%eax
je     11b0 <test_PROMOTES_TO_SIGNED_TYPE+0x50>
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <test_UNSIGNED_INT_NOT_PROMOTES_TO_SIGNED_TYPE@plt>
test   %eax,%eax
je     11b0 <test_PROMOTES_TO_SIGNED_TYPE+0x50>
xor    %ebx,%ebx
xor    %eax,%eax
call   1080 <test_UNSIGNED_LONG_NOT_PROMOTES_TO_SIGNED_TYPE@plt>
test   %eax,%eax
je     11b0 <test_PROMOTES_TO_SIGNED_TYPE+0x50>
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <test_UNSIGNED_LONGLONG_NOT_PROMOTES_TO_SIGNED_TYPE@plt>
test   %eax,%eax
je     11b0 <test_PROMOTES_TO_SIGNED_TYPE+0x50>
xor    %eax,%eax
call   1060 <test_SIGNED_LONGLONG_PROMOTES_TO_SIGNED_TYPE@plt>
xor    %ebx,%ebx
test   %eax,%eax
setne  %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @test_PROMOTES_TO_SIGNED_TYPE() {
%1 = alloca i32
%2 = call i32 (...) @test_CHAR_PROMOTES_TO_SIGNED_TYPE()
%3 = icmp ne i32 %2, 0
br i1 %3, label %5, label %4
4: ; preds = %0
store i32 0, i32* %1
br label %26
5: ; preds = %0
%6 = call i32 (...) @test_SIGNED_NONLONG_PROMOTES_TO_SIGNED_TYPE()
%7 = icmp ne i32 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %5
store i32 0, i32* %1
br label %26
9: ; preds = %5
%10 = call i32 (...) @test_UNSIGNED_INT_NOT_PROMOTES_TO_SIGNED_TYPE()
%11 = icmp ne i32 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %9
store i32 0, i32* %1
br label %26
13: ; preds = %9
%14 = call i32 (...) @test_UNSIGNED_LONG_NOT_PROMOTES_TO_SIGNED_TYPE()
%15 = icmp ne i32 %14, 0
br i1 %15, label %17, label %16
16: ; preds = %13
store i32 0, i32* %1
br label %26
17: ; preds = %13
%18 = call i32 (...) @test_UNSIGNED_LONGLONG_NOT_PROMOTES_TO_SIGNED_TYPE()
%19 = icmp ne i32 %18, 0
br i1 %19, label %21, label %20
20: ; preds = %17
store i32 0, i32* %1
br label %26
21: ; preds = %17
%22 = call i32 (...) @test_SIGNED_LONGLONG_PROMOTES_TO_SIGNED_TYPE()
%23 = icmp ne i32 %22, 0
br i1 %23, label %25, label %24
24: ; preds = %21
store i32 0, i32* %1
br label %26
25: ; preds = %21
store i32 1, i32* %1
br label %26
26: ; preds = %25, %24, %20, %16, %12, %8, %4
%27 = load i32, i32* %1
ret i32 %27
}

LLVM IR (-O2):
define i32 @test_PROMOTES_TO_SIGNED_TYPE() {
%1 = tail call i32 (...) @test_CHAR_PROMOTES_TO_SIGNED_TYPE()
%2 = icmp eq i32 %1, 0
br i1 %2, label %19, label %3
3: ; preds = %0
%4 = tail call i32 (...) @test_SIGNED_NONLONG_PROMOTES_TO_SIGNED_TYPE()
%5 = icmp eq i32 %4, 0
br i1 %5, label %19, label %6
6: ; preds = %3
%7 = tail call i32 (...) @test_UNSIGNED_INT_NOT_PROMOTES_TO_SIGNED_TYPE()
%8 = icmp eq i32 %7, 0
br i1 %8, label %19, label %9
9: ; preds = %6
%10 = tail call i32 (...) @test_UNSIGNED_LONG_NOT_PROMOTES_TO_SIGNED_TYPE()
%11 = icmp eq i32 %10, 0
br i1 %11, label %19, label %12
12: ; preds = %9
%13 = tail call i32 (...) @test_UNSIGNED_LONGLONG_NOT_PROMOTES_TO_SIGNED_TYPE()
%14 = icmp eq i32 %13, 0
br i1 %14, label %19, label %15
15: ; preds = %12
%16 = tail call i32 (...) @test_SIGNED_LONGLONG_PROMOTES_TO_SIGNED_TYPE()
%17 = icmp ne i32 %16, 0
%18 = zext i1 %17 to i32
br label %19
19: ; preds = %15, %12, %9, %6, %3, %0
%20 = phi i32 [ 0, %0 ], [ 0, %3 ], [ 0, %6 ], [ 0, %9 ], [ 0, %12 ], [ %18, %15 ]
ret i32 %20
}