xunge/DecIR huggingface dataset:
void easycharts_set_half_height(int *height, char printer_sized_yn) {
  if (printer_sized_yn == 'y') {
    *height = (double)*height / 1.4;
  } else {
    *height = (double)*height / 2.0;
  }
}


x86 assembly (clang, -O0):
<easycharts_set_half_height>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x79,%eax
jne    113e <easycharts_set_half_height+0x3e>
mov    -0x8(%rbp),%rax
cvtsi2sdl (%rax),%xmm0
movsd  0xedd(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
jmp    115c <easycharts_set_half_height+0x5c>
mov    -0x8(%rbp),%rax
cvtsi2sdl (%rax),%xmm0
movsd  0xeb2(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<easycharts_set_half_height>:
cvtsi2sdl (%rdi),%xmm0
cmp    $0x79,%sil
jne    1114 <easycharts_set_half_height+0x14>
divsd  0xef6(%rip),%xmm0
jmp    111c <easycharts_set_half_height+0x1c>
mulsd  0xee4(%rip),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @easycharts_set_half_height(i32* %0, i8 signext %1) {
%3 = alloca i32*
%4 = alloca i8
store i32* %0, i32** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 121
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load i32*, i32** %3
%10 = load i32, i32* %9
%11 = sitofp i32 %10 to double
%12 = fdiv double %11, 1.400000e+00
%13 = fptosi double %12 to i32
%14 = load i32*, i32** %3
store i32 %13, i32* %14
br label %22
15: ; preds = %2
%16 = load i32*, i32** %3
%17 = load i32, i32* %16
%18 = sitofp i32 %17 to double
%19 = fdiv double %18, 2.000000e+00
%20 = fptosi double %19 to i32
%21 = load i32*, i32** %3
store i32 %20, i32* %21
br label %22
22: ; preds = %15, %8
ret void
}

LLVM IR (-O2):
define void @easycharts_set_half_height(i32* nocapture %0, i8 signext %1) {
%3 = icmp eq i8 %1, 121
%4 = load i32, i32* %0
%5 = sitofp i32 %4 to double
br i1 %3, label %6, label %8
6: ; preds = %2
%7 = fdiv double %5, 1.400000e+00
br label %10
8: ; preds = %2
%9 = fmul double %5, 5.000000e-01
br label %10
10: ; preds = %8, %6
%11 = phi double [ %9, %8 ], [ %7, %6 ]
%12 = fptosi double %11 to i32
store i32 %12, i32* %0
ret void
}
/* Type definitions */
struct msqid_ds {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __NR_msgctl;
int syscall(int /*<<< orphan*/, int, int, struct msqid_ds *);
int msgctl(int msqid, int cmd, struct msqid_ds *buf) {
  return syscall(__NR_msgctl, msqid, cmd, buf);
}


x86 assembly (clang, -O0):
<msgctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rcx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msgctl>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    %edi,%esi
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.msqid_ds = type { i32 }
@__NR_msgctl = global i32 0
define i32 @msgctl(i32 %0, i32 %1, %struct.msqid_ds* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.msqid_ds*
store i32 %0, i32* %4
store i32 %1, i32* %5
store %struct.msqid_ds* %2, %struct.msqid_ds** %6
%7 = load i32, i32* @__NR_msgctl
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load %struct.msqid_ds*, %struct.msqid_ds** %6
%11 = call i32 @syscall(i32 %7, i32 %8, i32 %9, %struct.msqid_ds* %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.msqid_ds = type { i32 }
@__NR_msgctl = global i32 0
define i32 @msgctl(i32 %0, i32 %1, %struct.msqid_ds* %2) {
%4 = load i32, i32* @__NR_msgctl
%5 = tail call i32 @syscall(i32 %4, i32 %0, i32 %1, %struct.msqid_ds* %2)
ret i32 %5
}
/* Variables and functions */
int strcmp(char const *, char const *);
extern int str_cmp(const char *l, const char *r) { return strcmp(l, r); }


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

x86 assembly (clang, -O2):
<str_cmp>:
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @str_cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @strcmp(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @str_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ WARN_ON(int);
void radix__flush_pwc_lpid(unsigned int lpid) { WARN_ON(1); }


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

x86 assembly (clang, -O2):
<radix__flush_pwc_lpid>:
mov    $0x1,%edi
jmp    1030 <WARN_ON@plt>

LLVM IR (-O0):
define void @radix__flush_pwc_lpid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @WARN_ON(i32 1)
ret void
}

LLVM IR (-O2):
define void @radix__flush_pwc_lpid(i32 %0) {
%2 = tail call i32 @WARN_ON(i32 1)
ret void
}
void byteorder_swap_pointer_32(unsigned char *p) {
  unsigned char c;
  c = p[3];
  p[3] = p[0];
  p[0] = c;
  c = p[2];
  p[2] = p[1];
  p[1] = c;
}


x86 assembly (clang, -O0):
<byteorder_swap_pointer_32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<byteorder_swap_pointer_32>:
mov    (%rdi),%al
mov    0x3(%rdi),%cl
mov    %al,0x3(%rdi)
mov    %cl,(%rdi)
rolw   $0x8,0x1(%rdi)
ret

LLVM IR (-O0):
define void @byteorder_swap_pointer_32(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 3
%6 = load i8, i8* %5
store i8 %6, i8* %3
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 3
store i8 %9, i8* %11
%12 = load i8, i8* %3
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 0
store i8 %12, i8* %14
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 2
%17 = load i8, i8* %16
store i8 %17, i8* %3
%18 = load i8*, i8** %2
%19 = getelementptr inbounds i8, i8* %18, i64 1
%20 = load i8, i8* %19
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i64 2
store i8 %20, i8* %22
%23 = load i8, i8* %3
%24 = load i8*, i8** %2
%25 = getelementptr inbounds i8, i8* %24, i64 1
store i8 %23, i8* %25
ret void
}

LLVM IR (-O2):
define void @byteorder_swap_pointer_32(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = load i8, i8* %0
store i8 %4, i8* %2
store i8 %3, i8* %0
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 1
%8 = load i8, i8* %7
store i8 %8, i8* %5
store i8 %6, i8* %7
ret void
}
void BIO_indent(void) {}


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

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

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

LLVM IR (-O2):
define void @BIO_indent() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
char *strrchr(char *, char);
void print_title_count(char *filename, int count) {
  char *last_slash;
  char *title;
  last_slash = strrchr(filename, '/');
  if (last_slash == NULL) {
    title = filename;
  } else {
    title = last_slash + 1;
  }
  printf("%s page %d\n", title, count);
}


x86 assembly (clang, -O0):
<print_title_count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1159 <print_title_count+0x39>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1165 <print_title_count+0x45>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_title_count>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1040 <strrchr@plt>
lea    0x1(%rax),%rsi
test   %rax,%rax
cmove  %rbx,%rsi
lea    0xebc(%rip),%rdi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"%s page %d\0A\00"
define void @print_title_count(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = call i8* @strrchr(i8* %7, i8 signext 47)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i8*, i8** %3
store i8* %12, i8** %6
br label %16
13: ; preds = %2
%14 = load i8*, i8** %5
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8* %15, i8** %6
br label %16
16: ; preds = %13, %11
%17 = load i8*, i8** %6
%18 = load i32, i32* %4
%19 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %17, i32 %18)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%s page %d\0A\00"
define void @print_title_count(i8* %0, i32 %1) {
%3 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%4 = icmp eq i8* %3, null
%5 = getelementptr inbounds i8, i8* %3, i64 1
%6 = select i1 %4, i8* %0, i8* %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ err_message(char const *);
int /*<<< orphan*/ terminate(int);
void err_exit(const char *format, ...) {
  err_message(format);
  terminate(true);
}


x86 assembly (clang, -O0):
<err_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <err_message@plt>
mov    $0x1,%edi
call   1030 <terminate@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<err_exit>:
push   %rax
call   1040 <err_message@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <terminate@plt>

LLVM IR (-O0):
define void @err_exit(i8* %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @err_message(i8* %3)
%5 = call i32 @terminate(i32 1)
ret void
}

LLVM IR (-O2):
define void @err_exit(i8* %0, ...) {
%2 = tail call i32 @err_message(i8* %0)
%3 = tail call i32 @terminate(i32 1)
ret void
}
void hfi1_dbg_ibdev_init(struct hfi1_ibdev *ibd) {}


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

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

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

LLVM IR (-O2):
%struct.hfi1_ibdev = type opaque
define void @hfi1_dbg_ibdev_init(%struct.hfi1_ibdev* nocapture %0) {
ret void
}
int char_to_int(char string[]) {
  int c, n;
  n = 0;
  for (c = 0; string[c] != '\0'; c++) {
    n = n * 10 + string[c] - '0';
  }
  return n;
}


x86 assembly (clang, -O0):
<char_to_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1151 <char_to_int+0x51>
imul   $0xa,-0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
sub    $0x30,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <char_to_int+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_to_int>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <char_to_int+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <char_to_int+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @char_to_int(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %4
store i32 0, i32* %3
br label %5
5: ; preds = %24, %1
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %27
13: ; preds = %5
%14 = load i32, i32* %4
%15 = mul nsw i32 %14, 10
%16 = load i8*, i8** %2
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = add nsw i32 %15, %21
%23 = sub nsw i32 %22, 48
store i32 %23, i32* %4
br label %24
24: ; preds = %13
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 1
store i32 %26, i32* %3
br label %5
27: ; preds = %5
%28 = load i32, i32* %4
ret i32 %28
}

LLVM IR (-O2):
define i32 @char_to_int(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %12, %4 ], [ 0, %1 ]
%6 = phi i8 [ %14, %4 ], [ %2, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = sext i8 %6 to i32
%9 = mul nsw i32 %7, 10
%10 = add i32 %9, -48
%11 = add i32 %10, %8
%12 = add nuw nsw i64 %5, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %4, %1
%17 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %17
}
double metresToInches(double metres) { return metres * 39.3696; }


x86 assembly (clang, -O0):
<metresToInches>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<metresToInches>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @metresToInches(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 3.936960e+01
ret double %4
}

LLVM IR (-O2):
define double @metresToInches(double %0) {
%2 = fmul double %0, 3.936960e+01
ret double %2
}
unsigned int popcount(unsigned int value) {
  unsigned int count = 0;
  for (; value; ++count)
    value &= value - 1;
  return count;
}


x86 assembly (clang, -O0):
<popcount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1132 <popcount+0x32>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <popcount+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<popcount>:
xor    %eax,%eax
test   %edi,%edi
je     111c <popcount+0x1c>
cs nopw 0x0(%rax,%rax,1)
lea    -0x1(%rdi),%ecx
add    $0x1,%eax
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <popcount+0x10>
ret

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

LLVM IR (-O2):
define i32 @popcount(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add i32 %5, -1
%7 = and i32 %6, %5
%8 = add i32 %4, 1
%9 = icmp eq i32 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %11
}
OP(dd, bf) { op_bf(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <op_bf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
xor    %eax,%eax
jmp    1030 <op_bf@plt>

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @op_bf()
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_bf()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ alarm(int);
int /*<<< orphan*/ printf(char *, char *);
char *strsignal(int);
void alarm_handler(int sig) {
  printf("%s caught.\n", strsignal(sig));
  alarm(2);
}


x86 assembly (clang, -O0):
<alarm_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <strsignal@plt>
mov    %rax,%rsi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <alarm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alarm_handler>:
push   %rax
call   1050 <strsignal@plt>
lea    0xec3(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    $0x2,%edi
pop    %rax
jmp    1040 <alarm@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"%s caught.\0A\00"
define void @alarm_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i8* @strsignal(i32 %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @alarm(i32 2)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%s caught.\0A\00"
define void @alarm_handler(i32 %0) {
%2 = tail call i8* @strsignal(i32 %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @alarm(i32 2)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t mask(uint8_t x) { return x | 0x03; }


x86 assembly (clang, -O0):
<mask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mask>:
mov    %edi,%eax
or     $0x3,%eax
ret

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

LLVM IR (-O2):
define i32 @mask(i32 %0) {
%2 = or i32 %0, 3
ret i32 %2
}
/* Variables and functions */
scalar_t__ sys_tig_malloc(int);
extern int *tig_allocRecord(int size) {
  int i;
  int *p, *a;
  p = a = (int *)sys_tig_malloc(size);
  for (i = 0; i < size; i += sizeof(int))
    *p++ = 0;
  return a;
}


x86 assembly (clang, -O0):
<tig_allocRecord>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <sys_tig_malloc@plt>
mov    %rax,-0x18(%rbp)
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1163 <tig_allocRecord+0x53>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
movl   $0x0,(%rax)
movslq -0x8(%rbp),%rax
add    $0x4,%rax
mov    %eax,-0x8(%rbp)
jmp    1132 <tig_allocRecord+0x22>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tig_allocRecord>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
call   1040 <sys_tig_malloc@plt>
mov    %rax,%r14
test   %ebx,%ebx
jle    1149 <tig_allocRecord+0x29>
add    $0xffffffff,%ebx
and    $0xfffffffc,%ebx
add    $0x4,%rbx
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32* @tig_allocRecord(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = call i64 @sys_tig_malloc(i32 %6)
%8 = inttoptr i64 %7 to i32*
store i32* %8, i32** %5
store i32* %8, i32** %4
store i32 0, i32* %3
br label %9
9: ; preds = %16, %1
%10 = load i32, i32* %3
%11 = load i32, i32* %2
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %21
13: ; preds = %9
%14 = load i32*, i32** %4
%15 = getelementptr inbounds i32, i32* %14, i32 1
store i32* %15, i32** %4
store i32 0, i32* %14
br label %16
16: ; preds = %13
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = add i64 %18, 4
%20 = trunc i64 %19 to i32
store i32 %20, i32* %3
br label %9
21: ; preds = %9
%22 = load i32*, i32** %5
ret i32* %22
}

LLVM IR (-O2):
define i32* @tig_allocRecord(i32 %0) {
%2 = tail call i64 @sys_tig_malloc(i32 %0)
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = inttoptr i64 %2 to i8*
%6 = add nsw i32 %0, -1
%7 = and i32 %6, -4
%8 = zext i32 %7 to i64
%9 = add nuw nsw i64 %8, 4
br label %10
10: ; preds = %4, %1
%11 = inttoptr i64 %2 to i32*
ret i32* %11
}
char *tempstring() {
  static char strings[3][100];
  static int index;
  if (index >= 3)
    index = 0;
  return strings[index++];
}


x86 assembly (clang, -O0):
<tempstring>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x3,0x3051(%rip)
jl     111b <tempstring+0x1b>
movl   $0x0,0x3041(%rip)
mov    0x303b(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x3030(%rip)
movslq %eax,%rcx
lea    0x2efa(%rip),%rax
imul   $0x64,%rcx,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tempstring>:
mov    0x3056(%rip),%eax
xor    %ecx,%ecx
cmp    $0x3,%eax
cmovl  %eax,%ecx
lea    0x1(%rcx),%eax
mov    %eax,0x3045(%rip)
movslq %ecx,%rax
imul   $0x64,%rax,%rcx
lea    0x2f0b(%rip),%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
@tempstring.strings = internal global [3 x [100 x i8]] zeroinitializer
@tempstring.index = internal global i32 0
define i8* @tempstring() {
%1 = load i32, i32* @tempstring.index
%2 = icmp sge i32 %1, 3
br i1 %2, label %3, label %4
3: ; preds = %0
store i32 0, i32* @tempstring.index
br label %4
4: ; preds = %3, %0
%5 = load i32, i32* @tempstring.index
%6 = add nsw i32 %5, 1
store i32 %6, i32* @tempstring.index
%7 = sext i32 %5 to i64
%8 = getelementptr inbounds [3 x [100 x i8]], [3 x [100 x i8]]* @tempstring.strings, i64 0, i64 %7
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
ret i8* %9
}

LLVM IR (-O2):
@tempstring.strings = internal global [3 x [100 x i8]] zeroinitializer
@tempstring.index = internal unnamed_addr global i32 0
define i8* @tempstring() {
%1 = load i32, i32* @tempstring.index
%2 = icmp sgt i32 %1, 2
%3 = select i1 %2, i32 0, i32 %1
%4 = add nsw i32 %3, 1
store i32 %4, i32* @tempstring.index
%5 = sext i32 %3 to i64
%6 = getelementptr inbounds [3 x [100 x i8]], [3 x [100 x i8]]* @tempstring.strings, i64 0, i64 %5, i64 0
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ bar(int);
void foo(int x) { bar(x >= 1 && x <= 100 ? 0 : 1); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x1,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1134 <foo+0x24>
cmpl   $0x64,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%cl
mov    $0x1,%edi
xor    %eax,%eax
test   $0x1,%cl
cmovne %eax,%edi
call   1030 <bar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
add    $0xffffff9b,%edi
xor    %eax,%eax
cmp    $0xffffff9c,%edi
setb   %al
mov    %eax,%edi
jmp    1030 <bar@plt>

LLVM IR (-O0):
define void @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 1
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 100
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 0, i32 1
%12 = call i32 @bar(i32 %11)
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0) {
%2 = add i32 %0, -101
%3 = icmp ult i32 %2, -100
%4 = zext i1 %3 to i32
%5 = tail call i32 @bar(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr,
                "usage: uuencode [-m] [-o outfile] [infile] remotefile\n"
                "       b64encode [-o outfile] [infile] remotefile\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [105 x i8] c"usage: uuencode [-m] [-o outfile] [infile] remotefile\0A b64encode [-o outfile] [infile] remotefile\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([105 x i8], [105 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [105 x i8] c"usage: uuencode [-m] [-o outfile] [infile] remotefile\0A b64encode [-o outfile] [infile] remotefile\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([105 x i8], [105 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ f();
void g(void) {
  if (1)
    f();
  else
    f();
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <f@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
xor    %eax,%eax
jmp    1030 <f@plt>

LLVM IR (-O0):
define void @g() {
%1 = call i32 (...) @f()
ret void
}

LLVM IR (-O2):
define void @g() {
%1 = tail call i32 (...) @f()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void pass_by_value(int new_number) {
  new_number++;
  printf("\nnew_number is %d\n", new_number);
}


x86 assembly (clang, -O0):
<pass_by_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pass_by_value>:
lea    0x1(%rdi),%esi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [19 x i8] c"\0Anew_number is %d\0A\00"
define void @pass_by_value(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
void enter_fullscreen() {}


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

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

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

LLVM IR (-O2):
define void @enter_fullscreen() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LC_ALL;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
char *locale_charset();
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int main() {
  setlocale(LC_ALL, "");
  printf("%s\n", locale_charset());
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
lea    0xea4(%rip),%rsi
call   1040 <setlocale@plt>
mov    $0x0,%al
call   1060 <locale_charset@plt>
mov    %rax,%rsi
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
lea    0xeb2(%rip),%rsi
call   1040 <setlocale@plt>
xor    %eax,%eax
call   1060 <locale_charset@plt>
lea    0xe9c(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @LC_ALL
%3 = call i32 @setlocale(i32 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%4 = call i8* (...) @locale_charset()
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = load i32, i32* @LC_ALL
%2 = tail call i32 @setlocale(i32 %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%3 = tail call i8* (...) @locale_charset()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = tail call i32 @exit(i32 0)
unreachable
}
int stack_size_impl() { return 20; }


x86 assembly (clang, -O0):
<stack_size_impl>:
push   %rbp
mov    %rsp,%rbp
mov    $0x14,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @stack_size_impl() {
ret i32 20
}

LLVM IR (-O2):
define i32 @stack_size_impl() {
ret i32 20
}
/* Variables and functions */
int /*<<< orphan*/ add_to_stack(void *, int /*<<< orphan*/);
int /*<<< orphan*/ get_call_stack_for_current_thread();
void __cyg_profile_func_enter(void *fn, void *from) {
  add_to_stack(fn, get_call_stack_for_current_thread());
}


x86 assembly (clang, -O0):
<__cyg_profile_func_enter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1040 <get_call_stack_for_current_thread@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1030 <add_to_stack@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__cyg_profile_func_enter>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <get_call_stack_for_current_thread@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <add_to_stack@plt>

LLVM IR (-O0):
define void @__cyg_profile_func_enter(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i32 (...) @get_call_stack_for_current_thread()
%7 = call i32 @add_to_stack(i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @__cyg_profile_func_enter(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i32 (...) @get_call_stack_for_current_thread()
%4 = tail call i32 @add_to_stack(i8* %0, i32 %3)
ret void
}
/* Variables and functions */
long nvmem_set_mac_address(unsigned char *);
long netapp_config_mac_adrress(unsigned char *mac) {
  return nvmem_set_mac_address(mac);
}


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

x86 assembly (clang, -O2):
<netapp_config_mac_adrress>:
jmp    1030 <nvmem_set_mac_address@plt>

LLVM IR (-O0):
define i64 @netapp_config_mac_adrress(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @nvmem_set_mac_address(i8* %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @netapp_config_mac_adrress(i8* %0) {
%2 = tail call i64 @nvmem_set_mac_address(i8* %0)
ret i64 %2
}
void INT_Excep_TPU11_TGI11A(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_TPU11_TGI11A() {
ret void
}
/* Variables and functions */
unsigned int mul_sw(int volatile, int volatile);
int main(int argc, char *argv[]) {
  (*(volatile int(*)[0x2000])(0x6000))[0] = 5;
  (*(volatile int(*)[0x2000])(0x6000))[1] = 7;
  (*(volatile unsigned int *)(0x80000000)) = 0x55aa55aa;
  while (1) {
    (*(volatile unsigned int *)(0x80000000)) =
        mul_sw((*(volatile int(*)[0x2000])(0x6000))[0],
               (*(volatile int(*)[0x2000])(0x6000))[1]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x6000,%eax
movl   $0x5,(%rax)
mov    $0x6000,%eax
movl   $0x7,0x4(%rax)
mov    $0x80000000,%eax
movl   $0x55aa55aa,(%rax)
mov    $0x6000,%eax
mov    (%rax),%edi
mov    $0x6000,%eax
mov    0x4(%rax),%esi
call   1030 <mul_sw@plt>
mov    %eax,%ecx
mov    $0x80000000,%eax
mov    %ecx,(%rax)
jmp    1148 <main+0x38>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x80000000,%ebx
movl   $0x5,0x6000
movl   $0x7,0x6004
movl   $0x55aa55aa,(%rbx)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x6000,%edi
mov    0x6004,%esi
call   1030 <mul_sw@plt>
mov    %eax,(%rbx)
jmp    1140 <main+0x30>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store volatile i32 5, i32* getelementptr inbounds ([8192 x i32], [8192 x i32]* inttoptr (i64 24576 to [8192 x i32]*), i64 0, i64 0)
store volatile i32 7, i32* getelementptr inbounds ([8192 x i32], [8192 x i32]* inttoptr (i64 24576 to [8192 x i32]*), i64 0, i64 1)
store volatile i32 1437226410, i32* inttoptr (i64 2147483648 to i32*)
br label %6
6: ; preds = %2, %6
%7 = load volatile i32, i32* getelementptr inbounds ([8192 x i32], [8192 x i32]* inttoptr (i64 24576 to [8192 x i32]*), i64 0, i64 0)
%8 = load volatile i32, i32* getelementptr inbounds ([8192 x i32], [8192 x i32]* inttoptr (i64 24576 to [8192 x i32]*), i64 0, i64 1)
%9 = call i32 @mul_sw(i32 %7, i32 %8)
store volatile i32 %9, i32* inttoptr (i64 2147483648 to i32*)
br label %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
store volatile i32 5, i32* inttoptr (i64 24576 to i32*)
store volatile i32 7, i32* inttoptr (i64 24580 to i32*)
store volatile i32 1437226410, i32* inttoptr (i64 2147483648 to i32*)
br label %3
3: ; preds = %2, %3
%4 = load volatile i32, i32* inttoptr (i64 24576 to i32*)
%5 = load volatile i32, i32* inttoptr (i64 24580 to i32*)
%6 = tail call i32 @mul_sw(i32 %4, i32 %5)
store volatile i32 %6, i32* inttoptr (i64 2147483648 to i32*)
br label %3
}
/* Type definitions */
struct evbuffer {
  int dummy;
};

/* Variables and functions */
int decode_int64_internal(unsigned long long *, struct evbuffer *,
                          int /*<<< orphan*/);
int /*<<< orphan*/ evbuffer_drain(struct evbuffer *, int);
int evtag_decode_int64(unsigned long long *pnumber, struct evbuffer *evbuf) {
  int res = decode_int64_internal(pnumber, evbuf, 0);
  if (res != -1)
    evbuffer_drain(evbuf, res);
  return (res == -1 ? -1 : 0);
}


x86 assembly (clang, -O0):
<evtag_decode_int64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1030 <decode_int64_internal@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
je     1158 <evtag_decode_int64+0x38>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <evbuffer_drain@plt>
mov    -0x14(%rbp),%edx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0xffffffff,%edx
cmove  %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<evtag_decode_int64>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
xor    %edx,%edx
call   1030 <decode_int64_internal@plt>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
je     113e <evtag_decode_int64+0x1e>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <evbuffer_drain@plt>
xor    %eax,%eax
cmp    $0xffffffff,%ebp
sete   %al
neg    %eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.evbuffer = type { i32 }
define i32 @evtag_decode_int64(i64* %0, %struct.evbuffer* %1) {
%3 = alloca i64*
%4 = alloca %struct.evbuffer*
%5 = alloca i32
store i64* %0, i64** %3
store %struct.evbuffer* %1, %struct.evbuffer** %4
%6 = load i64*, i64** %3
%7 = load %struct.evbuffer*, %struct.evbuffer** %4
%8 = call i32 @decode_int64_internal(i64* %6, %struct.evbuffer* %7, i32 0)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, -1
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load %struct.evbuffer*, %struct.evbuffer** %4
%13 = load i32, i32* %5
%14 = call i32 @evbuffer_drain(%struct.evbuffer* %12, i32 %13)
br label %15
15: ; preds = %11, %2
%16 = load i32, i32* %5
%17 = icmp eq i32 %16, -1
%18 = zext i1 %17 to i64
%19 = select i1 %17, i32 -1, i32 0
ret i32 %19
}

LLVM IR (-O2):
%struct.evbuffer = type { i32 }
define i32 @evtag_decode_int64(i64* %0, %struct.evbuffer* %1) {
%3 = tail call i32 @decode_int64_internal(i64* %0, %struct.evbuffer* %1, i32 0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @evbuffer_drain(%struct.evbuffer* %1, i32 %3)
br label %7
7: ; preds = %5, %2
%8 = sext i1 %4 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printUsage() { printf("Usage: ./EP4 <file> <type> <mode>\n"); }


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"Usage: ./EP4 <file> <type> <mode>\0A\00"
define void @printUsage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [34 x i8] c"Usage: ./EP4 <file> <type> <mode>\00"
define void @printUsage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
long long rtapi_get_time(void) {
  struct timeval tv;
  gettimeofday(&tv, 0);
  return tv.tv_sec * 1000 * 1000 * 1000 + tv.tv_usec * 1000;
}


x86 assembly (clang, -O0):
<rtapi_get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x8(%rbp),%eax
imul   $0x3e8,%eax,%eax
imul   $0x3e8,%eax,%eax
imul   $0x3e8,-0x4(%rbp),%ecx
add    %ecx,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtapi_get_time>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3b9aca00,(%rsp),%eax
movslq 0x4(%rsp),%rcx
imul   $0x3e8,%rcx,%rcx
cltq
add    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i64 @rtapi_get_time() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000
%6 = mul nsw i32 %5, 1000
%7 = mul nsw i32 %6, 1000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%9 = load i32, i32* %8
%10 = mul nsw i32 %9, 1000
%11 = add nsw i32 %7, %10
%12 = sext i32 %11 to i64
ret i64 %12
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i64 @rtapi_get_time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul i32 %5, 1000000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = mul nsw i32 %8, 1000
%10 = add nsw i32 %9, %6
%11 = sext i32 %10 to i64
ret i64 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void gpio_pwm_toggle_led(uint32_t const index) {}


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

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

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

LLVM IR (-O2):
define void @gpio_pwm_toggle_led(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_config() {
  printf("runpath_var=%s\n", "LD_RUN_PATH");
  printf("shlibpath_var=%s\n", "LD_LIBRARY_PATH");
  printf("SHELL=\"%s\"\n", "/bin/sh");
}


x86 assembly (clang, -O0):
<print_config>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeee(%rip),%rsi
call   1030 <printf@plt>
lea    0xeee(%rip),%rdi
lea    0xef9(%rip),%rsi
call   1030 <printf@plt>
lea    0xefd(%rip),%rdi
lea    0xf02(%rip),%rsi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_config>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xef1(%rip),%rsi
call   1030 <printf@plt>
lea    0xef1(%rip),%rdi
lea    0xefc(%rip),%rsi
call   1030 <printf@plt>
lea    0xf00(%rip),%rdi
lea    0xf05(%rip),%rsi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"runpath_var=%s\0A\00"
@.str.1 = [12 x i8] c"LD_RUN_PATH\00"
@.str.2 = [18 x i8] c"shlibpath_var=%s\0A\00"
@.str.3 = [16 x i8] c"LD_LIBRARY_PATH\00"
@.str.4 = [12 x i8] c"SHELL=\22%s\22\0A\00"
@.str.5 = [8 x i8] c"/bin/sh\00"
define void @print_config() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"runpath_var=%s\0A\00"
@.str.1 = [12 x i8] c"LD_RUN_PATH\00"
@.str.2 = [18 x i8] c"shlibpath_var=%s\0A\00"
@.str.3 = [16 x i8] c"LD_LIBRARY_PATH\00"
@.str.4 = [12 x i8] c"SHELL=\22%s\22\0A\00"
@.str.5 = [8 x i8] c"/bin/sh\00"
define void @print_config() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
ret void
}
void wcolor_set() {}


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

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

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

LLVM IR (-O2):
define void @wcolor_set() {
ret void
}
void myswap(int *a, int *b) {
  int temp = *a;
  *a = *b;
  *b = temp;
}


x86 assembly (clang, -O0):
<myswap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<myswap>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @myswap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int f(int);
int g(void) {
  int si = 12;
  unsigned int ui = -1;
  unsigned char uc;
  ui = si;
  si = 0x80000000;
  si = 3.2f;
  uc = 256;
  si = 0x800000000;
  return f(si) + f(si);
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xc,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x80000000,-0x4(%rbp)
movl   $0x3,-0x4(%rbp)
movb   $0x0,-0x9(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <f@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <f@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
push   %rbx
xor    %edi,%edi
call   1030 <f@plt>
mov    %eax,%ebx
xor    %edi,%edi
call   1030 <f@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @g() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
store i32 12, i32* %1
store i32 -1, i32* %2
%4 = load i32, i32* %1
store i32 %4, i32* %2
store i32 -2147483648, i32* %1
store i32 3, i32* %1
store i8 0, i8* %3
store i32 0, i32* %1
%5 = load i32, i32* %1
%6 = call i32 @f(i32 %5)
%7 = load i32, i32* %1
%8 = call i32 @f(i32 %7)
%9 = add nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @g() {
%1 = tail call i32 @f(i32 0)
%2 = tail call i32 @f(i32 0)
%3 = add nsw i32 %2, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Msp430GpioC__1__GeneralIO__makeOutput();
void CC2420ControlP__CSN__makeOutput(void) {
  Msp430GpioC__1__GeneralIO__makeOutput();
}


x86 assembly (clang, -O0):
<CC2420ControlP__CSN__makeOutput>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <Msp430GpioC__1__GeneralIO__makeOutput@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CC2420ControlP__CSN__makeOutput>:
xor    %eax,%eax
jmp    1030 <Msp430GpioC__1__GeneralIO__makeOutput@plt>

LLVM IR (-O0):
define void @CC2420ControlP__CSN__makeOutput() {
%1 = call i32 (...) @Msp430GpioC__1__GeneralIO__makeOutput()
ret void
}

LLVM IR (-O2):
define void @CC2420ControlP__CSN__makeOutput() {
%1 = tail call i32 (...) @Msp430GpioC__1__GeneralIO__makeOutput()
ret void
}
double joules_to_kwh(double joules) { return joules * 2.7778E-7; }


x86 assembly (clang, -O0):
<joules_to_kwh>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<joules_to_kwh>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @joules_to_kwh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 2.777800e-07
ret double %4
}

LLVM IR (-O2):
define double @joules_to_kwh(double %0) {
%2 = fmul double %0, 2.777800e-07
ret double %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int type;
};
typedef TYPE_1__ XButtonPressedEvent;

/* Variables and functions */
void set_XButtonPressedEvent_type(void *_p, int _v) {
  ((XButtonPressedEvent *)_p)->type = (int)_v;
}


x86 assembly (clang, -O0):
<set_XButtonPressedEvent_type>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XButtonPressedEvent_type>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XButtonPressedEvent_type(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XButtonPressedEvent_type(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}