#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*/ printf(char *);
scalar_t__ test_locker1();
scalar_t__ test_locker2();
void print_locker(void) {
  if (test_locker1())
    printf("locker1 found!\n");
  else
    printf("locker1 no found!\n");
  if (test_locker2())
    printf("locker2 found!\n");
  else
    printf("locker2 no found!\n");
}


x86 assembly (clang, -O0):
<print_locker>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <test_locker1@plt>
cmp    $0x0,%rax
je     1156 <print_locker+0x26>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
jmp    1162 <print_locker+0x32>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <test_locker2@plt>
cmp    $0x0,%rax
je     1184 <print_locker+0x54>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
jmp    1190 <print_locker+0x60>
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_locker>:
push   %rax
xor    %eax,%eax
call   1040 <test_locker1@plt>
test   %rax,%rax
lea    0xebe(%rip),%rax
lea    0xeea(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <test_locker2@plt>
test   %rax,%rax
lea    0xeaf(%rip),%rax
lea    0xeba(%rip),%rdi
cmove  %rax,%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"locker1 found!\0A\00"
@.str.1 = [19 x i8] c"locker1 no found!\0A\00"
@.str.2 = [16 x i8] c"locker2 found!\0A\00"
@.str.3 = [19 x i8] c"locker2 no found!\0A\00"
define void @print_locker() {
%1 = call i64 (...) @test_locker1()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
%8 = call i64 (...) @test_locker2()
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
br label %14
12: ; preds = %7
%13 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
br label %14
14: ; preds = %12, %10
ret void
}

LLVM IR (-O2):
@str = [18 x i8] c"locker1 no found!\00"
@str.4 = [18 x i8] c"locker2 no found!\00"
@str.5 = [15 x i8] c"locker2 found!\00"
@str.6 = [15 x i8] c"locker1 found!\00"
define void @print_locker() {
%1 = tail call i64 (...) @test_locker1()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @str.6, i64 0, i64 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
%5 = tail call i64 (...) @test_locker2()
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @str.5, i64 0, i64 0)
%8 = tail call i32 @puts(i8* dereferenceable(1) %7)
ret void
}