#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*/ scanf(char *, ...);
void check_conditional_literal(char *s, int *i) {
  scanf(0 ? "%s" : "%d", i);
  scanf(1 ? "%s" : "%d", i);
  scanf(0 ? "%d %d" : "%d", i);
  scanf(1 ? "%d %d" : "%d", i);
  scanf(0 ? "%d %d" : "%d", i, s);
  scanf(1 ? "%d %s" : "%d", i, s);
  scanf(i ? "%d %s" : "%d", i, s);
  scanf(i ? "%d" : "%d", i, s);
  scanf(i ? "%s" : "%d", s);
}


x86 assembly (clang, -O0):
<check_conditional_literal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xed8(%rip),%rdi
mov    $0x0,%al
call   1030 <scanf@plt>
mov    -0x10(%rbp),%rsi
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <scanf@plt>
mov    -0x10(%rbp),%rsi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <scanf@plt>
mov    -0x10(%rbp),%rsi
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <scanf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1030 <scanf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1030 <scanf@plt>
mov    -0x10(%rbp),%rcx
lea    0xe64(%rip),%rdi
lea    0xe60(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    $0x0,%al
call   1030 <scanf@plt>
mov    -0x10(%rbp),%rax
lea    0xe3b(%rip),%rdi
cmp    $0x0,%rax
cmovne %rdi,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    $0x0,%al
call   1030 <scanf@plt>
mov    -0x10(%rbp),%rcx
lea    0xe19(%rip),%rdi
lea    0xe18(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rdi
mov    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1030 <scanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_conditional_literal>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rsi,%r13
mov    %rdi,%r14
lea    0xedd(%rip),%r15
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <scanf@plt>
lea    0xed2(%rip),%r12
mov    %r12,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1030 <scanf@plt>
mov    %r15,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1030 <scanf@plt>
lea    0xea8(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1030 <scanf@plt>
mov    %r15,%rdi
mov    %r13,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <scanf@plt>
lea    0xe8d(%rip),%rbx
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <scanf@plt>
test   %r13,%r13
cmove  %r15,%rbx
cmove  %r15,%r12
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <scanf@plt>
mov    %r15,%rdi
mov    %r13,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <scanf@plt>
mov    %r12,%rdi
mov    %r14,%rsi
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1030 <scanf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [6 x i8] c"%d %d\00"
@.str.3 = [6 x i8] c"%d %s\00"
define void @check_conditional_literal(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
%7 = load i32*, i32** %4
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%9 = load i32*, i32** %4
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %9)
%11 = load i32*, i32** %4
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32* %11)
%13 = load i32*, i32** %4
%14 = load i8*, i8** %3
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %13, i8* %14)
%16 = load i32*, i32** %4
%17 = load i8*, i8** %3
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32* %16, i8* %17)
%19 = load i32*, i32** %4
%20 = icmp ne i32* %19, null
%21 = zext i1 %20 to i64
%22 = select i1 %20, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
%23 = load i32*, i32** %4
%24 = load i8*, i8** %3
%25 = call i32 (i8*, ...) @scanf(i8* %22, i32* %23, i8* %24)
%26 = load i32*, i32** %4
%27 = icmp ne i32* %26, null
%28 = zext i1 %27 to i64
%29 = select i1 %27, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
%30 = load i32*, i32** %4
%31 = load i8*, i8** %3
%32 = call i32 (i8*, ...) @scanf(i8* %29, i32* %30, i8* %31)
%33 = load i32*, i32** %4
%34 = icmp ne i32* %33, null
%35 = zext i1 %34 to i64
%36 = select i1 %34, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
%37 = load i8*, i8** %3
%38 = call i32 (i8*, ...) @scanf(i8* %36, i8* %37)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [6 x i8] c"%d %d\00"
@.str.3 = [6 x i8] c"%d %s\00"
define void @check_conditional_literal(i8* %0, i32* %1) {
%3 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%7 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1, i8* %0)
%8 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32* %1, i8* %0)
%9 = icmp eq i32* %1, null
%10 = select i1 %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0)
%11 = tail call i32 (i8*, ...) @scanf(i8* %10, i32* %1, i8* %0)
%12 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1, i8* %0)
%13 = select i1 %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%14 = tail call i32 (i8*, ...) @scanf(i8* %13, i8* %0)
ret void
}