#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*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int num;
  printf("输入一个整数");
  scanf("%d", &num);
  if (num % 3 == 0)
    puts("能被3整除");
  else if (num % 3 == 1)
    puts("余数是1");
  else
    puts("余数是2");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
lea    0xec1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1180 <main+0x50>
lea    0xea0(%rip),%rdi
call   1030 <puts@plt>
jmp    11b6 <main+0x86>
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    11a5 <main+0x75>
lea    0xe89(%rip),%rdi
call   1030 <puts@plt>
jmp    11b1 <main+0x81>
lea    0xe83(%rip),%rdi
call   1030 <puts@plt>
jmp    11b6 <main+0x86>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xecf(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
movslq 0x4(%rsp),%rax
imul   $0x55555556,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%ecx
mov    %eax,%edx
sub    %ecx,%edx
cmp    $0x1,%edx
lea    0xeac(%rip),%rdx
lea    0xeb0(%rip),%rsi
cmove  %rdx,%rsi
cmp    %ecx,%eax
lea    0xe8a(%rip),%rdi
cmovne %rsi,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"\E8\BE\93\E5\85\A5\E4\B8\80\E4\B8\AA\E6\95\B4\E6\95\B0\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [14 x i8] c"\E8\83\BD\E8\A2\AB3\E6\95\B4\E9\99\A4\00"
@.str.3 = [11 x i8] c"\E4\BD\99\E6\95\B0\E6\98\AF1\00"
@.str.4 = [11 x i8] c"\E4\BD\99\E6\95\B0\E6\98\AF2\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = srem i32 %5, 3
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %19
10: ; preds = %0
%11 = load i32, i32* %2
%12 = srem i32 %11, 3
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = call i32 @puts(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
br label %18
16: ; preds = %10
%17 = call i32 @puts(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
br label %18
18: ; preds = %16, %14
br label %19
19: ; preds = %18, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"\E8\BE\93\E5\85\A5\E4\B8\80\E4\B8\AA\E6\95\B4\E6\95\B0\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [14 x i8] c"\E8\83\BD\E8\A2\AB3\E6\95\B4\E9\99\A4\00"
@.str.3 = [11 x i8] c"\E4\BD\99\E6\95\B0\E6\98\AF1\00"
@.str.4 = [11 x i8] c"\E4\BD\99\E6\95\B0\E6\98\AF2\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = srem i32 %5, 3
%7 = icmp eq i32 %6, 1
%8 = select i1 %7, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0)
%9 = icmp eq i32 %6, 0
%10 = select i1 %9, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* %8
%11 = call i32 @puts(i8* dereferenceable(1) %10)
ret i32 0
}