#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
struct cec_op_digital_service_id {
  int dummy;
};
struct cec_msg {
  int *msg;
};
typedef int __u8;

/* Variables and functions */
int /*<<< orphan*/
cec_get_digital_service_id(int *, struct cec_op_digital_service_id *);
void cec_ops_set_digital_timer(const struct cec_msg *msg, __u8 *day,
                               __u8 *month, __u8 *start_hr, __u8 *start_min,
                               __u8 *duration_hr, __u8 *duration_min,
                               __u8 *recording_seq,
                               struct cec_op_digital_service_id *digital) {
  *day = msg->msg[2];
  *month = msg->msg[3];
  *start_hr = (msg->msg[4] >> 4) * 10 + (msg->msg[4] & 0xf);
  *start_min = (msg->msg[5] >> 4) * 10 + (msg->msg[5] & 0xf);
  *duration_hr = (msg->msg[6] >> 4) * 10 + (msg->msg[6] & 0xf);
  *duration_min = (msg->msg[7] >> 4) * 10 + (msg->msg[7] & 0xf);
  *recording_seq = msg->msg[8];
  cec_get_digital_service_id(msg->msg + 9, digital);
}


x86 assembly (clang, -O0):
<cec_ops_set_digital_timer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x8(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0xc(%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x10(%rax),%eax
sar    $0x4,%eax
imul   $0xa,%eax,%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x10(%rax),%eax
and    $0xf,%eax
add    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x14(%rax),%eax
sar    $0x4,%eax
imul   $0xa,%eax,%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x14(%rax),%eax
and    $0xf,%eax
add    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x18(%rax),%eax
sar    $0x4,%eax
imul   $0xa,%eax,%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x18(%rax),%eax
and    $0xf,%eax
add    %eax,%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x1c(%rax),%eax
sar    $0x4,%eax
imul   $0xa,%eax,%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x1c(%rax),%eax
and    $0xf,%eax
add    %eax,%ecx
mov    0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x20(%rax),%ecx
mov    0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
add    $0x24,%rdi
mov    0x20(%rbp),%rsi
call   1030 <cec_get_digital_service_id@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cec_ops_set_digital_timer>:
push   %rbx
mov    %rsi,%rax
mov    0x20(%rsp),%rsi
mov    0x18(%rsp),%r10
mov    0x10(%rsp),%r11
mov    (%rdi),%rdi
mov    0x8(%rdi),%ebx
mov    %ebx,(%rax)
mov    0xc(%rdi),%eax
mov    %eax,(%rdx)
mov    0x10(%rdi),%eax
mov    %eax,%edx
sar    $0x4,%edx
lea    (%rdx,%rdx,4),%edx
and    $0xf,%eax
lea    (%rax,%rdx,2),%eax
mov    %eax,(%rcx)
mov    0x14(%rdi),%eax
mov    %eax,%ecx
sar    $0x4,%ecx
lea    (%rcx,%rcx,4),%ecx
and    $0xf,%eax
lea    (%rax,%rcx,2),%eax
mov    %eax,(%r8)
mov    0x18(%rdi),%eax
mov    %eax,%ecx
sar    $0x4,%ecx
lea    (%rcx,%rcx,4),%ecx
and    $0xf,%eax
lea    (%rax,%rcx,2),%eax
mov    %eax,(%r9)
mov    0x1c(%rdi),%eax
mov    %eax,%ecx
sar    $0x4,%ecx
lea    (%rcx,%rcx,4),%ecx
and    $0xf,%eax
lea    (%rax,%rcx,2),%eax
mov    %eax,(%r11)
mov    0x20(%rdi),%eax
mov    %eax,(%r10)
add    $0x24,%rdi
pop    %rbx
jmp    1030 <cec_get_digital_service_id@plt>

LLVM IR (-O0):
%struct.cec_msg = type { i32* }
%struct.cec_op_digital_service_id = type { i32 }
define void @cec_ops_set_digital_timer(%struct.cec_msg* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7, %struct.cec_op_digital_service_id* %8) {
%10 = alloca %struct.cec_msg*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca i32*
%17 = alloca i32*
%18 = alloca %struct.cec_op_digital_service_id*
store %struct.cec_msg* %0, %struct.cec_msg** %10
store i32* %1, i32** %11
store i32* %2, i32** %12
store i32* %3, i32** %13
store i32* %4, i32** %14
store i32* %5, i32** %15
store i32* %6, i32** %16
store i32* %7, i32** %17
store %struct.cec_op_digital_service_id* %8, %struct.cec_op_digital_service_id** %18
%19 = load %struct.cec_msg*, %struct.cec_msg** %10
%20 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %19, i32 0, i32 0
%21 = load i32*, i32** %20
%22 = getelementptr inbounds i32, i32* %21, i64 2
%23 = load i32, i32* %22
%24 = load i32*, i32** %11
store i32 %23, i32* %24
%25 = load %struct.cec_msg*, %struct.cec_msg** %10
%26 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %25, i32 0, i32 0
%27 = load i32*, i32** %26
%28 = getelementptr inbounds i32, i32* %27, i64 3
%29 = load i32, i32* %28
%30 = load i32*, i32** %12
store i32 %29, i32* %30
%31 = load %struct.cec_msg*, %struct.cec_msg** %10
%32 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %31, i32 0, i32 0
%33 = load i32*, i32** %32
%34 = getelementptr inbounds i32, i32* %33, i64 4
%35 = load i32, i32* %34
%36 = ashr i32 %35, 4
%37 = mul nsw i32 %36, 10
%38 = load %struct.cec_msg*, %struct.cec_msg** %10
%39 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %38, i32 0, i32 0
%40 = load i32*, i32** %39
%41 = getelementptr inbounds i32, i32* %40, i64 4
%42 = load i32, i32* %41
%43 = and i32 %42, 15
%44 = add nsw i32 %37, %43
%45 = load i32*, i32** %13
store i32 %44, i32* %45
%46 = load %struct.cec_msg*, %struct.cec_msg** %10
%47 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %46, i32 0, i32 0
%48 = load i32*, i32** %47
%49 = getelementptr inbounds i32, i32* %48, i64 5
%50 = load i32, i32* %49
%51 = ashr i32 %50, 4
%52 = mul nsw i32 %51, 10
%53 = load %struct.cec_msg*, %struct.cec_msg** %10
%54 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %53, i32 0, i32 0
%55 = load i32*, i32** %54
%56 = getelementptr inbounds i32, i32* %55, i64 5
%57 = load i32, i32* %56
%58 = and i32 %57, 15
%59 = add nsw i32 %52, %58
%60 = load i32*, i32** %14
store i32 %59, i32* %60
%61 = load %struct.cec_msg*, %struct.cec_msg** %10
%62 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %61, i32 0, i32 0
%63 = load i32*, i32** %62
%64 = getelementptr inbounds i32, i32* %63, i64 6
%65 = load i32, i32* %64
%66 = ashr i32 %65, 4
%67 = mul nsw i32 %66, 10
%68 = load %struct.cec_msg*, %struct.cec_msg** %10
%69 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %68, i32 0, i32 0
%70 = load i32*, i32** %69
%71 = getelementptr inbounds i32, i32* %70, i64 6
%72 = load i32, i32* %71
%73 = and i32 %72, 15
%74 = add nsw i32 %67, %73
%75 = load i32*, i32** %15
store i32 %74, i32* %75
%76 = load %struct.cec_msg*, %struct.cec_msg** %10
%77 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %76, i32 0, i32 0
%78 = load i32*, i32** %77
%79 = getelementptr inbounds i32, i32* %78, i64 7
%80 = load i32, i32* %79
%81 = ashr i32 %80, 4
%82 = mul nsw i32 %81, 10
%83 = load %struct.cec_msg*, %struct.cec_msg** %10
%84 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %83, i32 0, i32 0
%85 = load i32*, i32** %84
%86 = getelementptr inbounds i32, i32* %85, i64 7
%87 = load i32, i32* %86
%88 = and i32 %87, 15
%89 = add nsw i32 %82, %88
%90 = load i32*, i32** %16
store i32 %89, i32* %90
%91 = load %struct.cec_msg*, %struct.cec_msg** %10
%92 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %91, i32 0, i32 0
%93 = load i32*, i32** %92
%94 = getelementptr inbounds i32, i32* %93, i64 8
%95 = load i32, i32* %94
%96 = load i32*, i32** %17
store i32 %95, i32* %96
%97 = load %struct.cec_msg*, %struct.cec_msg** %10
%98 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %97, i32 0, i32 0
%99 = load i32*, i32** %98
%100 = getelementptr inbounds i32, i32* %99, i64 9
%101 = load %struct.cec_op_digital_service_id*, %struct.cec_op_digital_service_id** %18
%102 = call i32 @cec_get_digital_service_id(i32* %100, %struct.cec_op_digital_service_id* %101)
ret void
}

LLVM IR (-O2):
%struct.cec_msg = type { i32* }
%struct.cec_op_digital_service_id = type { i32 }
define void @cec_ops_set_digital_timer(%struct.cec_msg* nocapture %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3, i32* nocapture writeonly %4, i32* nocapture writeonly %5, i32* nocapture writeonly %6, i32* nocapture writeonly %7, %struct.cec_op_digital_service_id* %8) {
%10 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %0, i64 0, i32 0
%11 = load i32*, i32** %10
%12 = getelementptr inbounds i32, i32* %11, i64 2
%13 = load i32, i32* %12
store i32 %13, i32* %1
%14 = getelementptr inbounds i32, i32* %11, i64 3
%15 = load i32, i32* %14
store i32 %15, i32* %2
%16 = getelementptr inbounds i32, i32* %11, i64 4
%17 = load i32, i32* %16
%18 = ashr i32 %17, 4
%19 = mul nsw i32 %18, 10
%20 = and i32 %17, 15
%21 = add nsw i32 %19, %20
store i32 %21, i32* %3
%22 = getelementptr inbounds i32, i32* %11, i64 5
%23 = load i32, i32* %22
%24 = ashr i32 %23, 4
%25 = mul nsw i32 %24, 10
%26 = and i32 %23, 15
%27 = add nsw i32 %25, %26
store i32 %27, i32* %4
%28 = getelementptr inbounds i32, i32* %11, i64 6
%29 = load i32, i32* %28
%30 = ashr i32 %29, 4
%31 = mul nsw i32 %30, 10
%32 = and i32 %29, 15
%33 = add nsw i32 %31, %32
store i32 %33, i32* %5
%34 = getelementptr inbounds i32, i32* %11, i64 7
%35 = load i32, i32* %34
%36 = ashr i32 %35, 4
%37 = mul nsw i32 %36, 10
%38 = and i32 %35, 15
%39 = add nsw i32 %37, %38
store i32 %39, i32* %6
%40 = getelementptr inbounds i32, i32* %11, i64 8
%41 = load i32, i32* %40
store i32 %41, i32* %7
%42 = getelementptr inbounds i32, i32* %11, i64 9
%43 = tail call i32 @cec_get_digital_service_id(i32* %42, %struct.cec_op_digital_service_id* %8)
ret void
}