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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int, ...);
void fprint_mov_bit(FILE *stream, uint8_t bit) {
  if (bit & 0x80)
    fprintf(stream,
            "MOV   C, "
            "0x%02X"
            ".%X                 ",
            bit & 0xF8, bit & 0x07);
  else
    fprintf(stream,
            "MOV   C, "
            "0x%02X"
            "                   ",
            bit);
}


x86 assembly (clang, -O0):
<fprint_mov_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1156 <fprint_mov_bit+0x46>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
and    $0xf8,%edx
mov    -0xc(%rbp),%ecx
and    $0x7,%ecx
lea    0xeb6(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    116b <fprint_mov_bit+0x5b>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fprint_mov_bit>:
mov    %esi,%ecx
test   $0x80,%cl
jne    1127 <fprint_mov_bit+0x17>
lea    0xf06(%rip),%rsi
mov    %ecx,%edx
xor    %eax,%eax
jmp    1030 <fprintf@plt>
mov    %ecx,%edx
and    $0xf8,%edx
and    $0x7,%ecx
lea    0xec7(%rip),%rsi
xor    %eax,%eax
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"MOV C, 0x%02X.%X \00"
@.str.1 = [35 x i8] c"MOV C, 0x%02X \00"
define void @fprint_mov_bit(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 128
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load i32*, i32** %3
%10 = load i32, i32* %4
%11 = and i32 %10, 248
%12 = load i32, i32* %4
%13 = and i32 %12, 7
%14 = call i32 (i32*, i8*, i32, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %13)
br label %19
15: ; preds = %2
%16 = load i32*, i32** %3
%17 = load i32, i32* %4
%18 = call i32 (i32*, i8*, i32, ...) @fprintf(i32* %16, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %17)
br label %19
19: ; preds = %15, %8
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"MOV C, 0x%02X.%X \00"
@.str.1 = [35 x i8] c"MOV C, 0x%02X \00"
define void @fprint_mov_bit(i32* nocapture %0, i32 %1) {
%3 = and i32 %1, 128
%4 = icmp eq i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = and i32 %1, 248
%7 = and i32 %1, 7
%8 = tail call i32 (i32*, i8*, i32, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
br label %11
9: ; preds = %2
%10 = tail call i32 (i32*, i8*, i32, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %1)
br label %11
11: ; preds = %9, %5
ret void
}