void networkprobe_signal(int sig) {
  if (sig == 33) {
    do_system("/etc/init.d/network restart", 1);
    usleep(100);
    printf("##__%s, recv signal %d__##", __FUNCTION__, sig);
    do_system("/etc/init.d/firewall.sh restart", 1);
    return;
  } else if (sig == 34) {
    printf("##__%s, recv signal %d__##", __FUNCTION__, sig);
    return;
  } else if (sig == 35) {
    do_system("/etc/init.d/dnsmasq restart", 1);
    printf("##__%s, recv signal %d__##", __FUNCTION__, sig);
    return;
  } else if (sig == 36) {
    printf("##__%s, recv signal %d__##", __FUNCTION__, sig);
    return;
  } else {
    printf("##__%s, recv signal NULL##", __FUNCTION__);
    return;
  }
}


x86 assembly (clang, -O0):
<networkprobe_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x21,-0x4(%rbp)
jne    1194 <networkprobe_signal+0x64>
lea    0xeb4(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1040 <do_system@plt>
mov    $0x64,%edi
mov    $0x0,%al
call   1050 <usleep@plt>
mov    -0x4(%rbp),%edx
lea    0xeae(%rip),%rdi
lea    0xec2(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1040 <do_system@plt>
jmp    1231 <networkprobe_signal+0x101>
cmpl   $0x22,-0x4(%rbp)
jne    11bb <networkprobe_signal+0x8b>
mov    -0x4(%rbp),%edx
lea    0xe74(%rip),%rdi
lea    0xe88(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1231 <networkprobe_signal+0x101>
cmpl   $0x23,-0x4(%rbp)
jne    11f5 <networkprobe_signal+0xc5>
lea    0xe9f(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1040 <do_system@plt>
mov    -0x4(%rbp),%edx
lea    0xe3a(%rip),%rdi
lea    0xe4e(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1231 <networkprobe_signal+0x101>
cmpl   $0x24,-0x4(%rbp)
jne    121c <networkprobe_signal+0xec>
mov    -0x4(%rbp),%edx
lea    0xe13(%rip),%rdi
lea    0xe27(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1231 <networkprobe_signal+0x101>
lea    0xe64(%rip),%rdi
lea    0xe0d(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<networkprobe_signal>:
push   %rax
add    $0xffffffdf,%edi
cmp    $0x3,%edi
ja     1196 <networkprobe_signal+0x66>
lea    0xec0(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
lea    0xec0(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <do_system@plt>
mov    $0x64,%edi
xor    %eax,%eax
call   1050 <usleep@plt>
lea    0xebd(%rip),%rdi
lea    0xed1(%rip),%rsi
mov    $0x21,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
pop    %rcx
jmp    1040 <do_system@plt>
lea    0xefa(%rip),%rdi
lea    0xea3(%rip),%rsi
xor    %eax,%eax
pop    %rcx
jmp    1030 <printf@plt>
lea    0xe79(%rip),%rdi
lea    0xe8d(%rip),%rsi
mov    $0x22,%edx
jmp    11fc <networkprobe_signal+0xcc>
lea    0xeb3(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <do_system@plt>
lea    0xe51(%rip),%rdi
lea    0xe65(%rip),%rsi
mov    $0x23,%edx
jmp    11fc <networkprobe_signal+0xcc>
lea    0xe3c(%rip),%rdi
lea    0xe50(%rip),%rsi
mov    $0x24,%edx
xor    %eax,%eax
pop    %rcx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"/etc/init.d/network restart\00"
@.str.1 = [27 x i8] c"##__%s, recv signal %d__##\00"
@__FUNCTION__.networkprobe_signal = [20 x i8] c"networkprobe_signal\00"
@.str.2 = [32 x i8] c"/etc/init.d/firewall.sh restart\00"
@.str.3 = [28 x i8] c"/etc/init.d/dnsmasq restart\00"
@.str.4 = [27 x i8] c"##__%s, recv signal NULL##\00"
define void @networkprobe_signal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 33
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @do_system to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 1)
%7 = call i32 (i32, ...) bitcast (i32 (...)* @usleep to i32 (i32, ...)*)(i32 100)
%8 = load i32, i32* %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__FUNCTION__.networkprobe_signal, i64 0, i64 0), i32 %8)
%10 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @do_system to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 1)
br label %32
11: ; preds = %1
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 34
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i32, i32* %2
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__FUNCTION__.networkprobe_signal, i64 0, i64 0), i32 %15)
br label %32
17: ; preds = %11
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, 35
br i1 %19, label %20, label %24
20: ; preds = %17
%21 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @do_system to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 1)
%22 = load i32, i32* %2
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__FUNCTION__.networkprobe_signal, i64 0, i64 0), i32 %22)
br label %32
24: ; preds = %17
%25 = load i32, i32* %2
%26 = icmp eq i32 %25, 36
br i1 %26, label %27, label %30
27: ; preds = %24
%28 = load i32, i32* %2
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__FUNCTION__.networkprobe_signal, i64 0, i64 0), i32 %28)
br label %32
30: ; preds = %24
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__FUNCTION__.networkprobe_signal, i64 0, i64 0))
br label %32
32: ; preds = %30, %27, %20, %14, %5
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"/etc/init.d/network restart\00"
@.str.1 = [27 x i8] c"##__%s, recv signal %d__##\00"
@__FUNCTION__.networkprobe_signal = [20 x i8] c"networkprobe_signal\00"
@.str.2 = [32 x i8] c"/etc/init.d/firewall.sh restart\00"
@.str.3 = [28 x i8] c"/etc/init.d/dnsmasq restart\00"
@.str.4 = [27 x i8] c"##__%s, recv signal NULL##\00"
define void @networkprobe_signal(i32 %0) {
switch i32 %0, label %14 [
i32 33, label %2
i32 34, label %7
i32 35, label %9
i32 36, label %12
]
2: ; preds = %1
%3 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @do_system to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @usleep to i32 (i32, ...)*)(i32 100)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__FUNCTION__.networkprobe_signal, i64 0, i64 0), i32 33)
%6 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @do_system to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 1)
br label %16
7: ; preds = %1
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__FUNCTION__.networkprobe_signal, i64 0, i64 0), i32 34)
br label %16
9: ; preds = %1
%10 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @do_system to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 1)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__FUNCTION__.networkprobe_signal, i64 0, i64 0), i32 35)
br label %16
12: ; preds = %1
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__FUNCTION__.networkprobe_signal, i64 0, i64 0), i32 36)
br label %16
14: ; preds = %1
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__FUNCTION__.networkprobe_signal, i64 0, i64 0))
br label %16
16: ; preds = %14, %12, %9, %7, %2
ret void
}