void Thrd_motion_vectors(signed int t, 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_Thrd_Get_Bits$1;
        return_value_Thrd_Get_Bits$1 = Thrd_Get_Bits(t, 1);
        motion_vertical_field_select[(signed long int)0][(signed long int)s] =
            (signed int)return_value_Thrd_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];
      }
    }
    Thrd_motion_vector(t, 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_Thrd_Get_Bits$2;
    return_value_Thrd_Get_Bits$2 = Thrd_Get_Bits(t, 1);
    motion_vertical_field_select[(signed long int)0][(signed long int)s] =
        (signed int)return_value_Thrd_Get_Bits$2;
    Thrd_motion_vector(t, PMV[(signed long int)0][(signed long int)s], dmvector,
                       h_r_size, v_r_size, dmv, mvscale, 0);
    unsigned int return_value_Thrd_Get_Bits$3;
    return_value_Thrd_Get_Bits$3 = Thrd_Get_Bits(t, 1);
    motion_vertical_field_select[(signed long int)1][(signed long int)s] =
        (signed int)return_value_Thrd_Get_Bits$3;
    Thrd_motion_vector(t, PMV[(signed long int)1][(signed long int)s], dmvector,
                       h_r_size, v_r_size, dmv, mvscale, 0);
  }
}


x86 assembly (clang, -O0):
<Thrd_motion_vectors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x30(%rbp),%eax
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
cmpl   $0x1,-0x28(%rbp)
jne    1215 <Thrd_motion_vectors+0xf5>
cmpl   $0x0,0x10(%rbp)
jne    11a8 <Thrd_motion_vectors+0x88>
cmpl   $0x0,0x28(%rbp)
jne    11a3 <Thrd_motion_vectors+0x83>
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <Thrd_Get_Bits@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%edx
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    %edx,0x8(%rax,%rcx,4)
jmp    11a8 <Thrd_motion_vectors+0x88>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
movslq -0x24(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x18(%rbp),%rdx
mov    0x18(%rbp),%ecx
mov    0x20(%rbp),%r8d
mov    0x28(%rbp),%r9d
mov    0x30(%rbp),%eax
xor    %r10d,%r10d
mov    %eax,(%rsp)
movl   $0x0,0x8(%rsp)
mov    $0x0,%al
call   1040 <Thrd_motion_vector@plt>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%edx
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    %edx,0x10(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    0x4(%rax,%rcx,8),%edx
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    %edx,0x14(%rax,%rcx,8)
jmp    12cc <Thrd_motion_vectors+0x1ac>
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <Thrd_Get_Bits@plt>
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%edx
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
movslq -0x24(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x18(%rbp),%rdx
mov    0x18(%rbp),%ecx
mov    0x20(%rbp),%r8d
mov    0x28(%rbp),%r9d
mov    0x30(%rbp),%eax
xor    %r10d,%r10d
mov    %eax,(%rsp)
movl   $0x0,0x8(%rsp)
mov    $0x0,%al
call   1040 <Thrd_motion_vector@plt>
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <Thrd_Get_Bits@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%edx
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    %edx,0x8(%rax,%rcx,4)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
add    $0x10,%rsi
movslq -0x24(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x18(%rbp),%rdx
mov    0x18(%rbp),%ecx
mov    0x20(%rbp),%r8d
mov    0x28(%rbp),%r9d
mov    0x30(%rbp),%eax
xor    %r10d,%r10d
mov    %eax,(%rsp)
movl   $0x0,0x8(%rsp)
mov    $0x0,%al
call   1040 <Thrd_motion_vector@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Thrd_motion_vectors>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8d,%r12d
mov    %rcx,%r15
mov    %rsi,%r14
mov    %edi,%r13d
mov    0x60(%rsp),%r10d
mov    0x58(%rsp),%ebp
mov    0x50(%rsp),%r8d
mov    0x48(%rsp),%ecx
cmp    $0x1,%r9d
jne    1163 <Thrd_motion_vectors+0x43>
mov    0x40(%rsp),%eax
or     %ebp,%eax
je     11ed <Thrd_motion_vectors+0xcd>
movslq %r12d,%rbx
jmp    121c <Thrd_motion_vectors+0xfc>
mov    %r13d,%edi
mov    $0x1,%esi
xor    %eax,%eax
mov    %rdx,%rbp
call   1030 <Thrd_Get_Bits@plt>
movslq %r12d,%rbx
mov    %eax,(%r15,%rbx,4)
lea    (%r14,%rbx,8),%rsi
mov    %r13d,%edi
mov    %rbp,%rdx
mov    %rbp,%r12
mov    0x48(%rsp),%ecx
mov    0x50(%rsp),%r8d
mov    0x58(%rsp),%r9d
xor    %eax,%eax
push   $0x0
mov    0x68(%rsp),%ebp
push   %rbp
call   1040 <Thrd_motion_vector@plt>
add    $0x10,%rsp
mov    %r13d,%edi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <Thrd_Get_Bits@plt>
mov    %eax,0x8(%r15,%rbx,4)
lea    (%r14,%rbx,8),%rsi
add    $0x10,%rsi
mov    %r13d,%edi
mov    %r12,%rdx
mov    0x48(%rsp),%ecx
mov    0x50(%rsp),%r8d
mov    0x58(%rsp),%r9d
xor    %eax,%eax
push   $0x0
mov    0x68(%rsp),%ebp
push   %rbp
call   1040 <Thrd_motion_vector@plt>
add    $0x18,%rsp
jmp    1242 <Thrd_motion_vectors+0x122>
mov    %r13d,%edi
mov    $0x1,%esi
xor    %eax,%eax
mov    %rdx,%rbx
call   1030 <Thrd_Get_Bits@plt>
mov    0x48(%rsp),%ecx
mov    0x50(%rsp),%r8d
mov    %rbx,%rdx
mov    0x60(%rsp),%r10d
movslq %r12d,%rbx
mov    %eax,(%r15,%rbx,4)
mov    %eax,0x8(%r15,%rbx,4)
lea    (%r14,%rbx,8),%rsi
mov    %r13d,%edi
mov    %ebp,%r9d
xor    %eax,%eax
push   $0x0
push   %r10
call   1040 <Thrd_motion_vector@plt>
add    $0x10,%rsp
mov    (%r14,%rbx,8),%rax
mov    %rax,0x10(%r14,%rbx,8)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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