#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, unsigned char const,
                           unsigned char const, char const *, char *);
void midi_print_cc_cb(const char *fnname, const unsigned char chn,
                      const unsigned char cc, const unsigned char flags,
                      void *arg) {
  FILE *fp = (FILE *)arg;
  fprintf(fp, "  %d  %03d  | %s %s\n", chn, cc, fnname, (flags & 1) ? "-" : "");
}


x86 assembly (clang, -O0):
<midi_print_cc_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %rdi,-0x8(%rbp)
mov    %dl,-0x9(%rbp)
mov    %cl,-0xa(%rbp)
mov    %al,-0xb(%rbp)
mov    %r8,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x9(%rbp),%cl
mov    -0xa(%rbp),%al
mov    -0x8(%rbp),%r8
movzbl -0xb(%rbp),%esi
and    $0x1,%esi
lea    0xec0(%rip),%r9
lea    0xeba(%rip),%rdx
cmp    $0x0,%esi
cmovne %rdx,%r9
lea    0xe97(%rip),%rsi
movzbl %cl,%edx
movzbl %al,%ecx
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<midi_print_cc_cb>:
mov    %edx,%r10d
mov    %esi,%edx
mov    %rdi,%rax
test   $0x1,%cl
lea    0xef2(%rip),%rcx
lea    0xeec(%rip),%r9
cmove  %rcx,%r9
lea    0xecc(%rip),%rsi
mov    %r8,%rdi
mov    %r10d,%ecx
mov    %rax,%r8
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c" %d %03d | %s %s\0A\00"
@.str.1 = [2 x i8] c"-\00"
@.str.2 = [1 x i8] zeroinitializer
define void @midi_print_cc_cb(i8* %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
%10 = alloca i8*
%11 = alloca i32*
store i8* %0, i8** %6
store i8 %1, i8* %7
store i8 %2, i8* %8
store i8 %3, i8* %9
store i8* %4, i8** %10
%12 = load i8*, i8** %10
%13 = bitcast i8* %12 to i32*
store i32* %13, i32** %11
%14 = load i32*, i32** %11
%15 = load i8, i8* %7
%16 = load i8, i8* %8
%17 = load i8*, i8** %6
%18 = load i8, i8* %9
%19 = zext i8 %18 to i32
%20 = and i32 %19, 1
%21 = icmp ne i32 %20, 0
%22 = zext i1 %21 to i64
%23 = select i1 %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0)
%24 = call i32 @fprintf(i32* %14, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8 zeroext %15, i8 zeroext %16, i8* %17, i8* %23)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c" %d %03d | %s %s\0A\00"
@.str.1 = [2 x i8] c"-\00"
@.str.2 = [1 x i8] zeroinitializer
define void @midi_print_cc_cb(i8* %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3, i8* nocapture %4) {
%6 = bitcast i8* %4 to i32*
%7 = and i8 %3, 1
%8 = icmp eq i8 %7, 0
%9 = select i1 %8, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
%10 = tail call i32 @fprintf(i32* %6, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8 zeroext %1, i8 zeroext %2, i8* %0, i8* %9)
ret void
}