void motion_vector(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 = Get_motion_code();
  unsigned int tmp_if_expr$2;
  unsigned int return_value_Get_Bits$1;
  if (!(h_r_size == 0)) {
    if (motion_code == 0)
      goto __CPROVER_DUMP_L1;
    return_value_Get_Bits$1 = Get_Bits(h_r_size);
    tmp_if_expr$2 = return_value_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] = Get_dmvector();
  motion_code = Get_motion_code();
  unsigned int tmp_if_expr$4;
  unsigned int return_value_Get_Bits$3;
  if (!(v_r_size == 0)) {
    if (motion_code == 0)
      goto __CPROVER_DUMP_L4;
    return_value_Get_Bits$3 = Get_Bits(v_r_size);
    tmp_if_expr$4 = return_value_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] = Get_dmvector();
}


x86 assembly (clang, -O0):
<motion_vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    $0x0,%al
call   1050 <Get_motion_code@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     119c <motion_vector+0x5c>
cmpl   $0x0,-0x24(%rbp)
jne    1184 <motion_vector+0x44>
jmp    11a1 <motion_vector+0x61>
mov    -0x14(%rbp),%edi
mov    $0x0,%al
call   1060 <Get_Bits@plt>
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x2c(%rbp)
jmp    11a8 <motion_vector+0x68>
jmp    11a1 <motion_vector+0x61>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    -0x28(%rbp),%ecx
mov    0x10(%rbp),%r8d
mov    $0x0,%al
call   1030 <decode_motion_vector@plt>
cmpl   $0x0,-0x1c(%rbp)
je     11df <motion_vector+0x9f>
mov    $0x0,%al
call   1040 <Get_dmvector@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1050 <Get_motion_code@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     121a <motion_vector+0xda>
cmpl   $0x0,-0x24(%rbp)
jne    1202 <motion_vector+0xc2>
jmp    121f <motion_vector+0xdf>
mov    -0x18(%rbp),%edi
mov    $0x0,%al
call   1060 <Get_Bits@plt>
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    %eax,-0x34(%rbp)
jmp    1226 <motion_vector+0xe6>
jmp    121f <motion_vector+0xdf>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     1247 <motion_vector+0x107>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
sar    $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x8(%rbp),%rdi
add    $0x4,%rdi
mov    -0x18(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    -0x28(%rbp),%ecx
mov    0x10(%rbp),%r8d
mov    $0x0,%al
call   1030 <decode_motion_vector@plt>
cmpl   $0x0,-0x20(%rbp)
je     127e <motion_vector+0x13e>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
shl    $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
cmpl   $0x0,-0x1c(%rbp)
je     1298 <motion_vector+0x158>
mov    $0x0,%al
call   1040 <Get_dmvector@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<motion_vector>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9d,(%rsp)
mov    %r8d,%r15d
mov    %ecx,0x4(%rsp)
mov    %edx,%ebp
mov    %rsi,%r13
mov    %rdi,%r12
xor    %r14d,%r14d
xor    %eax,%eax
call   1050 <Get_motion_code@plt>
mov    %eax,%ebx
test   %ebp,%ebp
je     117e <motion_vector+0x3e>
test   %ebx,%ebx
je     117e <motion_vector+0x3e>
mov    %ebp,%edi
xor    %eax,%eax
call   1060 <Get_Bits@plt>
mov    %eax,%r14d
mov    %r12,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %r14d,%ecx
mov    0x40(%rsp),%ebx
mov    %ebx,%r8d
xor    %eax,%eax
call   1030 <decode_motion_vector@plt>
test   %r15d,%r15d
je     11a6 <motion_vector+0x66>
xor    %eax,%eax
call   1040 <Get_dmvector@plt>
mov    %eax,0x0(%r13)
xor    %eax,%eax
call   1050 <Get_motion_code@plt>
mov    %eax,%r14d
mov    0x4(%rsp),%ebp
test   %ebp,%ebp
je     11cf <motion_vector+0x8f>
test   %r14d,%r14d
mov    $0x0,%ecx
je     11d1 <motion_vector+0x91>
mov    %ebp,%edi
xor    %eax,%eax
call   1060 <Get_Bits@plt>
mov    %eax,%ecx
jmp    11d1 <motion_vector+0x91>
xor    %ecx,%ecx
add    $0x4,%r12
cmpl   $0x0,(%rsp)
je     1214 <motion_vector+0xd4>
sarl   (%r12)
mov    %r12,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
mov    %ebx,%r8d
xor    %eax,%eax
call   1030 <decode_motion_vector@plt>
shll   (%r12)
test   %r15d,%r15d
je     1205 <motion_vector+0xc5>
xor    %eax,%eax
call   1040 <Get_dmvector@plt>
mov    %eax,0x4(%r13)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r12,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
mov    %ebx,%r8d
xor    %eax,%eax
call   1030 <decode_motion_vector@plt>
test   %r15d,%r15d
jne    11fa <motion_vector+0xba>
jmp    1205 <motion_vector+0xc5>

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

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