xunge/DecIR huggingface dataset:
/* Variables and functions */
size_t ehnlc_strlen(char const *str) {
  char const *p;
  if (!str) {
    return 0;
  }
  for (p = str; *p; ++p)
    ;
  return p - str;
}


x86 assembly (clang, -O0):
<ehnlc_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1120 <ehnlc_strlen+0x20>
movq   $0x0,-0x8(%rbp)
jmp    115a <ehnlc_strlen+0x5a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     114b <ehnlc_strlen+0x4b>
jmp    113a <ehnlc_strlen+0x3a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <ehnlc_strlen+0x28>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ehnlc_strlen>:
test   %rdi,%rdi
je     111f <ehnlc_strlen+0x1f>
mov    $0xffffffffffffffff,%rcx
nopl   0x0(%rax)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <ehnlc_strlen+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @ehnlc_strlen(i8* %0) {
%2 = alloca i64
%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 i64 0, i64* %2
br label %24
8: ; preds = %1
%9 = load i8*, i8** %3
store i8* %9, i8** %4
br label %10
10: ; preds = %15, %8
%11 = load i8*, i8** %4
%12 = load i8, i8* %11
%13 = icmp ne i8 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %10
br label %15
15: ; preds = %14
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %4
br label %10
18: ; preds = %10
%19 = load i8*, i8** %4
%20 = load i8*, i8** %3
%21 = ptrtoint i8* %19 to i64
%22 = ptrtoint i8* %20 to i64
%23 = sub i64 %21, %22
store i64 %23, i64* %2
br label %24
24: ; preds = %18, %7
%25 = load i64, i64* %2
ret i64 %25
}

LLVM IR (-O2):
define i64 @ehnlc_strlen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i8* [ %7, %3 ], [ %0, %1 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = ptrtoint i8* %4 to i64
%10 = ptrtoint i8* %0 to i64
%11 = sub i64 %9, %10
br label %12
12: ; preds = %1, %8
%13 = phi i64 [ %11, %8 ], [ 0, %1 ]
ret i64 %13
}
/* Variables and functions */
int _jc_invoke(int, char const **, int, int /*<<< orphan*/);
int /*<<< orphan*/ vfprintf;
int main(int ac, char **av) {
  int status = 0;
  switch (_jc_invoke(ac, (const char **)av, 1, vfprintf)) {
  case 0:
    break;
  case 2:
  case 1:
    status = 1;
    break;
  }
  return status;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    0x2ead(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%edx
call   1030 <_jc_invoke@plt>
mov    %eax,%ecx
mov    %ecx,-0x18(%rbp)
test   %eax,%eax
je     116d <main+0x5d>
jmp    1159 <main+0x49>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
sub    $0x2,%eax
jb     1172 <main+0x62>
jmp    1179 <main+0x69>
jmp    1179 <main+0x69>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%edx
call   1030 <_jc_invoke@plt>
add    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x2,%eax
setb   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@vfprintf = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = load i32, i32* @vfprintf
%10 = call i32 @_jc_invoke(i32 %7, i8** %8, i32 1, i32 %9)
switch i32 %10, label %13 [
i32 0, label %11
i32 2, label %12
i32 1, label %12
]
11: ; preds = %2
br label %13
12: ; preds = %2, %2
store i32 1, i32* %6
br label %13
13: ; preds = %2, %12, %11
%14 = load i32, i32* %6
ret i32 %14
}

LLVM IR (-O2):
@vfprintf = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = load i32, i32* @vfprintf
%4 = tail call i32 @_jc_invoke(i32 %0, i8** %1, i32 1, i32 %3)
%5 = add i32 %4, -1
%6 = icmp ult i32 %5, 2
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
bool st_init(const char *file) { return true; }


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

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

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

LLVM IR (-O2):
define i32 @st_init(i8* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int n1, n2, n3;
  n1 = 5 + 3 * 8 / 2 - 3;
  n2 = 2 % 2 + 2 * 2 - 2 / 2;
  n3 = 2 * 4 * (5 + 9.0 / 2);
  printf("n1=%d ; n2=%d ; n3=%d ;\n", n1, n2, n3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xe,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
movl   $0x4c,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xebc(%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    $0xe,%esi
mov    $0x3,%edx
mov    $0x4c,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [25 x i8] c"n1=%d ; n2=%d ; n3=%d ;\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 14, i32 3, i32 76)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __memcpy(void *, char *, int);
void replace_version(char *version) {
  __memcpy((void *)0x8D000004, version, 5);
}


x86 assembly (clang, -O0):
<replace_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x8d000004,%edi
mov    $0x5,%edx
call   1030 <__memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<replace_version>:
mov    %rdi,%rsi
mov    $0x8d000004,%edi
mov    $0x5,%edx
jmp    1030 <__memcpy@plt>

LLVM IR (-O0):
define void @replace_version(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @__memcpy(i8* inttoptr (i64 2365587460 to i8*), i8* %3, i32 5)
ret void
}

LLVM IR (-O2):
define void @replace_version(i8* %0) {
%2 = tail call i32 @__memcpy(i8* inttoptr (i64 2365587460 to i8*), i8* %0, i32 5)
ret void
}
int _isatty(int fd) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @_isatty(i32 %0) {
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void USBDevDisconnect(uint32_t ui32Base) {
  ASSERT(ui32Base == 0x40050000);
  (*((volatile uint8_t *)(ui32Base + 0x00000001))) &= (~0x00000040);
}


x86 assembly (clang, -O0):
<USBDevDisconnect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x40050000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cltq
mov    (%rax),%ecx
and    $0xffffffbf,%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBDevDisconnect>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x40050000,%ebx
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebx,%rax
andl   $0xffffffbf,0x1(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @USBDevDisconnect(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1074069504
%5 = zext i1 %4 to i32
%6 = call i32 @ASSERT(i32 %5)
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
%12 = and i32 %11, -65
store volatile i32 %12, i32* %10
ret void
}

LLVM IR (-O2):
define void @USBDevDisconnect(i32 %0) {
%2 = icmp eq i32 %0, 1074069504
%3 = zext i1 %2 to i32
%4 = tail call i32 @ASSERT(i32 %3)
%5 = add nsw i32 %0, 1
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = and i32 %8, -65
store volatile i32 %9, i32* %7
ret void
}
void g_arith_pow_s64_f(void *s, void *d, void *o) {}


x86 assembly (clang, -O0):
<g_arith_pow_s64_f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @g_arith_pow_s64_f(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @g_arith_pow_s64_f(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
void ExttGroupGlueAuxTable(void) {}


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

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

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

LLVM IR (-O2):
define void @ExttGroupGlueAuxTable() {
ret void
}
int d_ge_cr1(double a1) { return (((100) >= (a1))); }


x86 assembly (clang, -O0):
<d_ge_cr1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_ge_cr1>:
movsd  0xef8(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
setae  %al
ret

LLVM IR (-O0):
define i32 @d_ge_cr1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oge double 1.000000e+02, %3
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @d_ge_cr1(double %0) {
%2 = fcmp ole double %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
long m12(long x) { return 12 * x; }


x86 assembly (clang, -O0):
<m12>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
imul   $0xc,-0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<m12>:
shl    $0x2,%rdi
lea    (%rdi,%rdi,2),%rax
ret

LLVM IR (-O0):
define i64 @m12(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul nsw i64 12, %3
ret i64 %4
}

LLVM IR (-O2):
define i64 @m12(i64 %0) {
%2 = mul nsw i64 %0, 12
ret i64 %2
}
int fun653() { return 653; }


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

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

LLVM IR (-O0):
define i32 @fun653() {
ret i32 653
}

LLVM IR (-O2):
define i32 @fun653() {
ret i32 653
}
/* Variables and functions */
int /*<<< orphan*/ usleep(unsigned long);
void ddcl_ThreadSleep(unsigned long ms) { usleep(ms * 1000); }


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

x86 assembly (clang, -O2):
<ddcl_ThreadSleep>:
imul   $0x3e8,%rdi,%rdi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @ddcl_ThreadSleep(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 %3, 1000
%5 = call i32 @usleep(i64 %4)
ret void
}

LLVM IR (-O2):
define void @ddcl_ThreadSleep(i64 %0) {
%2 = mul i64 %0, 1000
%3 = tail call i32 @usleep(i64 %2)
ret void
}
int Little_End_In_First(void) {
  int bStatus;
  unsigned char buf[4] = {0x0C, 0x00, 0x00, 0x00};
  unsigned int *p;
  p = (unsigned int *)buf;
  if (*p == 0x0C)
    bStatus = 1;
  else
    bStatus = 0;
  return bStatus;
}


x86 assembly (clang, -O0):
<Little_End_In_First>:
push   %rbp
mov    %rsp,%rbp
mov    0xef6(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0xc,(%rax)
jne    112e <Little_End_In_First+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    1135 <Little_End_In_First+0x35>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.Little_End_In_First.buf = [4 x i8] c"\0C\00\00\00"
define i32 @Little_End_In_First() {
%1 = alloca i32
%2 = alloca [4 x i8]
%3 = alloca i32*
%4 = bitcast [4 x i8]* %2 to i8*
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%6 = bitcast i8* %5 to i32*
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, 12
br i1 %9, label %10, label %11
10: ; preds = %0
store i32 1, i32* %1
br label %12
11: ; preds = %0
store i32 0, i32* %1
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
define i32 @Little_End_In_First() {
ret i32 1
}
void eos_remote_handle_message(unsigned char *message) {}


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

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

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

LLVM IR (-O2):
define void @eos_remote_handle_message(i8* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ check_input(char *, char const *);
void check_input_flag(char *response, const char *check_string, int *flags,
                      int check_flag) {
  if (check_input(response, check_string)) {
    *flags |= check_flag;
  }
}


x86 assembly (clang, -O0):
<check_input_flag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <check_input@plt>
cmp    $0x0,%rax
je     1149 <check_input_flag+0x39>
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_input_flag>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %rdx,%rbx
call   1030 <check_input@plt>
test   %rax,%rax
je     1124 <check_input_flag+0x14>
or     %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @check_input_flag(i8* %0, i8* %1, i32* nocapture %2, i32 %3) {
%5 = tail call i64 @check_input(i8* %0, i8* %1)
%6 = icmp eq i64 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = load i32, i32* %2
%9 = or i32 %8, %3
store i32 %9, i32* %2
br label %10
10: ; preds = %7, %4
ret void
}
void checker_get_couter_example() {}


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

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

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

LLVM IR (-O2):
define void @checker_get_couter_example() {
ret void
}
int f1(int x) { return x < 0 ? x : -x; }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111c <f1+0x1c>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <f1+0x24>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
mov    %edi,%eax
neg    %eax
cmovns %edi,%eax
ret

LLVM IR (-O0):
define i32 @f1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i32, i32* %2
br label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = sub nsw i32 0, %8
br label %10
10: ; preds = %7, %5
%11 = phi i32 [ %6, %5 ], [ %9, %7 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @f1(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 false)
%3 = sub i32 0, %2
ret i32 %3
}
/* Variables and functions */
int Partiton(int, int, int *);
void QuickSort(int p, int r, int *A) {
  int q;
  while (p < r) {
    q = Partiton(p, r, A);
    QuickSort(p, q, A);
    p = q + 1;
  }
}


x86 assembly (clang, -O0):
<QuickSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    116d <QuickSort+0x4d>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1040 <Partiton@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <QuickSort@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <QuickSort+0x12>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QuickSort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %esi,%edi
jge    1165 <QuickSort+0x45>
mov    %rdx,%r14
mov    %esi,%r15d
mov    %edi,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebp,%edi
mov    %r15d,%esi
mov    %r14,%rdx
call   1040 <Partiton@plt>
mov    %eax,%ebx
mov    %ebp,%edi
mov    %eax,%esi
mov    %r14,%rdx
call   1030 <QuickSort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r15d,%ebx
jl     1140 <QuickSort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @QuickSort(i32 %0, i32 %1, i32* %2) {
%4 = icmp slt i32 %0, %1
br i1 %4, label %5, label %10
5: ; preds = %3, %5
%6 = phi i32 [ %8, %5 ], [ %0, %3 ]
%7 = tail call i32 @Partiton(i32 %6, i32 %1, i32* %2)
tail call void @QuickSort(i32 %6, i32 %7, i32* %2)
%8 = add nsw i32 %7, 1
%9 = icmp slt i32 %8, %1
br i1 %9, label %5, label %10
10: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ make_deamon();
int main() {
  make_deamon();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <make_deamon@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <make_deamon@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @make_deamon()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Apigee_protobuf_c_out_of_memory();
void *malloc(size_t);
void *system_alloc(void *allocator_data, size_t size) {
  void *rv;
  (void)allocator_data;
  if (size == 0)
    return NULL;
  rv = malloc(size);
  if (rv == NULL)
    Apigee_protobuf_c_out_of_memory();
  return rv;
}


x86 assembly (clang, -O0):
<system_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1148 <system_alloc+0x28>
movq   $0x0,-0x8(%rbp)
jmp    116f <system_alloc+0x4f>
mov    -0x18(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1167 <system_alloc+0x47>
mov    $0x0,%al
call   1040 <Apigee_protobuf_c_out_of_memory@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<system_alloc>:
push   %rbx
test   %rsi,%rsi
je     1141 <system_alloc+0x21>
mov    %rsi,%rdi
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <system_alloc+0x23>
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <Apigee_protobuf_c_out_of_memory@plt>
jmp    1143 <system_alloc+0x23>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @system_alloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i8* null, i8** %3
br label %20
11: ; preds = %2
%12 = load i64, i64* %5
%13 = call i8* @malloc(i64 %12)
store i8* %13, i8** %6
%14 = load i8*, i8** %6
%15 = icmp eq i8* %14, null
br i1 %15, label %16, label %18
16: ; preds = %11
%17 = call i32 (...) @Apigee_protobuf_c_out_of_memory()
br label %18
18: ; preds = %16, %11
%19 = load i8*, i8** %6
store i8* %19, i8** %3
br label %20
20: ; preds = %18, %10
%21 = load i8*, i8** %3
ret i8* %21
}

LLVM IR (-O2):
define noalias i8* @system_alloc(i8* nocapture readnone %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = tail call i8* @malloc(i64 %1)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 (...) @Apigee_protobuf_c_out_of_memory()
br label %9
9: ; preds = %4, %7, %2
%10 = phi i8* [ null, %2 ], [ null, %7 ], [ %5, %4 ]
ret i8* %10
}
void nxtd_usb_shutdown() {}


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

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

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

LLVM IR (-O2):
define void @nxtd_usb_shutdown() {
ret void
}
read(buffer, blocknr) char *buffer;
unsigned int blocknr;
{ common(buffer, blocknr, 0); }


x86 assembly (clang, -O0):
<read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
xor    %edx,%edx
mov    $0x0,%al
call   1030 <common@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read>:
xor    %edx,%edx
xor    %eax,%eax
jmp    1030 <common@plt>

LLVM IR (-O0):
define i32 @read(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i8*, i8** %4
%7 = load i32, i32* %5
%8 = call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @common to i32 (i8*, i32, i32, ...)*)(i8* %6, i32 %7, i32 0)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @read(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @common to i32 (i8*, i32, i32, ...)*)(i8* %0, i32 %1, i32 0)
ret i32 undef
}
/* Variables and functions */
int strcmp(char *, char *);
int chrcomp(void *s1, void *s2) { return strcmp((char *)s1, (char *)s2); }


x86 assembly (clang, -O0):
<chrcomp>:
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):
<chrcomp>:
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @chrcomp(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 @chrcomp(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*/ free(int *);
scalar_t__ malloc(int);
void alias_ptr_free_ok(int *out, int flag) {
  int *y;
  if (flag) {
    y = (int *)malloc(sizeof(int));
  } else {
    y = out;
  }
  if (y && y != out) {
    free(y);
  }
}


x86 assembly (clang, -O0):
<alias_ptr_free_ok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114c <alias_ptr_free_ok+0x2c>
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
jmp    1154 <alias_ptr_free_ok+0x34>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1176 <alias_ptr_free_ok+0x56>
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
je     1176 <alias_ptr_free_ok+0x56>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alias_ptr_free_ok>:
push   %rbx
test   %esi,%esi
je     1145 <alias_ptr_free_ok+0x25>
mov    %rdi,%rbx
mov    $0x4,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1145 <alias_ptr_free_ok+0x25>
cmp    %rbx,%rax
je     1145 <alias_ptr_free_ok+0x25>
mov    %rax,%rdi
pop    %rbx
jmp    1030 <free@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @alias_ptr_free_ok(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* %4
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = call i64 @malloc(i32 4)
%10 = inttoptr i64 %9 to i32*
store i32* %10, i32** %5
br label %13
11: ; preds = %2
%12 = load i32*, i32** %3
store i32* %12, i32** %5
br label %13
13: ; preds = %11, %8
%14 = load i32*, i32** %5
%15 = icmp ne i32* %14, null
br i1 %15, label %16, label %23
16: ; preds = %13
%17 = load i32*, i32** %5
%18 = load i32*, i32** %3
%19 = icmp ne i32* %17, %18
br i1 %19, label %20, label %23
20: ; preds = %16
%21 = load i32*, i32** %5
%22 = call i32 @free(i32* %21)
br label %23
23: ; preds = %20, %16, %13
ret void
}

LLVM IR (-O2):
define void @alias_ptr_free_ok(i32* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = tail call i64 @malloc(i32 4)
%6 = inttoptr i64 %5 to i32*
%7 = icmp eq i64 %5, 0
%8 = icmp eq i32* %6, %0
%9 = or i1 %7, %8
br i1 %9, label %12, label %10
10: ; preds = %4
%11 = tail call i32 @free(i32* %6)
br label %12
12: ; preds = %2, %10, %4
ret void
}
void RTVfsIoStrmQueryInfo(void) {}


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

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

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

LLVM IR (-O2):
define void @RTVfsIoStrmQueryInfo() {
ret void
}
int test_imm_E0uint16_mem(unsigned short *val) {
  return ((*val) & (0xE0 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E0uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xe0,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_E0uint16_mem>:
testb  $0xe0,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_E0uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, 224
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_E0uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 224
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ GLUT_BITMAP_8_BY_13;
int /*<<< orphan*/ glWindowPos2i(int, int);
int /*<<< orphan*/ glutBitmapCharacter(int /*<<< orphan*/, char);
void drawchars(char *str, int ypos) {
  char *c;
  glWindowPos2i(5, ypos);
  for (c = str; *c; c++)
    glutBitmapCharacter(GLUT_BITMAP_8_BY_13, *c);
}


x86 assembly (clang, -O0):
<drawchars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    $0x5,%edi
call   1040 <glWindowPos2i@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1177 <drawchars+0x57>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rax
movsbl (%rax),%esi
call   1030 <glutBitmapCharacter@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1144 <drawchars+0x24>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawchars>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x5,%edi
call   1040 <glWindowPos2i@plt>
mov    (%rbx),%al
test   %al,%al
je     1166 <drawchars+0x46>
add    $0x1,%rbx
mov    0x2e9e(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r14),%edi
movsbl %al,%esi
call   1030 <glutBitmapCharacter@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1150 <drawchars+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@GLUT_BITMAP_8_BY_13 = global i32 0
define void @drawchars(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @glWindowPos2i(i32 5, i32 %1)
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %2, %6
%7 = phi i8 [ %12, %6 ], [ %4, %2 ]
%8 = phi i8* [ %11, %6 ], [ %0, %2 ]
%9 = load i32, i32* @GLUT_BITMAP_8_BY_13
%10 = tail call i32 @glutBitmapCharacter(i32 %9, i8 signext %7)
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  (void)fprintf(stderr, "usage: rmail [-T] [-D domain] user ...\n");
  exit(EX_USAGE);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [40 x i8] c"usage: rmail [-T] [-D domain] user ...\0A\00"
@EX_USAGE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [40 x i8] c"usage: rmail [-T] [-D domain] user ...\0A\00"
@EX_USAGE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
void I2C3_EV_IRQHandler() {}


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

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

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

LLVM IR (-O2):
define void @I2C3_EV_IRQHandler() {
ret void
}
int decimal_width(unsigned long num) {
  int width = 1;
  while (num >= 10) {
    num /= 10;
    width++;
  }
  return width;
}


x86 assembly (clang, -O0):
<decimal_width>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpq   $0xa,-0x8(%rbp)
jb     113a <decimal_width+0x3a>
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <decimal_width+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decimal_width>:
mov    $0x1,%ecx
cmp    $0xa,%rdi
jb     1136 <decimal_width+0x36>
mov    $0x1,%ecx
movabs $0xcccccccccccccccd,%rsi
cc cc cc
nopw   0x0(%rax,%rax,1)
mov    %rdi,%rax
mul    %rsi
shr    $0x3,%rdx
add    $0x1,%ecx
cmp    $0x63,%rdi
mov    %rdx,%rdi
ja     1120 <decimal_width+0x20>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @decimal_width(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
store i32 1, i32* %3
br label %4
4: ; preds = %7, %1
%5 = load i64, i64* %2
%6 = icmp uge i64 %5, 10
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load i64, i64* %2
%9 = udiv i64 %8, 10
store i64 %9, i64* %2
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %4
12: ; preds = %4
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @decimal_width(i64 %0) {
%2 = icmp ugt i64 %0, 9
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 1, %1 ]
%5 = phi i64 [ %6, %3 ], [ %0, %1 ]
%6 = udiv i64 %5, 10
%7 = add nuw nsw i32 %4, 1
%8 = icmp ugt i64 %5, 99
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i32 [ 1, %1 ], [ %7, %3 ]
ret i32 %10
}
void foo448() {}


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

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

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

LLVM IR (-O2):
define void @foo448() {
ret void
}
int break_continue_return() {
  int i = 0;
  char a[10];
  while (1) {
    i++;
    if (i >= 10)
      break;
    if (i < 2)
      continue;
    a[i] = 'a';
  }
  i = 0;
  while (1) {
    if (i > 10)
      return 0;
    a[i] = 'a';
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<break_continue_return>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jl     1123 <break_continue_return+0x23>
jmp    1140 <break_continue_return+0x40>
cmpl   $0x2,-0x4(%rbp)
jge    1132 <break_continue_return+0x32>
jmp    110b <break_continue_return+0xb>
movslq -0x4(%rbp),%rax
movb   $0x61,-0xe(%rbp,%rax,1)
jmp    110b <break_continue_return+0xb>
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jle    1155 <break_continue_return+0x55>
xor    %eax,%eax
pop    %rbp
ret
movslq -0x4(%rbp),%rax
movb   $0x61,-0xe(%rbp,%rax,1)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <break_continue_return+0x47>

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

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

LLVM IR (-O2):
define i32 @break_continue_return() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ clrtoeol();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ refresh();
void curses_end() {
  clrtoeol();
  refresh();
  endwin();
}


x86 assembly (clang, -O0):
<curses_end>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <clrtoeol@plt>
mov    $0x0,%al
call   1030 <refresh@plt>
mov    $0x0,%al
call   1040 <endwin@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<curses_end>:
push   %rax
xor    %eax,%eax
call   1050 <clrtoeol@plt>
xor    %eax,%eax
call   1030 <refresh@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <endwin@plt>

LLVM IR (-O0):
define void @curses_end() {
%1 = call i32 (...) @clrtoeol()
%2 = call i32 (...) @refresh()
%3 = call i32 (...) @endwin()
ret void
}

LLVM IR (-O2):
define void @curses_end() {
%1 = tail call i32 (...) @clrtoeol()
%2 = tail call i32 (...) @refresh()
%3 = tail call i32 (...) @endwin()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ doStuff_pointerToConstInt(int *);
void f_6_1(void) {
  int ta[5] = {1, 2, 3, 4, 5};
  doStuff_pointerToConstInt(ta);
}


x86 assembly (clang, -O0):
<f_6_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <doStuff_pointerToConstInt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_6_1>:
sub    $0x18,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <doStuff_pointerToConstInt@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.f_6_1.ta = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
define void @f_6_1() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @doStuff_pointerToConstInt(i32* %3)
ret void
}

LLVM IR (-O2):
@__const.f_6_1.ta = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
define void @f_6_1() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @doStuff_pointerToConstInt(i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ japi_releaseall(int);
void j_releaseall(int arg0) { japi_releaseall(arg0); }


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

x86 assembly (clang, -O2):
<j_releaseall>:
jmp    1030 <japi_releaseall@plt>

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

LLVM IR (-O2):
define void @j_releaseall(i32 %0) {
%2 = tail call i32 @japi_releaseall(i32 %0)
ret void
}
int Aig_InfoHasBit(unsigned *p, int i) {
  return (p[(i) >> 5] & (1 << ((i)&31))) > 0;
}


x86 assembly (clang, -O0):
<Aig_InfoHasBit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sar    $0x5,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0xc(%rbp),%ecx
and    $0x1f,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Aig_InfoHasBit>:
mov    %esi,%ecx
mov    %esi,%eax
sar    $0x5,%eax
cltq
mov    (%rdi,%rax,4),%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @Aig_InfoHasBit(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 = ashr i32 %6, 5
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %5, i64 %8
%10 = load i32, i32* %9
%11 = load i32, i32* %4
%12 = and i32 %11, 31
%13 = shl i32 1, %12
%14 = and i32 %10, %13
%15 = icmp ugt i32 %14, 0
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @Aig_InfoHasBit(i32* nocapture %0, i32 %1) {
%3 = ashr i32 %1, 5
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = and i32 %1, 31
%8 = lshr i32 %6, %7
%9 = and i32 %8, 1
ret i32 %9
}
void pool_releasefromcpu(struct _WsbmBufStorage *buf, unsigned mode) { ; }


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

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

LLVM IR (-O0):
%struct._WsbmBufStorage = type opaque
define void @pool_releasefromcpu(%struct._WsbmBufStorage* %0, i32 %1) {
%3 = alloca %struct._WsbmBufStorage*
%4 = alloca i32
store %struct._WsbmBufStorage* %0, %struct._WsbmBufStorage** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct._WsbmBufStorage = type opaque
define void @pool_releasefromcpu(%struct._WsbmBufStorage* nocapture %0, i32 %1) {
ret void
}
int arch_notes_size(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @arch_notes_size() {
ret i32 0
}
double myfunc0(double x) { return x * x + 1; }


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

x86 assembly (clang, -O2):
<myfunc0>:
mulsd  %xmm0,%xmm0
addsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @myfunc0(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = call double @llvm.fmuladd.f64(double %3, double %4, double 1.000000e+00)
ret double %5
}

LLVM IR (-O2):
define double @myfunc0(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double %0, double 1.000000e+00)
ret double %2
}
const char *five_irish() {
  char *lang = "cúig";
  return lang;
}


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

x86 assembly (clang, -O2):
<five_irish>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"c\C3\BAig\00"
define i8* @five_irish() {
%1 = alloca i8*
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
@.str = [6 x i8] c"c\C3\BAig\00"
define i8* @five_irish() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
scalar_t__ fuzix_isdigit(int);
int fuzix_isxdigit(int c) {
  uint8_t bc = c;
  if (fuzix_isdigit(bc))
    return 1;
  bc |= 0x20;
  return ((bc >= 'a') && (bc <= 'f'));
}


x86 assembly (clang, -O0):
<fuzix_isxdigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <fuzix_isdigit@plt>
cmp    $0x0,%rax
je     113f <fuzix_isxdigit+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    116c <fuzix_isxdigit+0x5c>
mov    -0xc(%rbp),%eax
or     $0x20,%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x61,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jl     1161 <fuzix_isxdigit+0x51>
cmpl   $0x66,-0xc(%rbp)
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%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):
<fuzix_isxdigit>:
push   %rbx
mov    %edi,%ebx
call   1030 <fuzix_isdigit@plt>
test   %rax,%rax
setne  %al
or     $0x20,%ebx
add    $0xffffff9f,%ebx
cmp    $0x6,%ebx
setb   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @fuzix_isxdigit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
store i32 %5, i32* %4
%6 = load i32, i32* %4
%7 = call i64 @fuzix_isdigit(i32 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %21
10: ; preds = %1
%11 = load i32, i32* %4
%12 = or i32 %11, 32
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = icmp sge i32 %13, 97
br i1 %14, label %15, label %18
15: ; preds = %10
%16 = load i32, i32* %4
%17 = icmp sle i32 %16, 102
br label %18
18: ; preds = %15, %10
%19 = phi i1 [ false, %10 ], [ %17, %15 ]
%20 = zext i1 %19 to i32
store i32 %20, i32* %2
br label %21
21: ; preds = %18, %9
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @fuzix_isxdigit(i32 %0) {
%2 = tail call i64 @fuzix_isdigit(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = or i32 %0, 32
%5 = add i32 %4, -97
%6 = icmp ult i32 %5, 6
%7 = or i1 %6, %3
%8 = zext i1 %7 to i32
ret i32 %8
}
double calctime2(double tv_sec, double tv_usec) {
  tv_usec /= 1000000;
  return tv_sec + tv_usec;
}


x86 assembly (clang, -O0):
<calctime2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xee5(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calctime2>:
divsd  0xef8(%rip),%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @calctime2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = fdiv double %5, 1.000000e+06
store double %6, double* %4
%7 = load double, double* %3
%8 = load double, double* %4
%9 = fadd double %7, %8
ret double %9
}

LLVM IR (-O2):
define double @calctime2(double %0, double %1) {
%3 = fdiv double %1, 1.000000e+06
%4 = fadd double %3, %0
ret double %4
}
void gas_server_deinit(struct gas_server *gas) {}


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

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

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

LLVM IR (-O2):
%struct.gas_server = type opaque
define void @gas_server_deinit(%struct.gas_server* nocapture %0) {
ret void
}