xunge/DecIR huggingface dataset:
/* Variables and functions */
int RSA_padding_check_PKCS1_OAEP_mgf1(unsigned char *, int,
                                      unsigned char const *, int, int,
                                      unsigned char const *, int,
                                      int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ *);
int RSA_padding_check_PKCS1_OAEP(unsigned char *to, int tlen,
                                 const unsigned char *from, int flen, int num,
                                 const unsigned char *param, int plen) {
  return RSA_padding_check_PKCS1_OAEP_mgf1(to, tlen, from, flen, num, param,
                                           plen, NULL, NULL);
}


x86 assembly (clang, -O0):
<RSA_padding_check_PKCS1_OAEP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    -0x28(%rbp),%r9
mov    0x10(%rbp),%eax
xor    %r10d,%r10d
mov    %eax,(%rsp)
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
call   1030 <RSA_padding_check_PKCS1_OAEP_mgf1@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RSA_padding_check_PKCS1_OAEP>:
sub    $0x18,%rsp
mov    0x20(%rsp),%eax
xorps  %xmm0,%xmm0
movups %xmm0,0x8(%rsp)
mov    %eax,(%rsp)
call   1030 <RSA_padding_check_PKCS1_OAEP_mgf1@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @RSA_padding_check_PKCS1_OAEP(i8* %0, i32 %1, i8* %2, i32 %3, i32 %4, i8* %5, i32 %6) {
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i32
store i8* %0, i8** %8
store i32 %1, i32* %9
store i8* %2, i8** %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i8* %5, i8** %13
store i32 %6, i32* %14
%15 = load i8*, i8** %8
%16 = load i32, i32* %9
%17 = load i8*, i8** %10
%18 = load i32, i32* %11
%19 = load i32, i32* %12
%20 = load i8*, i8** %13
%21 = load i32, i32* %14
%22 = call i32 @RSA_padding_check_PKCS1_OAEP_mgf1(i8* %15, i32 %16, i8* %17, i32 %18, i32 %19, i8* %20, i32 %21, i32* null, i32* null)
ret i32 %22
}

LLVM IR (-O2):
define i32 @RSA_padding_check_PKCS1_OAEP(i8* %0, i32 %1, i8* %2, i32 %3, i32 %4, i8* %5, i32 %6) {
%8 = tail call i32 @RSA_padding_check_PKCS1_OAEP_mgf1(i8* %0, i32 %1, i8* %2, i32 %3, i32 %4, i8* %5, i32 %6, i32* null, i32* null)
ret i32 %8
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISREG(int /*<<< orphan*/);
int fstat(int, struct stat *);
int ss_regular_file_p(int fd) {
  struct stat buf;
  if (fstat(fd, &buf) == -1)
    return -1;
  if (S_ISREG(buf.st_mode))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<ss_regular_file_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1040 <fstat@plt>
cmp    $0xffffffff,%eax
jne    114c <ss_regular_file_p+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1171 <ss_regular_file_p+0x51>
mov    -0x10(%rbp),%edi
call   1030 <S_ISREG@plt>
cmp    $0x0,%rax
je     116a <ss_regular_file_p+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1171 <ss_regular_file_p+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ss_regular_file_p>:
push   %rax
mov    %rsp,%rsi
call   1040 <fstat@plt>
cmp    $0xffffffff,%eax
je     1143 <ss_regular_file_p+0x23>
mov    (%rsp),%edi
call   1030 <S_ISREG@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @ss_regular_file_p(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.stat
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @fstat(i32 %5, %struct.stat* %4)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %16
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i64 @S_ISREG(i32 %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %9
store i32 1, i32* %2
br label %16
15: ; preds = %9
store i32 0, i32* %2
br label %16
16: ; preds = %15, %14, %8
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @ss_regular_file_p(i32 %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @fstat(i32 %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i64 @S_ISREG(i32 %8)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ -1, %1 ], [ %11, %6 ]
ret i32 %13
}
int test_imm_0Duint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x0D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_0Duint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x20,%rdx
and    $0xd,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_0Duint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 32
%6 = and i64 %5, 13
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_0Duint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 55834574848
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
int die(char *msg, int status) {
  perror(msg);
  fflush(stderr);
  exit(status);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
mov    -0xc(%rbp),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rbx
mov    %esi,%ebx
call   1040 <perror@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
mov    %ebx,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
define i32 @die(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 @perror(i8* %5)
%7 = load i32, i32* @stderr
%8 = call i32 @fflush(i32 %7)
%9 = load i32, i32* %4
%10 = call i32 @exit(i32 %9)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
define i32 @die(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @perror(i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fflush(i32 %4)
%6 = tail call i32 @exit(i32 %1)
unreachable
}
void store32(unsigned char *x, unsigned int u) {
  int i;
  for (i = 0; i < 4; ++i) {
    x[i] = u;
    u >>= 8;
  }
}


x86 assembly (clang, -O0):
<store32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jge    1143 <store32+0x43>
mov    -0xc(%rbp),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <store32+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<store32>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @store32(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
%7 = lshr i32 %1, 16
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
%10 = lshr i32 %1, 24
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
int toupper(int c) {
  if ((c >= 'a') && (c <= 'z'))
    return c + ('A' - 'a');
  return c;
}


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x61,-0x8(%rbp)
jl     1129 <toupper+0x29>
cmpl   $0x7a,-0x8(%rbp)
jg     1129 <toupper+0x29>
mov    -0x8(%rbp),%eax
add    $0xffffffe0,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <toupper+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 122
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = add nsw i32 %10, -32
store i32 %11, i32* %2
br label %14
12: ; preds = %6, %1
%13 = load i32, i32* %3
store i32 %13, i32* %2
br label %14
14: ; preds = %12, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void scrypt_be16enc(void *pp, uint16_t x) {
  uint8_t *p = (uint8_t *)pp;
  p[1] = x & 0xff;
  p[0] = (x >> 8) & 0xff;
}


x86 assembly (clang, -O0):
<scrypt_be16enc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<scrypt_be16enc>:
mov    %esi,%eax
movzbl %al,%ecx
mov    %ecx,0x4(%rdi)
movzbl %ah,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @scrypt_be16enc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32, i32* %4
%9 = and i32 %8, 255
%10 = load i32*, i32** %5
%11 = getelementptr inbounds i32, i32* %10, i64 1
store i32 %9, i32* %11
%12 = load i32, i32* %4
%13 = ashr i32 %12, 8
%14 = and i32 %13, 255
%15 = load i32*, i32** %5
%16 = getelementptr inbounds i32, i32* %15, i64 0
store i32 %14, i32* %16
ret void
}

LLVM IR (-O2):
define void @scrypt_be16enc(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = and i32 %1, 255
%5 = getelementptr inbounds i8, i8* %0, i64 4
%6 = bitcast i8* %5 to i32*
store i32 %4, i32* %6
%7 = lshr i32 %1, 8
%8 = and i32 %7, 255
store i32 %8, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SEEK_CUR;
int /*<<< orphan*/ lseek(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int write(int, char *, int);
int make_inode_bitmap(int fd, char *inode_bitmap) {
  int ret_byte;
  ret_byte = write(fd, inode_bitmap, 4096);
  printf("Inode Bitmap End == %ld\n", lseek(fd, 0, SEEK_CUR));
  return 0;
}


x86 assembly (clang, -O0):
<make_inode_bitmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x1000,%edx
call   1030 <write@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e8b(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1050 <lseek@plt>
mov    %eax,%esi
lea    0xe91(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_inode_bitmap>:
push   %rbx
mov    %edi,%ebx
mov    $0x1000,%edx
call   1030 <write@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edx
mov    %ebx,%edi
xor    %esi,%esi
call   1050 <lseek@plt>
lea    0xeaa(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Inode Bitmap End == %ld\0A\00"
@SEEK_CUR = global i32 0
define i32 @make_inode_bitmap(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = load i8*, i8** %4
%8 = call i32 @write(i32 %6, i8* %7, i32 4096)
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = load i32, i32* @SEEK_CUR
%11 = call i32 @lseek(i32 %9, i32 0, i32 %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"Inode Bitmap End == %ld\0A\00"
@SEEK_CUR = global i32 0
define i32 @make_inode_bitmap(i32 %0, i8* nocapture %1) {
%3 = tail call i32 @write(i32 %0, i8* %1, i32 4096)
%4 = load i32, i32* @SEEK_CUR
%5 = tail call i32 @lseek(i32 %0, i32 0, i32 %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
char *default_plot_func(int index) {
  static char buf[16];
  sprintf(buf, "f%d", index);
  return buf;
}


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

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

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

LLVM IR (-O2):
@default_plot_func.buf = internal global [16 x i8] zeroinitializer
@.str = [4 x i8] c"f%d\00"
define i8* @default_plot_func(i32 %0) {
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @default_plot_func.buf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @default_plot_func.buf, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void LogStr(FILE *log, char *s, int len) {
  if (!log)
    return;
  fprintf(log, "%s", s);
  fflush(log);
}


x86 assembly (clang, -O0):
<LogStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1143 <LogStr+0x23>
jmp    1160 <LogStr+0x40>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xeae(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <fflush@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LogStr>:
test   %rdi,%rdi
je     113d <LogStr+0x1d>
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rbx,%rsi
call   1030 <fputs@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <fflush@plt>
ret

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

LLVM IR (-O2):
define void @LogStr(i32* %0, i8* nocapture %1, i32 %2) {
%4 = icmp eq i32* %0, null
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = tail call i32 @fputs(i8* %1, i32* %0)
%7 = tail call i32 @fflush(i32* %0)
br label %8
8: ; preds = %3, %5
ret void
}
float f(float y) { return 1 / (1 + y * y); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
mulss  %xmm0,%xmm1
movss  0xee1(%rip),%xmm0
addss  %xmm0,%xmm1
movss  0xed5(%rip),%xmm0
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mulss  %xmm0,%xmm0
movss  0xef4(%rip),%xmm1
addss  %xmm1,%xmm0
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = call float @llvm.fmuladd.f32(float %3, float %4, float 1.000000e+00)
%6 = fdiv float 1.000000e+00, %5
ret float %6
}

LLVM IR (-O2):
define float @f(float %0) {
%2 = tail call float @llvm.fmuladd.f32(float %0, float %0, float 1.000000e+00)
%3 = fdiv float 1.000000e+00, %2
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ _ITM_finalizeThread();
void tanger_stm_thread_shutdown() { _ITM_finalizeThread(); }


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

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

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

LLVM IR (-O2):
define void @tanger_stm_thread_shutdown() {
%1 = tail call i32 (...) @_ITM_finalizeThread()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cgdiv();
int /*<<< orphan*/ gen(char *);
void cgmod(void) {
  cgdiv();
  gen("mov\tax,dx");
}


x86 assembly (clang, -O0):
<cgmod>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <cgdiv@plt>
lea    0xece(%rip),%rdi
call   1030 <gen@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgmod>:
push   %rax
xor    %eax,%eax
call   1040 <cgdiv@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1030 <gen@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"mov\09ax,dx\00"
define void @cgmod() {
%1 = call i32 (...) @cgdiv()
%2 = call i32 @gen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"mov\09ax,dx\00"
define void @cgmod() {
%1 = tail call i32 (...) @cgdiv()
%2 = tail call i32 @gen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
int f(unsigned bitcount, int mant) {
  int mask = -1 << bitcount;
  {
    if (!(mant & -mask))
      goto ab;
    if (mant & ~mask)
      goto auf;
  }
ab:
  return 0;
auf:
  return 1;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    %ecx,%ecx
sub    -0x10(%rbp),%ecx
and    %ecx,%eax
cmp    $0x0,%eax
jne    112f <f+0x2f>
jmp    114d <f+0x4d>
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1148 <f+0x48>
jmp    1159 <f+0x59>
jmp    114d <f+0x4d>
movl   $0x0,-0x4(%rbp)
jmp    1160 <f+0x60>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %edi,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
mov    %eax,%ecx
neg    %ecx
test   %esi,%ecx
setne  %cl
not    %eax
test   %esi,%eax
setne  %al
and    %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = shl i32 -1, %7
store i32 %8, i32* %6
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = sub nsw i32 0, %10
%12 = and i32 %9, %11
%13 = icmp ne i32 %12, 0
br i1 %13, label %15, label %14
14: ; preds = %2
br label %23
15: ; preds = %2
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = xor i32 %17, -1
%19 = and i32 %16, %18
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %15
br label %24
22: ; preds = %15
br label %23
23: ; preds = %22, %14
store i32 0, i32* %3
br label %25
24: ; preds = %21
store i32 1, i32* %3
br label %25
25: ; preds = %24, %23
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = shl nsw i32 -1, %0
%4 = sub nsw i32 0, %3
%5 = and i32 %4, %1
%6 = icmp ne i32 %5, 0
%7 = xor i32 %3, -1
%8 = and i32 %7, %1
%9 = icmp ne i32 %8, 0
%10 = select i1 %6, i1 %9, i1 false
%11 = zext i1 %10 to i32
ret i32 %11
}
int test_howManyBits(int x) {
  unsigned int a, cnt;
  x = x < 0 ? -x - 1 : x;
  a = (unsigned int)x;
  for (cnt = 0; a; a >>= 1, cnt++)
    ;
  return (int)(cnt + 1);
}


x86 assembly (clang, -O0):
<test_howManyBits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1121 <test_howManyBits+0x21>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1127 <test_howManyBits+0x27>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1160 <test_howManyBits+0x60>
jmp    1149 <test_howManyBits+0x49>
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113a <test_howManyBits+0x3a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_howManyBits>:
mov    %edi,%ecx
sar    $0x1f,%ecx
mov    $0x1,%eax
xor    %edi,%ecx
je     111c <test_howManyBits+0x1c>
mov    %ecx,%edx
shr    %edx
add    $0x1,%eax
cmp    $0x1,%ecx
mov    %edx,%ecx
ja     1110 <test_howManyBits+0x10>
ret

LLVM IR (-O0):
define i32 @test_howManyBits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* %2
%9 = sub nsw i32 0, %8
%10 = sub nsw i32 %9, 1
br label %13
11: ; preds = %1
%12 = load i32, i32* %2
br label %13
13: ; preds = %11, %7
%14 = phi i32 [ %10, %7 ], [ %12, %11 ]
store i32 %14, i32* %2
%15 = load i32, i32* %2
store i32 %15, i32* %3
store i32 0, i32* %4
br label %16
16: ; preds = %20, %13
%17 = load i32, i32* %3
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %25
19: ; preds = %16
br label %20
20: ; preds = %19
%21 = load i32, i32* %3
%22 = lshr i32 %21, 1
store i32 %22, i32* %3
%23 = load i32, i32* %4
%24 = add i32 %23, 1
store i32 %24, i32* %4
br label %16
25: ; preds = %16
%26 = load i32, i32* %4
%27 = add i32 %26, 1
ret i32 %27
}

LLVM IR (-O2):
define i32 @test_howManyBits(i32 %0) {
%2 = ashr i32 %0, 31
%3 = xor i32 %2, %0
%4 = icmp eq i32 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %9, %5 ], [ 1, %1 ]
%7 = phi i32 [ %8, %5 ], [ %3, %1 ]
%8 = lshr i32 %7, 1
%9 = add nuw nsw i32 %6, 1
%10 = icmp ult i32 %7, 2
br i1 %10, label %11, label %5
11: ; preds = %5, %1
%12 = phi i32 [ 1, %1 ], [ %9, %5 ]
ret i32 %12
}
int cb_hlt() {
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<cb_hlt>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <cb_hlt+0x9>
jmp    1109 <cb_hlt+0x9>

x86 assembly (clang, -O2):
<cb_hlt>:
jmp    1100 <cb_hlt>

LLVM IR (-O0):
define i32 @cb_hlt() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define i32 @cb_hlt() {
br label %1
1: ; preds = %1, %0
br label %1
}
gaether(out, in, cnt) char *out;
char *in[];
int cnt;
{ gether(out, in[0]); }


x86 assembly (clang, -O0):
<gaether>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
mov    $0x0,%al
call   1030 <gether@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gaether>:
mov    (%rsi),%rsi
xor    %eax,%eax
jmp    1030 <gether@plt>

LLVM IR (-O0):
define i32 @gaether(i8* %0, i8** %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i32
store i8* %0, i8** %5
store i8** %1, i8*** %6
store i32 %2, i32* %7
%8 = load i8*, i8** %5
%9 = load i8**, i8*** %6
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @gether to i32 (i8*, i8*, ...)*)(i8* %8, i8* %11)
%13 = load i32, i32* %4
ret i32 %13
}

LLVM IR (-O2):
define i32 @gaether(i8* %0, i8** nocapture %1, i32 %2) {
%4 = load i8*, i8** %1
%5 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @gether to i32 (i8*, i8*, ...)*)(i8* %0, i8* %4)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ smile();
int main() {
  smile();
  smile();
  smile();
  printf("\n");
  smile();
  smile();
  printf("\n");
  smile();
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <smile@plt>
mov    $0x0,%al
call   1030 <smile@plt>
mov    $0x0,%al
call   1030 <smile@plt>
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <smile@plt>
mov    $0x0,%al
call   1030 <smile@plt>
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <smile@plt>
lea    0xe88(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <smile@plt>
xor    %eax,%eax
call   1040 <smile@plt>
xor    %eax,%eax
call   1040 <smile@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <smile@plt>
xor    %eax,%eax
call   1040 <smile@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <smile@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @smile()
%2 = tail call i32 (...) @smile()
%3 = tail call i32 (...) @smile()
%4 = tail call i32 @putchar(i32 10)
%5 = tail call i32 (...) @smile()
%6 = tail call i32 (...) @smile()
%7 = tail call i32 @putchar(i32 10)
%8 = tail call i32 (...) @smile()
%9 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ handle_61(int /*<<< orphan*/);
int gen_61(void) {
  handle_61(0);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @gen_61() {
%1 = call i32 @handle_61(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_61() {
%1 = tail call i32 @handle_61(i32 0)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ buf;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fwrite(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
int fwrite_8(uint8_t buf, FILE *fd) {
  return (fwrite(&buf, sizeof(buf), 1, fd) == 1) ? 0 : -1;
}


x86 assembly (clang, -O0):
<fwrite_8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
lea    -0x4(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
mov    %eax,%edx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x1,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fwrite_8>:
push   %rax
mov    %rsi,%rcx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
setne  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fwrite_8(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 = call i32 @fwrite(i32* %3, i32 4, i32 1, i32* %5)
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 0, i32 -1
ret i32 %9
}

LLVM IR (-O2):
define i32 @fwrite_8(i32 %0, i32* nocapture %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @fwrite(i32* %3, i32 4, i32 1, i32* %1)
%5 = icmp ne i32 %4, 1
%6 = sext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
struct usb_function {
  int dummy;
};
struct f_rudolf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ disable_rudolf(struct f_rudolf *);
struct f_rudolf *func_to_rudolf(struct usb_function *);
void f_rudolf_disable(struct usb_function *f) {
  struct f_rudolf *rudolf = func_to_rudolf(f);
  disable_rudolf(rudolf);
}


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

x86 assembly (clang, -O2):
<f_rudolf_disable>:
push   %rax
call   1030 <func_to_rudolf@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <disable_rudolf@plt>

LLVM IR (-O0):
%struct.usb_function = type { i32 }
%struct.f_rudolf = type { i32 }
define void @f_rudolf_disable(%struct.usb_function* %0) {
%2 = alloca %struct.usb_function*
%3 = alloca %struct.f_rudolf*
store %struct.usb_function* %0, %struct.usb_function** %2
%4 = load %struct.usb_function*, %struct.usb_function** %2
%5 = call %struct.f_rudolf* @func_to_rudolf(%struct.usb_function* %4)
store %struct.f_rudolf* %5, %struct.f_rudolf** %3
%6 = load %struct.f_rudolf*, %struct.f_rudolf** %3
%7 = call i32 @disable_rudolf(%struct.f_rudolf* %6)
ret void
}

LLVM IR (-O2):
%struct.usb_function = type { i32 }
%struct.f_rudolf = type { i32 }
define void @f_rudolf_disable(%struct.usb_function* %0) {
%2 = tail call %struct.f_rudolf* @func_to_rudolf(%struct.usb_function* %0)
%3 = tail call i32 @disable_rudolf(%struct.f_rudolf* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ closep(int *);
void sync_close_child(int fd[2]) {
  if (fd[0] != -1)
    closep(&fd[0]);
}


x86 assembly (clang, -O0):
<sync_close_child>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0xffffffff,(%rax)
je     1132 <sync_close_child+0x22>
mov    -0x8(%rbp),%rdi
call   1030 <closep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sync_close_child>:
cmpl   $0xffffffff,(%rdi)
je     111a <sync_close_child+0xa>
jmp    1030 <closep@plt>
ret

LLVM IR (-O0):
define void @sync_close_child(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 = icmp ne i32 %5, -1
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = call i32 @closep(i32* %9)
br label %11
11: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @sync_close_child(i32* %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, -1
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @closep(i32* %0)
br label %6
6: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int main() {
  FILE *fp;
  fp = fopen("file.txt", "w");
  fprintf(fp, "%s", "This is tutorialspoint.com");
  fclose(fp);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    0xebc(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeaa(%rip),%rsi
lea    0xea6(%rip),%rdx
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
lea    0xebd(%rip),%rdi
mov    $0x1a,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"file.txt\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [27 x i8] c"This is tutorialspoint.com\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fprintf(i32* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
%6 = load i32*, i32** %2
%7 = call i32 @fclose(i32* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"file.txt\00"
@.str.1 = [2 x i8] c"w\00"
@.str.3 = [27 x i8] c"This is tutorialspoint.com\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i64 26, i64 1, i32* %1)
%3 = tail call i32 @fclose(i32* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __CRAB_assert(int);
int *foo(int *);
scalar_t__ malloc(int);
int main() {
  int *p = (int *)malloc(sizeof(int));
  int *q = foo(p);
  __CRAB_assert(*q >= 5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <foo@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpl   $0x5,(%rax)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__CRAB_assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
call   1050 <foo@plt>
xor    %edi,%edi
cmpl   $0x5,(%rax)
setge  %dil
call   1030 <__CRAB_assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
store i32 0, i32* %1
%4 = call i64 @malloc(i32 4)
%5 = inttoptr i64 %4 to i32*
store i32* %5, i32** %2
%6 = load i32*, i32** %2
%7 = call i32* @foo(i32* %6)
store i32* %7, i32** %3
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = icmp sge i32 %9, 5
%11 = zext i1 %10 to i32
%12 = call i32 @__CRAB_assert(i32 %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
%3 = tail call i32* @foo(i32* %2)
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 4
%6 = zext i1 %5 to i32
%7 = tail call i32 @__CRAB_assert(i32 %6)
ret i32 0
}
void VMR3PowerOn(void) {}


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

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

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

LLVM IR (-O2):
define void @VMR3PowerOn() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int tty_write(char const *, int /*<<< orphan*/);
int tty_print(const char *string) { return tty_write(string, strlen(string)); }


x86 assembly (clang, -O0):
<tty_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1030 <tty_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tty_print>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <tty_write@plt>

LLVM IR (-O0):
define i32 @tty_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @tty_write(i8* %3, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @tty_print(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @tty_write(i8* %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
main() {
  int i = 0;
  while ((i % 2) == 0) {
    i = i + 2;
    printf("%d\n", i);
    sleep(1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1171 <main+0x51>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x2,%ebx
lea    0xed0(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
add    $0x2,%ebx
jmp    1130 <main+0x10>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %3, %1 ]
%3 = add nuw nsw i32 %2, 2
%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 @sleep(i32 1)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, double);
char *md_double2string01(double number) {
  static char str[2048];
  int i;
  for (i = 0; i < 2048; i++) {
    str[i] = '\0';
  }
  sprintf(str, "%.1f", number);
  return (str);
}


x86 assembly (clang, -O0):
<md_double2string01>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x800,-0xc(%rbp)
jge    114e <md_double2string01+0x3e>
movslq -0xc(%rbp),%rcx
lea    0x2f04(%rip),%rax
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <md_double2string01+0x14>
movsd  -0x8(%rbp),%xmm0
lea    0x2ee6(%rip),%rdi
lea    0xe9f(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2ed3(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<md_double2string01>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
lea    0x2f0e(%rip),%rbx
mov    $0x800,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
lea    0xeb8(%rip),%rsi
mov    %rbx,%rdi
movsd  0x8(%rsp),%xmm0
call   1040 <sprintf@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@md_double2string01.str = internal global [2048 x i8] zeroinitializer
@.str = [5 x i8] c"%.1f\00"
define i8* @md_double2string01(double %0) {
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([2048 x i8], [2048 x i8]* @md_double2string01.str, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %0)
ret i8* getelementptr inbounds ([2048 x i8], [2048 x i8]* @md_double2string01.str, i64 0, i64 0)
}
/* Variables and functions */
long _strto_l(char const *, char **, int, int);
long strtol(const char *str, char **endptr, int base) {
  return _strto_l(str, endptr, base, 1);
}


x86 assembly (clang, -O0):
<strtol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x1,%ecx
call   1030 <_strto_l@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtol>:
mov    $0x1,%ecx
jmp    1030 <_strto_l@plt>

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

LLVM IR (-O2):
define i64 @strtol(i8* %0, i8** %1, i32 %2) {
%4 = tail call i64 @_strto_l(i8* %0, i8** %1, i32 %2, i32 1)
ret i64 %4
}
int main(void) {
  unsigned char uc;
  &uc;
  uc;
  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
%2 = alloca i8
store i32 0, i32* %1
%3 = load i8, i8* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fib(long);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
long strtol(char *, int /*<<< orphan*/, int);
int main(int argc, char **argv) {
  long n = strtol(argv[1], 0, 10);
  printf("%ld\n", fib(n));
  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)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <fib@plt>
mov    %eax,%esi
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %rax,%rdi
call   1050 <fib@plt>
lea    0xeb0(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i64 @strtol(i8* %4, i32 0, i32 10)
%6 = tail call i32 @fib(i64 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ DwTrace();
int target_step(void) {
  DwTrace();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @target_step() {
%1 = tail call i32 (...) @DwTrace()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ParamWrite(int, int);
void init_app_max6682mean() {
  ParamWrite(0x0000, 0x0000);
  ParamWrite(0x0001, 0x0000);
  ParamWrite(0x0002, 0x0050);
  ParamWrite(0x0003, 0x0000);
  ParamWrite(0x0004, 0x03E8);
  ParamWrite(0x0005, 0x0028);
}


x86 assembly (clang, -O0):
<init_app_max6682mean>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    %esi,%edi
call   1030 <ParamWrite@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <ParamWrite@plt>
mov    $0x2,%edi
mov    $0x50,%esi
call   1030 <ParamWrite@plt>
mov    $0x3,%edi
xor    %esi,%esi
call   1030 <ParamWrite@plt>
mov    $0x4,%edi
mov    $0x3e8,%esi
call   1030 <ParamWrite@plt>
mov    $0x5,%edi
mov    $0x28,%esi
call   1030 <ParamWrite@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_app_max6682mean>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1030 <ParamWrite@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <ParamWrite@plt>
mov    $0x2,%edi
mov    $0x50,%esi
call   1030 <ParamWrite@plt>
mov    $0x3,%edi
xor    %esi,%esi
call   1030 <ParamWrite@plt>
mov    $0x4,%edi
mov    $0x3e8,%esi
call   1030 <ParamWrite@plt>
mov    $0x5,%edi
mov    $0x28,%esi
pop    %rax
jmp    1030 <ParamWrite@plt>

LLVM IR (-O0):
define void @init_app_max6682mean() {
%1 = call i32 @ParamWrite(i32 0, i32 0)
%2 = call i32 @ParamWrite(i32 1, i32 0)
%3 = call i32 @ParamWrite(i32 2, i32 80)
%4 = call i32 @ParamWrite(i32 3, i32 0)
%5 = call i32 @ParamWrite(i32 4, i32 1000)
%6 = call i32 @ParamWrite(i32 5, i32 40)
ret void
}

LLVM IR (-O2):
define void @init_app_max6682mean() {
%1 = tail call i32 @ParamWrite(i32 0, i32 0)
%2 = tail call i32 @ParamWrite(i32 1, i32 0)
%3 = tail call i32 @ParamWrite(i32 2, i32 80)
%4 = tail call i32 @ParamWrite(i32 3, i32 0)
%5 = tail call i32 @ParamWrite(i32 4, i32 1000)
%6 = tail call i32 @ParamWrite(i32 5, i32 40)
ret void
}