#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 *, char *);
void TEST_log_and(void) {
  test("ab", "main(){1 && printf(\"a\"); printf(\"b\");}");
  test("b", "main(){0 && printf(\"a\"); printf(\"b\");}");
  test("3", "main(){int i = 1 && 3; printf(\"%d\", i);}");
  test("0", "main(){int i = 5 && 3 && 0; printf(\"%d\", i);}");
  test("0", "main(){int i = 0 && 0; printf(\"%d\", i);}");
}


x86 assembly (clang, -O0):
<TEST_log_and>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee1(%rip),%rsi
call   1030 <test@plt>
lea    0xed3(%rip),%rdi
lea    0xef5(%rip),%rsi
call   1030 <test@plt>
lea    0xf10(%rip),%rdi
lea    0xf0b(%rip),%rsi
call   1030 <test@plt>
lea    0xf28(%rip),%rdi
lea    0xf23(%rip),%rsi
call   1030 <test@plt>
lea    0xf15(%rip),%rdi
lea    0xf3e(%rip),%rsi
call   1030 <test@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TEST_log_and>:
push   %rbx
lea    0xee8(%rip),%rdi
lea    0xee4(%rip),%rsi
call   1030 <test@plt>
lea    0xed6(%rip),%rdi
lea    0xef8(%rip),%rsi
call   1030 <test@plt>
lea    0xf13(%rip),%rdi
lea    0xf0e(%rip),%rsi
call   1030 <test@plt>
lea    0xf2b(%rip),%rbx
lea    0xf26(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test@plt>
lea    0xf45(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <test@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"ab\00"
@.str.1 = [39 x i8] c"main(){1 && printf(\22a\22); printf(\22b\22);}\00"
@.str.2 = [2 x i8] c"b\00"
@.str.3 = [39 x i8] c"main(){0 && printf(\22a\22); printf(\22b\22);}\00"
@.str.4 = [2 x i8] c"3\00"
@.str.5 = [41 x i8] c"main(){int i = 1 && 3; printf(\22%d\22, i);}\00"
@.str.6 = [2 x i8] c"0\00"
@.str.7 = [46 x i8] c"main(){int i = 5 && 3 && 0; printf(\22%d\22, i);}\00"
@.str.8 = [41 x i8] c"main(){int i = 0 && 0; printf(\22%d\22, i);}\00"
define void @TEST_log_and() {
%1 = call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0))
%3 = call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0))
%4 = call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.7, i64 0, i64 0))
%5 = call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.8, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"ab\00"
@.str.1 = [39 x i8] c"main(){1 && printf(\22a\22); printf(\22b\22);}\00"
@.str.2 = [2 x i8] c"b\00"
@.str.3 = [39 x i8] c"main(){0 && printf(\22a\22); printf(\22b\22);}\00"
@.str.4 = [2 x i8] c"3\00"
@.str.5 = [41 x i8] c"main(){int i = 1 && 3; printf(\22%d\22, i);}\00"
@.str.6 = [2 x i8] c"0\00"
@.str.7 = [46 x i8] c"main(){int i = 5 && 3 && 0; printf(\22%d\22, i);}\00"
@.str.8 = [41 x i8] c"main(){int i = 0 && 0; printf(\22%d\22, i);}\00"
define void @TEST_log_and() {
%1 = tail call i32 @test(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0))
%3 = tail call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0))
%4 = tail call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.7, i64 0, i64 0))
%5 = tail call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.8, i64 0, i64 0))
ret void
}