xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int readInt() {
  int n;
  scanf("%d", &n);
  return n;
}


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

x86 assembly (clang, -O2):
<readInt>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @readInt() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int /*<<< orphan*/ readBytes(int /*<<< orphan*/, int /*<<< orphan*/, int,
                             int /*<<< orphan*/ *);
int8_t readByte(uint8_t devAddr, uint8_t regAddr, uint8_t *data) {
  return readBytes(devAddr, regAddr, 1, data);
}


x86 assembly (clang, -O0):
<readByte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rcx
mov    $0x1,%edx
call   1030 <readBytes@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readByte>:
mov    %rdx,%rcx
mov    $0x1,%edx
jmp    1030 <readBytes@plt>

LLVM IR (-O0):
define i32 @readByte(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 @readBytes(i32 %7, i32 %8, i32 1, i32* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @readByte(i32 %0, i32 %1, i32* %2) {
%4 = tail call i32 @readBytes(i32 %0, i32 %1, i32 1, i32* %2)
ret i32 %4
}
/* Variables and functions */
char *malloc(size_t);
void allocate(char **array, size_t size) { *array = malloc(size); }


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

x86 assembly (clang, -O2):
<allocate>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <malloc@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @allocate(i8** nocapture writeonly %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
store i8* %3, i8** %0
ret void
}
/* Variables and functions */
int create_file(char *, int);
int mfs_create_dir(char *newdir) { return create_file(newdir, 2); }


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

x86 assembly (clang, -O2):
<mfs_create_dir>:
mov    $0x2,%esi
jmp    1030 <create_file@plt>

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

LLVM IR (-O2):
define i32 @mfs_create_dir(i8* %0) {
%2 = tail call i32 @create_file(i8* %0, i32 2)
ret i32 %2
}
int myEqualChar(void *a, void *b) {
  char *aa = (char *)a;
  char *bb = (char *)b;
  return *aa = *bb;
}


x86 assembly (clang, -O0):
<myEqualChar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %al,(%rcx)
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<myEqualChar>:
movsbl (%rsi),%eax
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define i32 @myEqualChar(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
store i8 %3, i8* %0
%4 = sext i8 %3 to i32
ret i32 %4
}
/* Type definitions */
struct msghdr {
  int dummy;
};
typedef int ssize_t;

/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
int sendmsg(int, struct msghdr const *, int);
void Wsendmsg(int s, struct msghdr const *msg, int flags) {
  ssize_t res;
retry:
  res = sendmsg(s, msg, flags);
  if (res == -1) {
    if (errno == EINTR)
      goto retry;
  }
}


x86 assembly (clang, -O0):
<Wsendmsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <sendmsg@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
jne    1162 <Wsendmsg+0x52>
mov    0x2e9b(%rip),%rax
mov    (%rax),%rax
mov    0x2e89(%rip),%rcx
cmp    (%rcx),%rax
jne    115d <Wsendmsg+0x4d>
jmp    1122 <Wsendmsg+0x12>
jmp    1162 <Wsendmsg+0x52>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Wsendmsg>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb9(%rip),%r15
mov    0x2eaa(%rip),%r12
xchg   %ax,%ax
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <sendmsg@plt>
cmp    $0xffffffff,%eax
jne    114b <Wsendmsg+0x3b>
mov    (%r15),%rax
cmp    (%r12),%rax
je     1130 <Wsendmsg+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.msghdr = type { i32 }
@errno = global i64 0
@EINTR = global i64 0
define void @Wsendmsg(i32 %0, %struct.msghdr* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.msghdr*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store %struct.msghdr* %1, %struct.msghdr** %5
store i32 %2, i32* %6
br label %8
8: ; preds = %19, %3
%9 = load i32, i32* %4
%10 = load %struct.msghdr*, %struct.msghdr** %5
%11 = load i32, i32* %6
%12 = call i32 @sendmsg(i32 %9, %struct.msghdr* %10, i32 %11)
store i32 %12, i32* %7
%13 = load i32, i32* %7
%14 = icmp eq i32 %13, -1
br i1 %14, label %15, label %21
15: ; preds = %8
%16 = load i64, i64* @errno
%17 = load i64, i64* @EINTR
%18 = icmp eq i64 %16, %17
br i1 %18, label %19, label %20
19: ; preds = %15
br label %8
20: ; preds = %15
br label %21
21: ; preds = %20, %8
ret void
}

LLVM IR (-O2):
%struct.msghdr = type { i32 }
@errno = global i64 0
@EINTR = global i64 0
define void @Wsendmsg(i32 %0, %struct.msghdr* %1, i32 %2) {
br label %4
4: ; preds = %7, %3
%5 = tail call i32 @sendmsg(i32 %0, %struct.msghdr* %1, i32 %2)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = load i64, i64* @errno
%9 = load i64, i64* @EINTR
%10 = icmp eq i64 %8, %9
br i1 %10, label %4, label %11
11: ; preds = %7, %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIGALRM;
int /*<<< orphan*/ SIGHUP;
int /*<<< orphan*/ SIG_BLOCK;
int /*<<< orphan*/ sigaddset(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int /*<<< orphan*/ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *);
void BlockSignals() {
  sigset_t ss;
  sigemptyset(&ss);
  sigaddset(&ss, SIGHUP);
  sigaddset(&ss, SIGALRM);
  sigprocmask(SIG_BLOCK, &ss, NULL);
}


x86 assembly (clang, -O0):
<BlockSignals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <sigemptyset@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
lea    -0x4(%rbp),%rdi
call   1050 <sigaddset@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%esi
lea    -0x4(%rbp),%rdi
call   1050 <sigaddset@plt>
mov    0x2e64(%rip),%rax
mov    (%rax),%edi
lea    -0x4(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigprocmask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BlockSignals>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <sigemptyset@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1050 <sigaddset@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1050 <sigaddset@plt>
mov    0x2e65(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@SIGHUP = global i32 0
@SIGALRM = global i32 0
@SIG_BLOCK = global i32 0
define void @BlockSignals() {
%1 = alloca i32
%2 = call i32 @sigemptyset(i32* %1)
%3 = load i32, i32* @SIGHUP
%4 = call i32 @sigaddset(i32* %1, i32 %3)
%5 = load i32, i32* @SIGALRM
%6 = call i32 @sigaddset(i32* %1, i32 %5)
%7 = load i32, i32* @SIG_BLOCK
%8 = call i32 @sigprocmask(i32 %7, i32* %1, i32* null)
ret void
}

LLVM IR (-O2):
@SIGHUP = global i32 0
@SIGALRM = global i32 0
@SIG_BLOCK = global i32 0
define void @BlockSignals() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @sigemptyset(i32* %1)
%4 = load i32, i32* @SIGHUP
%5 = call i32 @sigaddset(i32* %1, i32 %4)
%6 = load i32, i32* @SIGALRM
%7 = call i32 @sigaddset(i32* %1, i32 %6)
%8 = load i32, i32* @SIG_BLOCK
%9 = call i32 @sigprocmask(i32 %8, i32* %1, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void ojSleepMsec(int msec) { usleep(msec * 1000); }


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

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

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

LLVM IR (-O2):
define void @ojSleepMsec(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_status_word(int /*<<< orphan*/);
int /*<<< orphan*/ x87FPU_fstsw();
void print_fpu_status(void) { print_status_word(x87FPU_fstsw()); }


x86 assembly (clang, -O0):
<print_fpu_status>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <x87FPU_fstsw@plt>
mov    %eax,%edi
call   1030 <print_status_word@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_fpu_status>:
push   %rax
xor    %eax,%eax
call   1040 <x87FPU_fstsw@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <print_status_word@plt>

LLVM IR (-O0):
define void @print_fpu_status() {
%1 = call i32 (...) @x87FPU_fstsw()
%2 = call i32 @print_status_word(i32 %1)
ret void
}

LLVM IR (-O2):
define void @print_fpu_status() {
%1 = tail call i32 (...) @x87FPU_fstsw()
%2 = tail call i32 @print_status_word(i32 %1)
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t __attribute__((always_)) abs_func(int32_t a) {
  int32_t isneg = a >> 31;
  int32_t xorval = a ^ isneg;
  int32_t result = xorval - isneg;
  return result;
}


x86 assembly (clang, -O0):
<abs_func>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @abs_func(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = ashr i32 %6, 31
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = xor i32 %8, %9
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = load i32, i32* %3
%13 = sub nsw i32 %11, %12
store i32 %13, i32* %5
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
define i32 @abs_func(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
int bla_is_backbone_gw(struct sk_buff *skb, struct orig_node *orig_node,
                       int hdr_size) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.sk_buff = type opaque
%struct.orig_node = type opaque
define i32 @bla_is_backbone_gw(%struct.sk_buff* %0, %struct.orig_node* %1, i32 %2) {
%4 = alloca %struct.sk_buff*
%5 = alloca %struct.orig_node*
%6 = alloca i32
store %struct.sk_buff* %0, %struct.sk_buff** %4
store %struct.orig_node* %1, %struct.orig_node** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.sk_buff = type opaque
%struct.orig_node = type opaque
define i32 @bla_is_backbone_gw(%struct.sk_buff* nocapture readnone %0, %struct.orig_node* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *prg) {
  printf("Usage: %s: filename id chans bits rate [host:port]\n", prg);
}


x86 assembly (clang, -O0):
<usage>:
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):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [52 x i8] c"Usage: %s: filename id chans bits rate [host:port]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [52 x i8] c"Usage: %s: filename id chans bits rate [host:port]\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
size_t strlen(char const *);
int stringStat(const char *string, size_t multiplier, int *count) {
  size_t len = strlen(string);
  (*count)++;
  return len * multiplier;
}


x86 assembly (clang, -O0):
<stringStat>:
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   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
imul   -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringStat>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
call   1030 <strlen@plt>
addl   $0x1,(%rbx)
imul   %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @stringStat(i8* nocapture %0, i64 %1, i32* nocapture %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
store i32 %6, i32* %2
%7 = mul i64 %4, %1
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ kprintf(char *, int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/, int /*<<< orphan*/);
void print_mac(uint8_t mac[6]) {
  kprintf("%02x:%02x:%02x:%02x:%02x:%02x", mac[0], mac[1], mac[2], mac[3],
          mac[4], mac[5]);
}


x86 assembly (clang, -O0):
<print_mac>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%r8d
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%r9d
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%eax
lea    0xeb2(%rip),%rdi
mov    %eax,(%rsp)
call   1030 <kprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_mac>:
push   %rax
mov    (%rdi),%esi
mov    0x4(%rdi),%edx
mov    0x8(%rdi),%ecx
mov    0xc(%rdi),%r8d
mov    0x10(%rdi),%r9d
mov    0x14(%rdi),%eax
mov    %eax,(%rsp)
lea    0xed2(%rip),%rdi
call   1030 <kprintf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [30 x i8] c"%02x:%02x:%02x:%02x:%02x:%02x\00"
define void @print_mac(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %7
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 2
%11 = load i32, i32* %10
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 3
%14 = load i32, i32* %13
%15 = load i32*, i32** %2
%16 = getelementptr inbounds i32, i32* %15, i64 4
%17 = load i32, i32* %16
%18 = load i32*, i32** %2
%19 = getelementptr inbounds i32, i32* %18, i64 5
%20 = load i32, i32* %19
%21 = call i32 @kprintf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %8, i32 %11, i32 %14, i32 %17, i32 %20)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"%02x:%02x:%02x:%02x:%02x:%02x\00"
define void @print_mac(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = getelementptr inbounds i32, i32* %0, i64 2
%6 = load i32, i32* %5
%7 = getelementptr inbounds i32, i32* %0, i64 3
%8 = load i32, i32* %7
%9 = getelementptr inbounds i32, i32* %0, i64 4
%10 = load i32, i32* %9
%11 = getelementptr inbounds i32, i32* %0, i64 5
%12 = load i32, i32* %11
%13 = tail call i32 @kprintf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %4, i32 %6, i32 %8, i32 %10, i32 %12)
ret void
}
int d_lt_cr1(double a1) { return (((100) < (a1))); }


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

x86 assembly (clang, -O2):
<d_lt_cr1>:
xor    %eax,%eax
ucomisd 0xef6(%rip),%xmm0
seta   %al
ret

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

LLVM IR (-O2):
define i32 @d_lt_cr1(double %0) {
%2 = fcmp ogt double %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int main(int argc, char **argv) { return sizeof(uintptr_t) != 8; }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int break_loop(int, int);
int break_constant(int p) { return break_loop(p, -1); }


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

x86 assembly (clang, -O2):
<break_constant>:
mov    $0xffffffff,%esi
jmp    1030 <break_loop@plt>

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

LLVM IR (-O2):
define i32 @break_constant(i32 %0) {
%2 = tail call i32 @break_loop(i32 %0, i32 -1)
ret i32 %2
}
void f(void) {
  char s0[] = "abc";
  char s1[3] = "abc";
  char *p = "abc";
  *s0 = 'b';
  s1[1] = 'd';
  *p = 'c';
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    0xef6(%rip),%eax
mov    %eax,-0x4(%rbp)
mov    0xef0(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xee8(%rip),%al
mov    %al,-0x5(%rbp)
lea    0xed8(%rip),%rax
mov    %rax,-0x10(%rbp)
movb   $0x62,-0x4(%rbp)
movb   $0x64,-0x6(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x63,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.f.s0 = [4 x i8] c"abc\00"
@__const.f.s1 = [3 x i8] c"abc"
@.str = [4 x i8] c"abc\00"
define void @f() {
%1 = alloca [4 x i8]
%2 = alloca [3 x i8]
%3 = alloca i8*
%4 = bitcast [4 x i8]* %1 to i8*
%5 = bitcast [3 x i8]* %2 to i8*
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %3
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
store i8 98, i8* %6
%7 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 1
store i8 100, i8* %7
%8 = load i8*, i8** %3
store i8 99, i8* %8
ret void
}

LLVM IR (-O2):
define void @f() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_users_control_window();
void users_init_mode(void) { init_users_control_window(); }


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

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

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

LLVM IR (-O2):
define void @users_init_mode() {
%1 = tail call i32 (...) @init_users_control_window()
ret void
}
/* Variables and functions */
int getdomainname(char *name, size_t len) {
  *name = 0;
  return 0;
}


x86 assembly (clang, -O0):
<getdomainname>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getdomainname>:
movb   $0x0,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @getdomainname(i8* nocapture writeonly %0, i64 %1) {
store i8 0, i8* %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void *sm_getptr_err(int offset) {
  fprintf(stderr,
          "invalid offset: (%d)"
          "\n",
          offset);
  return (NULL);
}


x86 assembly (clang, -O0):
<sm_getptr_err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sm_getptr_err>:
push   %rax
mov    %edi,%edx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"invalid offset: (%d)\0A\00"
define i8* @sm_getptr_err(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i8* null
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"invalid offset: (%d)\0A\00"
define noalias i8* @sm_getptr_err(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* null
}
char *utoa(n)
int n;
{
  static char buf[30];
  (void)sprintf(buf, "%u", (unsigned)n);
  return (buf);
}


x86 assembly (clang, -O0):
<utoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0x2f1b(%rip),%rdi
lea    0xed4(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
lea    0x2f06(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utoa>:
push   %rbx
mov    %edi,%edx
lea    0x2f26(%rip),%rbx
lea    0xedf(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@utoa.buf = internal global [30 x i8] zeroinitializer
@.str = [3 x i8] c"%u\00"
define i8* @utoa(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, i8*, ...) @sprintf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @utoa.buf, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* getelementptr inbounds ([30 x i8], [30 x i8]* @utoa.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@utoa.buf = internal global [30 x i8] zeroinitializer
@.str = [3 x i8] c"%u\00"
define i8* @utoa(i32 %0) {
%2 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @utoa.buf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* getelementptr inbounds ([30 x i8], [30 x i8]* @utoa.buf, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ die(char *, char *, char *);
void usage(char *progname) {
  die("Usage: %s -[afmprst] [-i infile | file b1 [b2 ...]]\n"
      "%s: opportunistically page-in file blocks\n"
      "  -a: set O_NOATIME (must be file owner or root)\n"
      "  -i: read input blocklist from infile (use '-' for stdin)\n"
      "  -f: use posix_fadvise(2) (default)\n"
      "  -m: use madvise(2)\n"
      "  -p: use mmap(2) + pagefault\n"
      "  -r: use read(2)\n"
      "  -s: compute success statistics using mincore(2)\n"
      "  -t: print timing information\n",
      progname, progname);
}


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

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

LLVM IR (-O0):
@.str = [390 x i8] c"Usage: %s -[afmprst] [-i infile | file b1 [b2 ...]]\0A%s: opportunistically page-in file blocks\0A -a: set O_NOATIME (must be file owner or root)\0A -i: read input blocklist from infile (use '-' for stdin)\0A -f: use posix_fadvise(2) (default)\0A -m: use madvise(2)\0A -p: use mmap(2) + pagefault\0A -r: use read(2)\0A -s: compute success statistics using mincore(2)\0A -t: print timing information\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @die(i8* getelementptr inbounds ([390 x i8], [390 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [390 x i8] c"Usage: %s -[afmprst] [-i infile | file b1 [b2 ...]]\0A%s: opportunistically page-in file blocks\0A -a: set O_NOATIME (must be file owner or root)\0A -i: read input blocklist from infile (use '-' for stdin)\0A -f: use posix_fadvise(2) (default)\0A -m: use madvise(2)\0A -p: use mmap(2) + pagefault\0A -r: use read(2)\0A -s: compute success statistics using mincore(2)\0A -t: print timing information\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @die(i8* getelementptr inbounds ([390 x i8], [390 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, long long);
int main() {
  long long int k, a, b, c;
  scanf("%d", a);
  while (a > 0) {
    scanf("%lld", k);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xed6(%rip),%rdi
call   1030 <scanf@plt>
cmpq   $0x0,-0x18(%rbp)
jle    114f <main+0x3f>
mov    -0x10(%rbp),%rsi
lea    0xebe(%rip),%rdi
call   1030 <scanf@plt>
jmp    112f <main+0x1f>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <scanf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"%lld\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i32 0, i32* %1
%6 = load i64, i64* %3
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 %6)
br label %8
8: ; preds = %11, %0
%9 = load i64, i64* %3
%10 = icmp sgt i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i64, i64* %2
%13 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %12)
br label %8
14: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 undef)
ret i32 0
}
int _lw6dat_flag(int index) { return (1 << index); }


x86 assembly (clang, -O0):
<_lw6dat_flag>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_lw6dat_flag>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @_lw6dat_flag(i32 %0) {
%2 = shl nuw i32 1, %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ localme(int, char *);
int /*<<< orphan*/ localtask();
int /*<<< orphan*/ localyou(int, char *);
int main(int argc, char *argv[]) {
  localme(10, "cxxxxyyyy");
  localyou(10, "cxxxxxxxx");
  localtask();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xa,%edi
lea    0xeb5(%rip),%rsi
call   1040 <localme@plt>
mov    $0xa,%edi
lea    0xeae(%rip),%rsi
call   1030 <localyou@plt>
mov    $0x0,%al
call   1050 <localtask@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rsi
mov    $0xa,%edi
call   1040 <localme@plt>
lea    0xec1(%rip),%rsi
mov    $0xa,%edi
call   1030 <localyou@plt>
xor    %eax,%eax
call   1050 <localtask@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"cxxxxyyyy\00"
@.str.1 = [10 x i8] c"cxxxxxxxx\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @localme(i32 10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @localyou(i32 10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (...) @localtask()
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"cxxxxyyyy\00"
@.str.1 = [10 x i8] c"cxxxxxxxx\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @localme(i32 10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @localyou(i32 10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 (...) @localtask()
ret i32 0
}
unsigned float2bit(float f) {
  union {
    float f;
    unsigned u;
  } temp;
  temp.f = f;
  return temp.u;
}


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

x86 assembly (clang, -O2):
<float2bit>:
movd   %xmm0,%eax
ret

LLVM IR (-O0):
%union.anon = type { float }
define i32 @float2bit(float %0) {
%2 = alloca float
%3 = alloca %union.anon
store float %0, float* %2
%4 = load float, float* %2
%5 = bitcast %union.anon* %3 to float*
store float %4, float* %5
%6 = bitcast %union.anon* %3 to i32*
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @float2bit(float %0) {
%2 = bitcast float %0 to i32
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ POLICY_CONSTRAINTS;

/* Variables and functions */
scalar_t__ ASN1_item_new(int /*<<< orphan*/ *);
int /*<<< orphan*/ POLICY_CONSTRAINTS_it;
POLICY_CONSTRAINTS *POLICY_CONSTRAINTS_new(void) {
  return (POLICY_CONSTRAINTS *)ASN1_item_new(&POLICY_CONSTRAINTS_it);
}


x86 assembly (clang, -O0):
<POLICY_CONSTRAINTS_new>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rdi
call   1030 <ASN1_item_new@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<POLICY_CONSTRAINTS_new>:
mov    0x2ec9(%rip),%rdi
jmp    1030 <ASN1_item_new@plt>

LLVM IR (-O0):
@POLICY_CONSTRAINTS_it = global i32 0
define i32* @POLICY_CONSTRAINTS_new() {
%1 = call i64 @ASN1_item_new(i32* @POLICY_CONSTRAINTS_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}

LLVM IR (-O2):
@POLICY_CONSTRAINTS_it = global i32 0
define i32* @POLICY_CONSTRAINTS_new() {
%1 = tail call i64 @ASN1_item_new(i32* @POLICY_CONSTRAINTS_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ foo2();
foo1() { foo2(); }


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

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

LLVM IR (-O0):
define i32 @foo1() {
%1 = alloca i32
%2 = call i32 (...) @foo2()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @foo1() {
%1 = tail call i32 (...) @foo2()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help() {
  printf("Usage: \033[1;31mtoy-http\033[0m [PORT] [SERVE-FOLDER] "
         "[MAX-CONNECTIONS]\n"
         "You can also use it without any arguments,\n to run it in the actual "
         "folder.\n\n"
         "See the project page: `http://himsel.me/toy-http'\n"
         "Copyright (C) 2015, 2016 Lukas Himsel\n"
         "  This program comes with ABSOLUTELY NO WARRANTY.\n"
         "  This is free software, and you are welcome to redistribute it\n"
         "  under certain conditions; see `www.gnu.org/licenses/agpl.html\' "
         "for details.\n");
}


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

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

LLVM IR (-O0):
@.str = [425 x i8] c"Usage: \1B[1;31mtoy-http\1B[0m [PORT] [SERVE-FOLDER] [MAX-CONNECTIONS]\0AYou can also use it without any arguments,\0A to run it in the actual folder.\0A\0ASee the project page: `http://himsel.me/toy-http'\0ACopyright (C) 2015, 2016 Lukas Himsel\0A This program comes with ABSOLUTELY NO WARRANTY.\0A This is free software, and you are welcome to redistribute it\0A under certain conditions; see `www.gnu.org/licenses/agpl.html' for details.\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([425 x i8], [425 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [424 x i8] c"Usage: \1B[1;31mtoy-http\1B[0m [PORT] [SERVE-FOLDER] [MAX-CONNECTIONS]\0AYou can also use it without any arguments,\0A to run it in the actual folder.\0A\0ASee the project page: `http://himsel.me/toy-http'\0ACopyright (C) 2015, 2016 Lukas Himsel\0A This program comes with ABSOLUTELY NO WARRANTY.\0A This is free software, and you are welcome to redistribute it\0A under certain conditions; see `www.gnu.org/licenses/agpl.html' for details.\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([424 x i8], [424 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xcf() {
  Assert_real((isbdigit(207) == 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",
              1040, ("isbdigit should be 0 for 0xcf"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0xcf>:
push   %rax
mov    $0xcf,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x410,%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 = [30 x i8] c"isbdigit should be 0 for 0xcf\00"
define void @t_isbdigit_0xcf() {
%1 = call i64 @isbdigit(i32 207)
%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 1040, i8* getelementptr inbounds ([30 x i8], [30 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 = [30 x i8] c"isbdigit should be 0 for 0xcf\00"
define void @t_isbdigit_0xcf() {
%1 = tail call i64 @isbdigit(i32 207)
%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 1040, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned int getHID() { return ~*(volatile unsigned int *)0x10146000; }


x86 assembly (clang, -O0):
<getHID>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10146000,%eax
mov    (%rax),%eax
xor    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getHID>:
mov    0x10146000,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @getHID() {
%1 = load volatile i32, i32* inttoptr (i64 269770752 to i32*)
%2 = xor i32 %1, -1
ret i32 %2
}

LLVM IR (-O2):
define i32 @getHID() {
%1 = load volatile i32, i32* inttoptr (i64 269770752 to i32*)
%2 = xor i32 %1, -1
ret i32 %2
}
const char *boolstr(int b) {
  if (b) {
    return "True";
  }
  return "False";
}


x86 assembly (clang, -O0):
<boolstr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1121 <boolstr+0x21>
lea    0xee8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    112c <boolstr+0x2c>
lea    0xedd(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<boolstr>:
test   %edi,%edi
lea    0xefc(%rip),%rcx
lea    0xef0(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"True\00"
@.str.1 = [6 x i8] c"False\00"
define i8* @boolstr(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
8: ; preds = %7, %6
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [5 x i8] c"True\00"
@.str.1 = [6 x i8] c"False\00"
define i8* @boolstr(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
void owRelease(int portnum) { portnum = 0; }


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

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

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

LLVM IR (-O2):
define void @owRelease(i32 %0) {
ret void
}
void AdPlug_LogWrite(char *fmt, ...) { (void)fmt; }


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

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

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

LLVM IR (-O2):
define void @AdPlug_LogWrite(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
void *malloc(int);
int /*<<< orphan*/ sat_oom(size_t, size_t);
void *sat_calloc(size_t num, size_t len) {
  void *r;
  if (num == 0 || len == 0)
    r = malloc(1);
  else
    r = calloc(num, len);
  if (!r)
    sat_oom(num, len);
  return r;
}


x86 assembly (clang, -O0):
<sat_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1156 <sat_calloc+0x26>
cmpq   $0x0,-0x10(%rbp)
jne    1169 <sat_calloc+0x39>
mov    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
jmp    117a <sat_calloc+0x4a>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1192 <sat_calloc+0x62>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <sat_oom@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sat_calloc>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
test   %rdi,%rdi
je     1152 <sat_calloc+0x22>
test   %r14,%r14
je     1152 <sat_calloc+0x22>
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <calloc@plt>
jmp    115c <sat_calloc+0x2c>
mov    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    116f <sat_calloc+0x3f>
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <sat_oom@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @sat_calloc(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 0
%4 = icmp eq i64 %1, 0
%5 = or i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
br label %10
8: ; preds = %2
%9 = tail call i8* @calloc(i64 %0, i64 %1)
br label %10
10: ; preds = %8, %6
%11 = phi i8* [ %7, %6 ], [ %9, %8 ]
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = tail call i32 @sat_oom(i64 %0, i64 %1)
br label %15
15: ; preds = %13, %10
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ DebugLogSettingsHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void DebugLogSettingsUpdated() { UAVObjUpdated(DebugLogSettingsHandle()); }


x86 assembly (clang, -O0):
<DebugLogSettingsUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <DebugLogSettingsHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DebugLogSettingsUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <DebugLogSettingsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @DebugLogSettingsUpdated() {
%1 = call i32 (...) @DebugLogSettingsHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @DebugLogSettingsUpdated() {
%1 = tail call i32 (...) @DebugLogSettingsHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Variables and functions */
int check_string(char *, char *);
int table_include(char *table, char *regexp) {
  if (!regexp)
    return 1;
  return check_string(table, regexp);
}


x86 assembly (clang, -O0):
<table_include>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1137 <table_include+0x27>
movl   $0x1,-0x4(%rbp)
jmp    1147 <table_include+0x37>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <check_string@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<table_include>:
test   %rsi,%rsi
je     111a <table_include+0xa>
jmp    1030 <check_string@plt>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @table_include(i8* %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @check_string(i8* %0, i8* %1)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ 1, %2 ]
ret i32 %7
}
/* Variables and functions */
int divide(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char const *argv[]) {
  int a = -2147483648, b = -1;
  printf("%d\n", divide(a, b));
  printf("%u\n", 0 - a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x80000000,-0x14(%rbp)
movl   $0xffffffff,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1030 <divide@plt>
mov    %eax,%esi
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
xor    %esi,%esi
sub    -0x14(%rbp),%esi
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%u\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @divide(i32 -2147483648, i32 -1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 -2147483648)
ret i32 0
}