xunge/DecIR huggingface dataset:
void prepare_cleanup_device_(long *Mesh_pointer, int *ACOUSTIC_SIMULATION,
                             int *ELASTIC_SIMULATION, int *ABSORBING_CONDITIONS,
                             int *NOISE_TOMOGRAPHY,
                             int *COMPUTE_AND_STORE_STRAIN, int *ATTENUATION,
                             int *ANISOTROPY, int *APPROXIMATE_OCEAN_LOAD,
                             int *APPROXIMATE_HESS_KL) {}


x86 assembly (clang, -O0):
<prepare_cleanup_device_>:
push   %rbp
mov    %rsp,%rbp
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @prepare_cleanup_device_(i64* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7, i32* %8, i32* %9) {
%11 = alloca i64*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca i32*
%17 = alloca i32*
%18 = alloca i32*
%19 = alloca i32*
%20 = alloca i32*
store i64* %0, i64** %11
store i32* %1, i32** %12
store i32* %2, i32** %13
store i32* %3, i32** %14
store i32* %4, i32** %15
store i32* %5, i32** %16
store i32* %6, i32** %17
store i32* %7, i32** %18
store i32* %8, i32** %19
store i32* %9, i32** %20
ret void
}

LLVM IR (-O2):
define void @prepare_cleanup_device_(i64* nocapture %0, i32* nocapture %1, i32* nocapture %2, i32* nocapture %3, i32* nocapture %4, i32* nocapture %5, i32* nocapture %6, i32* nocapture %7, i32* nocapture %8, i32* nocapture %9) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cpuAND();
int /*<<< orphan*/ cpuLSRa();
void cpuASR() {
  cpuAND();
  cpuLSRa();
}


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

x86 assembly (clang, -O2):
<cpuASR>:
push   %rax
xor    %eax,%eax
call   1040 <cpuAND@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <cpuLSRa@plt>

LLVM IR (-O0):
define void @cpuASR() {
%1 = call i32 (...) @cpuAND()
%2 = call i32 (...) @cpuLSRa()
ret void
}

LLVM IR (-O2):
define void @cpuASR() {
%1 = tail call i32 (...) @cpuAND()
%2 = tail call i32 (...) @cpuLSRa()
ret void
}
long long plugin_minimum_version(void) {
  return 0 * 100000000 + 0 * 100000 + 0;
}


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

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

LLVM IR (-O0):
define i64 @plugin_minimum_version() {
ret i64 0
}

LLVM IR (-O2):
define i64 @plugin_minimum_version() {
ret i64 0
}
int vexpress_spc_wfi_cpustat(int cluster) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @vexpress_spc_wfi_cpustat(i32 %0) {
ret i32 0
}
void replace(char string[]) {
  int index = 0;
  while (string[index] != '\0') {
    if (string[index] == '-') {
      string[index] = '_';
    }
    ++index;
  }
}


x86 assembly (clang, -O0):
<replace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1153 <replace+0x53>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2d,%eax
jne    1145 <replace+0x45>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x5f,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <replace+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<replace>:
jmp    1117 <replace+0x17>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x5f,(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0x2d,%al
je     1110 <replace+0x10>
test   %al,%al
jne    1113 <replace+0x13>
ret

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

LLVM IR (-O2):
define void @replace(i8* nocapture %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i64 [ %8, %7 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %7 [
i8 0, label %9
i8 45, label %6
]
6: ; preds = %2
store i8 95, i8* %4
br label %7
7: ; preds = %2, %6
%8 = add nuw i64 %3, 1
br label %2
9: ; preds = %2
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ window;
};
struct TYPE_4__ {
  TYPE_1__ xmotion;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned long get_XEvent_xmotion_window(void *_p) {
  return (unsigned long)((XEvent *)_p)->xmotion.window;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i64 @get_XEvent_xmotion_window(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @get_XEvent_xmotion_window(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
void __ompc_serialized_parallel(int vthread_id) {}


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

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

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

LLVM IR (-O2):
define void @__ompc_serialized_parallel(i32 %0) {
ret void
}
/* Variables and functions */
int calc();
int main(void) { return calc(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @calc()
ret i32 %1
}
/* Variables and functions */
char *strcpy(char *, char const *);
char *c_strcpy(char *dest, const char *src) { return strcpy(dest, src); }


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

x86 assembly (clang, -O2):
<c_strcpy>:
jmp    1030 <strcpy@plt>

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

LLVM IR (-O2):
define i8* @c_strcpy(i8* returned %0, i8* nocapture %1) {
%3 = tail call i8* @strcpy(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ isspace(char);
extern void CopyCobol(char *to, char *from) {
  while (!isspace(*from)) {
    *to++ = *from++;
  }
  *to = 0;
}


x86 assembly (clang, -O0):
<CopyCobol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1141 <CopyCobol+0x31>
jmp    1168 <CopyCobol+0x58>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1120 <CopyCobol+0x10>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CopyCobol>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
movsbl (%rsi),%edi
call   1030 <isspace@plt>
test   %eax,%eax
jne    114b <CopyCobol+0x3b>
add    $0x1,%rbx
nopw   0x0(%rax,%rax,1)
movzbl -0x1(%rbx),%eax
mov    %al,(%r14)
add    $0x1,%r14
movsbl (%rbx),%edi
call   1030 <isspace@plt>
add    $0x1,%rbx
test   %eax,%eax
je     1130 <CopyCobol+0x20>
movb   $0x0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @CopyCobol(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = tail call i32 @isspace(i8 signext %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %15
6: ; preds = %2, %6
%7 = phi i8* [ %9, %6 ], [ %1, %2 ]
%8 = phi i8* [ %11, %6 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %7
%11 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %10, i8* %8
%12 = load i8, i8* %9
%13 = tail call i32 @isspace(i8 signext %12)
%14 = icmp eq i32 %13, 0
br i1 %14, label %6, label %15
15: ; preds = %6, %2
%16 = phi i8* [ %0, %2 ], [ %11, %6 ]
store i8 0, i8* %16
ret void
}
int isupper(int c) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @isupper(i32 %0) {
ret i32 0
}
int do_556() { return 556; }


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

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

LLVM IR (-O0):
define i32 @do_556() {
ret i32 556
}

LLVM IR (-O2):
define i32 @do_556() {
ret i32 556
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int int32_t;

/* Variables and functions */
int __SSAT(int, int /*<<< orphan*/ const);
__attribute__((always_)) uint32_t __SSAT16(int32_t x, const uint32_t y) {
  int32_t r = 0, s = 0;
  r = __SSAT((((int32_t)x << 16) >> 16), y) & (int32_t)0x0000FFFF;
  s = __SSAT((((int32_t)x) >> 16), y) & (int32_t)0x0000FFFF;
  return ((uint32_t)((s << 16) | (r)));
}


x86 assembly (clang, -O0):
<__SSAT16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
shl    $0x10,%edi
sar    $0x10,%edi
mov    -0x8(%rbp),%esi
call   1030 <__SSAT@plt>
and    $0xffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
sar    $0x10,%edi
mov    -0x8(%rbp),%esi
call   1030 <__SSAT@plt>
and    $0xffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x10,%eax
or     -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__SSAT16>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
movswl %bp,%edi
call   1030 <__SSAT@plt>
movzwl %ax,%r14d
sar    $0x10,%ebp
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <__SSAT@plt>
shl    $0x10,%eax
or     %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @__SSAT16(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
%7 = load i32, i32* %3
%8 = shl i32 %7, 16
%9 = ashr i32 %8, 16
%10 = load i32, i32* %4
%11 = call i32 @__SSAT(i32 %9, i32 %10)
%12 = and i32 %11, 65535
store i32 %12, i32* %5
%13 = load i32, i32* %3
%14 = ashr i32 %13, 16
%15 = load i32, i32* %4
%16 = call i32 @__SSAT(i32 %14, i32 %15)
%17 = and i32 %16, 65535
store i32 %17, i32* %6
%18 = load i32, i32* %6
%19 = shl i32 %18, 16
%20 = load i32, i32* %5
%21 = or i32 %19, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @__SSAT16(i32 %0, i32 %1) {
%3 = shl i32 %0, 16
%4 = ashr exact i32 %3, 16
%5 = tail call i32 @__SSAT(i32 %4, i32 %1)
%6 = and i32 %5, 65535
%7 = ashr i32 %0, 16
%8 = tail call i32 @__SSAT(i32 %7, i32 %1)
%9 = shl i32 %8, 16
%10 = or i32 %9, %6
ret i32 %10
}
/* Type definitions */
struct tinyrl {
  int dummy;
};

/* Variables and functions */
int tinyrl_insert_text(struct tinyrl *, char *);
bool tinyrl_key_default(void *context, char *key) {
  struct tinyrl *this = context;
  return tinyrl_insert_text(this, key);
}


x86 assembly (clang, -O0):
<tinyrl_key_default>:
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    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <tinyrl_insert_text@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tinyrl_key_default>:
jmp    1030 <tinyrl_insert_text@plt>

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

LLVM IR (-O2):
%struct.tinyrl = type { i32 }
define i32 @tinyrl_key_default(i8* %0, i8* %1) {
%3 = bitcast i8* %0 to %struct.tinyrl*
%4 = tail call i32 @tinyrl_insert_text(%struct.tinyrl* %3, i8* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int log_msg(int, char *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
int log_errno(int lf, const char *s) {
  return log_msg(lf, "%s: %s", s, strerror(errno));
}


x86 assembly (clang, -O0):
<log_errno>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rdx
mov    %eax,%ecx
lea    0xea5(%rip),%rsi
call   1030 <log_msg@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_errno>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xec3(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %eax,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <log_msg@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%s: %s\00"
@errno = global i32 0
define i32 @log_errno(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 = load i8*, i8** %4
%7 = load i32, i32* @errno
%8 = call i32 @strerror(i32 %7)
%9 = call i32 @log_msg(i32 %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s: %s\00"
@errno = global i32 0
define i32 @log_errno(i32 %0, i8* %1) {
%3 = load i32, i32* @errno
%4 = tail call i32 @strerror(i32 %3)
%5 = tail call i32 @log_msg(i32 %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ *strchr(char *, char);
int is_field(char ch) { return strchr(" #$.*@+", ch) != NULL; }


x86 assembly (clang, -O0):
<is_field>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_field>:
push   %rax
mov    %edi,%esi
lea    0xee6(%rip),%rdi
call   1030 <strchr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c" #$.*@+\00"
define i32 @is_field(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32* @strchr(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8 signext %3)
%5 = icmp ne i32* %4, null
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [8 x i8] c" #$.*@+\00"
define i32 @is_field(i8 signext %0) {
%2 = tail call i32* @strchr(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%3 = icmp ne i32* %2, null
%4 = zext i1 %3 to i32
ret i32 %4
}
int f() {
  struct S {
    int i;
  };
  struct S;
  struct S s;
  return s.i;
}


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

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

LLVM IR (-O0):
%struct.S = type { i32 }
define i32 @f() {
%1 = alloca %struct.S
%2 = getelementptr inbounds %struct.S, %struct.S* %1, i32 0, i32 0
%3 = load i32, i32* %2
ret i32 %3
}

LLVM IR (-O2):
define i32 @f() {
ret i32 undef
}
/* Type definitions */
struct option {
  int dummy;
};

/* Variables and functions */
int _getopt_internal(int, char *const *, char const *, struct option const *,
                     int *, int /*<<< orphan*/, int /*<<< orphan*/);
int getopt(int argc, char *const *argv, const char *optstring) {
  return _getopt_internal(argc, argv, optstring, (const struct option *)0,
                          (int *)0, 0, 0);
}


x86 assembly (clang, -O0):
<getopt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%r8d
xor    %r9d,%r9d
mov    %r8,%rcx
movl   $0x0,(%rsp)
call   1030 <_getopt_internal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getopt>:
push   %rax
movl   $0x0,(%rsp)
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <_getopt_internal@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.option = type { i32 }
define i32 @getopt(i32 %0, i8** %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = load i8*, i8** %6
%10 = call i32 @_getopt_internal(i32 %7, i8** %8, i8* %9, %struct.option* null, i32* null, i32 0, i32 0)
ret i32 %10
}

LLVM IR (-O2):
%struct.option = type { i32 }
define i32 @getopt(i32 %0, i8** %1, i8* %2) {
%4 = tail call i32 @_getopt_internal(i32 %0, i8** %1, i8* %2, %struct.option* null, i32* null, i32 0, i32 0)
ret i32 %4
}
/* Type definitions */
struct xyz_event_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct xyz_event_t *);
void xyz_event_destroy(struct xyz_event_t *ev) {
  if (ev) {
    free(ev);
  }
  return;
}


x86 assembly (clang, -O0):
<xyz_event_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <xyz_event_destroy+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xyz_event_destroy>:
test   %rdi,%rdi
je     111a <xyz_event_destroy+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.xyz_event_t = type { i32 }
define void @xyz_event_destroy(%struct.xyz_event_t* %0) {
%2 = alloca %struct.xyz_event_t*
store %struct.xyz_event_t* %0, %struct.xyz_event_t** %2
%3 = load %struct.xyz_event_t*, %struct.xyz_event_t** %2
%4 = icmp ne %struct.xyz_event_t* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load %struct.xyz_event_t*, %struct.xyz_event_t** %2
%7 = call i32 @free(%struct.xyz_event_t* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.xyz_event_t = type { i32 }
define void @xyz_event_destroy(%struct.xyz_event_t* %0) {
%2 = icmp eq %struct.xyz_event_t* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.xyz_event_t* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int null_write(BIO *b, const char *in, int inl) { return (inl); }


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

x86 assembly (clang, -O2):
<null_write>:
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @null_write(i32* nocapture readnone %0, i8* nocapture readnone %1, i32 returned %2) {
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ write(int /*<<< orphan*/, int *, int);
int putchar(int c) {
  char cc = c;
  write(0, &c, 1);
  return (unsigned char)c;
}


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0x5(%rbp)
xor    %edi,%edi
lea    -0x4(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    %edi,0xc(%rsp)
lea    0xc(%rsp),%rsi
xor    %edi,%edi
mov    $0x1,%edx
call   1030 <write@plt>
movzbl %bl,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @putchar(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = trunc i32 %4 to i8
store i8 %5, i8* %3
%6 = call i32 @write(i32 0, i32* %2, i32 1)
%7 = load i32, i32* %2
%8 = trunc i32 %7 to i8
%9 = zext i8 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @putchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @write(i32 0, i32* %2, i32 1)
%4 = and i32 %0, 255
ret i32 %4
}
/* Variables and functions */
int fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ snprintf(char *, int, char *, int, int, int);
int /*<<< orphan*/ stdout;
int c_goto(int line, int off) {
  char c[10];
  snprintf(c, 10, "%c[%d;%dH", 0x1b, line, off);
  return fputs(c, stdout);
}


x86 assembly (clang, -O0):
<c_goto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x12(%rbp),%rdi
mov    -0x4(%rbp),%r8d
mov    -0x8(%rbp),%r9d
mov    $0xa,%esi
lea    0xeba(%rip),%rdx
mov    $0x1b,%ecx
call   1030 <snprintf@plt>
lea    -0x12(%rbp),%rdi
mov    0x2e85(%rip),%rax
mov    (%rax),%esi
call   1040 <fputs@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_goto>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%r9d
mov    %edi,%r8d
lea    0xece(%rip),%rdx
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0x1b,%ecx
call   1030 <snprintf@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1040 <fputs@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%c[%d;%dH\00"
@stdout = global i32 0
define i32 @c_goto(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [10 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @snprintf(i8* %6, i32 10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 27, i32 %7, i32 %8)
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%11 = load i32, i32* @stdout
%12 = call i32 @fputs(i8* %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
@.str = [10 x i8] c"%c[%d;%dH\00"
@stdout = global i32 0
define i32 @c_goto(i32 %0, i32 %1) {
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 27, i32 %0, i32 %1)
%6 = load i32, i32* @stdout
%7 = call i32 @fputs(i8* %4, i32 %6)
ret i32 %7
}
/* Variables and functions */
int CHAR_MAX;
int CHAR_MIN;
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("CHAR_MIN = %d\n", CHAR_MIN);
  printf("CHAR_MAX = %d\n", CHAR_MAX);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"CHAR_MIN = %d\0A\00"
@CHAR_MIN = global i32 0
@.str.1 = [15 x i8] c"CHAR_MAX = %d\0A\00"
@CHAR_MAX = global i32 0
define i32 @main() {
%1 = load i32, i32* @CHAR_MIN
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @CHAR_MAX
%4 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
size_t strlen(char *);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *strncat(char *dst, const char *src, register size_t cnt) {
  size_t off = strlen(dst);
  strncpy(dst + off, src, cnt);
  return dst;
}


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

x86 assembly (clang, -O2):
<strncat>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    (%rax,%rbx,1),%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <strncpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @strncat(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
store i64 %9, i64* %7
%10 = load i8*, i8** %4
%11 = load i64, i64* %7
%12 = getelementptr inbounds i8, i8* %10, i64 %11
%13 = load i8*, i8** %5
%14 = load i64, i64* %6
%15 = call i32 @strncpy(i8* %12, i8* %13, i64 %14)
%16 = load i8*, i8** %4
ret i8* %16
}

LLVM IR (-O2):
define i8* @strncat(i8* returned %0, i8* %1, i64 %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = tail call i32 @strncpy(i8* %5, i8* %1, i64 %2)
ret i8* %0
}
char *tounibuf(char *s) { return s; }


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

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

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

LLVM IR (-O2):
define i8* @tounibuf(i8* readnone returned %0) {
ret i8* %0
}
void nulltest() {
  int *i = (int *)0;
  (*i)++;
}


x86 assembly (clang, -O0):
<nulltest>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @nulltest() {
%1 = alloca i32*
store i32* null, i32** %1
%2 = load i32*, i32** %1
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
ret void
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ bar(int *);
int __attribute__((no)) foo(void) {
  int i, *j = &i;
  bar(j);
  return 6 + i;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <bar@plt>
mov    -0x4(%rbp),%eax
add    $0x6,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <bar@plt>
mov    0x4(%rsp),%eax
add    $0x6,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca i32
%2 = alloca i32*
store i32* %1, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @bar(i32* %3)
%5 = load i32, i32* %1
%6 = add nsw i32 6, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @foo() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @bar(i32* %1)
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 6
ret i32 %5
}
void gtk_text_view_set_pixels_below_lines() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_view_set_pixels_below_lines() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int comp(int);
int /*<<< orphan*/ printf(char *, int, int);
void dotest2(int n, int expr) {
  int act = comp(n);
  if (act != expr)
    printf("Expected %d, got %d\n", expr, act);
  assert(act == expr);
}


x86 assembly (clang, -O0):
<dotest2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <comp@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1167 <dotest2+0x37>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dotest2>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
call   1030 <comp@plt>
mov    %eax,%ebp
cmp    %ebx,%eax
je     1150 <dotest2+0x20>
lea    0xeb9(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   1040 <printf@plt>
xor    %edi,%edi
cmp    %ebx,%ebp
sete   %dil
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <assert@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Expected %d, got %d\0A\00"
define void @dotest2(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 = call i32 @comp(i32 %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp ne i32 %8, %9
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13)
br label %15
15: ; preds = %11, %2
%16 = load i32, i32* %5
%17 = load i32, i32* %4
%18 = icmp eq i32 %16, %17
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Expected %d, got %d\0A\00"
define void @dotest2(i32 %0, i32 %1) {
%3 = tail call i32 @comp(i32 %0)
%4 = icmp eq i32 %3, %1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %3)
br label %7
7: ; preds = %5, %2
%8 = zext i1 %4 to i32
%9 = tail call i32 @assert(i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_usage() {
  fprintf(stderr,
          "usage: nscp [-hup] [[user@]host1:]file1 ... [[user@]host2:]file2\n");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [66 x i8] c"usage: nscp [-hup] [[user@]host1:]file1 ... [[user@]host2:]file2\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [66 x i8] c"usage: nscp [-hup] [[user@]host1:]file1 ... [[user@]host2:]file2\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void __attribute__((constructor)) __attribute__((used)) A10(void) {
  printf("Test1\n");
}


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"Test1\0A\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @A10, i8* null }]
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void ()* @A10 to i8*)], section "llvm.metadata"
define void @A10() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @A10, i8* null }]
@str = [6 x i8] c"Test1\00"
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void ()* @A10 to i8*)], section "llvm.metadata"
define void @A10() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char serial_read(int);
int serial_device_read(int unit, void *data, int length, int offset) {
  int i;
  char *cdata = data;
  for (i = 0; i < length; i++) {
    cdata[i] = serial_read(unit);
  }
  return length;
}


x86 assembly (clang, -O0):
<serial_device_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1163 <serial_device_read+0x53>
mov    -0x4(%rbp),%edi
call   1030 <serial_read@plt>
mov    %al,%dl
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1134 <serial_device_read+0x24>
mov    -0x14(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_device_read>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r14d
test   %edx,%edx
jle    1145 <serial_device_read+0x35>
mov    %rsi,%r15
mov    %edi,%r12d
mov    %r14d,%ebx
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    %r12d,%edi
call   1030 <serial_read@plt>
mov    %al,(%r15,%rbp,1)
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1130 <serial_device_read+0x20>
mov    %r14d,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @serial_device_read(i32 %0, i8* nocapture writeonly %1, i32 returned %2, i32 %3) {
%5 = icmp sgt i32 %2, 0
br i1 %5, label %6, label %14
6: ; preds = %4
%7 = zext i32 %2 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %12, %8 ]
%10 = tail call signext i8 @serial_read(i32 %0)
%11 = getelementptr inbounds i8, i8* %1, i64 %9
store i8 %10, i8* %11
%12 = add nuw nsw i64 %9, 1
%13 = icmp eq i64 %12, %7
br i1 %13, label %14, label %8
14: ; preds = %8, %4
ret i32 %2
}
int int_max(int a, int b) { return a >= b ? a : b; }


x86 assembly (clang, -O0):
<int_max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1121 <int_max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <int_max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_max>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

LLVM IR (-O0):
define i32 @int_max(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 = icmp sge i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @int_max(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ lirerr(int);
void compress_rawdat_disk(void) { lirerr(999996); }


x86 assembly (clang, -O0):
<compress_rawdat_disk>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf423c,%edi
call   1030 <lirerr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<compress_rawdat_disk>:
mov    $0xf423c,%edi
jmp    1030 <lirerr@plt>

LLVM IR (-O0):
define void @compress_rawdat_disk() {
%1 = call i32 @lirerr(i32 999996)
ret void
}

LLVM IR (-O2):
define void @compress_rawdat_disk() {
%1 = tail call i32 @lirerr(i32 999996)
ret void
}
unsigned char getByte(unsigned char *inp, unsigned int bitpos) {
  unsigned char *addr;
  addr = inp + (bitpos >> 3);
  return (addr[0] << (bitpos & 7)) | (addr[1] >> (8 - (bitpos & 7)));
}


x86 assembly (clang, -O0):
<getByte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shr    $0x3,%ecx
mov    %ecx,%ecx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
mov    -0xc(%rbp),%ecx
and    $0x7,%ecx
shl    %cl,%eax
mov    -0x18(%rbp),%rcx
movzbl 0x1(%rcx),%edx
mov    -0xc(%rbp),%esi
and    $0x7,%esi
mov    $0x8,%ecx
sub    %esi,%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getByte>:
mov    %esi,%ecx
mov    %esi,%eax
shr    $0x3,%rax
movzbl 0x1(%rdi,%rax,1),%edx
movzbl (%rdi,%rax,1),%eax
shl    $0x8,%eax
or     %edx,%eax
and    $0x7,%cl
shl    %cl,%eax
shr    $0x8,%eax
ret

LLVM IR (-O0):
define zeroext i8 @getByte(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = lshr i32 %7, 3
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %6, i64 %9
store i8* %10, i8** %5
%11 = load i8*, i8** %5
%12 = getelementptr inbounds i8, i8* %11, i64 0
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = load i32, i32* %4
%16 = and i32 %15, 7
%17 = shl i32 %14, %16
%18 = load i8*, i8** %5
%19 = getelementptr inbounds i8, i8* %18, i64 1
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = load i32, i32* %4
%23 = and i32 %22, 7
%24 = sub i32 8, %23
%25 = ashr i32 %21, %24
%26 = or i32 %17, %25
%27 = trunc i32 %26 to i8
ret i8 %27
}

LLVM IR (-O2):
define zeroext i8 @getByte(i8* nocapture %0, i32 %1) {
%3 = lshr i32 %1, 3
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = load i8, i8* %7
%9 = trunc i32 %1 to i8
%10 = tail call i8 @llvm.fshl.i8(i8 %6, i8 %8, i8 %9)
ret i8 %10
}
/* Variables and functions */
unsigned char dxl_read_byte(unsigned char, int);
unsigned char getStatusReturnLevel(unsigned char id) {
  return dxl_read_byte(id, (16));
}


x86 assembly (clang, -O0):
<getStatusReturnLevel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x10,%esi
movzbl -0x1(%rbp),%edi
call   1030 <dxl_read_byte@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getStatusReturnLevel>:
mov    $0x10,%esi
jmp    1030 <dxl_read_byte@plt>

LLVM IR (-O0):
define zeroext i8 @getStatusReturnLevel(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call zeroext i8 @dxl_read_byte(i8 zeroext %3, i32 16)
ret i8 %4
}

LLVM IR (-O2):
define zeroext i8 @getStatusReturnLevel(i8 zeroext %0) {
%2 = tail call zeroext i8 @dxl_read_byte(i8 zeroext %0, i32 16)
ret i8 %2
}
/* Variables and functions */
char *strdup(const char *str) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @strdup(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
double aster(double, double, int);
int moi(int, int);
int main() {
  float color = aster(0.5, 0.2, 1) * 3.14159265;
  return moi(1, 2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed1(%rip),%xmm0
movsd  0xed1(%rip),%xmm1
mov    $0x1,%edi
call   1030 <aster@plt>
movsd  0xeaf(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
call   1040 <moi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
movsd  0xed7(%rip),%xmm1
mov    $0x1,%edi
call   1030 <aster@plt>
mov    $0x1,%edi
mov    $0x2,%esi
pop    %rax
jmp    1040 <moi@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call double @aster(double 5.000000e-01, double 2.000000e-01, i32 1)
%4 = fmul double %3, 0x400921FB53C8D4F1
%5 = fptrunc double %4 to float
store float %5, float* %2
%6 = call i32 @moi(i32 1, i32 2)
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call double @aster(double 5.000000e-01, double 2.000000e-01, i32 1)
%2 = tail call i32 @moi(i32 1, i32 2)
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef size_t uint16_t;

/* Variables and functions */
void zero(uint8_t *b, uint16_t len) {
  while (len--)
    b[len] = 0;
}


x86 assembly (clang, -O0):
<zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
je     113a <zero+0x3a>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
jmp    110c <zero+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero>:
test   %rsi,%rsi
je     1128 <zero+0x18>
push   %rax
mov    %rsi,%rdx
shl    $0x3,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @zero(i64* nocapture writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = bitcast i64* %0 to i8*
%6 = shl nuw i64 %1, 3
br label %7
7: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check();
int /*<<< orphan*/ exec();
int /*<<< orphan*/ exit(int);
scalar_t__ geteuid();
int /*<<< orphan*/ printf(char *);
int main() {
  if (geteuid()) {
    printf("You need to be uid 0\n");
    exit(1);
  }
  check();
  exec();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <geteuid@plt>
cmp    $0x0,%rax
je     1186 <main+0x36>
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    $0x0,%al
call   1050 <check@plt>
mov    $0x0,%al
call   1070 <exec@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <geteuid@plt>
test   %rax,%rax
jne    116f <main+0x1f>
xor    %eax,%eax
call   1050 <check@plt>
xor    %eax,%eax
call   1070 <exec@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xe8a(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"You need to be uid 0\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @geteuid()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @exit(i32 1)
unreachable
7: ; preds = %0
%8 = call i32 (...) @check()
%9 = call i32 (...) @exec()
ret i32 0
}

LLVM IR (-O2):
@str = [21 x i8] c"You need to be uid 0\00"
define i32 @main() {
%1 = tail call i64 (...) @geteuid()
%2 = icmp eq i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %0
%7 = tail call i32 (...) @check()
%8 = tail call i32 (...) @exec()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cofs_dump_cache();
int main() { cofs_dump_cache(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @cofs_dump_cache()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @cofs_dump_cache()
ret i32 0
}