xunge/DecIR huggingface dataset:
void quad_val_compare_and_swap(__int128_t *p, __int128_t i, __int128_t j,
                               __int128_t *q) {
  *q = __sync_val_compare_and_swap(p, i, j);
}


x86 assembly (clang, -O0):
<quad_val_compare_and_swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x8(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rsi
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rdi,-0x28(%rbp)
mov    %rsi,-0x38(%rbp)
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x48(%rbp)
mov    %rax,-0x50(%rbp)
mov    %r9,-0x58(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    -0x38(%rbp),%rdx
mov    -0x50(%rbp),%rcx
mov    -0x48(%rbp),%r8
call   1030 <__sync_val_compare_and_swap_16@plt>
mov    %rax,%rcx
mov    -0x58(%rbp),%rax
mov    %rdx,0x8(%rax)
mov    %rcx,(%rax)
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quad_val_compare_and_swap>:
push   %rbx
mov    %r9,%rbx
call   1030 <__sync_val_compare_and_swap_16@plt>
mov    %rax,(%rbx)
mov    %rdx,0x8(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @quad_val_compare_and_swap(i128* %0, i64 %1, i64 %2, i64 %3, i64 %4, i128* %5) {
%7 = alloca i128
%8 = alloca i128
%9 = alloca i128*
%10 = alloca i128
%11 = alloca i128
%12 = alloca i128*
%13 = bitcast i128* %7 to { i64, i64 }*
%14 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %13, i32 0, i32 0
store i64 %1, i64* %14
%15 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %13, i32 0, i32 1
store i64 %2, i64* %15
%16 = load i128, i128* %7
%17 = bitcast i128* %8 to { i64, i64 }*
%18 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %17, i32 0, i32 0
store i64 %3, i64* %18
%19 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %17, i32 0, i32 1
store i64 %4, i64* %19
%20 = load i128, i128* %8
store i128* %0, i128** %9
store i128 %16, i128* %10
store i128 %20, i128* %11
store i128* %5, i128** %12
%21 = load i128*, i128** %9
%22 = load i128, i128* %10
%23 = load i128, i128* %11
%24 = cmpxchg i128* %21, i128 %22, i128 %23 seq_cst seq_cst
%25 = extractvalue { i128, i1 } %24, 0
%26 = load i128*, i128** %12
store i128 %25, i128* %26
ret void
}

LLVM IR (-O2):
define void @quad_val_compare_and_swap(i128* nocapture %0, i64 %1, i64 %2, i64 %3, i64 %4, i128* nocapture writeonly %5) {
%7 = zext i64 %2 to i128
%8 = shl nuw i128 %7, 64
%9 = zext i64 %1 to i128
%10 = or i128 %8, %9
%11 = zext i64 %4 to i128
%12 = shl nuw i128 %11, 64
%13 = zext i64 %3 to i128
%14 = or i128 %12, %13
%15 = cmpxchg i128* %0, i128 %10, i128 %14 seq_cst seq_cst
%16 = extractvalue { i128, i1 } %15, 0
store i128 %16, i128* %5
ret void
}
/* Type definitions */
struct stat {
  size_t st_size;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int stat(char const *, struct stat *);
int /*<<< orphan*/ stderr;
size_t stat_size(const char *filename) {
  struct stat buf;
  int err = stat(filename, &buf);
  if (err) {
    fprintf(stderr, "stat() failed: %s\n", filename);
    exit(1);
  }
  return buf.st_size;
}


x86 assembly (clang, -O0):
<stat_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <stat@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1179 <stat_size+0x49>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe96(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stat_size>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
call   1040 <stat@plt>
test   %eax,%eax
jne    1151 <stat_size+0x21>
mov    0x8(%rsp),%rax
add    $0x10,%rsp
pop    %rbx
ret
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
lea    0xe9f(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { i64 }
@stderr = global i32 0
@.str = [19 x i8] c"stat() failed: %s\0A\00"
define i64 @stat_size(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @stat(i8* %5, %struct.stat* %3)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = load i8*, i8** %2
%12 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %1
%15 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%16 = load i64, i64* %15
ret i64 %16
}

LLVM IR (-O2):
%struct.stat = type { i64 }
@stderr = global i32 0
@.str = [19 x i8] c"stat() failed: %s\0A\00"
define i64 @stat_size(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %1
%11 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%12 = load i64, i64* %11
ret i64 %12
}
/* Variables and functions */
int detectPresence(char *);
scalar_t__ graphicMode();
int tfd_yadPresent(void) {
  static int lYadPresent = -1;
  if (lYadPresent < 0) {
    lYadPresent = detectPresence("yad");
  }
  return lYadPresent && graphicMode();
}


x86 assembly (clang, -O0):
<tfd_yadPresent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0x0,0x2f01(%rip)
jge    1147 <tfd_yadPresent+0x27>
lea    0xec4(%rip),%rdi
call   1040 <detectPresence@plt>
mov    %eax,0x2ee9(%rip)
xor    %eax,%eax
cmpl   $0x0,0x2ee0(%rip)
mov    %al,-0x1(%rbp)
je     116a <tfd_yadPresent+0x4a>
mov    $0x0,%al
call   1030 <graphicMode@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tfd_yadPresent>:
push   %rax
mov    0x2f09(%rip),%eax
test   %eax,%eax
js     1143 <tfd_yadPresent+0x23>
test   %eax,%eax
je     1159 <tfd_yadPresent+0x39>
xor    %eax,%eax
call   1030 <graphicMode@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret
lea    0xeb6(%rip),%rdi
call   1040 <detectPresence@plt>
mov    %eax,0x2edb(%rip)
test   %eax,%eax
jne    112f <tfd_yadPresent+0xf>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@tfd_yadPresent.lYadPresent = internal global i32 -1
@.str = [4 x i8] c"yad\00"
define i32 @tfd_yadPresent() {
%1 = load i32, i32* @tfd_yadPresent.lYadPresent
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @detectPresence(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* @tfd_yadPresent.lYadPresent
br label %5
5: ; preds = %3, %0
%6 = load i32, i32* @tfd_yadPresent.lYadPresent
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = call i64 (...) @graphicMode()
%10 = icmp ne i64 %9, 0
br label %11
11: ; preds = %8, %5
%12 = phi i1 [ false, %5 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@tfd_yadPresent.lYadPresent = internal unnamed_addr global i32 -1
@.str = [4 x i8] c"yad\00"
define i32 @tfd_yadPresent() {
%1 = load i32, i32* @tfd_yadPresent.lYadPresent
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @detectPresence(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* @tfd_yadPresent.lYadPresent
br label %5
5: ; preds = %3, %0
%6 = phi i32 [ %4, %3 ], [ %1, %0 ]
%7 = icmp eq i32 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %5
%9 = tail call i64 (...) @graphicMode()
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %8, %5
%13 = phi i32 [ 0, %5 ], [ %11, %8 ]
ret i32 %13
}
void r128_disable_vblank(struct drm_device *dev, int crtc) {
  if (crtc != 0)
    DRM_ERROR("%s:  bad crtc %d\n", __func__, crtc);
}


x86 assembly (clang, -O0):
<r128_disable_vblank>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1141 <r128_disable_vblank+0x31>
mov    -0xc(%rbp),%edx
lea    0xecd(%rip),%rdi
lea    0xed8(%rip),%rsi
mov    $0x0,%al
call   1030 <DRM_ERROR@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r128_disable_vblank>:
test   %esi,%esi
je     112b <r128_disable_vblank+0x1b>
mov    %esi,%edx
lea    0xee3(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %eax,%eax
jmp    1030 <DRM_ERROR@plt>
ret

LLVM IR (-O0):
%struct.drm_device = type opaque
@.str = [18 x i8] c"%s: bad crtc %d\0A\00"
@__func__.r128_disable_vblank = [20 x i8] c"r128_disable_vblank\00"
define void @r128_disable_vblank(%struct.drm_device* %0, i32 %1) {
%3 = alloca %struct.drm_device*
%4 = alloca i32
store %struct.drm_device* %0, %struct.drm_device** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %4
%9 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @DRM_ERROR to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__func__.r128_disable_vblank, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
%struct.drm_device = type opaque
@.str = [18 x i8] c"%s: bad crtc %d\0A\00"
@__func__.r128_disable_vblank = [20 x i8] c"r128_disable_vblank\00"
define void @r128_disable_vblank(%struct.drm_device* nocapture readnone %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @DRM_ERROR to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__func__.r128_disable_vblank, i64 0, i64 0), i32 %1)
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ sqrt(int);
int main() {
  printf("%lf\n", sqrt(-10));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lf\0A\00"
define i32 @main() {
%1 = tail call i32 @sqrt(i32 -10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int f7c(int *p) {
  p = (void *)0;
  return 1;
}


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

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

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

LLVM IR (-O2):
define i32 @f7c(i32* nocapture readnone %0) {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ SVCXPRT;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ svc_destroy(int /*<<< orphan*/ *);
int /*<<< orphan*/ *svcfd_create(int, int, int);
int /*<<< orphan*/ xprt_register(int /*<<< orphan*/ *);
int main(void) {
  int test_status = 1;
  SVCXPRT *svcr = NULL;
  int fd = 0;
  svcr = svcfd_create(fd, 1024, 1024);
  xprt_register(svcr);
  test_status = 0;
  svc_destroy(svcr);
  printf("%d\n", test_status);
  return test_status;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    $0x400,%edx
mov    %edx,%esi
call   1060 <svcfd_create@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <xprt_register@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <svc_destroy@plt>
mov    -0x8(%rbp),%esi
lea    0xe65(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
mov    $0x400,%esi
mov    $0x400,%edx
call   1060 <svcfd_create@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <xprt_register@plt>
mov    %rbx,%rdi
call   1040 <svc_destroy@plt>
lea    0xe94(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%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 1, i32* %2
store i32* null, i32** %3
store i32 0, i32* %4
%5 = load i32, i32* %4
%6 = call i32* @svcfd_create(i32 %5, i32 1024, i32 1024)
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = call i32 @xprt_register(i32* %7)
store i32 0, i32* %2
%9 = load i32*, i32** %3
%10 = call i32 @svc_destroy(i32* %9)
%11 = load i32, i32* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32* @svcfd_create(i32 0, i32 1024, i32 1024)
%2 = tail call i32 @xprt_register(i32* %1)
%3 = tail call i32 @svc_destroy(i32* %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
unsigned long PSEgetLibType(void) { return 1; }


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

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

LLVM IR (-O0):
define i64 @PSEgetLibType() {
ret i64 1
}

LLVM IR (-O2):
define i64 @PSEgetLibType() {
ret i64 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void say(void) {
  printf("hello, make!\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"hello, make!\0A\00"
define void @say() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"hello, make!\00"
define void @say() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
testGreater() { printf("%d > %d = %d\n", 10, 4, 10 > 4); }


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

x86 assembly (clang, -O2):
<testGreater>:
lea    0xee9(%rip),%rdi
mov    $0xa,%esi
mov    $0x4,%edx
mov    $0x1,%ecx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"%d > %d = %d\0A\00"
define i32 @testGreater() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 10, i32 4, i32 1)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [14 x i8] c"%d > %d = %d\0A\00"
define i32 @testGreater() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 10, i32 4, i32 1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int printhead() {
  printf("<section><h2>Tabla ASCII</h2>\n<table style=\"border-collapse: "
         "collapse; border:1px; width: 100%; font-size: 22px; \">\n");
}


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

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

LLVM IR (-O0):
@.str = [117 x i8] c"<section><h2>Tabla ASCII</h2>\0A<table style=\22border-collapse: collapse; border:1px; width: 100%; font-size: 22px; \22>\0A\00"
define i32 @printhead() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([117 x i8], [117 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [117 x i8] c"<section><h2>Tabla ASCII</h2>\0A<table style=\22border-collapse: collapse; border:1px; width: 100%; font-size: 22px; \22>\0A\00"
define i32 @printhead() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([117 x i8], [117 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
void *malloc(size_t);
void *PR_Malloc(size_t len) { return malloc(len); }


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

x86 assembly (clang, -O2):
<PR_Malloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @PR_Malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stdout;
void print_usage(char *progname) {
  fprintf(stdout, "usage: %s [-v] <aclfile>\n", progname);
  fprintf(stdout, "-v\tdebug flag, can be multiplied\n");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xed3(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rbx
mov    (%rbx),%edi
lea    0xedc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xee6(%rip),%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [26 x i8] c"usage: %s [-v] <aclfile>\0A\00"
@.str.1 = [34 x i8] c"-v\09debug flag, can be multiplied\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stdout
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [26 x i8] c"usage: %s [-v] <aclfile>\0A\00"
@.str.1 = [34 x i8] c"-v\09debug flag, can be multiplied\0A\00"
define void @print_usage(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stdout
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void O2(char *IR) {}


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

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

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

LLVM IR (-O2):
define void @O2(i8* nocapture %0) {
ret void
}
double dist(double a, double b) {
  if (a > b)
    return a - b;
  else
    return b - a;
}


x86 assembly (clang, -O0):
<dist>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1132 <dist+0x32>
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1141 <dist+0x41>
movsd  -0x18(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dist>:
movapd %xmm0,%xmm2
subsd  %xmm1,%xmm2
movapd %xmm1,%xmm3
subsd  %xmm0,%xmm3
cmpltsd %xmm0,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm3,%xmm1
orpd   %xmm1,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @dist(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fcmp ogt double %6, %7
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load double, double* %4
%11 = load double, double* %5
%12 = fsub double %10, %11
store double %12, double* %3
br label %17
13: ; preds = %2
%14 = load double, double* %5
%15 = load double, double* %4
%16 = fsub double %14, %15
store double %16, double* %3
br label %17
17: ; preds = %13, %9
%18 = load double, double* %3
ret double %18
}

LLVM IR (-O2):
define double @dist(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = fsub double %0, %1
%5 = fsub double %1, %0
%6 = select i1 %3, double %4, double %5
ret double %6
}
double round(double input) { return ((double)((int)(input + 0.5))); }


x86 assembly (clang, -O0):
<round>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<round>:
addsd  0xef8(%rip),%xmm0
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @round(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 5.000000e-01
%5 = fptosi double %4 to i32
%6 = sitofp i32 %5 to double
ret double %6
}

LLVM IR (-O2):
define double @round(double %0) {
%2 = fadd double %0, 5.000000e-01
%3 = fptosi double %2 to i32
%4 = sitofp i32 %3 to double
ret double %4
}
void ARGBSubtractRow_Any_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ARGBSubtractRow_Any_NEON() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_char;

/* Variables and functions */
void swap_bytes(u_char *a, u_char *b) {
  u_char temp;
  temp = *a;
  *a = *b;
  *b = temp;
}


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

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

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

LLVM IR (-O2):
define void @swap_bytes(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(unsigned char *, int /*<<< orphan*/, int);
void stack_prefault(void) {
  unsigned char dummy[(8 * 1024)];
  memset(dummy, 0, (8 * 1024));
  return;
}


x86 assembly (clang, -O0):
<stack_prefault>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2000,%rsp
lea    -0x2000(%rbp),%rdi
xor    %esi,%esi
mov    $0x2000,%edx
call   1030 <memset@plt>
add    $0x2000,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stack_prefault>:
sub    $0x2008,%rsp
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x2000,%edx
call   1030 <memset@plt>
add    $0x2008,%rsp
ret

LLVM IR (-O0):
define void @stack_prefault() {
%1 = alloca [8192 x i8]
%2 = getelementptr inbounds [8192 x i8], [8192 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i32 0, i32 8192)
ret void
}

LLVM IR (-O2):
define void @stack_prefault() {
%1 = alloca [8192 x i8]
%2 = getelementptr inbounds [8192 x i8], [8192 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i32 0, i32 8192)
ret void
}
/* Type definitions */
struct mndp_frame {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mndp_addB(struct mndp_frame *, int, int /*<<< orphan*/,
                             char const *);
int /*<<< orphan*/ strlen(char const *);
void mndp_addS(struct mndp_frame *f, int id, const char *msg) {
  mndp_addB(f, id, strlen(msg), msg);
}


x86 assembly (clang, -O0):
<mndp_addS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    %eax,%edx
mov    -0x18(%rbp),%rcx
call   1040 <mndp_addB@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mndp_addS>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%rbp
mov    %rdx,%rdi
call   1030 <strlen@plt>
mov    %rbp,%rdi
mov    %r14d,%esi
mov    %eax,%edx
mov    %rbx,%rcx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <mndp_addB@plt>

LLVM IR (-O0):
%struct.mndp_frame = type { i32 }
define void @mndp_addS(%struct.mndp_frame* %0, i32 %1, i8* %2) {
%4 = alloca %struct.mndp_frame*
%5 = alloca i32
%6 = alloca i8*
store %struct.mndp_frame* %0, %struct.mndp_frame** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load %struct.mndp_frame*, %struct.mndp_frame** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i32 @strlen(i8* %9)
%11 = load i8*, i8** %6
%12 = call i32 @mndp_addB(%struct.mndp_frame* %7, i32 %8, i32 %10, i8* %11)
ret void
}

LLVM IR (-O2):
%struct.mndp_frame = type { i32 }
define void @mndp_addS(%struct.mndp_frame* %0, i32 %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %2)
%5 = tail call i32 @mndp_addB(%struct.mndp_frame* %0, i32 %1, i32 %4, i8* %2)
ret void
}
/* Variables and functions */
int lace_builtin_zec_main(int, char **, int /*<<< orphan*/ *,
                          int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  return lace_builtin_zec_main(argc, argv, NULL, NULL);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rdx
call   1030 <lace_builtin_zec_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <lace_builtin_zec_main@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @lace_builtin_zec_main(i32 %0, i8** %1, i32* null, i32* null)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ laguna_writeb(int, int);
void __svgalib_laguna_attscreen(int i) { laguna_writeb(0x7c, i); }


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

x86 assembly (clang, -O2):
<__svgalib_laguna_attscreen>:
mov    %edi,%esi
mov    $0x7c,%edi
jmp    1030 <laguna_writeb@plt>

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

LLVM IR (-O2):
define void @__svgalib_laguna_attscreen(i32 %0) {
%2 = tail call i32 @laguna_writeb(i32 124, i32 %0)
ret void
}
/* Type definitions */
struct terminal_t {
  int dummy;
};
struct parm_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ move_cursor(struct terminal_t *, int /*<<< orphan*/, int);
int sum(struct parm_t *);
void curs_forward(struct terminal_t *term, struct parm_t *parm) {
  int num = sum(parm);
  if (num <= 0)
    num = 1;
  move_cursor(term, 0, num);
}


x86 assembly (clang, -O0):
<curs_forward>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <sum@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jg     114d <curs_forward+0x2d>
movl   $0x1,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%edx
xor    %esi,%esi
call   1040 <move_cursor@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<curs_forward>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <sum@plt>
test   %eax,%eax
mov    $0x1,%edx
cmovg  %eax,%edx
mov    %rbx,%rdi
xor    %esi,%esi
pop    %rbx
jmp    1040 <move_cursor@plt>

LLVM IR (-O0):
%struct.terminal_t = type { i32 }
%struct.parm_t = type { i32 }
define void @curs_forward(%struct.terminal_t* %0, %struct.parm_t* %1) {
%3 = alloca %struct.terminal_t*
%4 = alloca %struct.parm_t*
%5 = alloca i32
store %struct.terminal_t* %0, %struct.terminal_t** %3
store %struct.parm_t* %1, %struct.parm_t** %4
%6 = load %struct.parm_t*, %struct.parm_t** %4
%7 = call i32 @sum(%struct.parm_t* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp sle i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 1, i32* %5
br label %11
11: ; preds = %10, %2
%12 = load %struct.terminal_t*, %struct.terminal_t** %3
%13 = load i32, i32* %5
%14 = call i32 @move_cursor(%struct.terminal_t* %12, i32 0, i32 %13)
ret void
}

LLVM IR (-O2):
%struct.terminal_t = type { i32 }
%struct.parm_t = type { i32 }
define void @curs_forward(%struct.terminal_t* %0, %struct.parm_t* %1) {
%3 = tail call i32 @sum(%struct.parm_t* %1)
%4 = icmp sgt i32 %3, 1
%5 = select i1 %4, i32 %3, i32 1
%6 = tail call i32 @move_cursor(%struct.terminal_t* %0, i32 0, i32 %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct jp2_remote {
  int dummy;
};

/* Variables and functions */
int jp2_command(struct jp2_remote *, int /*<<< orphan*/ const *, int,
                int /*<<< orphan*/ *);
int jp2_simple_command(struct jp2_remote *r, const uint8_t cmd) {
  return jp2_command(r, &cmd, 1, NULL);
}


x86 assembly (clang, -O0):
<jp2_simple_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x1,%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <jp2_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jp2_simple_command>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1030 <jp2_command@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.jp2_remote = type { i32 }
define i32 @jp2_simple_command(%struct.jp2_remote* %0, i32 %1) {
%3 = alloca %struct.jp2_remote*
%4 = alloca i32
store %struct.jp2_remote* %0, %struct.jp2_remote** %3
store i32 %1, i32* %4
%5 = load %struct.jp2_remote*, %struct.jp2_remote** %3
%6 = call i32 @jp2_command(%struct.jp2_remote* %5, i32* %4, i32 1, i32* null)
ret i32 %6
}

LLVM IR (-O2):
%struct.jp2_remote = type { i32 }
define i32 @jp2_simple_command(%struct.jp2_remote* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @jp2_command(%struct.jp2_remote* %0, i32* %3, i32 1, i32* null)
ret i32 %4
}
int fun787() { return 787; }


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

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

LLVM IR (-O0):
define i32 @fun787() {
ret i32 787
}

LLVM IR (-O2):
define i32 @fun787() {
ret i32 787
}
int int_ceildivpow2(int a, int b) { return (a + (1 << b) - 1) >> b; }


x86 assembly (clang, -O0):
<int_ceildivpow2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
sub    $0x1,%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_ceildivpow2>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
add    %edi,%eax
add    $0xffffffff,%eax
sar    %cl,%eax
ret

LLVM IR (-O0):
define i32 @int_ceildivpow2(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 = shl i32 1, %6
%8 = add nsw i32 %5, %7
%9 = sub nsw i32 %8, 1
%10 = load i32, i32* %4
%11 = ashr i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @int_ceildivpow2(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = add i32 %0, -1
%5 = add i32 %4, %3
%6 = ashr i32 %5, %1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/
UpnpResponse_ConnectionManager_GetCurrentConnectionIDs(void *, char *);
int /*<<< orphan*/ printf(char *);
void UpnpConnectionManager_GetCurrentConnectionIDs(void *upnptoken) {
  printf("UPnP Invoke: UpnpConnectionManager_GetCurrentConnectionIDs();\r\n");
  UpnpResponse_ConnectionManager_GetCurrentConnectionIDs(upnptoken, "");
}


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

x86 assembly (clang, -O2):
<UpnpConnectionManager_GetCurrentConnectionIDs>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1040 <puts@plt>
lea    0xf07(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <UpnpResponse_ConnectionManager_GetCurrentConnectionIDs@plt>

LLVM IR (-O0):
@.str = [64 x i8] c"UPnP Invoke: UpnpConnectionManager_GetCurrentConnectionIDs();\0D\0A\00"
@.str.1 = [1 x i8] zeroinitializer
define void @UpnpConnectionManager_GetCurrentConnectionIDs(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @UpnpResponse_ConnectionManager_GetCurrentConnectionIDs(i8* %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [1 x i8] zeroinitializer
@str = [63 x i8] c"UPnP Invoke: UpnpConnectionManager_GetCurrentConnectionIDs();\0D\00"
define void @UpnpConnectionManager_GetCurrentConnectionIDs(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @UpnpResponse_ConnectionManager_GetCurrentConnectionIDs(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bzero(char *, int);
int /*<<< orphan*/ memset(int *, int, int);
void test(int *X, char *Y) {
  memset(X, 4, 1000);
  bzero(Y, 100);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x4,%esi
mov    $0x3e8,%edx
call   1030 <memset@plt>
mov    -0x10(%rbp),%rdi
mov    $0x64,%esi
call   1040 <bzero@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
mov    %rsi,%rbx
mov    $0x4,%esi
mov    $0x3e8,%edx
call   1030 <memset@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
pop    %rbx
jmp    1040 <bzero@plt>

LLVM IR (-O0):
define void @test(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 = call i32 @memset(i32* %5, i32 4, i32 1000)
%7 = load i8*, i8** %4
%8 = call i32 @bzero(i8* %7, i32 100)
ret void
}

LLVM IR (-O2):
define void @test(i32* %0, i8* nocapture writeonly %1) {
%3 = tail call i32 @memset(i32* %0, i32 4, i32 1000)
%4 = tail call i32 @bzero(i8* %1, i32 100)
ret void
}
/* Variables and functions */
unsigned char tolower(unsigned char);
void to_lower(char *s) {
  unsigned char *b;
  for (b = (unsigned char *)s; (*b = tolower(*b)); b++)
    ;
}


x86 assembly (clang, -O0):
<to_lower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%edi
call   1030 <tolower@plt>
mov    -0x10(%rbp),%rcx
mov    %al,(%rcx)
cmp    $0x0,%al
je     1154 <to_lower+0x44>
jmp    1143 <to_lower+0x33>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <to_lower+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_lower>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl (%rbx),%edi
call   1030 <tolower@plt>
mov    %al,(%rbx)
add    $0x1,%rbx
test   %al,%al
jne    1120 <to_lower+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @to_lower(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %12, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = call zeroext i8 @tolower(i8 zeroext %7)
%9 = load i8*, i8** %3
store i8 %8, i8* %9
%10 = icmp ne i8 %8, 0
br i1 %10, label %11, label %15
11: ; preds = %5
br label %12
12: ; preds = %11
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %3
br label %5
15: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @to_lower(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call zeroext i8 @tolower(i8 zeroext %4)
store i8 %5, i8* %3
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret void
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ exit(int);
int open(char const *, int);
int /*<<< orphan*/ perror(char const *);
int Open(const char *path, int flags) {
  int ret = open(path, flags);
  if (ret == -1) {
    do {
      int e = errno;
      perror(path);
      exit(e);
    } while (0);
  }
  return ret;
}


x86 assembly (clang, -O0):
<Open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <open@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
jne    117a <Open+0x4a>
jmp    115d <Open+0x2d>
mov    0x2e7c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    -0x14(%rbp),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Open>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <open@plt>
cmp    $0xffffffff,%eax
je     1147 <Open+0x17>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    0x2e92(%rip),%rax
mov    (%rax),%ebp
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    %ebp,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@errno = global i32 0
define i32 @Open(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @open(i8* %7, i32 %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %20
12: ; preds = %2
br label %13
13: ; preds = %12
%14 = load i32, i32* @errno
store i32 %14, i32* %6
%15 = load i8*, i8** %3
%16 = call i32 @perror(i8* %15)
%17 = load i32, i32* %6
%18 = call i32 @exit(i32 %17)
unreachable
19: ; No predecessors!
br label %20
20: ; preds = %19, %2
%21 = load i32, i32* %5
ret i32 %21
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @Open(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @open(i8* %0, i32 %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @errno
%7 = tail call i32 @perror(i8* %0)
%8 = tail call i32 @exit(i32 %6)
unreachable
9: ; preds = %2
ret i32 %3
}
void default_log_debug(const char *a, ...) {}


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

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

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

LLVM IR (-O2):
define void @default_log_debug(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
void *dm(size_t);
void *d3(size_t n) { return dm(n); }


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

x86 assembly (clang, -O2):
<d3>:
jmp    1030 <dm@plt>

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

LLVM IR (-O2):
define i8* @d3(i64 %0) {
%2 = tail call i8* @dm(i64 %0)
ret i8* %2
}
/* Type definitions */
typedef int uint16_t;
struct buffer {
  int dummy;
};

/* Variables and functions */
int get8(struct buffer *);
uint16_t get16be(struct buffer *input) {
  uint16_t ret;
  ret = get8(input) << 8;
  ret |= get8(input);
  return ret;
}


x86 assembly (clang, -O0):
<get16be>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get8@plt>
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get8@plt>
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get16be>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <get8@plt>
mov    %eax,%ebp
shl    $0x8,%ebp
mov    %rbx,%rdi
call   1030 <get8@plt>
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.buffer = type { i32 }
define i32 @get16be(%struct.buffer* %0) {
%2 = alloca %struct.buffer*
%3 = alloca i32
store %struct.buffer* %0, %struct.buffer** %2
%4 = load %struct.buffer*, %struct.buffer** %2
%5 = call i32 @get8(%struct.buffer* %4)
%6 = shl i32 %5, 8
store i32 %6, i32* %3
%7 = load %struct.buffer*, %struct.buffer** %2
%8 = call i32 @get8(%struct.buffer* %7)
%9 = load i32, i32* %3
%10 = or i32 %9, %8
store i32 %10, i32* %3
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
%struct.buffer = type { i32 }
define i32 @get16be(%struct.buffer* %0) {
%2 = tail call i32 @get8(%struct.buffer* %0)
%3 = shl i32 %2, 8
%4 = tail call i32 @get8(%struct.buffer* %0)
%5 = or i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int FHTFloatCombined(float *, int, int);
int FHTFloat(float *buffer, int len, int chunk) {
  return FHTFloatCombined(buffer, len, chunk);
}


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

x86 assembly (clang, -O2):
<FHTFloat>:
jmp    1030 <FHTFloatCombined@plt>

LLVM IR (-O0):
define i32 @FHTFloat(float* %0, i32 %1, i32 %2) {
%4 = alloca float*
%5 = alloca i32
%6 = alloca i32
store float* %0, float** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load float*, float** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @FHTFloatCombined(float* %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @FHTFloat(float* %0, i32 %1, i32 %2) {
%4 = tail call i32 @FHTFloatCombined(float* %0, i32 %1, i32 %2)
ret i32 %4
}
xx(unsigned char c) {
  if (c >= 32 && c < 128)
    return c;
  return '?';
}


x86 assembly (clang, -O0):
<xx>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x20,%eax
jl     1132 <xx+0x32>
movzbl -0x5(%rbp),%eax
cmp    $0x80,%eax
jge    1132 <xx+0x32>
movzbl -0x5(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1139 <xx+0x39>
movl   $0x3f,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xx>:
cmp    $0x20,%dil
mov    $0x3f,%eax
cmovge %edi,%eax
ret

LLVM IR (-O0):
define i32 @xx(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp sge i32 %5, 32
br i1 %6, label %7, label %14
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp slt i32 %9, 128
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
store i32 %13, i32* %2
br label %15
14: ; preds = %7, %1
store i32 63, i32* %2
br label %15
15: ; preds = %14, %11
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @xx(i8 zeroext %0) {
%2 = icmp sgt i8 %0, 31
%3 = select i1 %2, i8 %0, i8 63
%4 = zext i8 %3 to i32
ret i32 %4
}
int baz(unsigned long long x) {
  if (x == 0)
    __builtin_unreachable();
  return __builtin_ffsll(x) - 1;
}


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1113 <baz+0x13>
mov    -0x8(%rbp),%rdx
bsf    %rdx,%rax
add    $0x1,%rax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmove  %rcx,%rax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<baz>:
bsf    %rdi,%rax
ret

LLVM IR (-O0):
define i32 @baz(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
unreachable
6: ; preds = %1
%7 = load i64, i64* %2
%8 = call i64 @llvm.cttz.i64(i64 %7, i1 true)
%9 = add i64 %8, 1
%10 = icmp eq i64 %7, 0
%11 = select i1 %10, i64 0, i64 %9
%12 = trunc i64 %11 to i32
%13 = sub nsw i32 %12, 1
ret i32 %13
}

LLVM IR (-O2):
define i32 @baz(i64 %0) {
%2 = icmp ne i64 %0, 0
tail call void @llvm.assume(i1 %2)
%3 = tail call i64 @llvm.cttz.i64(i64 %0, i1 true)
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help() {
  printf(
      "./LAC.o [options]\n	Options:\n	--help \tDisplay this "
      "information\n	-i \tInterpretor mode\n	-f \tInterpretor mode with "
      "file input, using the file ./input.lac\n	-f [filepath] \tInterpretor "
      "mode with file input, using custom file\n	-c [inputfile] "
      "[outputfile] \t Complie mode\n	-l [inputfile] [outputfile] \tOnly run "
      "lexcal analyse\n	-r [inputfile] \truntime mode\n");
}


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

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

LLVM IR (-O0):
@.str = [347 x i8] c"./LAC.o [options]\0A\09Options:\0A\09--help \09Display this information\0A\09-i \09Interpretor mode\0A\09-f \09Interpretor mode with file input, using the file ./input.lac\0A\09-f [filepath] \09Interpretor mode with file input, using custom file\0A\09-c [inputfile] [outputfile] \09 Complie mode\0A\09-l [inputfile] [outputfile] \09Only run lexcal analyse\0A\09-r [inputfile] \09runtime mode\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([347 x i8], [347 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [346 x i8] c"./LAC.o [options]\0A\09Options:\0A\09--help \09Display this information\0A\09-i \09Interpretor mode\0A\09-f \09Interpretor mode with file input, using the file ./input.lac\0A\09-f [filepath] \09Interpretor mode with file input, using custom file\0A\09-c [inputfile] [outputfile] \09 Complie mode\0A\09-l [inputfile] [outputfile] \09Only run lexcal analyse\0A\09-r [inputfile] \09runtime mode\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([346 x i8], [346 x i8]* @str, i64 0, i64 0))
ret void
}