void Thrd_motion_vector(signed int t, signed int *PMV, signed int *dmvector,
                        signed int h_r_size, signed int v_r_size,
                        signed int dmv, signed int mvscale,
                        signed int full_pel_vector) {
  signed int motion_code;
  signed int motion_residual;
  motion_code = Thrd_Get_motion_code(t);
  unsigned int tmp_if_expr$2;
  unsigned int return_value_Thrd_Get_Bits$1;
  if (!(h_r_size == 0)) {
    if (motion_code == 0)
      goto __CPROVER_DUMP_L1;
    return_value_Thrd_Get_Bits$1 = Thrd_Get_Bits(t, h_r_size);
    tmp_if_expr$2 = return_value_Thrd_Get_Bits$1;
  } else {
  __CPROVER_DUMP_L1:;
    tmp_if_expr$2 = (unsigned int)0;
  }
  motion_residual = (signed int)tmp_if_expr$2;
  decode_motion_vector(&PMV[(signed long int)0], h_r_size, motion_code,
                       motion_residual, full_pel_vector);
  if (!(dmv == 0))
    dmvector[(signed long int)0] = Thrd_Get_dmvector(t);
  motion_code = Thrd_Get_motion_code(t);
  unsigned int tmp_if_expr$4;
  unsigned int return_value_Thrd_Get_Bits$3;
  if (!(v_r_size == 0)) {
    if (motion_code == 0)
      goto __CPROVER_DUMP_L4;
    return_value_Thrd_Get_Bits$3 = Thrd_Get_Bits(t, v_r_size);
    tmp_if_expr$4 = return_value_Thrd_Get_Bits$3;
  } else {
  __CPROVER_DUMP_L4:;
    tmp_if_expr$4 = (unsigned int)0;
  }
  motion_residual = (signed int)tmp_if_expr$4;
  if (!(mvscale == 0))
    PMV[(signed long int)1] = PMV[(signed long int)1] >> 1;
  decode_motion_vector(&PMV[(signed long int)1], v_r_size, motion_code,
                       motion_residual, full_pel_vector);
  if (!(mvscale == 0))
    PMV[(signed long int)1] = PMV[(signed long int)1] << 1;
  if (!(dmv == 0))
    dmvector[(signed long int)1] = Thrd_Get_dmvector(t);
}


x86 assembly (clang, -O0):
<Thrd_motion_vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1050 <Thrd_Get_motion_code@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     11a5 <Thrd_motion_vector+0x65>
cmpl   $0x0,-0x28(%rbp)
jne    118a <Thrd_motion_vector+0x4a>
jmp    11aa <Thrd_motion_vector+0x6a>
mov    -0x4(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    $0x0,%al
call   1040 <Thrd_Get_Bits@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x30(%rbp)
jmp    11b1 <Thrd_motion_vector+0x71>
jmp    11aa <Thrd_motion_vector+0x6a>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x28(%rbp),%edx
mov    -0x2c(%rbp),%ecx
mov    0x18(%rbp),%r8d
mov    $0x0,%al
call   1030 <decode_motion_vector@plt>
cmpl   $0x0,-0x24(%rbp)
je     11eb <Thrd_motion_vector+0xab>
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1060 <Thrd_Get_dmvector@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1050 <Thrd_Get_motion_code@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     122c <Thrd_motion_vector+0xec>
cmpl   $0x0,-0x28(%rbp)
jne    1211 <Thrd_motion_vector+0xd1>
jmp    1231 <Thrd_motion_vector+0xf1>
mov    -0x4(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    $0x0,%al
call   1040 <Thrd_Get_Bits@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    %eax,-0x38(%rbp)
jmp    1238 <Thrd_motion_vector+0xf8>
jmp    1231 <Thrd_motion_vector+0xf1>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,0x10(%rbp)
je     1259 <Thrd_motion_vector+0x119>
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%ecx
sar    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x10(%rbp),%rdi
add    $0x4,%rdi
mov    -0x20(%rbp),%esi
mov    -0x28(%rbp),%edx
mov    -0x2c(%rbp),%ecx
mov    0x18(%rbp),%r8d
mov    $0x0,%al
call   1030 <decode_motion_vector@plt>
cmpl   $0x0,0x10(%rbp)
je     1290 <Thrd_motion_vector+0x150>
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%ecx
shl    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
cmpl   $0x0,-0x24(%rbp)
je     12ad <Thrd_motion_vector+0x16d>
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1060 <Thrd_Get_dmvector@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Thrd_motion_vector>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9d,0x4(%rsp)
mov    %r8d,(%rsp)
mov    %ecx,%ebp
mov    %rdx,%r12
mov    %rsi,%r13
mov    %edi,%r15d
xor    %r14d,%r14d
xor    %eax,%eax
call   1050 <Thrd_Get_motion_code@plt>
mov    %eax,%ebx
test   %ebp,%ebp
je     1182 <Thrd_motion_vector+0x42>
test   %ebx,%ebx
je     1182 <Thrd_motion_vector+0x42>
mov    %r15d,%edi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <Thrd_Get_Bits@plt>
mov    %eax,%r14d
mov    %r13,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %r14d,%ecx
mov    0x48(%rsp),%r8d
xor    %eax,%eax
call   1030 <decode_motion_vector@plt>
mov    0x4(%rsp),%ebp
test   %ebp,%ebp
je     11ae <Thrd_motion_vector+0x6e>
mov    %r15d,%edi
xor    %eax,%eax
call   1060 <Thrd_Get_dmvector@plt>
mov    %eax,(%r12)
mov    0x40(%rsp),%ebx
mov    %r15d,%edi
xor    %eax,%eax
call   1050 <Thrd_Get_motion_code@plt>
mov    %eax,%r14d
mov    (%rsp),%esi
test   %esi,%esi
je     11e4 <Thrd_motion_vector+0xa4>
test   %r14d,%r14d
mov    $0x0,%ecx
je     11e6 <Thrd_motion_vector+0xa6>
mov    %r15d,%edi
mov    (%rsp),%esi
xor    %eax,%eax
call   1040 <Thrd_Get_Bits@plt>
mov    (%rsp),%esi
mov    %eax,%ecx
jmp    11e6 <Thrd_motion_vector+0xa6>
xor    %ecx,%ecx
add    $0x4,%r13
test   %ebx,%ebx
je     122a <Thrd_motion_vector+0xea>
sarl   0x0(%r13)
mov    %r13,%rdi
mov    %r14d,%edx
mov    0x48(%rsp),%r8d
xor    %eax,%eax
call   1030 <decode_motion_vector@plt>
shll   0x0(%r13)
test   %ebp,%ebp
je     121b <Thrd_motion_vector+0xdb>
mov    %r15d,%edi
xor    %eax,%eax
call   1060 <Thrd_Get_dmvector@plt>
mov    %eax,0x4(%r12)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r13,%rdi
mov    %r14d,%edx
mov    0x48(%rsp),%r8d
xor    %eax,%eax
call   1030 <decode_motion_vector@plt>
test   %ebp,%ebp
jne    120c <Thrd_motion_vector+0xcc>
jmp    121b <Thrd_motion_vector+0xdb>

LLVM IR (-O0):
define void @Thrd_motion_vector(i32 %0, i32* %1, i32* %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7) {
%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
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
store i32 %0, i32* %9
store i32* %1, i32** %10
store i32* %2, i32** %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i32 %6, i32* %15
store i32 %7, i32* %16
%23 = load i32, i32* %9
%24 = call i32 (i32, ...) bitcast (i32 (...)* @Thrd_Get_motion_code to i32 (i32, ...)*)(i32 %23)
store i32 %24, i32* %17
%25 = load i32, i32* %12
%26 = icmp eq i32 %25, 0
br i1 %26, label %36, label %27
27: ; preds = %8
%28 = load i32, i32* %17
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %31
30: ; preds = %27
br label %37
31: ; preds = %27
%32 = load i32, i32* %9
%33 = load i32, i32* %12
%34 = call i32 (i32, i32, ...) bitcast (i32 (...)* @Thrd_Get_Bits to i32 (i32, i32, ...)*)(i32 %32, i32 %33)
store i32 %34, i32* %20
%35 = load i32, i32* %20
store i32 %35, i32* %19
br label %38
36: ; preds = %8
br label %37
37: ; preds = %36, %30
store i32 0, i32* %19
br label %38
38: ; preds = %37, %31
%39 = load i32, i32* %19
store i32 %39, i32* %18
%40 = load i32*, i32** %10
%41 = getelementptr inbounds i32, i32* %40, i64 0
%42 = load i32, i32* %12
%43 = load i32, i32* %17
%44 = load i32, i32* %18
%45 = load i32, i32* %16
%46 = call i32 (i32*, i32, i32, i32, i32, ...) bitcast (i32 (...)* @decode_motion_vector to i32 (i32*, i32, i32, i32, i32, ...)*)(i32* %41, i32 %42, i32 %43, i32 %44, i32 %45)
%47 = load i32, i32* %14
%48 = icmp eq i32 %47, 0
br i1 %48, label %54, label %49
49: ; preds = %38
%50 = load i32, i32* %9
%51 = call i32 (i32, ...) bitcast (i32 (...)* @Thrd_Get_dmvector to i32 (i32, ...)*)(i32 %50)
%52 = load i32*, i32** %11
%53 = getelementptr inbounds i32, i32* %52, i64 0
store i32 %51, i32* %53
br label %54
54: ; preds = %49, %38
%55 = load i32, i32* %9
%56 = call i32 (i32, ...) bitcast (i32 (...)* @Thrd_Get_motion_code to i32 (i32, ...)*)(i32 %55)
store i32 %56, i32* %17
%57 = load i32, i32* %13
%58 = icmp eq i32 %57, 0
br i1 %58, label %68, label %59
59: ; preds = %54
%60 = load i32, i32* %17
%61 = icmp eq i32 %60, 0
br i1 %61, label %62, label %63
62: ; preds = %59
br label %69
63: ; preds = %59
%64 = load i32, i32* %9
%65 = load i32, i32* %13
%66 = call i32 (i32, i32, ...) bitcast (i32 (...)* @Thrd_Get_Bits to i32 (i32, i32, ...)*)(i32 %64, i32 %65)
store i32 %66, i32* %22
%67 = load i32, i32* %22
store i32 %67, i32* %21
br label %70
68: ; preds = %54
br label %69
69: ; preds = %68, %62
store i32 0, i32* %21
br label %70
70: ; preds = %69, %63
%71 = load i32, i32* %21
store i32 %71, i32* %18
%72 = load i32, i32* %15
%73 = icmp eq i32 %72, 0
br i1 %73, label %81, label %74
74: ; preds = %70
%75 = load i32*, i32** %10
%76 = getelementptr inbounds i32, i32* %75, i64 1
%77 = load i32, i32* %76
%78 = ashr i32 %77, 1
%79 = load i32*, i32** %10
%80 = getelementptr inbounds i32, i32* %79, i64 1
store i32 %78, i32* %80
br label %81
81: ; preds = %74, %70
%82 = load i32*, i32** %10
%83 = getelementptr inbounds i32, i32* %82, i64 1
%84 = load i32, i32* %13
%85 = load i32, i32* %17
%86 = load i32, i32* %18
%87 = load i32, i32* %16
%88 = call i32 (i32*, i32, i32, i32, i32, ...) bitcast (i32 (...)* @decode_motion_vector to i32 (i32*, i32, i32, i32, i32, ...)*)(i32* %83, i32 %84, i32 %85, i32 %86, i32 %87)
%89 = load i32, i32* %15
%90 = icmp eq i32 %89, 0
br i1 %90, label %98, label %91
91: ; preds = %81
%92 = load i32*, i32** %10
%93 = getelementptr inbounds i32, i32* %92, i64 1
%94 = load i32, i32* %93
%95 = shl i32 %94, 1
%96 = load i32*, i32** %10
%97 = getelementptr inbounds i32, i32* %96, i64 1
store i32 %95, i32* %97
br label %98
98: ; preds = %91, %81
%99 = load i32, i32* %14
%100 = icmp eq i32 %99, 0
br i1 %100, label %106, label %101
101: ; preds = %98
%102 = load i32, i32* %9
%103 = call i32 (i32, ...) bitcast (i32 (...)* @Thrd_Get_dmvector to i32 (i32, ...)*)(i32 %102)
%104 = load i32*, i32** %11
%105 = getelementptr inbounds i32, i32* %104, i64 1
store i32 %103, i32* %105
br label %106
106: ; preds = %101, %98
ret void
}

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