xunge/DecIR huggingface dataset:
/* Variables and functions */
int O_CREAT;
int O_WRONLY;
int /*<<< orphan*/ close(int);
int open(char *, int);
int strlen(char *);
int /*<<< orphan*/ write(int, char *, int);
int file_dump(char *path, char *content) {
  int fd;
  int len;
  fd = open(path, O_WRONLY | O_CREAT);
  len = strlen(content);
  write(fd, content, len);
  close(fd);
  return 0;
}


x86 assembly (clang, -O0):
<file_dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e75(%rip),%rax
mov    (%rax),%esi
mov    0x2e94(%rip),%rax
or     (%rax),%esi
call   1060 <open@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%edx
call   1030 <write@plt>
mov    -0x14(%rbp),%edi
call   1050 <close@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_dump>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x2e83(%rip),%rax
mov    0x2ea4(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
call   1060 <open@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    %ebp,%edi
call   1050 <close@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
define i32 @file_dump(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = load i32, i32* @O_WRONLY
%9 = load i32, i32* @O_CREAT
%10 = or i32 %8, %9
%11 = call i32 @open(i8* %7, i32 %10)
store i32 %11, i32* %5
%12 = load i8*, i8** %4
%13 = call i32 @strlen(i8* %12)
store i32 %13, i32* %6
%14 = load i32, i32* %5
%15 = load i8*, i8** %4
%16 = load i32, i32* %6
%17 = call i32 @write(i32 %14, i8* %15, i32 %16)
%18 = load i32, i32* %5
%19 = call i32 @close(i32 %18)
ret i32 0
}

LLVM IR (-O2):
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
define i32 @file_dump(i8* nocapture %0, i8* %1) {
%3 = load i32, i32* @O_WRONLY
%4 = load i32, i32* @O_CREAT
%5 = or i32 %4, %3
%6 = tail call i32 @open(i8* %0, i32 %5)
%7 = tail call i32 @strlen(i8* %1)
%8 = tail call i32 @write(i32 %6, i8* %1, i32 %7)
%9 = tail call i32 @close(i32 %6)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ EBADF;
scalar_t__ sys_isatty(int);
int /*<<< orphan*/ sys_stub(int /*<<< orphan*/);
off_t sys_lseek(int fd, off_t ptr, int dir) {
  ;
  if (sys_isatty(fd)) {
    return 0;
  }
  return sys_stub(EBADF);
}


x86 assembly (clang, -O0):
<sys_lseek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <sys_isatty@plt>
cmp    $0x0,%rax
je     114f <sys_lseek+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1160 <sys_lseek+0x40>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
call   1030 <sys_stub@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_lseek>:
push   %rax
call   1040 <sys_isatty@plt>
test   %rax,%rax
je     112f <sys_lseek+0xf>
xor    %eax,%eax
pop    %rcx
ret
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1030 <sys_stub@plt>

LLVM IR (-O0):
@EBADF = global i32 0
define i32 @sys_lseek(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %5
%9 = call i64 @sys_isatty(i32 %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %3
store i32 0, i32* %4
br label %15
12: ; preds = %3
%13 = load i32, i32* @EBADF
%14 = call i32 @sys_stub(i32 %13)
store i32 %14, i32* %4
br label %15
15: ; preds = %12, %11
%16 = load i32, i32* %4
ret i32 %16
}

LLVM IR (-O2):
@EBADF = global i32 0
define i32 @sys_lseek(i32 %0, i32 %1, i32 %2) {
%4 = tail call i64 @sys_isatty(i32 %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i32, i32* @EBADF
%8 = tail call i32 @sys_stub(i32 %7)
br label %9
9: ; preds = %3, %6
%10 = phi i32 [ %8, %6 ], [ 0, %3 ]
ret i32 %10
}
/* Variables and functions */
int test_if7(void) {
  if (1)
    return 'g';
  else
    return 0;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @test_if7() {
ret i32 103
}

LLVM IR (-O2):
define i32 @test_if7() {
ret i32 103
}
/* Variables and functions */
int ERR_isError(size_t);
unsigned HUFv05_isError(size_t code) { return ERR_isError(code); }


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

x86 assembly (clang, -O2):
<HUFv05_isError>:
jmp    1030 <ERR_isError@plt>

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

LLVM IR (-O2):
define i32 @HUFv05_isError(i64 %0) {
%2 = tail call i32 @ERR_isError(i64 %0)
ret i32 %2
}
/* Variables and functions */
int classify_char(char);
char *next_nonvoid(char *str) {
  for (str++; *str; str++)
    if (classify_char(*str) != 1)
      return str;
  return NULL;
}


x86 assembly (clang, -O0):
<next_nonvoid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     116d <next_nonvoid+0x5d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <classify_char@plt>
cmp    $0x1,%eax
je     1157 <next_nonvoid+0x47>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1175 <next_nonvoid+0x65>
jmp    115c <next_nonvoid+0x4c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1128 <next_nonvoid+0x18>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_nonvoid>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl 0x1(%rbx),%eax
test   %al,%al
je     113b <next_nonvoid+0x2b>
add    $0x1,%rbx
movsbl %al,%edi
call   1030 <classify_char@plt>
cmp    $0x1,%eax
je     1120 <next_nonvoid+0x10>
jmp    113d <next_nonvoid+0x2d>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @next_nonvoid(i8* %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i8* [ %0, %1 ], [ %4, %7 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = tail call i32 @classify_char(i8 signext %5)
%9 = icmp eq i32 %8, 1
br i1 %9, label %2, label %10
10: ; preds = %2, %7
%11 = phi i8* [ %4, %7 ], [ null, %2 ]
ret i8* %11
}
unsigned long long foo(unsigned int x) {
  return ((unsigned long long)x & 0x00ff000000000000ULL) >> 40;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movabs $0xff000000000000,%rcx
and    %rcx,%rax
shr    $0x28,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = and i64 %4, 71776119061217280
%6 = lshr i64 %5, 40
ret i64 %6
}

LLVM IR (-O2):
define i64 @foo(i32 %0) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *prog_name) {
  fprintf(stderr, "Usage:  %s <Server Port>\n", prog_name);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"Usage: %s <Server Port>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"Usage: %s <Server Port>\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct snd_pcm_hw_params {
  struct snd_interval *intervals;
};
struct snd_interval {
  int dummy;
};

/* Variables and functions */
int SNDRV_PCM_HW_PARAM_FIRST_INTERVAL;
struct snd_interval *param_to_interval(struct snd_pcm_hw_params *p, int n) {
  return &(p->intervals[n - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL]);
}


x86 assembly (clang, -O0):
<param_to_interval>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0xc(%rbp),%ecx
mov    0x2ebc(%rip),%rdx
sub    (%rdx),%ecx
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<param_to_interval>:
mov    0x2ed1(%rip),%rax
movslq (%rax),%rcx
movslq %esi,%rax
sub    %rcx,%rax
shl    $0x2,%rax
add    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.snd_interval = type { i32 }
%struct.snd_pcm_hw_params = type { %struct.snd_interval* }
@SNDRV_PCM_HW_PARAM_FIRST_INTERVAL = global i32 0
define %struct.snd_interval* @param_to_interval(%struct.snd_pcm_hw_params* %0, i32 %1) {
%3 = alloca %struct.snd_pcm_hw_params*
%4 = alloca i32
store %struct.snd_pcm_hw_params* %0, %struct.snd_pcm_hw_params** %3
store i32 %1, i32* %4
%5 = load %struct.snd_pcm_hw_params*, %struct.snd_pcm_hw_params** %3
%6 = getelementptr inbounds %struct.snd_pcm_hw_params, %struct.snd_pcm_hw_params* %5, i32 0, i32 0
%7 = load %struct.snd_interval*, %struct.snd_interval** %6
%8 = load i32, i32* %4
%9 = load i32, i32* @SNDRV_PCM_HW_PARAM_FIRST_INTERVAL
%10 = sub nsw i32 %8, %9
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds %struct.snd_interval, %struct.snd_interval* %7, i64 %11
ret %struct.snd_interval* %12
}

LLVM IR (-O2):
%struct.snd_interval = type { i32 }
%struct.snd_pcm_hw_params = type { %struct.snd_interval* }
@SNDRV_PCM_HW_PARAM_FIRST_INTERVAL = global i32 0
define %struct.snd_interval* @param_to_interval(%struct.snd_pcm_hw_params* nocapture %0, i32 %1) {
%3 = getelementptr inbounds %struct.snd_pcm_hw_params, %struct.snd_pcm_hw_params* %0, i64 0, i32 0
%4 = load %struct.snd_interval*, %struct.snd_interval** %3
%5 = load i32, i32* @SNDRV_PCM_HW_PARAM_FIRST_INTERVAL
%6 = sub nsw i32 %1, %5
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds %struct.snd_interval, %struct.snd_interval* %4, i64 %7
ret %struct.snd_interval* %8
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *xmalloc(scalar_t__);
char *xstrdup(const char *str) {
  char *cpy;
  cpy = xmalloc(strlen(str) + 1);
  strcpy(cpy, str);
  return cpy;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <xmalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <xmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @xmalloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @xstrdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @xmalloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void s_namespace_val_freeup(void *val) { free((char *)val); }


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

x86 assembly (clang, -O2):
<s_namespace_val_freeup>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @s_namespace_val_freeup(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void func_1b(int *const i) {
  printf("func_1b : %d >> ", *i);
  {
    int bkup = *i;
    *i = 10;
    printf("%d\n", *i);
    *i = bkup;
  }
}


x86 assembly (clang, -O0):
<func_1b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movl   $0xa,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_1b>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%esi
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    (%rbx),%ebp
movl   $0xa,(%rbx)
lea    0xede(%rip),%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"func_1b : %d >> \00"
@.str.1 = [4 x i8] c"%d\0A\00"
define void @func_1b(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* %0
store i32 10, i32* %0
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 10)
store i32 %4, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ inet_pton(int /*<<< orphan*/, char *, unsigned int *);
int /*<<< orphan*/ stderr;
bool parseIP(char *ip_addr, unsigned int *ip) {
  bool exit_due_to_arg_error = false;
  if (!inet_pton(AF_INET, ip_addr, ip)) {
    fprintf(stderr, "IP (%s) is incorrect and we could not continue !",
            ip_addr);
    exit_due_to_arg_error = true;
  }
  return exit_due_to_arg_error;
}


x86 assembly (clang, -O0):
<parseIP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <inet_pton@plt>
cmp    $0x0,%eax
jne    1176 <parseIP+0x56>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe96(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseIP>:
push   %rbx
mov    %rsi,%rdx
mov    %rdi,%rbx
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
call   1040 <inet_pton@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
je     1142 <parseIP+0x22>
pop    %rbx
ret
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
lea    0xeae(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@AF_INET = global i32 0
@stderr = global i32 0
@.str = [49 x i8] c"IP (%s) is incorrect and we could not continue !\00"
define i32 @parseIP(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
%6 = load i32, i32* @AF_INET
%7 = load i8*, i8** %3
%8 = load i32*, i32** %4
%9 = call i32 @inet_pton(i32 %6, i8* %7, i32* %8)
%10 = icmp ne i32 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i8*, i8** %3
%14 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %13)
store i32 1, i32* %5
br label %15
15: ; preds = %11, %2
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
@AF_INET = global i32 0
@stderr = global i32 0
@.str = [49 x i8] c"IP (%s) is incorrect and we could not continue !\00"
define i32 @parseIP(i8* %0, i32* %1) {
%3 = load i32, i32* @AF_INET
%4 = tail call i32 @inet_pton(i32 %3, i8* %0, i32* %1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %9
9: ; preds = %6, %2
%10 = phi i32 [ 0, %2 ], [ 1, %6 ]
ret i32 %10
}
void clear_buffer(void *buf, int nbytes) {
  int *ptr = buf;
  int nwords = nbytes / sizeof(int);
  while (nwords-- > 0) {
    *ptr++ = 0;
  }
}


x86 assembly (clang, -O0):
<clear_buffer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movslq -0xc(%rbp),%rax
shr    $0x2,%rax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x1c(%rbp)
cmp    $0x0,%eax
jle    114c <clear_buffer+0x4c>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x18(%rbp)
movl   $0x0,(%rax)
jmp    111e <clear_buffer+0x1e>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_buffer>:
cmp    $0x4,%esi
jl     1138 <clear_buffer+0x28>
push   %rax
sar    $0x2,%esi
test   %esi,%esi
mov    $0x1,%eax
cmovle %esi,%eax
sub    %eax,%esi
lea    0x4(,%rsi,4),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @clear_buffer(i8* nocapture writeonly %0, i32 %1) {
%3 = ashr i32 %1, 2
%4 = icmp sgt i32 %1, 3
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = call i32 @llvm.smin.i32(i32 %3, i32 1)
%7 = sub nsw i32 %3, %6
%8 = zext i32 %7 to i64
%9 = shl nuw nsw i64 %8, 2
%10 = add nuw nsw i64 %9, 4
br label %11
11: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GL_BLEND;
int /*<<< orphan*/ glDisable(int /*<<< orphan*/);
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
extern void zlBlend(unsigned char value) {
  if (value == 1) {
    glEnable(GL_BLEND);
  } else {
    glDisable(GL_BLEND);
  }
}


x86 assembly (clang, -O0):
<zlBlend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x1,%eax
jne    114e <zlBlend+0x2e>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
jmp    115c <zlBlend+0x3c>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1040 <glDisable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zlBlend>:
mov    %edi,%eax
mov    0x2ebf(%rip),%rcx
mov    (%rcx),%edi
cmp    $0x1,%al
jne    1134 <zlBlend+0x14>
jmp    1030 <glEnable@plt>
jmp    1040 <glDisable@plt>

LLVM IR (-O0):
@GL_BLEND = global i32 0
define void @zlBlend(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* @GL_BLEND
%8 = call i32 @glEnable(i32 %7)
br label %12
9: ; preds = %1
%10 = load i32, i32* @GL_BLEND
%11 = call i32 @glDisable(i32 %10)
br label %12
12: ; preds = %9, %6
ret void
}

LLVM IR (-O2):
@GL_BLEND = global i32 0
define void @zlBlend(i8 zeroext %0) {
%2 = icmp eq i8 %0, 1
%3 = load i32, i32* @GL_BLEND
br i1 %2, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @glEnable(i32 %3)
br label %8
6: ; preds = %1
%7 = tail call i32 @glDisable(i32 %3)
br label %8
8: ; preds = %6, %4
ret void
}
int prime(int x, int y) {
  if (x == y)
    return 0;
  else if (x == 1 || y == 1)
    return 1;
  else if (x % y == 0 || y % x == 0)
    return 0;
  else
    return prime(y, x % y);
}


x86 assembly (clang, -O0):
<prime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1136 <prime+0x26>
movl   $0x0,-0x4(%rbp)
jmp    1196 <prime+0x86>
cmpl   $0x1,-0x8(%rbp)
je     114a <prime+0x3a>
cmpl   $0x1,-0xc(%rbp)
jne    1156 <prime+0x46>
movl   $0x1,-0x4(%rbp)
jmp    1196 <prime+0x86>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
je     1176 <prime+0x66>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    1182 <prime+0x72>
movl   $0x0,-0x4(%rbp)
jmp    1196 <prime+0x86>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%esi
call   1030 <prime@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prime>:
cmp    %esi,%edi
je     1131 <prime+0x31>
mov    $0x1,%eax
cmp    $0x1,%edi
je     1130 <prime+0x30>
cmp    $0x1,%esi
je     1130 <prime+0x30>
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1131 <prime+0x31>
mov    %edx,%ecx
mov    %esi,%eax
cltd
idiv   %edi
mov    %esi,%edi
mov    %ecx,%esi
mov    $0x0,%eax
test   %edx,%edx
jne    1100 <prime>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @prime(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = icmp eq i32 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 0, i32* %3
br label %34
10: ; preds = %2
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 1
br i1 %12, label %16, label %13
13: ; preds = %10
%14 = load i32, i32* %5
%15 = icmp eq i32 %14, 1
br i1 %15, label %16, label %17
16: ; preds = %13, %10
store i32 1, i32* %3
br label %34
17: ; preds = %13
%18 = load i32, i32* %4
%19 = load i32, i32* %5
%20 = srem i32 %18, %19
%21 = icmp eq i32 %20, 0
br i1 %21, label %27, label %22
22: ; preds = %17
%23 = load i32, i32* %5
%24 = load i32, i32* %4
%25 = srem i32 %23, %24
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %22, %17
store i32 0, i32* %3
br label %34
28: ; preds = %22
%29 = load i32, i32* %5
%30 = load i32, i32* %4
%31 = load i32, i32* %5
%32 = srem i32 %30, %31
%33 = call i32 @prime(i32 %29, i32 %32)
store i32 %33, i32* %3
br label %34
34: ; preds = %28, %27, %16, %9
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
define i32 @prime(i32 %0, i32 %1) {
br label %3
3: ; preds = %14, %2
%4 = phi i32 [ %0, %2 ], [ %5, %14 ]
%5 = phi i32 [ %1, %2 ], [ %12, %14 ]
%6 = icmp eq i32 %4, %5
br i1 %6, label %17, label %7
7: ; preds = %3
%8 = icmp eq i32 %4, 1
%9 = icmp eq i32 %5, 1
%10 = or i1 %8, %9
br i1 %10, label %17, label %11
11: ; preds = %7
%12 = srem i32 %4, %5
%13 = icmp eq i32 %12, 0
br i1 %13, label %17, label %14
14: ; preds = %11
%15 = srem i32 %5, %4
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %3
17: ; preds = %11, %14, %7, %3
%18 = phi i32 [ 0, %3 ], [ 1, %7 ], [ 0, %14 ], [ 0, %11 ]
ret i32 %18
}
void ENGINE_load_rsax(void) {}


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

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

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

LLVM IR (-O2):
define void @ENGINE_load_rsax() {
ret void
}
/* Variables and functions */
double cvArcLength(void const *, int /*<<< orphan*/, int);
int /*<<< orphan*/ cvSlice(int /*<<< orphan*/, int);
double cvContourPerimeter(const void *contour) {
  return cvArcLength(contour, cvSlice(0, 0x3fffffff), 1);
}


x86 assembly (clang, -O0):
<cvContourPerimeter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
xor    %edi,%edi
mov    $0x3fffffff,%esi
call   1040 <cvSlice@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
mov    $0x1,%edx
call   1030 <cvArcLength@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvContourPerimeter>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
mov    $0x3fffffff,%esi
call   1040 <cvSlice@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0x1,%edx
pop    %rbx
jmp    1030 <cvArcLength@plt>

LLVM IR (-O0):
define double @cvContourPerimeter(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @cvSlice(i32 0, i32 1073741823)
%5 = call double @cvArcLength(i8* %3, i32 %4, i32 1)
ret double %5
}

LLVM IR (-O2):
define double @cvContourPerimeter(i8* %0) {
%2 = tail call i32 @cvSlice(i32 0, i32 1073741823)
%3 = tail call double @cvArcLength(i8* %0, i32 %2, i32 1)
ret double %3
}
/* Type definitions */
typedef int uint64_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
double doubleValue(uint32_t v[]) {
  return (double)((uint64_t)v[0] + ((uint64_t)v[1] << 32));
}


x86 assembly (clang, -O0):
<doubleValue>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
mov    %ecx,%edx
mov    $0x20,%ecx
shl    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @doubleValue(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 0
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = load i64*, i64** %2
%8 = getelementptr inbounds i64, i64* %7, i64 1
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = shl i32 %10, 32
%12 = add nsw i32 %6, %11
%13 = sitofp i32 %12 to double
ret double %13
}

LLVM IR (-O2):
define double @doubleValue(i64* nocapture readnone %0) {
ret double poison
}
enum { b } c() {}


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

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

LLVM IR (-O0):
define i32 @c() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @c() {
ret i32 undef
}
void SHA512_Transform(void) {}


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

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

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

LLVM IR (-O2):
define void @SHA512_Transform() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FIONBIO;
int ioctl(int, int /*<<< orphan*/, unsigned long *);
int noly_socket_set_nonblock(int sk) {
  unsigned long on = 1;
  return ioctl(sk, FIONBIO, &on);
}


x86 assembly (clang, -O0):
<noly_socket_set_nonblock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x1,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb3(%rip),%rax
mov    (%rax),%esi
lea    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<noly_socket_set_nonblock>:
push   %rax
movq   $0x1,(%rsp)
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
call   1030 <ioctl@plt>
pop    %rcx
ret

LLVM IR (-O0):
@FIONBIO = global i32 0
define i32 @noly_socket_set_nonblock(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
store i64 1, i64* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @FIONBIO
%6 = call i32 @ioctl(i32 %4, i32 %5, i64* %3)
ret i32 %6
}

LLVM IR (-O2):
@FIONBIO = global i32 0
define i32 @noly_socket_set_nonblock(i32 %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
store i64 1, i64* %2
%4 = load i32, i32* @FIONBIO
%5 = call i32 @ioctl(i32 %0, i32 %4, i64* %2)
ret i32 %5
}
int base1() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @base1() {
ret i32 1
}
int fs_grubfs_probe(int fd, long long offs) { return -1; }


x86 assembly (clang, -O0):
<fs_grubfs_probe>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @fs_grubfs_probe(i32 %0, i64 %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ showMathMenu();
int main(void) {
  showMathMenu();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @showMathMenu()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ kprintf(char *);
void ktimes(void) {
  kprintf("A");
  return;
}


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

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

LLVM IR (-O0):
@.str = [2 x i8] c"A\00"
define void @ktimes() {
%1 = call i32 @kprintf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"A\00"
define void @ktimes() {
%1 = tail call i32 @kprintf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double log(double);
double module_libc_log(double x) { return log(x); }


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

x86 assembly (clang, -O2):
<module_libc_log>:
jmp    1030 <log@plt>

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

LLVM IR (-O2):
define double @module_libc_log(double %0) {
%2 = tail call double @log(double %0)
ret double %2
}
double centigradeToFahrenheit(double centigrade) {
  return centigrade * 1.8000 + 32.00;
}


x86 assembly (clang, -O0):
<centigradeToFahrenheit>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee6(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<centigradeToFahrenheit>:
mulsd  0xef8(%rip),%xmm0
addsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @centigradeToFahrenheit(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.fmuladd.f64(double %3, double 1.800000e+00, double 3.200000e+01)
ret double %4
}

LLVM IR (-O2):
define double @centigradeToFahrenheit(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 1.800000e+00, double 3.200000e+01)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ free(long *);
void pp_free_long(long **arr_ptr) {
  if (arr_ptr) {
    free(*arr_ptr);
    *arr_ptr = NULL;
  }
}


x86 assembly (clang, -O0):
<pp_free_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113e <pp_free_long+0x2e>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pp_free_long>:
test   %rdi,%rdi
je     1129 <pp_free_long+0x19>
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @pp_free_long(i64** %0) {
%2 = icmp eq i64** %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i64*, i64** %0
%5 = tail call i32 @free(i64* %4)
store i64* null, i64** %0
br label %6
6: ; preds = %3, %1
ret void
}
double sin_integ0(const double kr, const double sinkr, const double coskr) {
  return -coskr;
}


x86 assembly (clang, -O0):
<sin_integ0>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sin_integ0>:
movaps %xmm2,%xmm0
xorps  0xef6(%rip),%xmm0
ret

LLVM IR (-O0):
define double @sin_integ0(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %6
%8 = fneg double %7
ret double %8
}

LLVM IR (-O2):
define double @sin_integ0(double %0, double %1, double %2) {
%4 = fneg double %2
ret double %4
}
void write_ledword(unsigned char **out, unsigned int dw) {
  unsigned char *p = *out;
  *p++ = dw & 0xff;
  *p++ = (dw >> 8) & 0xff;
  *p++ = (dw >> 16) & 0xff;
  *p++ = (dw >> 24) & 0xff;
  *out = p;
}


x86 assembly (clang, -O0):
<write_ledword>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
shr    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_ledword>:
mov    (%rdi),%rax
mov    %esi,(%rax)
add    $0x4,%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @write_ledword(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
%5 = alloca i8*
store i8** %0, i8*** %3
store i32 %1, i32* %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
store i8* %7, i8** %5
%8 = load i32, i32* %4
%9 = and i32 %8, 255
%10 = trunc i32 %9 to i8
%11 = load i8*, i8** %5
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %5
store i8 %10, i8* %11
%13 = load i32, i32* %4
%14 = lshr i32 %13, 8
%15 = and i32 %14, 255
%16 = trunc i32 %15 to i8
%17 = load i8*, i8** %5
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %5
store i8 %16, i8* %17
%19 = load i32, i32* %4
%20 = lshr i32 %19, 16
%21 = and i32 %20, 255
%22 = trunc i32 %21 to i8
%23 = load i8*, i8** %5
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %5
store i8 %22, i8* %23
%25 = load i32, i32* %4
%26 = lshr i32 %25, 24
%27 = and i32 %26, 255
%28 = trunc i32 %27 to i8
%29 = load i8*, i8** %5
%30 = getelementptr inbounds i8, i8* %29, i32 1
store i8* %30, i8** %5
store i8 %28, i8* %29
%31 = load i8*, i8** %5
%32 = load i8**, i8*** %3
store i8* %31, i8** %32
ret void
}

LLVM IR (-O2):
define void @write_ledword(i8** nocapture %0, i32 %1) {
%3 = load i8*, i8** %0
%4 = trunc i32 %1 to i8
%5 = getelementptr inbounds i8, i8* %3, i64 1
store i8 %4, i8* %3
%6 = lshr i32 %1, 8
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds i8, i8* %3, i64 2
store i8 %7, i8* %5
%9 = lshr i32 %1, 16
%10 = trunc i32 %9 to i8
%11 = getelementptr inbounds i8, i8* %3, i64 3
store i8 %10, i8* %8
%12 = lshr i32 %1, 24
%13 = trunc i32 %12 to i8
%14 = getelementptr inbounds i8, i8* %3, i64 4
store i8 %13, i8* %11
store i8* %14, i8** %0
ret void
}
void RTVfsIoStrmPoll(void) {}


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

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

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

LLVM IR (-O2):
define void @RTVfsIoStrmPoll() {
ret void
}
/* Variables and functions */
int booster_stat(char const *, void *);
int stat(const char *path, void *buf) { return booster_stat(path, buf); }


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

x86 assembly (clang, -O2):
<stat>:
jmp    1030 <booster_stat@plt>

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

LLVM IR (-O2):
define i32 @stat(i8* %0, i8* %1) {
%3 = tail call i32 @booster_stat(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
scalar_t__ isgraph(int);
int isprint(int c) { return isgraph(c) && c != ' '; }


x86 assembly (clang, -O0):
<isprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isgraph@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
je     113f <isprint+0x2f>
cmpl   $0x20,-0x4(%rbp)
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprint>:
push   %rbx
mov    %edi,%ebx
call   1030 <isgraph@plt>
test   %rax,%rax
setne  %al
cmp    $0x20,%ebx
setne  %cl
and    %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isprint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isgraph(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 32
br label %9
9: ; preds = %6, %1
%10 = phi i1 [ false, %1 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @isprint(i32 %0) {
%2 = tail call i64 @isgraph(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = icmp ne i32 %0, 32
%5 = and i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int de_feat_get_num_layers(unsigned int);
int bsp_disp_feat_get_num_layers(unsigned int disp) {
  return de_feat_get_num_layers(disp);
}


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

x86 assembly (clang, -O2):
<bsp_disp_feat_get_num_layers>:
jmp    1030 <de_feat_get_num_layers@plt>

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

LLVM IR (-O2):
define i32 @bsp_disp_feat_get_num_layers(i32 %0) {
%2 = tail call i32 @de_feat_get_num_layers(i32 %0)
ret i32 %2
}
int f_test(int x) {
  char arr[128 * 1024];
  return arr[x];
}


x86 assembly (clang, -O0):
<f_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1ff90,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
movsbl -0x20010(%rbp,%rax,1),%eax
ff
add    $0x1ff90,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f_test(i32 %0) {
%2 = alloca i32
%3 = alloca [131072 x i8]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [131072 x i8], [131072 x i8]* %3, i64 0, i64 %5
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @f_test(i32 %0) {
ret i32 0
}
/* Type definitions */
struct base {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void base_destructor(struct base *obj) { printf("base_destructor!!\n"); }


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

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

LLVM IR (-O0):
%struct.base = type { i32 }
@.str = [19 x i8] c"base_destructor!!\0A\00"
define void @base_destructor(%struct.base* %0) {
%2 = alloca %struct.base*
store %struct.base* %0, %struct.base** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.base = type { i32 }
@str = [18 x i8] c"base_destructor!!\00"
define void @base_destructor(%struct.base* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret void
}
int test_imm_71uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x71 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_71uint64_midword_reg>:
test   $0x710000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_71uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 7405568
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void cleanup1(void *arg) { *(int *)arg = 2; }


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

x86 assembly (clang, -O2):
<cleanup1>:
movl   $0x2,(%rdi)
ret

LLVM IR (-O0):
define void @cleanup1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
store i32 2, i32* %4
ret void
}

LLVM IR (-O2):
define void @cleanup1(i8* nocapture writeonly %0) {
%2 = bitcast i8* %0 to i32*
store i32 2, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ foo(int);
main() {
  foo(64);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x40,%edi
call   1030 <foo@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x40,%edi
call   1030 <foo@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 64)
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 64)
%2 = tail call i32 @exit(i32 0)
unreachable
}