#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*/ gen_call(char *);
int /*<<< orphan*/ gen_immediate2();
int /*<<< orphan*/ gen_multiply_by_two();
int /*<<< orphan*/ newline();
int /*<<< orphan*/ output_number(int);
void gen_multiply(int type, int size) {
  switch (type) {
  case (2 << 2):
  case ((2 << 2) + 1):
    gen_multiply_by_two();
    break;
  case 2:
    gen_immediate2();
    output_number(size);
    newline();
    gen_call("ccmul");
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<gen_multiply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x2,%eax
je     1192 <gen_multiply+0x42>
jmp    1172 <gen_multiply+0x22>
mov    -0xc(%rbp),%eax
add    $0xfffffff8,%eax
sub    $0x1,%eax
ja     11b9 <gen_multiply+0x69>
jmp    1186 <gen_multiply+0x36>
mov    $0x0,%al
call   1070 <gen_multiply_by_two@plt>
jmp    11be <gen_multiply+0x6e>
mov    $0x0,%al
call   1050 <gen_immediate2@plt>
mov    -0x8(%rbp),%edi
call   1040 <output_number@plt>
mov    $0x0,%al
call   1030 <newline@plt>
lea    0xe51(%rip),%rdi
call   1060 <gen_call@plt>
jmp    11be <gen_multiply+0x6e>
jmp    11be <gen_multiply+0x6e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_multiply>:
lea    -0x8(%rdi),%eax
cmp    $0x2,%eax
jae    115f <gen_multiply+0xf>
xor    %eax,%eax
jmp    1070 <gen_multiply_by_two@plt>
cmp    $0x2,%edi
jne    1189 <gen_multiply+0x39>
push   %rbx
mov    %esi,%ebx
xor    %eax,%eax
call   1050 <gen_immediate2@plt>
mov    %ebx,%edi
call   1040 <output_number@plt>
xor    %eax,%eax
call   1030 <newline@plt>
lea    0xe7d(%rip),%rdi
pop    %rbx
jmp    1060 <gen_call@plt>
ret

LLVM IR (-O0):
@.str = [6 x i8] c"ccmul\00"
define void @gen_multiply(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
switch i32 %5, label %14 [
i32 8, label %6
i32 9, label %6
i32 2, label %8
]
6: ; preds = %2, %2
%7 = call i32 (...) @gen_multiply_by_two()
br label %15
8: ; preds = %2
%9 = call i32 (...) @gen_immediate2()
%10 = load i32, i32* %4
%11 = call i32 @output_number(i32 %10)
%12 = call i32 (...) @newline()
%13 = call i32 @gen_call(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %15
14: ; preds = %2
br label %15
15: ; preds = %14, %8, %6
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"ccmul\00"
define void @gen_multiply(i32 %0, i32 %1) {
switch i32 %0, label %10 [
i32 8, label %3
i32 9, label %3
i32 2, label %5
]
3: ; preds = %2, %2
%4 = tail call i32 (...) @gen_multiply_by_two()
br label %10
5: ; preds = %2
%6 = tail call i32 (...) @gen_immediate2()
%7 = tail call i32 @output_number(i32 %1)
%8 = tail call i32 (...) @newline()
%9 = tail call i32 @gen_call(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %2, %5, %3
ret void
}