#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*/ print_int(int);
int /*<<< orphan*/ print_string(char *);
void main(void) {
  int num;
  num = 6 + 2;
  print_string("Should get 8\nGot: ");
  print_int(num);
  print_string("\n");
  num = 6 - 2;
  print_string("Should get 4\nGot: ");
  print_int(num);
  print_string("\n");
  num = 6 * 2;
  print_string("Should get 12\nGot: ");
  print_int(num);
  print_string("\n");
  num = 6 / 2;
  print_string("Should get 3\nGot: ");
  print_int(num);
  print_string("\n");
  num = '2' / 25;
  print_string("Should get 2 ('2' = 50)\nGot: ");
  print_int(num);
  print_string("\n");
  num = 2 * '1';
  print_string("Should get 98 ('1' = 49)\nGot: ");
  print_int(num);
  print_string("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x8,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <print_string@plt>
mov    -0x4(%rbp),%edi
call   1040 <print_int@plt>
lea    0xec9(%rip),%rdi
call   1030 <print_string@plt>
movl   $0x4,-0x4(%rbp)
lea    0xeb8(%rip),%rdi
call   1030 <print_string@plt>
mov    -0x4(%rbp),%edi
call   1040 <print_int@plt>
lea    0xea2(%rip),%rdi
call   1030 <print_string@plt>
movl   $0xc,-0x4(%rbp)
lea    0xea4(%rip),%rdi
call   1030 <print_string@plt>
mov    -0x4(%rbp),%edi
call   1040 <print_int@plt>
lea    0xe7b(%rip),%rdi
call   1030 <print_string@plt>
movl   $0x3,-0x4(%rbp)
lea    0xe91(%rip),%rdi
call   1030 <print_string@plt>
mov    -0x4(%rbp),%edi
call   1040 <print_int@plt>
lea    0xe54(%rip),%rdi
call   1030 <print_string@plt>
movl   $0x2,-0x4(%rbp)
lea    0xe7d(%rip),%rdi
call   1030 <print_string@plt>
mov    -0x4(%rbp),%edi
call   1040 <print_int@plt>
lea    0xe2d(%rip),%rdi
call   1030 <print_string@plt>
movl   $0x62,-0x4(%rbp)
lea    0xe74(%rip),%rdi
call   1030 <print_string@plt>
mov    -0x4(%rbp),%edi
call   1040 <print_int@plt>
lea    0xe06(%rip),%rdi
call   1030 <print_string@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1030 <print_string@plt>
mov    $0x8,%edi
call   1040 <print_int@plt>
lea    0xed5(%rip),%rbx
mov    %rbx,%rdi
call   1030 <print_string@plt>
lea    0xec8(%rip),%rdi
call   1030 <print_string@plt>
mov    $0x4,%edi
call   1040 <print_int@plt>
mov    %rbx,%rdi
call   1030 <print_string@plt>
lea    0xebd(%rip),%rdi
call   1030 <print_string@plt>
mov    $0xc,%edi
call   1040 <print_int@plt>
mov    %rbx,%rdi
call   1030 <print_string@plt>
lea    0xeb3(%rip),%rdi
call   1030 <print_string@plt>
mov    $0x3,%edi
call   1040 <print_int@plt>
mov    %rbx,%rdi
call   1030 <print_string@plt>
lea    0xea8(%rip),%rdi
call   1030 <print_string@plt>
mov    $0x2,%edi
call   1040 <print_int@plt>
mov    %rbx,%rdi
call   1030 <print_string@plt>
lea    0xea8(%rip),%rdi
call   1030 <print_string@plt>
mov    $0x62,%edi
call   1040 <print_int@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <print_string@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Should get 8\0AGot: \00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [19 x i8] c"Should get 4\0AGot: \00"
@.str.3 = [20 x i8] c"Should get 12\0AGot: \00"
@.str.4 = [19 x i8] c"Should get 3\0AGot: \00"
@.str.5 = [30 x i8] c"Should get 2 ('2' = 50)\0AGot: \00"
@.str.6 = [31 x i8] c"Should get 98 ('1' = 49)\0AGot: \00"
define void @main() {
%1 = alloca i32
store i32 8, i32* %1
%2 = call i32 @print_string(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
%4 = call i32 @print_int(i32 %3)
%5 = call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 4, i32* %1
%6 = call i32 @print_string(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%7 = load i32, i32* %1
%8 = call i32 @print_int(i32 %7)
%9 = call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 12, i32* %1
%10 = call i32 @print_string(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%11 = load i32, i32* %1
%12 = call i32 @print_int(i32 %11)
%13 = call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 3, i32* %1
%14 = call i32 @print_string(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%15 = load i32, i32* %1
%16 = call i32 @print_int(i32 %15)
%17 = call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 2, i32* %1
%18 = call i32 @print_string(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0))
%19 = load i32, i32* %1
%20 = call i32 @print_int(i32 %19)
%21 = call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 98, i32* %1
%22 = call i32 @print_string(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0))
%23 = load i32, i32* %1
%24 = call i32 @print_int(i32 %23)
%25 = call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Should get 8\0AGot: \00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [19 x i8] c"Should get 4\0AGot: \00"
@.str.3 = [20 x i8] c"Should get 12\0AGot: \00"
@.str.4 = [19 x i8] c"Should get 3\0AGot: \00"
@.str.5 = [30 x i8] c"Should get 2 ('2' = 50)\0AGot: \00"
@.str.6 = [31 x i8] c"Should get 98 ('1' = 49)\0AGot: \00"
define void @main() {
%1 = tail call i32 @print_string(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @print_int(i32 8)
%3 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @print_string(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @print_int(i32 4)
%6 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @print_string(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%8 = tail call i32 @print_int(i32 12)
%9 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%10 = tail call i32 @print_string(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%11 = tail call i32 @print_int(i32 3)
%12 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%13 = tail call i32 @print_string(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0))
%14 = tail call i32 @print_int(i32 2)
%15 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%16 = tail call i32 @print_string(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0))
%17 = tail call i32 @print_int(i32 98)
%18 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}