void round_box_meter(int x, int y, int value, int fg, int bg) {
  value = ({
    __typeof__((({
                 __typeof__(((value)) + ((100))) _a = ((value));
                 __typeof__(((value)) + ((100))) _b = ((100));
                 _a < _b ? _a : _b;
               })) +
               ((0))) _a = (({
      __typeof__(((value)) + ((100))) _a = ((value));
      __typeof__(((value)) + ((100))) _b = ((100));
      _a < _b ? _a : _b;
    }));
    __typeof__((({
                 __typeof__(((value)) + ((100))) _a = ((value));
                 __typeof__(((value)) + ((100))) _b = ((100));
                 _a < _b ? _a : _b;
               })) +
               ((0))) _b = ((0));
    _a > _b ? _a : _b;
  });
  round_box(fg, x + 8, y + 8, 16, 16);
  int X = x + 9 + 12 * value / 100;
  bmp_draw_rect(bg, X, y + 10, 2, 12);
}


x86 assembly (clang, -O0):
<round_box_meter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
movl   $0x64,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    115c <round_box_meter+0x3c>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x34(%rbp)
jmp    1162 <round_box_meter+0x42>
mov    -0x20(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x28(%rbp),%eax
jle    118c <round_box_meter+0x6c>
mov    -0x18(%rbp),%eax
mov    %eax,-0x38(%rbp)
jmp    1192 <round_box_meter+0x72>
mov    -0x28(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x4(%rbp),%esi
add    $0x8,%esi
mov    -0x8(%rbp),%edx
add    $0x8,%edx
mov    $0x10,%r8d
mov    %r8d,%ecx
mov    $0x0,%al
call   1030 <round_box@plt>
mov    -0x4(%rbp),%eax
add    $0x9,%eax
mov    %eax,-0x3c(%rbp)
imul   $0xc,-0xc(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x3c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x30(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x30(%rbp),%esi
mov    -0x8(%rbp),%edx
add    $0xa,%edx
mov    $0x2,%ecx
mov    $0xc,%r8d
mov    $0x0,%al
call   1040 <bmp_draw_rect@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_box_meter>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%r14d
mov    %esi,%ebx
mov    %edi,%r15d
cmp    $0x64,%edx
mov    $0x64,%ebp
cmovl  %edx,%ebp
lea    0x8(%r15),%esi
lea    0x8(%rbx),%edx
xor    %r12d,%r12d
mov    %ecx,%edi
mov    $0x10,%ecx
mov    $0x10,%r8d
xor    %eax,%eax
call   1030 <round_box@plt>
test   %ebp,%ebp
cmovle %r12d,%ebp
shl    $0x2,%ebp
lea    0x0(%rbp,%rbp,2),%eax
movzwl %ax,%eax
shr    $0x2,%eax
imul   $0x147b,%eax,%eax
shr    $0x11,%eax
lea    (%r15,%rax,1),%esi
add    $0x9,%esi
add    $0xa,%ebx
mov    %r14d,%edi
mov    %ebx,%edx
mov    $0x2,%ecx
mov    $0xc,%r8d
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <bmp_draw_rect@plt>

LLVM IR (-O0):
define void @round_box_meter(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%18 = load i32, i32* %8
store i32 %18, i32* %12
store i32 100, i32* %13
%19 = load i32, i32* %12
%20 = load i32, i32* %13
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %24
22: ; preds = %5
%23 = load i32, i32* %12
br label %26
24: ; preds = %5
%25 = load i32, i32* %13
br label %26
26: ; preds = %24, %22
%27 = phi i32 [ %23, %22 ], [ %25, %24 ]
store i32 %27, i32* %14
%28 = load i32, i32* %14
store i32 %28, i32* %11
store i32 0, i32* %15
%29 = load i32, i32* %11
%30 = load i32, i32* %15
%31 = icmp sgt i32 %29, %30
br i1 %31, label %32, label %34
32: ; preds = %26
%33 = load i32, i32* %11
br label %36
34: ; preds = %26
%35 = load i32, i32* %15
br label %36
36: ; preds = %34, %32
%37 = phi i32 [ %33, %32 ], [ %35, %34 ]
store i32 %37, i32* %16
%38 = load i32, i32* %16
store i32 %38, i32* %8
%39 = load i32, i32* %9
%40 = load i32, i32* %6
%41 = add nsw i32 %40, 8
%42 = load i32, i32* %7
%43 = add nsw i32 %42, 8
%44 = call i32 (i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @round_box to i32 (i32, i32, i32, i32, i32, ...)*)(i32 %39, i32 %41, i32 %43, i32 16, i32 16)
%45 = load i32, i32* %6
%46 = add nsw i32 %45, 9
%47 = load i32, i32* %8
%48 = mul nsw i32 12, %47
%49 = sdiv i32 %48, 100
%50 = add nsw i32 %46, %49
store i32 %50, i32* %17
%51 = load i32, i32* %10
%52 = load i32, i32* %17
%53 = load i32, i32* %7
%54 = add nsw i32 %53, 10
%55 = call i32 (i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @bmp_draw_rect to i32 (i32, i32, i32, i32, i32, ...)*)(i32 %51, i32 %52, i32 %54, i32 2, i32 12)
ret void
}

LLVM IR (-O2):
define void @round_box_meter(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = icmp slt i32 %2, 100
%7 = select i1 %6, i32 %2, i32 100
%8 = icmp sgt i32 %7, 0
%9 = select i1 %8, i32 %7, i32 0
%10 = add nsw i32 %0, 8
%11 = add nsw i32 %1, 8
%12 = tail call i32 (i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @round_box to i32 (i32, i32, i32, i32, i32, ...)*)(i32 %3, i32 %10, i32 %11, i32 16, i32 16)
%13 = add nsw i32 %0, 9
%14 = trunc i32 %9 to i16
%15 = mul nuw nsw i16 %14, 12
%16 = udiv i16 %15, 100
%17 = zext i16 %16 to i32
%18 = add nsw i32 %13, %17
%19 = add nsw i32 %1, 10
%20 = tail call i32 (i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @bmp_draw_rect to i32 (i32, i32, i32, i32, i32, ...)*)(i32 %4, i32 %18, i32 %19, i32 2, i32 12)
ret void
}