xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int nl_sendgetaddr_do(int, int /*<<< orphan*/, int /*<<< orphan*/, int,
                      int /*<<< orphan*/, int /*<<< orphan*/);
int nl_sendgetaddr(int fd, uint32_t seq, uint32_t ifindex) {
  return nl_sendgetaddr_do(fd, seq, ifindex, 1, 0, 0);
}


x86 assembly (clang, -O0):
<nl_sendgetaddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    $0x1,%ecx
xor    %r9d,%r9d
mov    %r9d,%r8d
call   1030 <nl_sendgetaddr_do@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nl_sendgetaddr>:
mov    $0x1,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <nl_sendgetaddr_do@plt>

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

LLVM IR (-O2):
define i32 @nl_sendgetaddr(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @nl_sendgetaddr_do(i32 %0, i32 %1, i32 %2, i32 1, i32 0, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char, unsigned char, unsigned char);
int main(void) {
  unsigned char a = 45;
  unsigned char b = 250;
  unsigned char c = 0;
  c = a - b;
  printf("unsigned version: %d - %d = %d\n", a, b, c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x2d,-0x5(%rbp)
movb   $0xfa,-0x6(%rbp)
movb   $0x0,-0x7(%rbp)
movzbl -0x5(%rbp),%eax
movzbl -0x6(%rbp),%ecx
sub    %ecx,%eax
mov    %al,-0x7(%rbp)
mov    -0x5(%rbp),%cl
mov    -0x6(%rbp),%al
lea    0xebb(%rip),%rdi
movzbl %cl,%esi
movzbl %al,%edx
movzbl -0x7(%rbp),%ecx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x2d,%esi
mov    $0xfa,%edx
mov    $0x33,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"unsigned version: %d - %d = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
store i32 0, i32* %1
store i8 45, i8* %2
store i8 -6, i8* %3
store i8 0, i8* %4
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = load i8, i8* %3
%8 = zext i8 %7 to i32
%9 = sub nsw i32 %6, %8
%10 = trunc i32 %9 to i8
store i8 %10, i8* %4
%11 = load i8, i8* %2
%12 = load i8, i8* %3
%13 = load i8, i8* %4
%14 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8 zeroext %11, i8 zeroext %12, i8 zeroext %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"unsigned version: %d - %d = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8 zeroext 45, i8 zeroext -6, i8 zeroext 51)
ret i32 0
}
/* Type definitions */
struct timespec {
  unsigned long long tv_sec;
  unsigned long long tv_nsec;
};
typedef int /*<<< orphan*/ clockid_t;

/* Variables and functions */
scalar_t__ clock_gettime(int /*<<< orphan*/, struct timespec *);
int /*<<< orphan*/ perror(char *);
unsigned long long getcputime(clockid_t clk_id) {
  struct timespec ts;
  if (clock_gettime(clk_id, &ts))
    perror("clock_gettime() error:");
  return ts.tv_sec * 1000000000ULL + ts.tv_nsec;
}


x86 assembly (clang, -O0):
<getcputime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
call   1030 <clock_gettime@plt>
cmp    $0x0,%rax
je     114d <getcputime+0x2d>
lea    0xeb8(%rip),%rdi
call   1040 <perror@plt>
imul   $0x3b9aca00,-0x18(%rbp),%rax
3b
add    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getcputime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
test   %rax,%rax
jne    1146 <getcputime+0x26>
imul   $0x3b9aca00,0x8(%rsp),%rax
9a 3b
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret
lea    0xeb3(%rip),%rdi
call   1040 <perror@plt>
jmp    1133 <getcputime+0x13>

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@.str = [23 x i8] c"clock_gettime() error:\00"
define i64 @getcputime(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @clock_gettime(i32 %4, %struct.timespec* %3)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%11 = load i64, i64* %10
%12 = mul i64 %11, 1000000000
%13 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%14 = load i64, i64* %13
%15 = add i64 %12, %14
ret i64 %15
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@.str = [23 x i8] c"clock_gettime() error:\00"
define i64 @getcputime(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = call i64 @clock_gettime(i32 %0, %struct.timespec* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
%10 = load i64, i64* %9
%11 = mul i64 %10, 1000000000
%12 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
%13 = load i64, i64* %12
%14 = add i64 %11, %13
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, size_t);
size_t pbl_memlcpy(void *to, size_t tolen, void *from, size_t n) {
  size_t l = n > tolen ? tolen : n;
  memcpy(to, from, l);
  return (l);
}


x86 assembly (clang, -O0):
<pbl_memlcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    1143 <pbl_memlcpy+0x33>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    114b <pbl_memlcpy+0x3b>
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pbl_memlcpy>:
push   %rbx
mov    %rcx,%rbx
cmp    %rsi,%rcx
cmova  %rsi,%rbx
mov    %rdx,%rsi
mov    %rbx,%rdx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @pbl_memlcpy(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%10 = load i64, i64* %8
%11 = load i64, i64* %6
%12 = icmp ugt i64 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %4
%14 = load i64, i64* %6
br label %17
15: ; preds = %4
%16 = load i64, i64* %8
br label %17
17: ; preds = %15, %13
%18 = phi i64 [ %14, %13 ], [ %16, %15 ]
store i64 %18, i64* %9
%19 = load i8*, i8** %5
%20 = load i8*, i8** %7
%21 = load i64, i64* %9
%22 = call i32 @memcpy(i8* %19, i8* %20, i64 %21)
%23 = load i64, i64* %9
ret i64 %23
}

LLVM IR (-O2):
define i64 @pbl_memlcpy(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = icmp ugt i64 %3, %1
%6 = select i1 %5, i64 %1, i64 %3
%7 = tail call i32 @memcpy(i8* %0, i8* %2, i64 %6)
ret i64 %6
}
/* Type definitions */
struct timeval {
  int tv_sec;
  long tv_usec;
};

/* Variables and functions */
long timeval_to_usec(struct timeval tm) {
  return tm.tv_sec * 1000000 + tm.tv_usec;
}


x86 assembly (clang, -O0):
<timeval_to_usec>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
imul   $0xf4240,-0x10(%rbp),%eax
cltq
add    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timeval_to_usec>:
imul   $0xf4240,%edi,%eax
cltq
add    %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @timeval_to_usec(i32 %0, i64 %1) {
%3 = mul nsw i32 %0, 1000000
%4 = sext i32 %3 to i64
%5 = add nsw i64 %4, %1
ret i64 %5
}
/* Variables and functions */
int fonction(int);
int main(void) { return (fonction(1)); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @fonction(i32 1)
ret i32 %1
}
/* Variables and functions */
int *getNullIfNonNull(void *);
void testKnownPath(void *input) {
  if (!input)
    return;
  int *casted = getNullIfNonNull(input);
  *casted = 1;
}


x86 assembly (clang, -O0):
<testKnownPath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <testKnownPath+0x1c>
jmp    1143 <testKnownPath+0x33>
mov    -0x8(%rbp),%rdi
call   1030 <getNullIfNonNull@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testKnownPath>:
test   %rdi,%rdi
je     1125 <testKnownPath+0x15>
push   %rax
call   1030 <getNullIfNonNull@plt>
movl   $0x1,(%rax)
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @testKnownPath(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32* @getNullIfNonNull(i8* %0)
store i32 1, i32* %4
br label %5
5: ; preds = %1, %3
ret void
}
/* Variables and functions */
scalar_t__ strtol(char *, int /*<<< orphan*/ *, int);
int AtoiHex(char *string) {
  if (string != NULL && *string != '\0') {
    int val = (int)strtol(string, NULL, 16);
    return (val);
  }
  return (-1);
}


x86 assembly (clang, -O0):
<AtoiHex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1157 <AtoiHex+0x47>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1157 <AtoiHex+0x47>
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   1030 <strtol@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115e <AtoiHex+0x4e>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AtoiHex>:
push   %rax
mov    $0xffffffff,%eax
test   %rdi,%rdi
je     112c <AtoiHex+0x1c>
cmpb   $0x0,(%rdi)
je     112c <AtoiHex+0x1c>
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <strtol@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @AtoiHex(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i64 @strtol(i8* nocapture %0, i32* null, i32 16)
%8 = trunc i64 %7 to i32
br label %9
9: ; preds = %1, %3, %6
%10 = phi i32 [ %8, %6 ], [ -1, %3 ], [ -1, %1 ]
ret i32 %10
}
/* Variables and functions */
int check_regex(char const *, char const *);
int check_valid_integer(const char *integer) {
  const char *integer_er = "^[0-9]{1,4}\\d+*$";
  return check_regex(integer_er, integer);
}


x86 assembly (clang, -O0):
<check_valid_integer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <check_regex@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_valid_integer>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <check_regex@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"^[0-9]{1,4}\\d+*$\00"
define i32 @check_valid_integer(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %3
%5 = load i8*, i8** %2
%6 = call i32 @check_regex(i8* %4, i8* %5)
ret i32 %6
}

LLVM IR (-O2):
@.str = [17 x i8] c"^[0-9]{1,4}\\d+*$\00"
define i32 @check_valid_integer(i8* %0) {
%2 = tail call i32 @check_regex(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *, int, int);
int /*<<< orphan*/ output_w32(int);
void emit_fabsd(int s, int d) {
  assem_debug("fabsd s%d,d%d\n", d, s);
  output_w32(0xeeb00bc0 | ((d & 7) << 12) | (s & 7));
}


x86 assembly (clang, -O0):
<emit_fabsd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xec5(%rip),%rdi
call   1030 <assem_debug@plt>
mov    -0x8(%rbp),%edi
and    $0x7,%edi
shl    $0xc,%edi
or     $0xeeb00bc0,%edi
mov    -0x4(%rbp),%eax
and    $0x7,%eax
or     %eax,%edi
call   1040 <output_w32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_fabsd>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%r14d
lea    0xed0(%rip),%rdi
mov    %r14d,%edx
call   1030 <assem_debug@plt>
and    $0x7,%ebx
shl    $0xc,%ebx
and    $0x7,%r14d
lea    (%r14,%rbx,1),%edi
add    $0xeeb00bc0,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <output_w32@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"fabsd s%d,d%d\0A\00"
define void @emit_fabsd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @assem_debug(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* %4
%9 = and i32 %8, 7
%10 = shl i32 %9, 12
%11 = or i32 -290452544, %10
%12 = load i32, i32* %3
%13 = and i32 %12, 7
%14 = or i32 %11, %13
%15 = call i32 @output_w32(i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"fabsd s%d,d%d\0A\00"
define void @emit_fabsd(i32 %0, i32 %1) {
%3 = tail call i32 @assem_debug(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
%4 = shl i32 %1, 12
%5 = and i32 %4, 28672
%6 = and i32 %0, 7
%7 = or i32 %6, %5
%8 = or i32 %7, -290452544
%9 = tail call i32 @output_w32(i32 %8)
ret void
}
/* Variables and functions */
void maskfloat(float *in, unsigned char *mask, size_t size, float maskvalue) {
  unsigned char *f;
  f = mask + size;
  do {
    if (*mask)
      *in = maskvalue;
    in++;
  } while (++mask < f);
}


x86 assembly (clang, -O0):
<maskfloat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movss  %xmm0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     113b <maskfloat+0x3b>
movss  -0x1c(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
cmp    -0x28(%rbp),%rax
jb     1121 <maskfloat+0x21>
pop    %rbp
ret

x86 assembly (clang, -O2):
<maskfloat>:
add    %rsi,%rdx
jmp    111d <maskfloat+0x1d>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x4,%rdi
add    $0x1,%rsi
cmp    %rdx,%rsi
jae    1128 <maskfloat+0x28>
cmpb   $0x0,(%rsi)
je     1110 <maskfloat+0x10>
movss  %xmm0,(%rdi)
jmp    1110 <maskfloat+0x10>
ret

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

LLVM IR (-O2):
define void @maskfloat(float* nocapture writeonly %0, i8* %1, i64 %2, float %3) {
%5 = getelementptr inbounds i8, i8* %1, i64 %2
br label %6
6: ; preds = %12, %4
%7 = phi i8* [ %1, %4 ], [ %14, %12 ]
%8 = phi float* [ %0, %4 ], [ %13, %12 ]
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %12, label %11
11: ; preds = %6
store float %3, float* %8
br label %12
12: ; preds = %11, %6
%13 = getelementptr inbounds float, float* %8, i64 1
%14 = getelementptr inbounds i8, i8* %7, i64 1
%15 = icmp ult i8* %14, %5
br i1 %15, label %6, label %16
16: ; preds = %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ transformPointXyinto(double, double, int *);
int transformPointinto(int srcPoint, int dstPoint) {
  transformPointXyinto(((double)((((int *)srcPoint))[0])),
                       ((double)((((int *)srcPoint))[1])), ((int *)dstPoint));
}


x86 assembly (clang, -O0):
<transformPointinto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0x8(%rbp),%rax
cvtsi2sdl (%rax),%xmm0
movslq -0x8(%rbp),%rax
cvtsi2sdl 0x4(%rax),%xmm1
movslq -0xc(%rbp),%rdi
call   1030 <transformPointXyinto@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<transformPointinto>:
movslq %edi,%rax
cvtsi2sdl (%rax),%xmm0
cvtsi2sdl 0x4(%rax),%xmm1
movslq %esi,%rdi
jmp    1030 <transformPointXyinto@plt>

LLVM IR (-O0):
define i32 @transformPointinto(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = sitofp i32 %10 to double
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i32*
%15 = getelementptr inbounds i32, i32* %14, i64 1
%16 = load i32, i32* %15
%17 = sitofp i32 %16 to double
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = inttoptr i64 %19 to i32*
%21 = call i32 @transformPointXyinto(double %11, double %17, i32* %20)
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @transformPointinto(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load i32, i32* %4
%6 = sitofp i32 %5 to double
%7 = getelementptr inbounds i32, i32* %4, i64 1
%8 = load i32, i32* %7
%9 = sitofp i32 %8 to double
%10 = sext i32 %1 to i64
%11 = inttoptr i64 %10 to i32*
%12 = tail call i32 @transformPointXyinto(double %6, double %9, i32* %11)
ret i32 undef
}
void EVP_CipherFinal_ex(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_CipherFinal_ex() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x25() {
  Assert_real((isbdigit(37) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              190, ("isbdigit should be 0 for %"));
}


x86 assembly (clang, -O0):
<t_isbdigit_0x25>:
push   %rbp
mov    %rsp,%rbp
mov    $0x25,%edi
call   1040 <isbdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0xbe,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isbdigit_0x25>:
push   %rax
mov    $0x25,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0xbe,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for %\00"
define void @t_isbdigit_0x25() {
%1 = call i64 @isbdigit(i32 37)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 190, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for %\00"
define void @t_isbdigit_0x25() {
%1 = tail call i64 @isbdigit(i32 37)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 190, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int pathconN_nm3_n_in(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @pathconN_nm3_n_in() {
ret i32 1
}

LLVM IR (-O2):
define i32 @pathconN_nm3_n_in() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void test1(double *a, int n) {
  int i;
  for (i = 0; i < n; i++) {
    printf("%f\n", a[i]);
  }
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <test1+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <test1+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1147 <test1+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsd  (%r15,%rbx,8),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <test1+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define void @test1(double* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds double, double* %0, i64 %7
%9 = load double, double* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(unsigned int);
void mov_reg32_m32(unsigned int reg32, unsigned int *m32) {
  put8(0x8B);
  put8((reg32 << 3) | 5);
  put32((unsigned int)(m32));
}


x86 assembly (clang, -O0):
<mov_reg32_m32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x8b,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     $0x5,%edi
call   1030 <put8@plt>
mov    -0x10(%rbp),%rax
mov    %eax,%edi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mov_reg32_m32>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
mov    $0x8b,%edi
call   1030 <put8@plt>
lea    0x5(,%rbx,8),%edi
call   1030 <put8@plt>
mov    %r14d,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @mov_reg32_m32(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = call i32 @put8(i32 139)
%6 = load i32, i32* %3
%7 = shl i32 %6, 3
%8 = or i32 %7, 5
%9 = call i32 @put8(i32 %8)
%10 = load i32*, i32** %4
%11 = ptrtoint i32* %10 to i32
%12 = call i32 @put32(i32 %11)
ret void
}

LLVM IR (-O2):
define void @mov_reg32_m32(i32 %0, i32* %1) {
%3 = tail call i32 @put8(i32 139)
%4 = shl i32 %0, 3
%5 = or i32 %4, 5
%6 = tail call i32 @put8(i32 %5)
%7 = ptrtoint i32* %1 to i64
%8 = trunc i64 %7 to i32
%9 = tail call i32 @put32(i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ form_output_submit_button(char *, char *,
                                             int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void validation_form_output_trailer(void) {
  printf("<tr><td>");
  form_output_submit_button((char *)0, "Validate", 0);
  printf("</table></form>\n");
}


x86 assembly (clang, -O0):
<validation_form_output_trailer>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
lea    0xece(%rip),%rsi
xor    %edx,%edx
call   1030 <form_output_submit_button@plt>
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<validation_form_output_trailer>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <printf@plt>
lea    0xec5(%rip),%rsi
xor    %edi,%edi
xor    %edx,%edx
call   1030 <form_output_submit_button@plt>
lea    0xebe(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"<tr><td>\00"
@.str.1 = [9 x i8] c"Validate\00"
@.str.2 = [17 x i8] c"</table></form>\0A\00"
define void @validation_form_output_trailer() {
%1 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @form_output_submit_button(i8* null, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 0)
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"<tr><td>\00"
@.str.1 = [9 x i8] c"Validate\00"
@str = [16 x i8] c"</table></form>\00"
define void @validation_form_output_trailer() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @form_output_submit_button(i8* null, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int foo(int *const p __attribute__((pass_object_size(0))), int n) {
  int x = (p)[n];
  {
    int **p = &p;
    x = *p[n];
  }
  return x;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x18(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movslq %edx,%rax
lea    -0x8(%rsp),%rcx
mov    %rcx,-0x8(%rsp)
mov    -0x8(%rsp,%rax,8),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
define i32 @foo(i32* %0, i64 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32**
store i32* %0, i32** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%9 = load i32*, i32** %4
%10 = load i32, i32* %6
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %9, i64 %11
%13 = load i32, i32* %12
store i32 %13, i32* %7
%14 = bitcast i32*** %8 to i32**
store i32** %14, i32*** %8
%15 = load i32**, i32*** %8
%16 = load i32, i32* %6
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32*, i32** %15, i64 %17
%19 = load i32*, i32** %18
%20 = load i32, i32* %19
store i32 %20, i32* %7
%21 = load i32, i32* %7
ret i32 %21
}

LLVM IR (-O2):
define i32 @foo(i32* nocapture readnone %0, i64 %1, i32 %2) {
%4 = alloca i32**
%5 = sext i32 %2 to i64
%6 = bitcast i32*** %4 to i8*
%7 = bitcast i32*** %4 to i32****
store i32*** %4, i32**** %7
%8 = getelementptr inbounds i32**, i32*** %4, i64 %5
%9 = bitcast i32*** %8 to i32**
%10 = load i32*, i32** %9
%11 = load i32, i32* %10
ret i32 %11
}
void Injector1ISR() {}


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

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

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

LLVM IR (-O2):
define void @Injector1ISR() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int main() {
  if ('\1' < 0)
    abort();
  if ('\234a' != '\234a')
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
struct node *map_nil() {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.node = type opaque
define %struct.node* @map_nil() {
ret %struct.node* null
}

LLVM IR (-O2):
%struct.node = type opaque
define noalias %struct.node* @map_nil() {
ret %struct.node* null
}
/* Variables and functions */
unsigned long hiBit(unsigned long);
unsigned long loBits(unsigned long);
unsigned long mixBits(unsigned long u, unsigned long v) {
  return hiBit(u) | loBits(v);
}


x86 assembly (clang, -O0):
<mixBits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <hiBit@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <loBits@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
or     %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mixBits>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1030 <hiBit@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <loBits@plt>
or     %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @mixBits(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = call i64 @hiBit(i64 %5)
%7 = load i64, i64* %4
%8 = call i64 @loBits(i64 %7)
%9 = or i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @mixBits(i64 %0, i64 %1) {
%3 = tail call i64 @hiBit(i64 %0)
%4 = tail call i64 @loBits(i64 %1)
%5 = or i64 %4, %3
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ __test_print_vasp(unsigned int);
void test_print_vasp_monolayer() { __test_print_vasp((unsigned)1); }


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

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

LLVM IR (-O0):
define void @test_print_vasp_monolayer() {
%1 = call i32 @__test_print_vasp(i32 1)
ret void
}

LLVM IR (-O2):
define void @test_print_vasp_monolayer() {
%1 = tail call i32 @__test_print_vasp(i32 1)
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int random_uint64_t();
uint64_t random_uint64_t_fewbits() {
  return random_uint64_t() & random_uint64_t() & random_uint64_t();
}


x86 assembly (clang, -O0):
<random_uint64_t_fewbits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <random_uint64_t@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <random_uint64_t@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <random_uint64_t@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
and    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_uint64_t_fewbits>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <random_uint64_t@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <random_uint64_t@plt>
mov    %eax,%ebp
and    %ebx,%ebp
xor    %eax,%eax
call   1030 <random_uint64_t@plt>
and    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @random_uint64_t_fewbits() {
%1 = call i32 (...) @random_uint64_t()
%2 = call i32 (...) @random_uint64_t()
%3 = and i32 %1, %2
%4 = call i32 (...) @random_uint64_t()
%5 = and i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @random_uint64_t_fewbits() {
%1 = tail call i32 (...) @random_uint64_t()
%2 = tail call i32 (...) @random_uint64_t()
%3 = and i32 %2, %1
%4 = tail call i32 (...) @random_uint64_t()
%5 = and i32 %3, %4
ret i32 %5
}
int abs(int n) { return (n >= 0) ? n : -n; }


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

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

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

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
void foo646(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo646(i32 %0) {
ret void
}
int test08(char a) { return ((a & 1) == 0) ? 0x7FFFFFFF : 0x80000000; }


x86 assembly (clang, -O0):
<test08>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x1,%edx
mov    $0x80000000,%eax
mov    $0x7fffffff,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test08>:
and    $0x1,%edi
lea    0x7fffffff(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @test08(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 2147483647, i32 -2147483648
ret i32 %8
}

LLVM IR (-O2):
define i32 @test08(i8 signext %0) {
%2 = and i8 %0, 1
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 2147483647, i32 -2147483648
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ clone(int /*<<< orphan*/);
int /*<<< orphan*/ dpeek();
int /*<<< orphan*/ drepl(int /*<<< orphan*/);
void primitive_clone_impl(void) { drepl(clone(dpeek())); }


x86 assembly (clang, -O0):
<primitive_clone_impl>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <dpeek@plt>
mov    %eax,%edi
call   1040 <clone@plt>
mov    %eax,%edi
call   1050 <drepl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<primitive_clone_impl>:
push   %rax
xor    %eax,%eax
call   1030 <dpeek@plt>
mov    %eax,%edi
call   1040 <clone@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <drepl@plt>

LLVM IR (-O0):
define void @primitive_clone_impl() {
%1 = call i32 (...) @dpeek()
%2 = call i32 @clone(i32 %1)
%3 = call i32 @drepl(i32 %2)
ret void
}

LLVM IR (-O2):
define void @primitive_clone_impl() {
%1 = tail call i32 (...) @dpeek()
%2 = tail call i32 @clone(i32 %1)
%3 = tail call i32 @drepl(i32 %2)
ret void
}
/* Variables and functions */
int set_bit(int /*<<< orphan*/, int);
int test_set_bit() { return 0b1000 == set_bit(0, 3); }


x86 assembly (clang, -O0):
<test_set_bit>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x3,%esi
call   1030 <set_bit@plt>
mov    %eax,%ecx
mov    $0x8,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_set_bit>:
push   %rax
xor    %edi,%edi
mov    $0x3,%esi
call   1030 <set_bit@plt>
xor    %ecx,%ecx
cmp    $0x8,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test_set_bit() {
%1 = call i32 @set_bit(i32 0, i32 3)
%2 = icmp eq i32 8, %1
%3 = zext i1 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @test_set_bit() {
%1 = tail call i32 @set_bit(i32 0, i32 3)
%2 = icmp eq i32 %1, 8
%3 = zext i1 %2 to i32
ret i32 %3
}
int mvpmod_stop_audit(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @mvpmod_stop_audit() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void err_syntax10_error(const char *s) { printf("%s\n", s); }


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

x86 assembly (clang, -O2):
<err_syntax10_error>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

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

/* Variables and functions */
int /*<<< orphan*/ fread(char *, int, int, int /*<<< orphan*/ *);
int get_2(int /*<<< orphan*/ *);
scalar_t__ malloc(int);
char *get_str_16(FILE *fp) {
  char *s;
  int len = get_2(fp) + 1;
  s = (char *)malloc(len + 1);
  if (s != NULL) {
    fread(s, 1, len, fp);
    s[len] = '\0';
  }
  return s;
}


x86 assembly (clang, -O0):
<get_str_16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get_2@plt>
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
add    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1186 <get_str_16+0x56>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fread@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_str_16>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <get_2@plt>
mov    %eax,%r15d
lea    0x2(%r15),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1170 <get_str_16+0x40>
movslq %r15d,%r15
add    $0x1,%r15
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %r15d,%edx
mov    %r14,%rcx
call   1040 <fread@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @get_str_16(i32* %0) {
%2 = tail call i32 @get_2(i32* %0)
%3 = add nsw i32 %2, 1
%4 = add nsw i32 %2, 2
%5 = tail call i64 @malloc(i32 %4)
%6 = inttoptr i64 %5 to i8*
%7 = icmp eq i64 %5, 0
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = tail call i32 @fread(i8* %6, i32 1, i32 %3, i32* %0)
%10 = sext i32 %3 to i64
%11 = getelementptr inbounds i8, i8* %6, i64 %10
store i8 0, i8* %11
br label %12
12: ; preds = %8, %1
ret i8* %6
}
char make_c_str(p)
char *p;
{
  char rtn;
  rtn = *p;
  if (rtn)
    *p = 0;
  return rtn;
}


x86 assembly (clang, -O0):
<make_c_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
cmpb   $0x0,-0x9(%rbp)
je     1122 <make_c_str+0x22>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
movsbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_c_str>:
mov    (%rdi),%al
test   %al,%al
je     1109 <make_c_str+0x9>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define signext i8 @make_c_str(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 0, i8* %0
br label %5
5: ; preds = %4, %1
ret i8 %2
}
/* Variables and functions */
double sin(double);
double intr_wrap_059(double p1) { return sin(p1); }


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

x86 assembly (clang, -O2):
<intr_wrap_059>:
jmp    1030 <sin@plt>

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

LLVM IR (-O2):
define double @intr_wrap_059(double %0) {
%2 = tail call double @sin(double %0)
ret double %2
}
/* Variables and functions */
float M_PI;
float el_areaf(float semiMajor, float semiMinor) {
  return M_PI * semiMajor * semiMinor;
}


x86 assembly (clang, -O0):
<el_areaf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    0x2ed3(%rip),%rax
movss  (%rax),%xmm0
mulss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<el_areaf>:
mov    0x2ee1(%rip),%rax
mulss  (%rax),%xmm0
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
@M_PI = global float 0.000000e+00
define float @el_areaf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* @M_PI
%6 = load float, float* %3
%7 = fmul float %5, %6
%8 = load float, float* %4
%9 = fmul float %7, %8
ret float %9
}

LLVM IR (-O2):
@M_PI = global float 0.000000e+00
define float @el_areaf(float %0, float %1) {
%3 = load float, float* @M_PI
%4 = fmul float %3, %0
%5 = fmul float %4, %1
ret float %5
}
float square(float f) { return f * f; }


x86 assembly (clang, -O0):
<square>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<square>:
mulss  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @square(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fmul float %3, %4
ret float %5
}

LLVM IR (-O2):
define float @square(float %0) {
%2 = fmul float %0, %0
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ MIPS_SET_BIT(int, int);
void xburst_cgm_lpcr_pd_scpu_down() { MIPS_SET_BIT((0xB0000000 + 0x4), 31); }


x86 assembly (clang, -O0):
<xburst_cgm_lpcr_pd_scpu_down>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb0000004,%edi
mov    $0x1f,%esi
call   1030 <MIPS_SET_BIT@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<xburst_cgm_lpcr_pd_scpu_down>:
mov    $0xb0000004,%edi
mov    $0x1f,%esi
jmp    1030 <MIPS_SET_BIT@plt>

LLVM IR (-O0):
define void @xburst_cgm_lpcr_pd_scpu_down() {
%1 = call i32 @MIPS_SET_BIT(i32 -1342177276, i32 31)
ret void
}

LLVM IR (-O2):
define void @xburst_cgm_lpcr_pd_scpu_down() {
%1 = tail call i32 @MIPS_SET_BIT(i32 -1342177276, i32 31)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void terminate_device(void) {
  printf("Performing low level device termination...\n");
}


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

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

LLVM IR (-O0):
@.str = [44 x i8] c"Performing low level device termination...\0A\00"
define void @terminate_device() {
%1 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [43 x i8] c"Performing low level device termination...\00"
define void @terminate_device() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
ret void
}