#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 */

/* Variables and functions */
int /*<<< orphan*/ LOG_NOTICE;
int /*<<< orphan*/ socket_send(char, char, char, char);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *);
int sock_ctrl(char *recbuf) {
  syslog(LOG_NOTICE, "RSS Control");
  socket_send(recbuf[0] - 48, recbuf[1] - 48, recbuf[2] - 48, recbuf[3] - 48);
  return 0;
}


x86 assembly (clang, -O0):
<sock_ctrl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
call   1040 <syslog@plt>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
mov    %al,%sil
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
sub    $0x30,%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movsbl 0x2(%rax),%eax
sub    $0x30,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
movsbl 0x3(%rax),%eax
sub    $0x30,%eax
movsbl %sil,%edi
movsbl %dl,%esi
movsbl %cl,%edx
movsbl %al,%ecx
call   1030 <socket_send@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sock_ctrl>:
push   %rbx
mov    %rdi,%rbx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <syslog@plt>
mov    (%rbx),%al
mov    0x1(%rbx),%cl
add    $0xd0,%al
add    $0xd0,%cl
mov    0x2(%rbx),%dl
add    $0xd0,%dl
mov    0x3(%rbx),%bl
add    $0xd0,%bl
movsbl %al,%edi
movsbl %cl,%esi
movsbl %dl,%edx
movsbl %bl,%ecx
call   1030 <socket_send@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@LOG_NOTICE = global i32 0
@.str = [12 x i8] c"RSS Control\00"
define i32 @sock_ctrl(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @LOG_NOTICE
%4 = call i32 @syslog(i32 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = sub nsw i32 %8, 48
%10 = trunc i32 %9 to i8
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = sub nsw i32 %14, 48
%16 = trunc i32 %15 to i8
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i64 2
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = sub nsw i32 %20, 48
%22 = trunc i32 %21 to i8
%23 = load i8*, i8** %2
%24 = getelementptr inbounds i8, i8* %23, i64 3
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = sub nsw i32 %26, 48
%28 = trunc i32 %27 to i8
%29 = call i32 @socket_send(i8 signext %10, i8 signext %16, i8 signext %22, i8 signext %28)
ret i32 0
}

LLVM IR (-O2):
@LOG_NOTICE = global i32 0
@.str = [12 x i8] c"RSS Control\00"
define i32 @sock_ctrl(i8* nocapture %0) {
%2 = load i32, i32* @LOG_NOTICE
%3 = tail call i32 @syslog(i32 %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = load i8, i8* %0
%5 = add i8 %4, -48
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = add i8 %7, -48
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = add i8 %10, -48
%12 = getelementptr inbounds i8, i8* %0, i64 3
%13 = load i8, i8* %12
%14 = add i8 %13, -48
%15 = tail call i32 @socket_send(i8 signext %5, i8 signext %8, i8 signext %11, i8 signext %14)
ret i32 0
}