xunge/DecIR huggingface dataset:
/* Type definitions */
struct serial_struct {
  int dummy;
};

/* Variables and functions */
int main(void) {
  struct serial_struct serial;
  (void)serial;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.serial_struct = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.serial_struct
store i32 0, i32* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void tegra210_init_speedo_data(struct tegra_sku_info *sku_info) {}


x86 assembly (clang, -O0):
<tegra210_init_speedo_data>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<tegra210_init_speedo_data>:
ret

LLVM IR (-O0):
%struct.tegra_sku_info = type opaque
define void @tegra210_init_speedo_data(%struct.tegra_sku_info* %0) {
%2 = alloca %struct.tegra_sku_info*
store %struct.tegra_sku_info* %0, %struct.tegra_sku_info** %2
ret void
}

LLVM IR (-O2):
%struct.tegra_sku_info = type opaque
define void @tegra210_init_speedo_data(%struct.tegra_sku_info* nocapture %0) {
ret void
}
int clearWordwith(int source, int destination) { return 0; }


x86 assembly (clang, -O0):
<clearWordwith>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearWordwith>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @clearWordwith(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @clearWordwith(i32 %0, i32 %1) {
ret i32 0
}
void uart_clear(void) {}


x86 assembly (clang, -O0):
<uart_clear>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_clear>:
ret

LLVM IR (-O0):
define void @uart_clear() {
ret void
}

LLVM IR (-O2):
define void @uart_clear() {
ret void
}
/* Variables and functions */
double M_PI;
int /*<<< orphan*/ printf(char *, double);
int main(void) {
  printf("M_PI = %f\n", M_PI);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ec2(%rip),%rax
movsd  (%rax),%xmm0
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
movsd  (%rax),%xmm0
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"M_PI = %f\0A\00"
@M_PI = global double 0.000000e+00
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load double, double* @M_PI
%3 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), double %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"M_PI = %f\0A\00"
@M_PI = global double 0.000000e+00
define i32 @main() {
%1 = load double, double* @M_PI
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), double %1)
ret i32 0
}
/* Variables and functions */
char *cnfCreim(char *const, int);
int /*<<< orphan*/ cnfFree(char *);
int /*<<< orphan*/ hdsShow(char *, int *);
void hds_show_(char *const topic, int *status, int topic_length) {
  char *topic_c;
  topic_c = cnfCreim(topic, topic_length);
  hdsShow(topic_c, status);
  cnfFree(topic_c);
}


x86 assembly (clang, -O0):
<hds_show_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1050 <cnfCreim@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <hdsShow@plt>
mov    -0x20(%rbp),%rdi
call   1040 <cnfFree@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hds_show_>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edx,%esi
call   1050 <cnfCreim@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <hdsShow@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <cnfFree@plt>

LLVM IR (-O0):
define void @hds_show_(i8* %0, i32* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %6
%10 = call i8* @cnfCreim(i8* %8, i32 %9)
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = load i32*, i32** %5
%13 = call i32 @hdsShow(i8* %11, i32* %12)
%14 = load i8*, i8** %7
%15 = call i32 @cnfFree(i8* %14)
ret void
}

LLVM IR (-O2):
define void @hds_show_(i8* %0, i32* %1, i32 %2) {
%4 = tail call i8* @cnfCreim(i8* %0, i32 %2)
%5 = tail call i32 @hdsShow(i8* %4, i32* %1)
%6 = tail call i32 @cnfFree(i8* %4)
ret void
}
/* Variables and functions */
int si_receive_char(int);
int si_expect_yn(int fd) {
  int got;
  if ((got = si_receive_char(fd)) < 0)
    return -1;
  if (got != 'Y' && got != 'N')
    return -1;
  return (got == 'Y');
}


x86 assembly (clang, -O0):
<si_expect_yn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <si_receive_char@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jge    113b <si_expect_yn+0x2b>
movl   $0xffffffff,-0x4(%rbp)
jmp    116a <si_expect_yn+0x5a>
cmpl   $0x59,-0xc(%rbp)
je     115b <si_expect_yn+0x4b>
cmpl   $0x4e,-0xc(%rbp)
je     115b <si_expect_yn+0x4b>
movl   $0xffffffff,-0x4(%rbp)
jmp    116a <si_expect_yn+0x5a>
cmpl   $0x59,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<si_expect_yn>:
push   %rax
call   1030 <si_receive_char@plt>
xor    %ecx,%ecx
cmp    $0x4e,%eax
setne  %cl
neg    %ecx
cmp    $0x59,%eax
mov    $0x1,%edx
cmovne %ecx,%edx
test   %eax,%eax
mov    $0xffffffff,%eax
cmovns %edx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @si_expect_yn(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @si_receive_char(i32 %5)
store i32 %6, i32* %4
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %20
9: ; preds = %1
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 89
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = load i32, i32* %4
%14 = icmp ne i32 %13, 78
br i1 %14, label %15, label %16
15: ; preds = %12
store i32 -1, i32* %2
br label %20
16: ; preds = %12, %9
%17 = load i32, i32* %4
%18 = icmp eq i32 %17, 89
%19 = zext i1 %18 to i32
store i32 %19, i32* %2
br label %20
20: ; preds = %16, %15, %8
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @si_expect_yn(i32 %0) {
%2 = tail call i32 @si_receive_char(i32 %0)
%3 = icmp ne i32 %2, 78
%4 = sext i1 %3 to i32
%5 = icmp eq i32 %2, 89
%6 = select i1 %5, i32 1, i32 %4
%7 = icmp sgt i32 %2, -1
%8 = select i1 %7, i32 %6, i32 -1
ret i32 %8
}
/* Type definitions */
struct tinyrl {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ tinyrl_printf(struct tinyrl *, char *);
void tinyrl_vt100_clear_screen(struct tinyrl *this) {
  tinyrl_printf(this, "\x1b[2J");
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <tinyrl_printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
lea    0xee9(%rip),%rsi
jmp    1030 <tinyrl_printf@plt>

LLVM IR (-O0):
%struct.tinyrl = type { i32 }
@.str = [5 x i8] c"\1B[2J\00"
define void @tinyrl_vt100_clear_screen(%struct.tinyrl* %0) {
%2 = alloca %struct.tinyrl*
store %struct.tinyrl* %0, %struct.tinyrl** %2
%3 = load %struct.tinyrl*, %struct.tinyrl** %2
%4 = call i32 @tinyrl_printf(%struct.tinyrl* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.tinyrl = type { i32 }
@.str = [5 x i8] c"\1B[2J\00"
define void @tinyrl_vt100_clear_screen(%struct.tinyrl* %0) {
%2 = tail call i32 @tinyrl_printf(%struct.tinyrl* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint_least16_t;
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ endian_16hi8(int /*<<< orphan*/);
int /*<<< orphan*/ endian_16lo8(int /*<<< orphan*/);
void endian_big16(uint8_t ptr[2], uint_least16_t word) {
  ptr[0] = endian_16hi8(word);
  ptr[1] = endian_16lo8(word);
}


x86 assembly (clang, -O0):
<endian_big16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <endian_16hi8@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%edi
call   1030 <endian_16lo8@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<endian_big16>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%edi
call   1040 <endian_16hi8@plt>
mov    %eax,(%r14)
mov    %ebx,%edi
call   1030 <endian_16lo8@plt>
mov    %eax,0x4(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @endian_big16(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @endian_16hi8(i32 %5)
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
store i32 %6, i32* %8
%9 = load i32, i32* %4
%10 = call i32 @endian_16lo8(i32 %9)
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 1
store i32 %10, i32* %12
ret void
}

LLVM IR (-O2):
define void @endian_big16(i32* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @endian_16hi8(i32 %1)
store i32 %3, i32* %0
%4 = tail call i32 @endian_16lo8(i32 %1)
%5 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %4, i32* %5
ret void
}
void draw_pt(unsigned char *buf, const int buf_width, const int buf_height,
             const int x, const int y, const int fill) {
  if (x >= 0 && x < buf_width && y >= 0 && y < buf_height) {
    buf[y * buf_width + x] = fill;
  }
}


x86 assembly (clang, -O0):
<draw_pt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     115e <draw_pt+0x5e>
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115e <draw_pt+0x5e>
cmpl   $0x0,-0x18(%rbp)
jl     115e <draw_pt+0x5e>
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    115e <draw_pt+0x5e>
mov    -0x1c(%rbp),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
imul   -0xc(%rbp),%ecx
add    -0x14(%rbp),%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_pt>:
test   %ecx,%ecx
js     1120 <draw_pt+0x20>
cmp    %edx,%r8d
jge    1120 <draw_pt+0x20>
cmp    %esi,%ecx
jge    1120 <draw_pt+0x20>
test   %r8d,%r8d
js     1120 <draw_pt+0x20>
imul   %esi,%r8d
add    %ecx,%r8d
movslq %r8d,%rax
mov    %r9b,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @draw_pt(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i8* %0, i8** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i32, i32* %10
%14 = icmp sge i32 %13, 0
br i1 %14, label %15, label %37
15: ; preds = %6
%16 = load i32, i32* %10
%17 = load i32, i32* %8
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %37
19: ; preds = %15
%20 = load i32, i32* %11
%21 = icmp sge i32 %20, 0
br i1 %21, label %22, label %37
22: ; preds = %19
%23 = load i32, i32* %11
%24 = load i32, i32* %9
%25 = icmp slt i32 %23, %24
br i1 %25, label %26, label %37
26: ; preds = %22
%27 = load i32, i32* %12
%28 = trunc i32 %27 to i8
%29 = load i8*, i8** %7
%30 = load i32, i32* %11
%31 = load i32, i32* %8
%32 = mul nsw i32 %30, %31
%33 = load i32, i32* %10
%34 = add nsw i32 %32, %33
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i8, i8* %29, i64 %35
store i8 %28, i8* %36
br label %37
37: ; preds = %26, %22, %19, %15, %6
ret void
}

LLVM IR (-O2):
define void @draw_pt(i8* nocapture writeonly %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = icmp sgt i32 %3, -1
br i1 %7, label %8, label %20
8: ; preds = %6
%9 = icmp slt i32 %3, %1
%10 = icmp sgt i32 %4, -1
%11 = and i1 %9, %10
%12 = icmp slt i32 %4, %2
%13 = and i1 %12, %11
br i1 %13, label %14, label %20
14: ; preds = %8
%15 = trunc i32 %5 to i8
%16 = mul nsw i32 %4, %1
%17 = add nsw i32 %16, %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %0, i64 %18
store i8 %15, i8* %19
br label %20
20: ; preds = %14, %8, %6
ret void
}
int gtp_kernel_enabled(void) { return 0; }


x86 assembly (clang, -O0):
<gtp_kernel_enabled>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gtp_kernel_enabled>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @gtp_kernel_enabled() {
ret i32 0
}

LLVM IR (-O2):
define i32 @gtp_kernel_enabled() {
ret i32 0
}
/* Variables and functions */
void signal_handler(int sig) {}


x86 assembly (clang, -O0):
<signal_handler>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<signal_handler>:
ret

LLVM IR (-O0):
define void @signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @signal_handler(i32 %0) {
ret void
}
char *CopyString(const char *in) {
  char *out;
  if (!in) {
    return ((void *)0);
  }
  out = malloc(strlen(in) + 1);
  strcpy(out, in);
  return out;
}


x86 assembly (clang, -O0):
<CopyString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <CopyString+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1182 <CopyString+0x52>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CopyString>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     115a <CopyString+0x2a>
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
jmp    115d <CopyString+0x2d>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @CopyString(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %1
store i8* null, i8** %2
br label %17
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i64 @strlen(i8* %9)
%11 = add i64 %10, 1
%12 = call i8* @malloc(i64 %11)
store i8* %12, i8** %4
%13 = load i8*, i8** %4
%14 = load i8*, i8** %3
%15 = call i8* @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %4
store i8* %16, i8** %2
br label %17
17: ; preds = %8, %7
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
define i8* @CopyString(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = add i64 %4, 1
%6 = tail call i8* @malloc(i64 %5)
%7 = tail call i8* @strcpy(i8* dereferenceable(1) %6, i8* %0)
br label %8
8: ; preds = %1, %3
%9 = phi i8* [ %6, %3 ], [ null, %1 ]
ret i8* %9
}
/* Variables and functions */
int fact(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int res, n;
  printf("Enter the n\n");
  scanf("%d", &n);
  res = fact(n);
  printf("fact=%d", res);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0xc(%rbp),%edi
call   1040 <fact@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec0(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <fact@plt>
lea    0xe92(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Enter the n\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [8 x i8] c"fact=%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
%7 = call i32 @fact(i32 %6)
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [8 x i8] c"fact=%d\00"
@str = [12 x i8] c"Enter the n\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 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 = call i32 @fact(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
int power(int n, int exp) {
  static int ans = 1;
  if (exp > 0) {
    ans *= n;
    exp--;
    power(n, exp);
  }
  return ans;
}


x86 assembly (clang, -O0):
<power>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    114c <power+0x3c>
mov    -0x4(%rbp),%eax
imul   0x2ef6(%rip),%eax
mov    %eax,0x2ef0(%rip)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <power@plt>
mov    0x2ed6(%rip),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<power>:
push   %rax
test   %esi,%esi
jle    112c <power+0x1c>
mov    0x2f0d(%rip),%eax
imul   %edi,%eax
mov    %eax,0x2f04(%rip)
add    $0xffffffff,%esi
call   1030 <power@plt>
mov    0x2ef6(%rip),%eax
pop    %rcx
ret

LLVM IR (-O0):
@power.ans = internal global i32 1
define i32 @power(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %2
%8 = load i32, i32* %3
%9 = load i32, i32* @power.ans
%10 = mul nsw i32 %9, %8
store i32 %10, i32* @power.ans
%11 = load i32, i32* %4
%12 = add nsw i32 %11, -1
store i32 %12, i32* %4
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = call i32 @power(i32 %13, i32 %14)
br label %16
16: ; preds = %7, %2
%17 = load i32, i32* @power.ans
ret i32 %17
}

LLVM IR (-O2):
@power.ans = internal unnamed_addr global i32 1
define i32 @power(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = load i32, i32* @power.ans
%6 = mul nsw i32 %5, %0
store i32 %6, i32* @power.ans
%7 = add nsw i32 %1, -1
%8 = tail call i32 @power(i32 %0, i32 %7)
br label %9
9: ; preds = %4, %2
%10 = load i32, i32* @power.ans
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t xmodem_recv(uint8_t *addr_mem) {}


x86 assembly (clang, -O0):
<xmodem_recv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmodem_recv>:
ret

LLVM IR (-O0):
define i32 @xmodem_recv(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
define i32 @xmodem_recv(i32* nocapture readnone %0) {
ret i32 undef
}
void ScaleARGBRowDown2Box_C() {}


x86 assembly (clang, -O0):
<ScaleARGBRowDown2Box_C>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ScaleARGBRowDown2Box_C>:
ret

LLVM IR (-O0):
define void @ScaleARGBRowDown2Box_C() {
ret void
}

LLVM IR (-O2):
define void @ScaleARGBRowDown2Box_C() {
ret void
}
/* Variables and functions */
scalar_t__ is_full_dump();
int mem_init_flex();
int mem_init_full();
int mem_init(void) {
  if (is_full_dump())
    return mem_init_full();
  else
    return mem_init_flex();
}


x86 assembly (clang, -O0):
<mem_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <is_full_dump@plt>
cmp    $0x0,%rax
je     1158 <mem_init+0x28>
mov    $0x0,%al
call   1050 <mem_init_full@plt>
mov    %eax,-0x4(%rbp)
jmp    1162 <mem_init+0x32>
mov    $0x0,%al
call   1030 <mem_init_flex@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_init>:
push   %rax
xor    %eax,%eax
call   1040 <is_full_dump@plt>
test   %rax,%rax
je     1145 <mem_init+0x15>
xor    %eax,%eax
pop    %rcx
jmp    1050 <mem_init_full@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <mem_init_flex@plt>

LLVM IR (-O0):
define i32 @mem_init() {
%1 = alloca i32
%2 = call i64 (...) @is_full_dump()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @mem_init_full()
store i32 %5, i32* %1
br label %8
6: ; preds = %0
%7 = call i32 (...) @mem_init_flex()
store i32 %7, i32* %1
br label %8
8: ; preds = %6, %4
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @mem_init() {
%1 = tail call i64 (...) @is_full_dump()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @mem_init_full()
br label %7
5: ; preds = %0
%6 = tail call i32 (...) @mem_init_flex()
br label %7
7: ; preds = %5, %3
%8 = phi i32 [ %4, %3 ], [ %6, %5 ]
ret i32 %8
}
void LimitInt(int *a, int min, int max) {
  if (*a < min)
    *a = min;
  if (*a > max)
    *a = max;
}


x86 assembly (clang, -O0):
<LimitInt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
cmp    -0xc(%rbp),%eax
jge    1126 <LimitInt+0x26>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
cmp    -0x10(%rbp),%eax
jle    113e <LimitInt+0x3e>
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<LimitInt>:
mov    (%rdi),%eax
cmp    %esi,%eax
cmovl  %esi,%eax
jl     110e <LimitInt+0xe>
cmp    %edx,%eax
jg     110e <LimitInt+0xe>
ret
cmp    %edx,%eax
cmovg  %edx,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @LimitInt(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = load i32, i32* %5
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %14
11: ; preds = %3
%12 = load i32, i32* %5
%13 = load i32*, i32** %4
store i32 %12, i32* %13
br label %14
14: ; preds = %11, %3
%15 = load i32*, i32** %4
%16 = load i32, i32* %15
%17 = load i32, i32* %6
%18 = icmp sgt i32 %16, %17
br i1 %18, label %19, label %22
19: ; preds = %14
%20 = load i32, i32* %6
%21 = load i32*, i32** %4
store i32 %20, i32* %21
br label %22
22: ; preds = %19, %14
ret void
}

LLVM IR (-O2):
define void @LimitInt(i32* nocapture %0, i32 %1, i32 %2) {
%4 = load i32, i32* %0
%5 = icmp slt i32 %4, %1
%6 = select i1 %5, i32 %1, i32 %4
%7 = icmp sgt i32 %6, %2
%8 = or i1 %5, %7
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = select i1 %7, i32 %2, i32 %6
store i32 %10, i32* %0
br label %11
11: ; preds = %3, %9
ret void
}
int f(int *p) { return 0; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @f(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @f(i32* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int recv_msg(int, size_t, void *);
int send_msg(int, int, int, size_t, void const *);
int send_msg_recv_msg(int sock, int type, int op, size_t send_len,
                      const void *send_buf, size_t recv_len, void *recv_buf) {
  int ret;
  ret = send_msg(sock, type, op, send_len, send_buf);
  if (!ret) {
    ret = recv_msg(sock, recv_len, recv_buf);
  }
  return ret;
}


x86 assembly (clang, -O0):
<send_msg_recv_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
call   1040 <send_msg@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jne    1177 <send_msg_recv_msg+0x57>
mov    -0x4(%rbp),%edi
mov    -0x28(%rbp),%rsi
mov    0x10(%rbp),%rdx
call   1030 <recv_msg@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_msg_recv_msg>:
push   %rbp
push   %r14
push   %rbx
mov    %r9,%r14
mov    %edi,%ebp
mov    0x20(%rsp),%rbx
call   1040 <send_msg@plt>
test   %eax,%eax
je     113c <send_msg_recv_msg+0x1c>
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %ebp,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <recv_msg@plt>

LLVM IR (-O0):
define i32 @send_msg_recv_msg(i32 %0, i32 %1, i32 %2, i64 %3, i8* %4, i64 %5, i8* %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i64
%12 = alloca i8*
%13 = alloca i64
%14 = alloca i8*
%15 = alloca i32
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i64 %3, i64* %11
store i8* %4, i8** %12
store i64 %5, i64* %13
store i8* %6, i8** %14
%16 = load i32, i32* %8
%17 = load i32, i32* %9
%18 = load i32, i32* %10
%19 = load i64, i64* %11
%20 = load i8*, i8** %12
%21 = call i32 @send_msg(i32 %16, i32 %17, i32 %18, i64 %19, i8* %20)
store i32 %21, i32* %15
%22 = load i32, i32* %15
%23 = icmp ne i32 %22, 0
br i1 %23, label %29, label %24
24: ; preds = %7
%25 = load i32, i32* %8
%26 = load i64, i64* %13
%27 = load i8*, i8** %14
%28 = call i32 @recv_msg(i32 %25, i64 %26, i8* %27)
store i32 %28, i32* %15
br label %29
29: ; preds = %24, %7
%30 = load i32, i32* %15
ret i32 %30
}

LLVM IR (-O2):
define i32 @send_msg_recv_msg(i32 %0, i32 %1, i32 %2, i64 %3, i8* %4, i64 %5, i8* %6) {
%8 = tail call i32 @send_msg(i32 %0, i32 %1, i32 %2, i64 %3, i8* %4)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = tail call i32 @recv_msg(i32 %0, i64 %5, i8* %6)
br label %12
12: ; preds = %10, %7
%13 = phi i32 [ %8, %7 ], [ %11, %10 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ two_complement(char *);
void op_neg_b(char rega[], char regb[], char accumulator[], char flags[]) {
  two_complement(regb);
}


x86 assembly (clang, -O0):
<op_neg_b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <two_complement@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_neg_b>:
mov    %rsi,%rdi
jmp    1030 <two_complement@plt>

LLVM IR (-O0):
define void @op_neg_b(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %6
%10 = call i32 @two_complement(i8* %9)
ret void
}

LLVM IR (-O2):
define void @op_neg_b(i8* nocapture readnone %0, i8* %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
%5 = tail call i32 @two_complement(i8* %1)
ret void
}
long long int longlongint_ignoring_longdouble(long long int x, long double y) {
  return x;
}


x86 assembly (clang, -O0):
<longlongint_ignoring_longdouble>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
mov    %rdi,-0x8(%rbp)
fstpt  -0x20(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<longlongint_ignoring_longdouble>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @longlongint_ignoring_longdouble(i64 %0, x86_fp80 %1) {
%3 = alloca i64
%4 = alloca x86_fp80
store i64 %0, i64* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @longlongint_ignoring_longdouble(i64 returned %0, x86_fp80 %1) {
ret i64 %0
}
unsigned xrop3_222_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D ^ T;
  stk1 = S | stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_222_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_222_1_1>:
mov    $0xff,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_222_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %7
%24 = xor i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %6
%26 = load i32, i32* %9
%27 = or i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = load i32, i32* %6
%30 = xor i32 %29, -1
%31 = and i32 %28, %30
%32 = load i32, i32* %7
%33 = xor i32 %32, -1
%34 = and i32 %31, %33
%35 = load i32, i32* %5
%36 = load i32, i32* %6
%37 = and i32 %35, %36
%38 = or i32 %34, %37
%39 = load i32, i32* %5
%40 = load i32, i32* %7
%41 = and i32 %39, %40
%42 = or i32 %38, %41
ret i32 %42
}

LLVM IR (-O2):
define i32 @xrop3_222_1_1(i8 zeroext %0, i8 zeroext %1) {
ret i32 255
}
double difftime(unsigned long time1, unsigned long time0) {
  return time1 - time0;
}


x86 assembly (clang, -O0):
<difftime>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
movq   %rax,%xmm0
movaps 0xedd(%rip),%xmm1
punpckldq %xmm1,%xmm0
movapd 0xee1(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<difftime>:
sub    %rsi,%rdi
movq   %rdi,%xmm1
punpckldq 0xef0(%rip),%xmm1
subpd  0xef8(%rip),%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @difftime(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = sub i64 %5, %6
%8 = uitofp i64 %7 to double
ret double %8
}

LLVM IR (-O2):
define double @difftime(i64 %0, i64 %1) {
%3 = sub i64 %0, %1
%4 = uitofp i64 %3 to double
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ uart_putf(char *);
void handler_undefined() { uart_putf("undefined instruction, skipping\n"); }


x86 assembly (clang, -O0):
<handler_undefined>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <uart_putf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler_undefined>:
lea    0xee9(%rip),%rdi
jmp    1030 <uart_putf@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"undefined instruction, skipping\0A\00"
define void @handler_undefined() {
%1 = call i32 @uart_putf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"undefined instruction, skipping\0A\00"
define void @handler_undefined() {
%1 = tail call i32 @uart_putf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int EOF;
int getter_string(void *cookie) {
  char **pt = (char **)cookie;
  int ch = **pt;
  if (ch) {
    (*pt)++;
    return (ch);
  }
  return (EOF);
}


x86 assembly (clang, -O0):
<getter_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1140 <getter_string+0x40>
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114c <getter_string+0x4c>
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getter_string>:
mov    (%rdi),%rcx
movsbl (%rcx),%eax
test   %eax,%eax
je     1112 <getter_string+0x12>
add    $0x1,%rcx
mov    %rcx,(%rdi)
ret
mov    0x2ecf(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @getter_string(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i8**
store i8** %7, i8*** %4
%8 = load i8**, i8*** %4
%9 = load i8*, i8** %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %1
%15 = load i8**, i8*** %4
%16 = load i8*, i8** %15
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %15
%18 = load i32, i32* %5
store i32 %18, i32* %2
br label %21
19: ; preds = %1
%20 = load i32, i32* @EOF
store i32 %20, i32* %2
br label %21
21: ; preds = %19, %14
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @getter_string(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = sext i8 %4 to i32
%8 = getelementptr inbounds i8, i8* %3, i64 1
store i8* %8, i8** %2
br label %11
9: ; preds = %1
%10 = load i32, i32* @EOF
br label %11
11: ; preds = %9, %6
%12 = phi i32 [ %7, %6 ], [ %10, %9 ]
ret i32 %12
}
int isinf(double X) { return 0; }


x86 assembly (clang, -O0):
<isinf>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isinf>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isinf(double %0) {
%2 = alloca double
store double %0, double* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @isinf(double %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ say(char *, int);
void hit(void) { say("Die, strange machine that doesn't belong here!", 1); }


x86 assembly (clang, -O0):
<hit>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%esi
call   1030 <say@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hit>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
jmp    1030 <say@plt>

LLVM IR (-O0):
@.str = [47 x i8] c"Die, strange machine that doesn't belong here!\00"
define void @hit() {
%1 = call i32 @say(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [47 x i8] c"Die, strange machine that doesn't belong here!\00"
define void @hit() {
%1 = tail call i32 @say(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
void foo() {
  for (; 1;)
    ;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <foo+0x9>
mov    $0x1,%al
test   $0x1,%al
jne    1118 <foo+0x18>
jmp    111d <foo+0x1d>
jmp    1109 <foo+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
jmp    1100 <foo>

LLVM IR (-O0):
define void @foo() {
br label %1
1: ; preds = %2, %0
br i1 true, label %2, label %3
2: ; preds = %1
br label %1
3: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @foo() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ MFRC522_HAL_write(int /*<<< orphan*/, int /*<<< orphan*/);
void MFRC522_WriteRegister(uint8_t addr, uint8_t val) {
  MFRC522_HAL_write(addr, val);
}


x86 assembly (clang, -O0):
<MFRC522_WriteRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <MFRC522_HAL_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MFRC522_WriteRegister>:
jmp    1030 <MFRC522_HAL_write@plt>

LLVM IR (-O0):
define void @MFRC522_WriteRegister(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
%6 = load i32, i32* %4
%7 = call i32 @MFRC522_HAL_write(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @MFRC522_WriteRegister(i32 %0, i32 %1) {
%3 = tail call i32 @MFRC522_HAL_write(i32 %0, i32 %1)
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main() {
  uint64_t x = *(uint64_t *)"action =";
  char *var = "action =gijoe command test";
  uint64_t z = *(uint64_t *)var;
  if (x == z)
    puts("OK");
  else
    puts("NOT MATCH");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xed8(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jne    115f <main+0x4f>
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
jmp    116b <main+0x5b>
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"action =\00"
@.str.1 = [27 x i8] c"action =gijoe command test\00"
@.str.2 = [3 x i8] c"OK\00"
@.str.3 = [10 x i8] c"NOT MATCH\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i8*
%4 = alloca i64
store i32 0, i32* %1
%5 = load i64, i64* bitcast ([9 x i8]* @.str to i64*)
store i64 %5, i64* %2
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8** %3
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i64*
%8 = load i64, i64* %7
store i64 %8, i64* %4
%9 = load i64, i64* %2
%10 = load i64, i64* %4
%11 = icmp eq i64 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %0
%13 = call i32 @puts(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %16
14: ; preds = %0
%15 = call i32 @puts(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
br label %16
16: ; preds = %14, %12
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [3 x i8] c"OK\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 5;
  printf("%d", ++a);
  printf("%d\n", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%esi
add    $0x1,%esi
mov    %esi,-0x8(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 6)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 6)
ret i32 0
}
void func(void) { char str[] = "something_local"; }


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
mov    0xef5(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xef2(%rip),%rax
mov    %rax,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
ret

LLVM IR (-O0):
@__const.func.str = [16 x i8] c"something_local\00"
define void @func() {
%1 = alloca [16 x i8]
%2 = bitcast [16 x i8]* %1 to i8*
ret void
}

LLVM IR (-O2):
define void @func() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ right_rotate(char *, int);
int /*<<< orphan*/ scanf(char *, char *, int *);
int main() {
  char str[101];
  int n;
  scanf("%s%d", str, &n);
  right_rotate(str, n);
  printf("%s", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xeb3(%rip),%rdi
lea    -0x74(%rbp),%rdx
call   1050 <scanf@plt>
lea    -0x70(%rbp),%rdi
mov    -0x74(%rbp),%esi
call   1030 <right_rotate@plt>
lea    -0x70(%rbp),%rsi
lea    0xe98(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x80,%rsp
lea    0xec1(%rip),%rdi
lea    0x10(%rsp),%rbx
lea    0xc(%rsp),%rdx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1030 <right_rotate@plt>
lea    0xea1(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%s%d\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [101 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [101 x i8], [101 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %4, i32* %3)
%6 = getelementptr inbounds [101 x i8], [101 x i8]* %2, i64 0, i64 0
%7 = load i32, i32* %3
%8 = call i32 @right_rotate(i8* %6, i32 %7)
%9 = getelementptr inbounds [101 x i8], [101 x i8]* %2, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s%d\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [101 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [101 x i8], [101 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3, i32* %2)
%6 = load i32, i32* %2
%7 = call i32 @right_rotate(i8* %3, i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret i32 0
}
unsigned long GetStringLen(unsigned char *str) {
  unsigned char *p = str;
  while (*str) {
    str++;
  }
  return (str - p);
}


x86 assembly (clang, -O0):
<GetStringLen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     112e <GetStringLen+0x2e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <GetStringLen+0x10>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetStringLen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <GetStringLen+0x10>
ret

LLVM IR (-O0):
define i64 @GetStringLen(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %9, %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %2
br label %5
12: ; preds = %5
%13 = load i8*, i8** %2
%14 = load i8*, i8** %3
%15 = ptrtoint i8* %13 to i64
%16 = ptrtoint i8* %14 to i64
%17 = sub i64 %15, %16
ret i64 %17
}

LLVM IR (-O2):
define i64 @GetStringLen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
ret i64 %10
}
/* Variables and functions */
char *getchar();
int /*<<< orphan*/ terminal_writestring(char *);
void prompt() {
  char *cmd = getchar();
  while (cmd != "\n") {
    terminal_writestring(">> ");
  }
}


x86 assembly (clang, -O0):
<prompt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %rax,-0x8(%rbp)
lea    0xec6(%rip),%rax
cmp    %rax,-0x8(%rbp)
je     1155 <prompt+0x35>
lea    0xeb7(%rip),%rdi
call   1030 <terminal_writestring@plt>
jmp    1133 <prompt+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prompt>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
lea    0xed1(%rip),%rcx
cmp    %rcx,%rax
je     115a <prompt+0x3a>
lea    0xec7(%rip),%rbx
mov    %rbx,%rdi
call   1030 <terminal_writestring@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
call   1030 <terminal_writestring@plt>
jmp    1150 <prompt+0x30>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [4 x i8] c">> \00"
define void @prompt() {
%1 = alloca i8*
%2 = call i8* (...) @getchar()
store i8* %2, i8** %1
br label %3
3: ; preds = %6, %0
%4 = load i8*, i8** %1
%5 = icmp ne i8* %4, getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = call i32 @terminal_writestring(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %3
8: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [4 x i8] c">> \00"
define void @prompt() {
%1 = tail call i8* (...) @getchar()
%2 = icmp eq i8* %1, getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i32 @terminal_writestring(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %5, %3
%6 = tail call i32 @terminal_writestring(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %5
7: ; preds = %0
ret void
}