#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 color;

/* Variables and functions */
int /*<<< orphan*/ bmp_printf(int, int, int, char *, char *);
int bmp_string_width(int, char *);
void print_help_line(int color, int x, int y, char *msg) {
  int fnt = (0 |
             (((0 | (((2) << 16) & (0xFFFF0000)) | ((0) & 0xFF) << 8 |
                ((0) & 0xFF) << 0)) &
              (0xFFFF0000)) |
             ((42) & 0xFF) << 8 | ((color)&0xFF) << 0);
  int len = bmp_string_width(fnt, msg);
  if (len > 720 - 2 * x) {
    fnt |= 0x03000000 | ((((720 - 2 * x + 8) >> 4) << 26) & 0xFC000000);
  }
  bmp_printf(fnt, x, y, "%s", msg);
}


x86 assembly (clang, -O0):
<print_help_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x0,%eax
or     $0x22a00,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1040 <bmp_string_width@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    -0x8(%rbp),%edx
shl    $0x1,%edx
mov    $0x2d0,%ecx
sub    %edx,%ecx
cmp    %ecx,%eax
jle    1195 <print_help_line+0x75>
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
mov    $0x2d0,%eax
sub    %ecx,%eax
add    $0x8,%eax
sar    $0x4,%eax
shl    $0x1a,%eax
and    $0xfc000000,%eax
or     $0x3000000,%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%r8
lea    0xe57(%rip),%rcx
call   1030 <bmp_printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_help_line>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rcx,%r15
mov    %edx,%r14d
mov    %esi,%ebp
movzbl %dil,%r12d
lea    0x22a00(%r12),%ebx
mov    %ebx,%edi
mov    %rcx,%rsi
call   1040 <bmp_string_width@plt>
mov    $0x2d0,%edx
sub    %ebp,%edx
sub    %ebp,%edx
cmp    %edx,%eax
jle    116f <print_help_line+0x4f>
mov    %ebp,%eax
shl    $0x17,%eax
mov    $0xb6000000,%ecx
sub    %eax,%ecx
and    $0xfc000000,%ecx
lea    (%r12,%rcx,1),%ebx
add    $0x3022a00,%ebx
lea    0xe8a(%rip),%rcx
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14d,%edx
mov    %r15,%r8
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <bmp_printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @print_help_line(i32 %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%11 = load i32, i32* %5
%12 = and i32 %11, 255
%13 = shl i32 %12, 0
%14 = or i32 141824, %13
store i32 %14, i32* %9
%15 = load i32, i32* %9
%16 = load i8*, i8** %8
%17 = call i32 @bmp_string_width(i32 %15, i8* %16)
store i32 %17, i32* %10
%18 = load i32, i32* %10
%19 = load i32, i32* %6
%20 = mul nsw i32 2, %19
%21 = sub nsw i32 720, %20
%22 = icmp sgt i32 %18, %21
br i1 %22, label %23, label %34
23: ; preds = %4
%24 = load i32, i32* %6
%25 = mul nsw i32 2, %24
%26 = sub nsw i32 720, %25
%27 = add nsw i32 %26, 8
%28 = ashr i32 %27, 4
%29 = shl i32 %28, 26
%30 = and i32 %29, -67108864
%31 = or i32 50331648, %30
%32 = load i32, i32* %9
%33 = or i32 %32, %31
store i32 %33, i32* %9
br label %34
34: ; preds = %23, %4
%35 = load i32, i32* %9
%36 = load i32, i32* %6
%37 = load i32, i32* %7
%38 = load i8*, i8** %8
%39 = call i32 @bmp_printf(i32 %35, i32 %36, i32 %37, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %38)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @print_help_line(i32 %0, i32 %1, i32 %2, i8* %3) {
%5 = and i32 %0, 255
%6 = or i32 %5, 141824
%7 = tail call i32 @bmp_string_width(i32 %6, i8* %3)
%8 = mul i32 %1, -2
%9 = add i32 %8, 720
%10 = icmp sgt i32 %7, %9
br i1 %10, label %11, label %17
11: ; preds = %4
%12 = mul i32 %1, -8388608
%13 = add i32 %12, -1241513984
%14 = and i32 %13, -67108864
%15 = or i32 %5, %14
%16 = or i32 %15, 50473472
br label %17
17: ; preds = %11, %4
%18 = phi i32 [ %16, %11 ], [ %6, %4 ]
%19 = tail call i32 @bmp_printf(i32 %18, i32 %1, i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}