#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 user_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ remove_all(int, int, int);
int /*<<< orphan*/ send_to_humans(char *, int, struct user_t *);
int /*<<< orphan*/ send_to_non_humans(char *, int, struct user_t *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
void redirect_all(char *buf, struct user_t *user) {
  char move_string[121 + 20];
  sprintf(move_string, "$ForceMove %s", buf);
  send_to_humans(move_string, 0x4 | 0x8 | 0x10, user);
  remove_all(0x1 | 0x2 | 0x4 | 0x8 | 0x10, 1, 1);
  send_to_non_humans(move_string, 0x80, user);
}


x86 assembly (clang, -O0):
<redirect_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe9b(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0xa0(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x1c,%esi
call   1040 <send_to_humans@plt>
mov    $0x1f,%edi
mov    $0x1,%edx
mov    %edx,%esi
call   1050 <remove_all@plt>
lea    -0xa0(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x80,%esi
call   1030 <send_to_non_humans@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<redirect_all>:
push   %r14
push   %rbx
sub    $0x98,%rsp
mov    %rsi,%rbx
mov    %rdi,%rdx
lea    0xea9(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1060 <sprintf@plt>
mov    %r14,%rdi
mov    $0x1c,%esi
mov    %rbx,%rdx
call   1040 <send_to_humans@plt>
mov    $0x1f,%edi
mov    $0x1,%esi
mov    $0x1,%edx
call   1050 <remove_all@plt>
mov    %r14,%rdi
mov    $0x80,%esi
mov    %rbx,%rdx
call   1030 <send_to_non_humans@plt>
add    $0x98,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.user_t = type { i32 }
@.str = [14 x i8] c"$ForceMove %s\00"
define void @redirect_all(i8* %0, %struct.user_t* %1) {
%3 = alloca i8*
%4 = alloca %struct.user_t*
%5 = alloca [141 x i8]
store i8* %0, i8** %3
store %struct.user_t* %1, %struct.user_t** %4
%6 = getelementptr inbounds [141 x i8], [141 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [141 x i8], [141 x i8]* %5, i64 0, i64 0
%10 = load %struct.user_t*, %struct.user_t** %4
%11 = call i32 @send_to_humans(i8* %9, i32 28, %struct.user_t* %10)
%12 = call i32 @remove_all(i32 31, i32 1, i32 1)
%13 = getelementptr inbounds [141 x i8], [141 x i8]* %5, i64 0, i64 0
%14 = load %struct.user_t*, %struct.user_t** %4
%15 = call i32 @send_to_non_humans(i8* %13, i32 128, %struct.user_t* %14)
ret void
}

LLVM IR (-O2):
%struct.user_t = type { i32 }
@.str = [14 x i8] c"$ForceMove %s\00"
define void @redirect_all(i8* %0, %struct.user_t* %1) {
%3 = alloca [141 x i8]
%4 = getelementptr inbounds [141 x i8], [141 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = call i32 @send_to_humans(i8* %4, i32 28, %struct.user_t* %1)
%7 = call i32 @remove_all(i32 31, i32 1, i32 1)
%8 = call i32 @send_to_non_humans(i8* %4, i32 128, %struct.user_t* %1)
ret void
}