#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*/ newline();
int /*<<< orphan*/ output_line(char *);
int /*<<< orphan*/ output_with_tab(char *);
int /*<<< orphan*/ print_label(int);
void gen_test_jump(int label, int ft) {
  output_line("ld a,h");
  output_line("or l");
  if (ft)
    output_with_tab("jp nz,");
  else
    output_with_tab("jp z,");
  print_label(label);
  newline();
}


x86 assembly (clang, -O0):
<gen_test_jump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xeab(%rip),%rdi
call   1060 <output_line@plt>
lea    0xea6(%rip),%rdi
call   1060 <output_line@plt>
cmpl   $0x0,-0x8(%rbp)
je     1181 <gen_test_jump+0x41>
lea    0xe95(%rip),%rdi
call   1050 <output_with_tab@plt>
jmp    118d <gen_test_jump+0x4d>
lea    0xe8b(%rip),%rdi
call   1050 <output_with_tab@plt>
mov    -0x4(%rbp),%edi
call   1040 <print_label@plt>
mov    $0x0,%al
call   1030 <newline@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_test_jump>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xeb2(%rip),%rdi
call   1060 <output_line@plt>
lea    0xead(%rip),%rdi
call   1060 <output_line@plt>
test   %ebx,%ebx
lea    0xeab(%rip),%rax
lea    0xe9d(%rip),%rdi
cmove  %rax,%rdi
call   1050 <output_with_tab@plt>
mov    %ebp,%edi
call   1040 <print_label@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <newline@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"ld a,h\00"
@.str.1 = [5 x i8] c"or l\00"
@.str.2 = [7 x i8] c"jp nz,\00"
@.str.3 = [6 x i8] c"jp z,\00"
define void @gen_test_jump(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @output_line(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @output_line(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @output_with_tab(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %13
11: ; preds = %2
%12 = call i32 @output_with_tab(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %3
%15 = call i32 @print_label(i32 %14)
%16 = call i32 (...) @newline()
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"ld a,h\00"
@.str.1 = [5 x i8] c"or l\00"
@.str.2 = [7 x i8] c"jp nz,\00"
@.str.3 = [6 x i8] c"jp z,\00"
define void @gen_test_jump(i32 %0, i32 %1) {
%3 = tail call i32 @output_line(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @output_line(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp eq i32 %1, 0
%6 = select i1 %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0)
%7 = tail call i32 @output_with_tab(i8* %6)
%8 = tail call i32 @print_label(i32 %0)
%9 = tail call i32 (...) @newline()
ret void
}