int h263_get_picture_format(int width, int height) {
  int format;
  if (width == 128 && height == 96)
    format = 1;
  else if (width == 176 && height == 144)
    format = 2;
  else if (width == 352 && height == 288)
    format = 3;
  else if (width == 704 && height == 576)
    format = 4;
  else if (width == 1408 && height == 1152)
    format = 5;
  else
    format = 7;
  return format;
}


x86 assembly (clang, -O0):
<h263_get_picture_format>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x80,-0x4(%rbp)
jne    112d <h263_get_picture_format+0x2d>
cmpl   $0x60,-0x8(%rbp)
jne    112d <h263_get_picture_format+0x2d>
movl   $0x1,-0xc(%rbp)
jmp    11e0 <h263_get_picture_format+0xe0>
cmpl   $0xb0,-0x4(%rbp)
jne    1153 <h263_get_picture_format+0x53>
cmpl   $0x90,-0x8(%rbp)
jne    1153 <h263_get_picture_format+0x53>
movl   $0x2,-0xc(%rbp)
jmp    11db <h263_get_picture_format+0xdb>
cmpl   $0x160,-0x4(%rbp)
jne    1179 <h263_get_picture_format+0x79>
cmpl   $0x120,-0x8(%rbp)
jne    1179 <h263_get_picture_format+0x79>
movl   $0x3,-0xc(%rbp)
jmp    11d6 <h263_get_picture_format+0xd6>
cmpl   $0x2c0,-0x4(%rbp)
jne    119f <h263_get_picture_format+0x9f>
cmpl   $0x240,-0x8(%rbp)
jne    119f <h263_get_picture_format+0x9f>
movl   $0x4,-0xc(%rbp)
jmp    11d1 <h263_get_picture_format+0xd1>
cmpl   $0x580,-0x4(%rbp)
jne    11c5 <h263_get_picture_format+0xc5>
cmpl   $0x480,-0x8(%rbp)
jne    11c5 <h263_get_picture_format+0xc5>
movl   $0x5,-0xc(%rbp)
jmp    11cc <h263_get_picture_format+0xcc>
movl   $0x7,-0xc(%rbp)
jmp    11d1 <h263_get_picture_format+0xd1>
jmp    11d6 <h263_get_picture_format+0xd6>
jmp    11db <h263_get_picture_format+0xdb>
jmp    11e0 <h263_get_picture_format+0xe0>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h263_get_picture_format>:
cmp    $0x80,%edi
jne    1113 <h263_get_picture_format+0x13>
mov    $0x1,%eax
cmp    $0x60,%esi
jne    1113 <h263_get_picture_format+0x13>
ret
cmp    $0xb0,%edi
jne    1128 <h263_get_picture_format+0x28>
mov    $0x2,%eax
cmp    $0x90,%esi
je     1112 <h263_get_picture_format+0x12>
cmp    $0x160,%edi
jne    113d <h263_get_picture_format+0x3d>
mov    $0x3,%eax
cmp    $0x120,%esi
je     1112 <h263_get_picture_format+0x12>
cmp    $0x2c0,%edi
jne    1152 <h263_get_picture_format+0x52>
mov    $0x4,%eax
cmp    $0x240,%esi
je     1112 <h263_get_picture_format+0x12>
xor    $0x580,%edi
xor    $0x480,%esi
xor    %eax,%eax
or     %edi,%esi
setne  %al
add    %eax,%eax
add    $0x5,%eax
ret

LLVM IR (-O0):
define i32 @h263_get_picture_format(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 128
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 96
br i1 %10, label %11, label %12
11: ; preds = %8
store i32 1, i32* %5
br label %45
12: ; preds = %8, %2
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 176
br i1 %14, label %15, label %19
15: ; preds = %12
%16 = load i32, i32* %4
%17 = icmp eq i32 %16, 144
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 2, i32* %5
br label %44
19: ; preds = %15, %12
%20 = load i32, i32* %3
%21 = icmp eq i32 %20, 352
br i1 %21, label %22, label %26
22: ; preds = %19
%23 = load i32, i32* %4
%24 = icmp eq i32 %23, 288
br i1 %24, label %25, label %26
25: ; preds = %22
store i32 3, i32* %5
br label %43
26: ; preds = %22, %19
%27 = load i32, i32* %3
%28 = icmp eq i32 %27, 704
br i1 %28, label %29, label %33
29: ; preds = %26
%30 = load i32, i32* %4
%31 = icmp eq i32 %30, 576
br i1 %31, label %32, label %33
32: ; preds = %29
store i32 4, i32* %5
br label %42
33: ; preds = %29, %26
%34 = load i32, i32* %3
%35 = icmp eq i32 %34, 1408
br i1 %35, label %36, label %40
36: ; preds = %33
%37 = load i32, i32* %4
%38 = icmp eq i32 %37, 1152
br i1 %38, label %39, label %40
39: ; preds = %36
store i32 5, i32* %5
br label %41
40: ; preds = %36, %33
store i32 7, i32* %5
br label %41
41: ; preds = %40, %39
br label %42
42: ; preds = %41, %32
br label %43
43: ; preds = %42, %25
br label %44
44: ; preds = %43, %18
br label %45
45: ; preds = %44, %11
%46 = load i32, i32* %5
ret i32 %46
}

LLVM IR (-O2):
define i32 @h263_get_picture_format(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 128
%4 = icmp eq i32 %1, 96
%5 = and i1 %3, %4
br i1 %5, label %23, label %6
6: ; preds = %2
%7 = icmp eq i32 %0, 176
%8 = icmp eq i32 %1, 144
%9 = and i1 %7, %8
br i1 %9, label %23, label %10
10: ; preds = %6
%11 = icmp eq i32 %0, 352
%12 = icmp eq i32 %1, 288
%13 = and i1 %11, %12
br i1 %13, label %23, label %14
14: ; preds = %10
%15 = icmp eq i32 %0, 704
%16 = icmp eq i32 %1, 576
%17 = and i1 %15, %16
br i1 %17, label %23, label %18
18: ; preds = %14
%19 = icmp eq i32 %0, 1408
%20 = icmp eq i32 %1, 1152
%21 = and i1 %19, %20
%22 = select i1 %21, i32 5, i32 7
br label %23
23: ; preds = %18, %14, %10, %6, %2
%24 = phi i32 [ 1, %2 ], [ 2, %6 ], [ 3, %10 ], [ 4, %14 ], [ %22, %18 ]
ret i32 %24
}