#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*/ sprintf(char *, char *, char const *, char const *);
char *formcond(const char *c1, const char *c2) {
  static char cond[(120 * 10)];
  if (c1[0] && c2[0])
    (void)sprintf(cond, "(%s) && (%s)", c1, c2);
  else if (c1[0] || c2[0])
    (void)sprintf(cond, "(%s%s)", c1, c2);
  else
    cond[0] = '\0';
  return cond;
}


x86 assembly (clang, -O0):
<formcond>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1160 <formcond+0x50>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1160 <formcond+0x50>
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0x2ef1(%rip),%rdi
lea    0xeaa(%rip),%rsi
call   1030 <sprintf@plt>
jmp    11ac <formcond+0x9c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1180 <formcond+0x70>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     11a0 <formcond+0x90>
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0x2eb1(%rip),%rdi
lea    0xe77(%rip),%rsi
call   1030 <sprintf@plt>
jmp    11a7 <formcond+0x97>
movb   $0x0,0x2e99(%rip)
jmp    11ac <formcond+0x9c>
lea    0x2e8d(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<formcond>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
cmpb   $0x0,(%rdi)
mov    (%rsi),%al
je     1137 <formcond+0x27>
test   %al,%al
je     113b <formcond+0x2b>
lea    0x2f17(%rip),%rdi
lea    0xed0(%rip),%rsi
call   1030 <sprintf@plt>
jmp    1157 <formcond+0x47>
test   %al,%al
je     1150 <formcond+0x40>
lea    0x2efe(%rip),%rdi
lea    0xec4(%rip),%rsi
call   1030 <sprintf@plt>
jmp    1157 <formcond+0x47>
movb   $0x0,0x2ee9(%rip)
lea    0x2ee2(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@formcond.cond = internal global [1200 x i8] zeroinitializer
@.str = [13 x i8] c"(%s) && (%s)\00"
@.str.1 = [7 x i8] c"(%s%s)\00"
define i8* @formcond(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %20
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 0
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %10
%17 = load i8*, i8** %3
%18 = load i8*, i8** %4
%19 = call i32 @sprintf(i8* getelementptr inbounds ([1200 x i8], [1200 x i8]* @formcond.cond, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %17, i8* %18)
br label %38
20: ; preds = %10, %2
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i64 0
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp ne i32 %24, 0
br i1 %25, label %32, label %26
26: ; preds = %20
%27 = load i8*, i8** %4
%28 = getelementptr inbounds i8, i8* %27, i64 0
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = icmp ne i32 %30, 0
br i1 %31, label %32, label %36
32: ; preds = %26, %20
%33 = load i8*, i8** %3
%34 = load i8*, i8** %4
%35 = call i32 @sprintf(i8* getelementptr inbounds ([1200 x i8], [1200 x i8]* @formcond.cond, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %33, i8* %34)
br label %37
36: ; preds = %26
store i8 0, i8* getelementptr inbounds ([1200 x i8], [1200 x i8]* @formcond.cond, i64 0, i64 0)
br label %37
37: ; preds = %36, %32
br label %38
38: ; preds = %37, %16
ret i8* getelementptr inbounds ([1200 x i8], [1200 x i8]* @formcond.cond, i64 0, i64 0)
}

LLVM IR (-O2):
@formcond.cond = internal global [1200 x i8] zeroinitializer
@.str = [13 x i8] c"(%s) && (%s)\00"
@.str.1 = [7 x i8] c"(%s%s)\00"
define i8* @formcond(i8* %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
%5 = load i8, i8* %1
%6 = icmp eq i8 %5, 0
br i1 %4, label %10, label %7
7: ; preds = %2
br i1 %6, label %11, label %8
8: ; preds = %7
%9 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([1200 x i8], [1200 x i8]* @formcond.cond, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
br label %14
10: ; preds = %2
br i1 %6, label %13, label %11
11: ; preds = %7, %10
%12 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([1200 x i8], [1200 x i8]* @formcond.cond, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %1)
br label %14
13: ; preds = %10
store i8 0, i8* getelementptr inbounds ([1200 x i8], [1200 x i8]* @formcond.cond, i64 0, i64 0)
br label %14
14: ; preds = %11, %13, %8
ret i8* getelementptr inbounds ([1200 x i8], [1200 x i8]* @formcond.cond, i64 0, i64 0)
}