xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *malloc(size_t);
int /*<<< orphan*/ printf(char *);
void *xmalloc(size_t size) {
  void *p = NULL;
  if (!(p = malloc(size))) {
    printf("ERROR: out of memory\n");
    exit(1);
  }
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1171 <xmalloc+0x41>
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <xmalloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"ERROR: out of memory\0A\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
store i8* null, i8** %3
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@str = [21 x i8] c"ERROR: out of memory\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret i8* %2
}
float gte_float(float a, float b) { return a >= b; }


x86 assembly (clang, -O0):
<gte_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2ss %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<gte_float>:
cmpless %xmm0,%xmm1
movss  0xef3(%rip),%xmm0
andps  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @gte_float(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp oge float %5, %6
%8 = zext i1 %7 to i32
%9 = sitofp i32 %8 to float
ret float %9
}

LLVM IR (-O2):
define float @gte_float(float %0, float %1) {
%3 = fcmp oge float %0, %1
%4 = uitofp i1 %3 to float
ret float %4
}
char *strdup(str)
char *str;
{
  int len = strlen(str);
  char *n;
  if (!(n = (char *)malloc(len + 1)))
    return (0);
  memcpy(n, str, len + 1);
  return (n);
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1171 <strdup+0x41>
movq   $0x0,-0x8(%rbp)
jmp    118f <strdup+0x5f>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rdx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1161 <strdup+0x31>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define noalias i8* @strdup(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = shl i64 %2, 32
%4 = add i64 %3, 4294967296
%5 = ashr exact i64 %4, 32
%6 = tail call i8* @malloc(i64 %5)
%7 = icmp eq i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %1
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %6, i8* align 1 %0, i64 %5, i1 false)
br label %9
9: ; preds = %1, %8
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ fatal_error(char *, size_t);
void *malloc(size_t);
void *xmalloc(size_t size) {
  void *p = malloc(size);
  if (!p)
    fatal_error("Out of memory: tried to allocate %zu bytes", size);
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <xmalloc+0x34>
mov    -0x8(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1030 <fatal_error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <xmalloc+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1030 <fatal_error@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [43 x i8] c"Out of memory: tried to allocate %zu bytes\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i32 @fatal_error(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i64 %9)
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [43 x i8] c"Out of memory: tried to allocate %zu bytes\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @fatal_error(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
bool nrf91_errata_26(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf91_errata_26() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ lc75710_init();
void lc75710_display_hal_init(void) { lc75710_init(); }


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

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

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

LLVM IR (-O2):
define void @lc75710_display_hal_init() {
%1 = tail call i32 (...) @lc75710_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int u2dump(char *);
int main(int argc, char **argv) {
  if (argc != 2) {
    printf("usage: %s <file>\n", argv[0]);
    return 1;
  }
  return u2dump(argv[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)
cmpl   $0x2,-0x8(%rbp)
je     115f <main+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    116f <main+0x4f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <u2dump@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1130 <main+0x10>
mov    0x8(%rsi),%rdi
pop    %rax
jmp    1030 <u2dump@plt>
mov    (%rsi),%rsi
lea    0xec6(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"usage: %s <file>\0A\00"
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
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %11)
store i32 1, i32* %3
br label %18
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @u2dump(i8* %16)
store i32 %17, i32* %3
br label %18
18: ; preds = %13, %8
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@.str = [18 x i8] c"usage: %s <file>\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %11
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @u2dump(i8* %9)
br label %11
11: ; preds = %7, %4
%12 = phi i32 [ 1, %4 ], [ %10, %7 ]
ret i32 %12
}
void uwsgi_backtrace(int depth) {}


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

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

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

LLVM IR (-O2):
define void @uwsgi_backtrace(i32 %0) {
ret void
}
int is_var_char(c)
char c;
{
  return ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c == '_') ||
          c == ',');
}


x86 assembly (clang, -O0):
<is_var_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1129 <is_var_char+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5a,%ecx
mov    %al,-0x2(%rbp)
jle    1167 <is_var_char+0x67>
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1148 <is_var_char+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    1167 <is_var_char+0x67>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5f,%ecx
mov    %al,-0x2(%rbp)
je     1167 <is_var_char+0x67>
movsbl -0x1(%rbp),%eax
cmp    $0x2c,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_var_char>:
shl    $0x18,%edi
lea    -0x40000001(%rdi),%ecx
mov    $0x1,%eax
cmp    $0x1affffff,%ecx
jb     1137 <is_var_char+0x37>
cmp    $0x5f000000,%edi
je     1137 <is_var_char+0x37>
lea    -0x60000001(%rdi),%ecx
cmp    $0x1affffff,%ecx
jb     1137 <is_var_char+0x37>
xor    %eax,%eax
cmp    $0x2c000000,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_var_char(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 65
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 90
br i1 %10, label %27, label %11
11: ; preds = %7, %1
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 97
br i1 %14, label %15, label %19
15: ; preds = %11
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 122
br i1 %18, label %27, label %19
19: ; preds = %15, %11
%20 = load i8, i8* %2
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 95
br i1 %22, label %27, label %23
23: ; preds = %19
%24 = load i8, i8* %2
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 44
br label %27
27: ; preds = %23, %19, %15, %7
%28 = phi i1 [ true, %19 ], [ true, %15 ], [ true, %7 ], [ %26, %23 ]
%29 = zext i1 %28 to i32
ret i32 %29
}

LLVM IR (-O2):
define i32 @is_var_char(i32 %0) {
%2 = shl i32 %0, 24
%3 = add i32 %2, -1073741825
%4 = icmp ult i32 %3, 452984831
br i1 %4, label %13, label %5
5: ; preds = %1
%6 = add i32 %2, -1610612737
%7 = icmp ult i32 %6, 452984831
%8 = icmp eq i32 %2, 1593835520
%9 = or i1 %8, %7
br i1 %9, label %13, label %10
10: ; preds = %5
%11 = icmp eq i32 %2, 738197504
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %5, %1, %10
%14 = phi i32 [ %12, %10 ], [ 1, %1 ], [ 1, %5 ]
ret i32 %14
}
/* Variables and functions */
int abs(int);
int sign(int a, int b) { return b >= 0 ? abs(a) : -abs(a); }


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1138 <sign+0x28>
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0xc(%rbp)
jmp    1149 <sign+0x39>
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign>:
mov    %edi,%ecx
neg    %ecx
cmovs  %edi,%ecx
mov    %ecx,%eax
neg    %eax
test   %esi,%esi
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @sign(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, -1
%4 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%5 = sub nsw i32 0, %4
%6 = select i1 %3, i32 %4, i32 %5
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t get_32(const unsigned char *p) { return *(uint32_t *)p; }


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

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

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

LLVM IR (-O2):
define i32 @get_32(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello World!\n");
  printf("It is not gonna match 0 times\n");
  printf("But this is Ok\n");
  printf("Let's begin thi");
  return 0;
}


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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
lea    0xeec(%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
call   1030 <puts@plt>
lea    0xee9(%rip),%rdi
call   1030 <puts@plt>
lea    0xefb(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
@.str.1 = [31 x i8] c"It is not gonna match 0 times\0A\00"
@.str.2 = [16 x i8] c"But this is Ok\0A\00"
@.str.3 = [16 x i8] c"Let's begin thi\00"
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
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.3 = [16 x i8] c"Let's begin thi\00"
@str = [13 x i8] c"Hello World!\00"
@str.4 = [30 x i8] c"It is not gonna match 0 times\00"
@str.5 = [15 x i8] c"But this is Ok\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.4, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.5, i64 0, i64 0))
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ clear_framebuffer();
void clear_console() { clear_framebuffer(); }


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

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

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

LLVM IR (-O2):
define void @clear_console() {
%1 = tail call i32 (...) @clear_framebuffer()
ret void
}
void iic_write() {}


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

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

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

LLVM IR (-O2):
define void @iic_write() {
ret void
}
void clear_pin(volatile unsigned *gpio, int pin) { *(gpio + 10) = 1 << pin; }


x86 assembly (clang, -O0):
<clear_pin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x28(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_pin>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,0x28(%rdi)
ret

LLVM IR (-O0):
define void @clear_pin(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 1, %5
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 10
store volatile i32 %6, i32* %8
ret void
}

LLVM IR (-O2):
define void @clear_pin(i32* %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = getelementptr inbounds i32, i32* %0, i64 10
store volatile i32 %3, i32* %4
ret void
}
void TOSH_rfm_tx_mode(void) {}


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

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

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

LLVM IR (-O2):
define void @TOSH_rfm_tx_mode() {
ret void
}
/* Variables and functions */
int fabs(double);
double fmod(double, double);
double swe_radnorm(double x) {
  double y;
  y = fmod(x, (2.0 * 3.14159265358979323846));
  if (fabs(y) < 1e-13)
    y = 0;
  if (y < 0.0)
    y += (2.0 * 3.14159265358979323846);
  return (y);
}


x86 assembly (clang, -O0):
<swe_radnorm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xece(%rip),%xmm1
call   1030 <fmod@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xea6(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    116c <swe_radnorm+0x4c>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    118c <swe_radnorm+0x6c>
movsd  0xe86(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swe_radnorm>:
push   %rax
movsd  0xed7(%rip),%xmm1
call   1030 <fmod@plt>
movsd  %xmm0,(%rsp)
call   1040 <fabs@plt>
xorpd  %xmm2,%xmm2
xorpd  %xmm1,%xmm1
test   %eax,%eax
jle    1149 <swe_radnorm+0x29>
movsd  (%rsp),%xmm1
movsd  0xeaf(%rip),%xmm3
addsd  %xmm1,%xmm3
movapd %xmm1,%xmm0
cmpltsd %xmm2,%xmm0
andpd  %xmm0,%xmm3
andnpd %xmm1,%xmm0
orpd   %xmm3,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @swe_radnorm(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @fmod(double %4, double 0x401921FB54442D18)
store double %5, double* %3
%6 = load double, double* %3
%7 = call i32 @fabs(double %6)
%8 = sitofp i32 %7 to double
%9 = fcmp olt double %8, 1.000000e-13
br i1 %9, label %10, label %11
10: ; preds = %1
store double 0.000000e+00, double* %3
br label %11
11: ; preds = %10, %1
%12 = load double, double* %3
%13 = fcmp olt double %12, 0.000000e+00
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load double, double* %3
%16 = fadd double %15, 0x401921FB54442D18
store double %16, double* %3
br label %17
17: ; preds = %14, %11
%18 = load double, double* %3
ret double %18
}

LLVM IR (-O2):
define double @swe_radnorm(double %0) {
%2 = tail call double @fmod(double %0, double 0x401921FB54442D18)
%3 = tail call i32 @fabs(double %2)
%4 = icmp slt i32 %3, 1
%5 = select i1 %4, double 0.000000e+00, double %2
%6 = fcmp olt double %5, 0.000000e+00
%7 = fadd double %5, 0x401921FB54442D18
%8 = select i1 %6, double %7, double %5
ret double %8
}
unsigned int is_reserved_hash(register char c) { register const char *x; }


x86 assembly (clang, -O0):
<is_reserved_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @is_reserved_hash(i8 signext %0) {
ret i32 undef
}
/* Variables and functions */
int get_steps_recursive(int, int);
int get_steps(int s) {
  if (s <= 0) {
    return 0;
  }
  return get_steps_recursive(s, 1);
}


x86 assembly (clang, -O0):
<get_steps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1131 <get_steps+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1141 <get_steps+0x31>
mov    -0x8(%rbp),%edi
mov    $0x1,%esi
call   1030 <get_steps_recursive@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_steps>:
test   %edi,%edi
jle    111e <get_steps+0xe>
mov    $0x1,%esi
jmp    1030 <get_steps_recursive@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @get_steps(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i32 @get_steps_recursive(i32 %8, i32 1)
store i32 %9, i32* %2
br label %10
10: ; preds = %7, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @get_steps(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @get_steps_recursive(i32 %0, i32 1)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
double pulsefn(double d) {
  if (d < 0.5)
    return 1.0;
  else
    return -1.0;
}


x86 assembly (clang, -O0):
<pulsefn>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  0xeef(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112e <pulsefn+0x2e>
movsd  0xeec(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    113b <pulsefn+0x3b>
movsd  0xed2(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pulsefn>:
movsd  0xef8(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
lea    0xef0(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm0
ret

LLVM IR (-O0):
define double @pulsefn(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 5.000000e-01
br i1 %5, label %6, label %7
6: ; preds = %1
store double 1.000000e+00, double* %2
br label %8
7: ; preds = %1
store double -1.000000e+00, double* %2
br label %8
8: ; preds = %7, %6
%9 = load double, double* %2
ret double %9
}

LLVM IR (-O2):
define double @pulsefn(double %0) {
%2 = fcmp olt double %0, 5.000000e-01
%3 = select i1 %2, double 1.000000e+00, double -1.000000e+00
ret double %3
}
/* Variables and functions */
double RandomUniform();
double RandomDouble(double lower, double upper) {
  return ((upper - lower) * RandomUniform() + lower);
}


x86 assembly (clang, -O0):
<RandomDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <RandomUniform@plt>
movaps %xmm0,%xmm2
movsd  -0x18(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomDouble>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
subsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
xor    %eax,%eax
call   1030 <RandomUniform@plt>
mulsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @RandomDouble(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 = load double, double* %3
%7 = fsub double %5, %6
%8 = call double (...) @RandomUniform()
%9 = load double, double* %3
%10 = call double @llvm.fmuladd.f64(double %7, double %8, double %9)
ret double %10
}

LLVM IR (-O2):
define double @RandomDouble(double %0, double %1) {
%3 = fsub double %1, %0
%4 = tail call double (...) @RandomUniform()
%5 = tail call double @llvm.fmuladd.f64(double %3, double %4, double %0)
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
void func6() {
  print("If not see flow water");
  print("then on,timeout.");
}


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

x86 assembly (clang, -O2):
<func6>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <print@plt>
lea    0xef2(%rip),%rdi
pop    %rax
jmp    1030 <print@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"If not see flow water\00"
@.str.1 = [17 x i8] c"then on,timeout.\00"
define void @func6() {
%1 = call i32 @print(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @print(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"If not see flow water\00"
@.str.1 = [17 x i8] c"then on,timeout.\00"
define void @func6() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @print(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef unsigned int u_int32_t;

/* Variables and functions */
u_int32_t cshift(u_int32_t x, unsigned int n) {
  x = (x);
  return ((x << n) | (x >> (32 - n)));
}


x86 assembly (clang, -O0):
<cshift>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shr    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cshift>:
mov    %esi,%ecx
mov    %edi,%eax
rol    %cl,%eax
ret

LLVM IR (-O0):
define i32 @cshift(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
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = shl i32 %6, %7
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = sub i32 32, %10
%12 = lshr i32 %9, %11
%13 = or i32 %8, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @cshift(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub i32 32, %1
%5 = lshr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Type definitions */
struct in6_addr {
  int dummy;
};
struct dns_rr_ptr {
  int dummy;
};
struct dns_ctx {
  int dummy;
};

/* Variables and functions */
scalar_t__ dns_resolve(struct dns_ctx *, int /*<<< orphan*/);
int /*<<< orphan*/ dns_submit_a6ptr(struct dns_ctx *, struct in6_addr const *,
                                    int /*<<< orphan*/ *, int /*<<< orphan*/ *);
struct dns_rr_ptr *dns_resolve_a6ptr(struct dns_ctx *ctx,
                                     const struct in6_addr *addr) {
  return (struct dns_rr_ptr *)dns_resolve(
      ctx, dns_submit_a6ptr(ctx, addr, NULL, NULL));
}


x86 assembly (clang, -O0):
<dns_resolve_a6ptr>:
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    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rdx
call   1040 <dns_submit_a6ptr@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1030 <dns_resolve@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dns_resolve_a6ptr>:
push   %rbx
mov    %rdi,%rbx
xor    %edx,%edx
xor    %ecx,%ecx
call   1040 <dns_submit_a6ptr@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <dns_resolve@plt>

LLVM IR (-O0):
%struct.dns_rr_ptr = type { i32 }
%struct.dns_ctx = type { i32 }
%struct.in6_addr = type { i32 }
define %struct.dns_rr_ptr* @dns_resolve_a6ptr(%struct.dns_ctx* %0, %struct.in6_addr* %1) {
%3 = alloca %struct.dns_ctx*
%4 = alloca %struct.in6_addr*
store %struct.dns_ctx* %0, %struct.dns_ctx** %3
store %struct.in6_addr* %1, %struct.in6_addr** %4
%5 = load %struct.dns_ctx*, %struct.dns_ctx** %3
%6 = load %struct.dns_ctx*, %struct.dns_ctx** %3
%7 = load %struct.in6_addr*, %struct.in6_addr** %4
%8 = call i32 @dns_submit_a6ptr(%struct.dns_ctx* %6, %struct.in6_addr* %7, i32* null, i32* null)
%9 = call i64 @dns_resolve(%struct.dns_ctx* %5, i32 %8)
%10 = inttoptr i64 %9 to %struct.dns_rr_ptr*
ret %struct.dns_rr_ptr* %10
}

LLVM IR (-O2):
%struct.dns_rr_ptr = type { i32 }
%struct.dns_ctx = type { i32 }
%struct.in6_addr = type { i32 }
define %struct.dns_rr_ptr* @dns_resolve_a6ptr(%struct.dns_ctx* %0, %struct.in6_addr* %1) {
%3 = tail call i32 @dns_submit_a6ptr(%struct.dns_ctx* %0, %struct.in6_addr* %1, i32* null, i32* null)
%4 = tail call i64 @dns_resolve(%struct.dns_ctx* %0, i32 %3)
%5 = inttoptr i64 %4 to %struct.dns_rr_ptr*
ret %struct.dns_rr_ptr* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ ByteSwap16(int /*<<< orphan*/);
uint16_t FromBE16(uint16_t value) { return ByteSwap16(value); }


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

x86 assembly (clang, -O2):
<FromBE16>:
jmp    1030 <ByteSwap16@plt>

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

LLVM IR (-O2):
define i32 @FromBE16(i32 %0) {
%2 = tail call i32 @ByteSwap16(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ assume(int);
int main() {
  int i;
  int j;
  int x, y;
  x = 0;
  y = 0;
  int flag;
  assume(i == 0 && j == 0);
  while (1) {
    x++;
    y++;
    i += x;
    j += y;
    if (flag)
      j += 1;
    assert(j >= i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x19(%rbp)
jne    1156 <main+0x36>
cmpl   $0x0,-0xc(%rbp)
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assume@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     119a <main+0x7a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
jmp    1163 <main+0x43>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <assume@plt>
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <assert@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
store i32 0, i32* %5
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 0
br label %12
12: ; preds = %9, %0
%13 = phi i1 [ false, %0 ], [ %11, %9 ]
%14 = zext i1 %13 to i32
%15 = call i32 @assume(i32 %14)
br label %16
16: ; preds = %12, %32
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
%21 = load i32, i32* %4
%22 = load i32, i32* %2
%23 = add nsw i32 %22, %21
store i32 %23, i32* %2
%24 = load i32, i32* %5
%25 = load i32, i32* %3
%26 = add nsw i32 %25, %24
store i32 %26, i32* %3
%27 = load i32, i32* %6
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %32
29: ; preds = %16
%30 = load i32, i32* %3
%31 = add nsw i32 %30, 1
store i32 %31, i32* %3
br label %32
32: ; preds = %29, %16
%33 = load i32, i32* %3
%34 = load i32, i32* %2
%35 = icmp sge i32 %33, %34
%36 = zext i1 %35 to i32
%37 = call i32 @assert(i32 %36)
br label %16
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assume(i32 0)
br label %2
2: ; preds = %2, %0
%3 = tail call i32 @assert(i32 1)
br label %2
}
void g_array_remove_index() {}


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

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

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

LLVM IR (-O2):
define void @g_array_remove_index() {
ret void
}
char *skip(bp)
register char *bp;
{
  while (*bp && *bp != ':')
    bp++;
  while (*bp == ':')
    bp++;
  return (bp);
}


x86 assembly (clang, -O0):
<skip>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     112d <skip+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <skip+0x3d>
jmp    114e <skip+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skip+0x8>
jmp    1153 <skip+0x53>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
jne    1174 <skip+0x74>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <skip+0x53>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip>:
movzbl (%rdi),%eax
test   %al,%al
je     112e <skip+0x2e>
cmp    $0x3a,%al
je     1120 <skip+0x20>
add    $0x1,%rdi
jmp    1100 <skip>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0x1(%rdi),%rax
cmpb   $0x3a,0x1(%rdi)
mov    %rax,%rdi
je     1120 <skip+0x20>
ret
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @skip(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 58, label %7
i8 0, label %12
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %7
%8 = phi i8* [ %9, %7 ], [ %3, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 58
br i1 %11, label %7, label %12
12: ; preds = %2, %7
%13 = phi i8* [ %9, %7 ], [ %3, %2 ]
ret i8* %13
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void MoultStr(int f, char *S) {
  if (f < -1)
    strcpy(S, "MOULT");
  else if (f == -1)
    strcpy(S, "END");
  else
    strcpy(S, "NO");
  return;
}


x86 assembly (clang, -O0):
<MoultStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jge    113e <MoultStr+0x2e>
mov    -0x10(%rbp),%rdi
lea    0xecc(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1172 <MoultStr+0x62>
cmpl   $0xffffffff,-0x4(%rbp)
jne    115d <MoultStr+0x4d>
mov    -0x10(%rbp),%rdi
lea    0xeb3(%rip),%rsi
call   1030 <strcpy@plt>
jmp    116d <MoultStr+0x5d>
mov    -0x10(%rbp),%rdi
lea    0xea2(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1172 <MoultStr+0x62>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MoultStr>:
cmp    $0xffffffff,%edi
lea    0xeec(%rip),%rax
lea    0xee9(%rip),%rcx
cmove  %rax,%rcx
mov    %rsi,%rdi
lea    0xed1(%rip),%rsi
cmovge %rcx,%rsi
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"MOULT\00"
@.str.1 = [4 x i8] c"END\00"
@.str.2 = [3 x i8] c"NO\00"
define void @MoultStr(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %20
10: ; preds = %2
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i8*, i8** %4
%15 = call i32 @strcpy(i8* %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %19
16: ; preds = %10
%17 = load i8*, i8** %4
%18 = call i32 @strcpy(i8* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %19
19: ; preds = %16, %13
br label %20
20: ; preds = %19, %7
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"MOULT\00"
@.str.1 = [4 x i8] c"END\00"
@.str.2 = [3 x i8] c"NO\00"
define void @MoultStr(i32 %0, i8* %1) {
%3 = icmp slt i32 %0, -1
%4 = icmp eq i32 %0, -1
%5 = select i1 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%6 = select i1 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %5
%7 = tail call i32 @strcpy(i8* %1, i8* %6)
ret void
}
/* Variables and functions */
double exp(double);
double func(double x) { return exp(-x * x); }


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
movapd 0xee8(%rip),%xmm1
xorpd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @func(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
%5 = load double, double* %2
%6 = fmul double %4, %5
%7 = call double @exp(double %6)
ret double %7
}

LLVM IR (-O2):
define double @func(double %0) {
%2 = fneg double %0
%3 = fmul double %2, %0
%4 = tail call double @exp(double %3)
ret double %4
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int v_len(uint64_t val) {
  int i;
  val &= 0x7FFFFFFFFFFFFFFFULL;
  for (i = 1; val >> (i * 7); i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<v_len>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
movabs $0x7fffffffffffffff,%rcx
ff ff 7f
and    %rcx,%rax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   $0x7,-0x8(%rbp),%ecx
sar    %cl,%eax
cmp    $0x0,%eax
je     1147 <v_len+0x47>
jmp    1139 <v_len+0x39>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <v_len+0x22>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<v_len>:
xor    %eax,%eax
mov    $0x7,%ecx
nopw   0x0(%rax,%rax,1)
mov    %edi,%edx
sar    %cl,%edx
add    $0x1,%eax
add    $0x7,%ecx
test   %edx,%edx
jne    1110 <v_len+0x10>
ret

LLVM IR (-O0):
define i32 @v_len(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = and i64 %5, 9223372036854775807
%7 = trunc i64 %6 to i32
store i32 %7, i32* %2
store i32 1, i32* %3
br label %8
8: ; preds = %15, %1
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = mul nsw i32 %10, 7
%12 = ashr i32 %9, %11
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %8
br label %15
15: ; preds = %14
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %8
18: ; preds = %8
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @v_len(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 1, %1 ], [ %7, %2 ]
%4 = mul nsw i32 %3, 7
%5 = ashr i32 %0, %4
%6 = icmp eq i32 %5, 0
%7 = add nuw nsw i32 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ _adc_interrupt_handler(int /*<<< orphan*/);
void ADC_Handler(void) { _adc_interrupt_handler(0); }


x86 assembly (clang, -O0):
<ADC_Handler>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <_adc_interrupt_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADC_Handler>:
xor    %edi,%edi
jmp    1030 <_adc_interrupt_handler@plt>

LLVM IR (-O0):
define void @ADC_Handler() {
%1 = call i32 @_adc_interrupt_handler(i32 0)
ret void
}

LLVM IR (-O2):
define void @ADC_Handler() {
%1 = tail call i32 @_adc_interrupt_handler(i32 0)
ret void
}
int test_imm_A1uint8_mem(unsigned char *val) {
  return ((*val) & (0xA1 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_A1uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 161
%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_A1uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -95
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ scim_bridge_perrorln(char *);
int strlen(char const *);
ssize_t scim_bridge_string_get_length(const char *str) {
  if (str == 0) {
    scim_bridge_perrorln("A NULL pointer is given as the UTF8 string at "
                         "scim_bridge_string_get_length ()");
    return -1;
  }
  return strlen(str);
}


x86 assembly (clang, -O0):
<scim_bridge_string_get_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114f <scim_bridge_string_get_length+0x2f>
lea    0xec2(%rip),%rdi
call   1040 <scim_bridge_perrorln@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    115b <scim_bridge_string_get_length+0x3b>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scim_bridge_string_get_length>:
test   %rdi,%rdi
je     112a <scim_bridge_string_get_length+0xa>
jmp    1030 <strlen@plt>
push   %rax
lea    0xece(%rip),%rdi
call   1040 <scim_bridge_perrorln@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [79 x i8] c"A NULL pointer is given as the UTF8 string at scim_bridge_string_get_length ()\00"
define i32 @scim_bridge_string_get_length(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @scim_bridge_perrorln(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i32 @strlen(i8* %9)
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@.str = [79 x i8] c"A NULL pointer is given as the UTF8 string at scim_bridge_string_get_length ()\00"
define i32 @scim_bridge_string_get_length(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @scim_bridge_perrorln(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = tail call i32 @strlen(i8* %0)
br label %7
7: ; preds = %5, %3
%8 = phi i32 [ -1, %3 ], [ %6, %5 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ matNd_print_to_string(char *, int, double const *,
                                         int const);
int /*<<< orphan*/ printf(char *, char *);
void matNd_print(const double m[], const int n) {
  char str[256];
  matNd_print_to_string(str, 256, m, n);
  printf("%s\n", str);
}


x86 assembly (clang, -O0):
<matNd_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    $0x100,%esi
call   1040 <matNd_print_to_string@plt>
lea    -0x110(%rbp),%rsi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matNd_print>:
push   %rbx
sub    $0x100,%rsp
mov    %esi,%ecx
mov    %rdi,%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x100,%esi
call   1040 <matNd_print_to_string@plt>
lea    0xebc(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @matNd_print(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca [256 x i8]
store double* %0, double** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%7 = load double*, double** %3
%8 = load i32, i32* %4
%9 = call i32 @matNd_print_to_string(i8* %6, i32 256, double* %7, i32 %8)
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @matNd_print(double* %0, i32 %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = call i32 @matNd_print_to_string(i8* %4, i32 256, double* %0, i32 %1)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}
int execute_execve() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_execve() {
ret i32 0
}