void motion_vectors(signed int (*PMV)[2l][2l], signed int *dmvector,
                    signed int (*motion_vertical_field_select)[2l],
                    signed int s, signed int motion_vector_count,
                    signed int mv_format, signed int h_r_size,
                    signed int v_r_size, signed int dmv, signed int mvscale) {
  if (motion_vector_count == 1) {
    if (mv_format == 0) {
      if (dmv == 0) {
        unsigned int return_value_Get_Bits$1;
        return_value_Get_Bits$1 = Get_Bits(1);
        motion_vertical_field_select[(signed long int)0][(signed long int)s] =
            (signed int)return_value_Get_Bits$1;
        motion_vertical_field_select[(signed long int)1][(signed long int)s] =
            motion_vertical_field_select[(signed long int)0]
                                        [(signed long int)s];
      }
    }
    motion_vector(PMV[(signed long int)0][(signed long int)s], dmvector,
                  h_r_size, v_r_size, dmv, mvscale, 0);
    PMV[(signed long int)1][(signed long int)s][(signed long int)0] =
        PMV[(signed long int)0][(signed long int)s][(signed long int)0];
    PMV[(signed long int)1][(signed long int)s][(signed long int)1] =
        PMV[(signed long int)0][(signed long int)s][(signed long int)1];
  } else {
    unsigned int return_value_Get_Bits$2;
    return_value_Get_Bits$2 = Get_Bits(1);
    motion_vertical_field_select[(signed long int)0][(signed long int)s] =
        (signed int)return_value_Get_Bits$2;
    motion_vector(PMV[(signed long int)0][(signed long int)s], dmvector,
                  h_r_size, v_r_size, dmv, mvscale, 0);
    unsigned int return_value_Get_Bits$3;
    return_value_Get_Bits$3 = Get_Bits(1);
    motion_vertical_field_select[(signed long int)1][(signed long int)s] =
        (signed int)return_value_Get_Bits$3;
    motion_vector(PMV[(signed long int)1][(signed long int)s], dmvector,
                  h_r_size, v_r_size, dmv, mvscale, 0);
  }
}


x86 assembly (clang, -O0):
<motion_vectors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
cmpl   $0x1,-0x20(%rbp)
jne    1207 <motion_vectors+0xe7>
cmpl   $0x0,-0x24(%rbp)
jne    11a2 <motion_vectors+0x82>
cmpl   $0x0,0x20(%rbp)
jne    119d <motion_vectors+0x7d>
mov    $0x1,%edi
mov    $0x0,%al
call   1040 <Get_Bits@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%edx
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,0x8(%rax,%rcx,4)
jmp    11a2 <motion_vectors+0x82>
mov    -0x8(%rbp),%rdi
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    0x10(%rbp),%edx
mov    0x18(%rbp),%ecx
mov    0x20(%rbp),%r8d
mov    0x28(%rbp),%r9d
xor    %eax,%eax
movl   $0x0,(%rsp)
mov    $0x0,%al
call   1030 <motion_vector@plt>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%edx
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,0x10(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    0x4(%rax,%rcx,8),%edx
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,0x14(%rax,%rcx,8)
jmp    12a8 <motion_vectors+0x188>
mov    $0x1,%edi
mov    $0x0,%al
call   1040 <Get_Bits@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%edx
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%rdi
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    0x10(%rbp),%edx
mov    0x18(%rbp),%ecx
mov    0x20(%rbp),%r8d
mov    0x28(%rbp),%r9d
xor    %eax,%eax
movl   $0x0,(%rsp)
mov    $0x0,%al
call   1030 <motion_vector@plt>
mov    $0x1,%edi
mov    $0x0,%al
call   1040 <Get_Bits@plt>
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%edx
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,0x8(%rax,%rcx,4)
mov    -0x8(%rbp),%rdi
add    $0x10,%rdi
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    0x10(%rbp),%edx
mov    0x18(%rbp),%ecx
mov    0x20(%rbp),%r8d
mov    0x28(%rbp),%r9d
xor    %eax,%eax
movl   $0x0,(%rsp)
mov    $0x0,%al
call   1030 <motion_vector@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<motion_vectors>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %ecx,%r12d
mov    %rdx,%r14
mov    %rsi,%r13
mov    %rdi,%rbx
mov    0x58(%rsp),%eax
mov    0x50(%rsp),%r15d
mov    0x48(%rsp),%ecx
mov    0x40(%rsp),%edx
cmp    $0x1,%r8d
jne    115f <motion_vectors+0x3f>
or     %r15d,%r9d
je     11d8 <motion_vectors+0xb8>
movslq %r12d,%rbp
jmp    11fc <motion_vectors+0xdc>
mov    $0x1,%edi
xor    %eax,%eax
mov    %edx,%r15d
call   1040 <Get_Bits@plt>
movslq %r12d,%rbp
mov    %eax,(%r14,%rbp,4)
lea    (%rbx,%rbp,8),%rdi
movl   $0x0,(%rsp)
mov    %r13,%rsi
mov    %r15d,%edx
mov    0x48(%rsp),%ecx
mov    0x50(%rsp),%r8d
mov    0x58(%rsp),%r9d
xor    %eax,%eax
call   1030 <motion_vector@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1040 <Get_Bits@plt>
mov    %eax,0x8(%r14,%rbp,4)
lea    (%rbx,%rbp,8),%rdi
add    $0x10,%rdi
movl   $0x0,(%rsp)
mov    %r13,%rsi
mov    %r15d,%edx
mov    0x48(%rsp),%ecx
mov    0x50(%rsp),%r8d
mov    0x58(%rsp),%r9d
xor    %eax,%eax
call   1030 <motion_vector@plt>
jmp    1220 <motion_vectors+0x100>
mov    $0x1,%edi
xor    %eax,%eax
mov    %edx,%ebp
call   1040 <Get_Bits@plt>
mov    %ebp,%edx
mov    0x48(%rsp),%ecx
movslq %r12d,%rbp
mov    %eax,(%r14,%rbp,4)
mov    %eax,0x8(%r14,%rbp,4)
mov    0x58(%rsp),%eax
lea    (%rbx,%rbp,8),%rdi
movl   $0x0,(%rsp)
mov    %r13,%rsi
mov    %r15d,%r8d
mov    %eax,%r9d
xor    %eax,%eax
call   1030 <motion_vector@plt>
mov    (%rbx,%rbp,8),%rax
mov    %rax,0x10(%rbx,%rbp,8)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @motion_vectors([2 x [2 x i32]]* %0, i32* %1, [2 x i32]* %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9) {
%11 = alloca [2 x [2 x i32]]*
%12 = alloca i32*
%13 = alloca [2 x i32]*
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
store [2 x [2 x i32]]* %0, [2 x [2 x i32]]** %11
store i32* %1, i32** %12
store [2 x i32]* %2, [2 x i32]** %13
store i32 %3, i32* %14
store i32 %4, i32* %15
store i32 %5, i32* %16
store i32 %6, i32* %17
store i32 %7, i32* %18
store i32 %8, i32* %19
store i32 %9, i32* %20
%24 = load i32, i32* %15
%25 = icmp eq i32 %24, 1
br i1 %25, label %26, label %91
26: ; preds = %10
%27 = load i32, i32* %16
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %52
29: ; preds = %26
%30 = load i32, i32* %19
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %51
32: ; preds = %29
%33 = call i32 (i32, ...) bitcast (i32 (...)* @Get_Bits to i32 (i32, ...)*)(i32 1)
store i32 %33, i32* %21
%34 = load i32, i32* %21
%35 = load [2 x i32]*, [2 x i32]** %13
%36 = getelementptr inbounds [2 x i32], [2 x i32]* %35, i64 0
%37 = load i32, i32* %14
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [2 x i32], [2 x i32]* %36, i64 0, i64 %38
store i32 %34, i32* %39
%40 = load [2 x i32]*, [2 x i32]** %13
%41 = getelementptr inbounds [2 x i32], [2 x i32]* %40, i64 0
%42 = load i32, i32* %14
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [2 x i32], [2 x i32]* %41, i64 0, i64 %43
%45 = load i32, i32* %44
%46 = load [2 x i32]*, [2 x i32]** %13
%47 = getelementptr inbounds [2 x i32], [2 x i32]* %46, i64 1
%48 = load i32, i32* %14
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [2 x i32], [2 x i32]* %47, i64 0, i64 %49
store i32 %45, i32* %50
br label %51
51: ; preds = %32, %29
br label %52
52: ; preds = %51, %26
%53 = load [2 x [2 x i32]]*, [2 x [2 x i32]]** %11
%54 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %53, i64 0
%55 = load i32, i32* %14
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %54, i64 0, i64 %56
%58 = getelementptr inbounds [2 x i32], [2 x i32]* %57, i64 0, i64 0
%59 = load i32*, i32** %12
%60 = load i32, i32* %17
%61 = load i32, i32* %18
%62 = load i32, i32* %19
%63 = load i32, i32* %20
%64 = call i32 (i32*, i32*, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @motion_vector to i32 (i32*, i32*, i32, i32, i32, i32, i32, ...)*)(i32* %58, i32* %59, i32 %60, i32 %61, i32 %62, i32 %63, i32 0)
%65 = load [2 x [2 x i32]]*, [2 x [2 x i32]]** %11
%66 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %65, i64 0
%67 = load i32, i32* %14
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %66, i64 0, i64 %68
%70 = getelementptr inbounds [2 x i32], [2 x i32]* %69, i64 0, i64 0
%71 = load i32, i32* %70
%72 = load [2 x [2 x i32]]*, [2 x [2 x i32]]** %11
%73 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %72, i64 1
%74 = load i32, i32* %14
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %73, i64 0, i64 %75
%77 = getelementptr inbounds [2 x i32], [2 x i32]* %76, i64 0, i64 0
store i32 %71, i32* %77
%78 = load [2 x [2 x i32]]*, [2 x [2 x i32]]** %11
%79 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %78, i64 0
%80 = load i32, i32* %14
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %79, i64 0, i64 %81
%83 = getelementptr inbounds [2 x i32], [2 x i32]* %82, i64 0, i64 1
%84 = load i32, i32* %83
%85 = load [2 x [2 x i32]]*, [2 x [2 x i32]]** %11
%86 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %85, i64 1
%87 = load i32, i32* %14
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %86, i64 0, i64 %88
%90 = getelementptr inbounds [2 x i32], [2 x i32]* %89, i64 0, i64 1
store i32 %84, i32* %90
br label %130
91: ; preds = %10
%92 = call i32 (i32, ...) bitcast (i32 (...)* @Get_Bits to i32 (i32, ...)*)(i32 1)
store i32 %92, i32* %22
%93 = load i32, i32* %22
%94 = load [2 x i32]*, [2 x i32]** %13
%95 = getelementptr inbounds [2 x i32], [2 x i32]* %94, i64 0
%96 = load i32, i32* %14
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds [2 x i32], [2 x i32]* %95, i64 0, i64 %97
store i32 %93, i32* %98
%99 = load [2 x [2 x i32]]*, [2 x [2 x i32]]** %11
%100 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %99, i64 0
%101 = load i32, i32* %14
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %100, i64 0, i64 %102
%104 = getelementptr inbounds [2 x i32], [2 x i32]* %103, i64 0, i64 0
%105 = load i32*, i32** %12
%106 = load i32, i32* %17
%107 = load i32, i32* %18
%108 = load i32, i32* %19
%109 = load i32, i32* %20
%110 = call i32 (i32*, i32*, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @motion_vector to i32 (i32*, i32*, i32, i32, i32, i32, i32, ...)*)(i32* %104, i32* %105, i32 %106, i32 %107, i32 %108, i32 %109, i32 0)
%111 = call i32 (i32, ...) bitcast (i32 (...)* @Get_Bits to i32 (i32, ...)*)(i32 1)
store i32 %111, i32* %23
%112 = load i32, i32* %23
%113 = load [2 x i32]*, [2 x i32]** %13
%114 = getelementptr inbounds [2 x i32], [2 x i32]* %113, i64 1
%115 = load i32, i32* %14
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds [2 x i32], [2 x i32]* %114, i64 0, i64 %116
store i32 %112, i32* %117
%118 = load [2 x [2 x i32]]*, [2 x [2 x i32]]** %11
%119 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %118, i64 1
%120 = load i32, i32* %14
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %119, i64 0, i64 %121
%123 = getelementptr inbounds [2 x i32], [2 x i32]* %122, i64 0, i64 0
%124 = load i32*, i32** %12
%125 = load i32, i32* %17
%126 = load i32, i32* %18
%127 = load i32, i32* %19
%128 = load i32, i32* %20
%129 = call i32 (i32*, i32*, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @motion_vector to i32 (i32*, i32*, i32, i32, i32, i32, i32, ...)*)(i32* %123, i32* %124, i32 %125, i32 %126, i32 %127, i32 %128, i32 0)
br label %130
130: ; preds = %91, %52
ret void
}

LLVM IR (-O2):
define void @motion_vectors([2 x [2 x i32]]* %0, i32* %1, [2 x i32]* nocapture writeonly %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9) {
%11 = icmp eq i32 %4, 1
br i1 %11, label %12, label %31
12: ; preds = %10
%13 = or i32 %8, %5
%14 = icmp eq i32 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %12
%16 = sext i32 %3 to i64
br label %22
17: ; preds = %12
%18 = tail call i32 (i32, ...) bitcast (i32 (...)* @Get_Bits to i32 (i32, ...)*)(i32 1)
%19 = sext i32 %3 to i64
%20 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 %19
store i32 %18, i32* %20
%21 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 1, i64 %19
store i32 %18, i32* %21
br label %22
22: ; preds = %15, %17
%23 = phi i64 [ %16, %15 ], [ %19, %17 ]
%24 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %0, i64 0, i64 %23, i64 0
%25 = tail call i32 (i32*, i32*, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @motion_vector to i32 (i32*, i32*, i32, i32, i32, i32, i32, ...)*)(i32* %24, i32* %1, i32 %6, i32 %7, i32 %8, i32 %9, i32 0)
%26 = load i32, i32* %24
%27 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %0, i64 1, i64 %23, i64 0
store i32 %26, i32* %27
%28 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %0, i64 0, i64 %23, i64 1
%29 = load i32, i32* %28
%30 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %0, i64 1, i64 %23, i64 1
store i32 %29, i32* %30
br label %41
31: ; preds = %10
%32 = tail call i32 (i32, ...) bitcast (i32 (...)* @Get_Bits to i32 (i32, ...)*)(i32 1)
%33 = sext i32 %3 to i64
%34 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 %33
store i32 %32, i32* %34
%35 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %0, i64 0, i64 %33, i64 0
%36 = tail call i32 (i32*, i32*, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @motion_vector to i32 (i32*, i32*, i32, i32, i32, i32, i32, ...)*)(i32* %35, i32* %1, i32 %6, i32 %7, i32 %8, i32 %9, i32 0)
%37 = tail call i32 (i32, ...) bitcast (i32 (...)* @Get_Bits to i32 (i32, ...)*)(i32 1)
%38 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 1, i64 %33
store i32 %37, i32* %38
%39 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %0, i64 1, i64 %33, i64 0
%40 = tail call i32 (i32*, i32*, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @motion_vector to i32 (i32*, i32*, i32, i32, i32, i32, i32, ...)*)(i32* %39, i32* %1, i32 %6, i32 %7, i32 %8, i32 %9, i32 0)
br label %41
41: ; preds = %31, %22
ret void
}