#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*/ clrtask(unsigned int *, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ settask(unsigned int *, int);
int testtask(unsigned int, int);
int main(void) {
  unsigned int set = 0;
  settask(&set, 7);
  printf("set task %x\n", set);
  printf("test task %x\n", testtask(set, 7));
  clrtask(&set, 7);
  printf("clear task %x\n", set);
  printf("test task %x\n", testtask(set, 7));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
mov    $0x7,%esi
call   1060 <settask@plt>
mov    -0x8(%rbp),%esi
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
mov    $0x7,%esi
call   1040 <testtask@plt>
mov    %eax,%esi
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
lea    -0x8(%rbp),%rdi
mov    $0x7,%esi
call   1050 <clrtask@plt>
mov    -0x8(%rbp),%esi
lea    0xe75(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
mov    $0x7,%esi
call   1040 <testtask@plt>
mov    %eax,%esi
lea    0xe4c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%r14
mov    %r14,%rdi
mov    $0x7,%esi
call   1060 <settask@plt>
mov    0x4(%rsp),%esi
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
mov    0x4(%rsp),%edi
mov    $0x7,%esi
call   1040 <testtask@plt>
lea    0xe8a(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0x7,%esi
call   1050 <clrtask@plt>
mov    0x4(%rsp),%esi
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
mov    0x4(%rsp),%edi
mov    $0x7,%esi
call   1040 <testtask@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [13 x i8] c"set task %x\0A\00"
@.str.1 = [14 x i8] c"test task %x\0A\00"
@.str.2 = [15 x i8] c"clear task %x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 @settask(i32* %2, i32 7)
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @testtask(i32 %6, i32 7)
%8 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = call i32 @clrtask(i32* %2, i32 7)
%10 = load i32, i32* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %2
%13 = call i32 @testtask(i32 %12, i32 7)
%14 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"set task %x\0A\00"
@.str.1 = [14 x i8] c"test task %x\0A\00"
@.str.2 = [15 x i8] c"clear task %x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @settask(i32* %1, i32 7)
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %1
%7 = call i32 @testtask(i32 %6, i32 7)
%8 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = call i32 @clrtask(i32* %1, i32 7)
%10 = load i32, i32* %1
%11 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %1
%13 = call i32 @testtask(i32 %12, i32 7)
%14 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %13)
ret i32 0
}