xunge/DecIR huggingface dataset:
/* Variables and functions */
char *getConfigText(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
void getWebRootPath(char *path) {
  char *configValue;
  if ((configValue = getConfigText("web.dir", 1)) == NULL) {
    strcpy(path, "/var/www/bitmeter/");
  } else {
    strcpy(path, configValue);
  }
}


x86 assembly (clang, -O0):
<getWebRootPath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x1,%esi
call   1030 <getConfigText@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1160 <getWebRootPath+0x40>
mov    -0x8(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1040 <strcpy@plt>
jmp    116d <getWebRootPath+0x4d>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getWebRootPath>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    $0x1,%esi
call   1030 <getConfigText@plt>
test   %rax,%rax
je     1146 <getWebRootPath+0x26>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1040 <strcpy@plt>
lea    0xebb(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <strcpy@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"web.dir\00"
@.str.1 = [19 x i8] c"/var/www/bitmeter/\00"
define void @getWebRootPath(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i8* @getConfigText(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 1)
store i8* %4, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
br label %13
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = load i8*, i8** %3
%12 = call i32 @strcpy(i8* %10, i8* %11)
br label %13
13: ; preds = %9, %6
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"web.dir\00"
@.str.1 = [19 x i8] c"/var/www/bitmeter/\00"
define void @getWebRootPath(i8* %0) {
%2 = tail call i8* @getConfigText(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
br label %8
6: ; preds = %1
%7 = tail call i32 @strcpy(i8* %0, i8* %2)
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ varfunc();
void main() {
  int i;
  for (i = 0; i < 3; i++)
    varfunc();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
jge    113e <main+0x2e>
mov    $0x0,%al
call   1030 <varfunc@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <main+0xf>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %7, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 3
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = call i32 (...) @varfunc()
br label %7
7: ; preds = %5
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %2
10: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @varfunc()
%2 = tail call i32 (...) @varfunc()
%3 = tail call i32 (...) @varfunc()
ret void
}
/* Type definitions */
struct stat {
  int st_size;
};

/* Variables and functions */
int /*<<< orphan*/ fstat(int, struct stat *);
int get_file_size(int fd) {
  struct stat _info;
  fstat(fd, &_info);
  return _info.st_size;
}


x86 assembly (clang, -O0):
<get_file_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1030 <fstat@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_file_size>:
push   %rax
mov    %rsp,%rsi
call   1030 <fstat@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @get_file_size(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.stat
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @fstat(i32 %4, %struct.stat* %3)
%6 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @get_file_size(i32 %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @fstat(i32 %0, %struct.stat* %2)
%5 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}
/* Variables and functions */
long double __qcosh(long double);
long double __q_cosh(long double *arg) { return (__qcosh(*arg)); }


x86 assembly (clang, -O0):
<__q_cosh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
fldt   (%rax)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <__qcosh@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__q_cosh>:
sub    $0x18,%rsp
fldt   (%rdi)
fstpt  (%rsp)
call   1030 <__qcosh@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @__q_cosh(x86_fp80* %0) {
%2 = alloca x86_fp80*
store x86_fp80* %0, x86_fp80** %2
%3 = load x86_fp80*, x86_fp80** %2
%4 = load x86_fp80, x86_fp80* %3
%5 = call x86_fp80 @__qcosh(x86_fp80 %4)
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @__q_cosh(x86_fp80* nocapture %0) {
%2 = load x86_fp80, x86_fp80* %0
%3 = tail call x86_fp80 @__qcosh(x86_fp80 %2)
ret x86_fp80 %3
}
void SystemCoreClockUpdate(void) {}


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

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

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

LLVM IR (-O2):
define void @SystemCoreClockUpdate() {
ret void
}
int dtls_fls(unsigned int i) {
  int n;
  for (n = 0; i; n++)
    i >>= 1;
  return n;
}


x86 assembly (clang, -O0):
<dtls_fls>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112f <dtls_fls+0x2f>
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <dtls_fls+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dtls_fls>:
xor    %eax,%eax
test   %edi,%edi
je     111c <dtls_fls+0x1c>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
shr    %ecx
add    $0x1,%eax
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <dtls_fls+0x10>
ret

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

LLVM IR (-O2):
define i32 @dtls_fls(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Variables and functions */
void g();
int f(int i) { i ? (void)0 : g(); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112a <f+0x1a>
jmp    1131 <f+0x21>
mov    $0x0,%al
call   1030 <g@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
test   %edi,%edi
je     1115 <f+0x5>
ret
push   %rax
xor    %eax,%eax
call   1030 <g@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %4
3: ; preds = %1
tail call void (...) @g()
br label %4
4: ; preds = %1, %3
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ foo(int /*<<< orphan*/, int, long, int *);
int main() {
  int i = 1;
  long l = 2;
  int *p = &i;
  foo(0, i, l, p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movq   $0x2,-0x10(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
xor    %edi,%edi
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x1,0x4(%rsp)
lea    0x4(%rsp),%rcx
mov    $0x2,%edx
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
%4 = alloca i32*
store i32 0, i32* %1
store i32 1, i32* %2
store i64 2, i64* %3
store i32* %2, i32** %4
%5 = load i32, i32* %2
%6 = load i64, i64* %3
%7 = load i32*, i32** %4
%8 = call i32 @foo(i32 0, i32 %5, i64 %6, i32* %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 1, i32* %1
%3 = call i32 @foo(i32 0, i32 1, i64 2, i32* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void kerror(const char *s) {
  fprintf(stderr, "%s\n", s);
  exit(1);
}


x86 assembly (clang, -O0):
<kerror>:
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):
<kerror>:
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 = [4 x i8] c"%s\0A\00"
define void @kerror(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 ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @kerror(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
char *concat(char *, char *);
char *getString(char *input) {
  char *test = "welcome: <b>";
  test = concat(test, input);
  test = concat(test, "</b> from C++");
  return test;
}


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

x86 assembly (clang, -O2):
<getString>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <concat@plt>
lea    0xee6(%rip),%rsi
mov    %rax,%rdi
pop    %rax
jmp    1030 <concat@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"welcome: <b>\00"
@.str.1 = [14 x i8] c"</b> from C++\00"
define i8* @getString(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %3
%5 = load i8*, i8** %2
%6 = call i8* @concat(i8* %4, i8* %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i8* @concat(i8* %7, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
store i8* %8, i8** %3
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
@.str = [13 x i8] c"welcome: <b>\00"
@.str.1 = [14 x i8] c"</b> from C++\00"
define i8* @getString(i8* %0) {
%2 = tail call i8* @concat(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i8* @concat(i8* %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret i8* %3
}
void disableAprsPwm(void) {}


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

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

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

LLVM IR (-O2):
define void @disableAprsPwm() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cpu_enable_int();
int /*<<< orphan*/ scheduler_init();
void os_init(void) {
  scheduler_init();
  cpu_enable_int();
}


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

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

LLVM IR (-O0):
define void @os_init() {
%1 = call i32 (...) @scheduler_init()
%2 = call i32 (...) @cpu_enable_int()
ret void
}

LLVM IR (-O2):
define void @os_init() {
%1 = tail call i32 (...) @scheduler_init()
%2 = tail call i32 (...) @cpu_enable_int()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
void free_anything(int *p) { free(p); }


x86 assembly (clang, -O0):
<free_anything>:
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):
<free_anything>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_anything(i32* nocapture %0) {
%2 = tail call i32 @free(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ alarm(int);
int /*<<< orphan*/ printProgress();
void alarmInterrupt() {
  if (!printProgress())
    alarm(20);
}


x86 assembly (clang, -O0):
<alarmInterrupt>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <printProgress@plt>
cmp    $0x0,%eax
jne    113e <alarmInterrupt+0x1e>
mov    $0x14,%edi
call   1030 <alarm@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<alarmInterrupt>:
push   %rax
xor    %eax,%eax
call   1040 <printProgress@plt>
test   %eax,%eax
je     112e <alarmInterrupt+0xe>
pop    %rax
ret
mov    $0x14,%edi
pop    %rax
jmp    1030 <alarm@plt>

LLVM IR (-O0):
define void @alarmInterrupt() {
%1 = call i32 (...) @printProgress()
%2 = icmp ne i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = call i32 @alarm(i32 20)
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @alarmInterrupt() {
%1 = tail call i32 (...) @printProgress()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @alarm(i32 20)
br label %5
5: ; preds = %3, %0
ret void
}
void memory_present(int nid, unsigned long start, unsigned long end) {}


x86 assembly (clang, -O0):
<memory_present>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @memory_present(i32 %0, i64 %1, i64 %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
store i32 %0, i32* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
ret void
}

LLVM IR (-O2):
define void @memory_present(i32 %0, i64 %1, i64 %2) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ w;
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(scalar_t__ *, int *, int);
void store32(uint8_t *dst, uint32_t w) {
  const union {
    long one;
    char little;
  } is_endian = {1};
  if (is_endian.little) {
    memcpy(dst, &w, sizeof(w));
  } else {
    uint8_t *p = (uint8_t *)dst;
    int i;
    for (i = 0; i < 4; i++)
      p[i] = (uint8_t)(w >> (8 * i));
  }
}


x86 assembly (clang, -O0):
<store32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x18(%rbp)
cmpb   $0x0,-0x18(%rbp)
je     114b <store32+0x3b>
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
jmp    1191 <store32+0x81>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x4,-0x24(%rbp)
jge    118c <store32+0x7c>
mov    -0xc(%rbp),%eax
mov    -0x24(%rbp),%ecx
shl    $0x3,%ecx
sar    %cl,%eax
movslq %eax,%rdx
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    115a <store32+0x4a>
jmp    1191 <store32+0x81>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<store32>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
%union.anon = type { i64 }
@__const.store32.is_endian = %union.anon { i64 1 }
define void @store32(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
%5 = alloca %union.anon
%6 = alloca i64*
%7 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%8 = bitcast %union.anon* %5 to i8*
%9 = bitcast %union.anon* %5 to i8*
%10 = load i8, i8* %9
%11 = icmp ne i8 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load i64*, i64** %3
%14 = call i32 @memcpy(i64* %13, i32* %4, i32 4)
br label %34
15: ; preds = %2
%16 = load i64*, i64** %3
store i64* %16, i64** %6
store i32 0, i32* %7
br label %17
17: ; preds = %30, %15
%18 = load i32, i32* %7
%19 = icmp slt i32 %18, 4
br i1 %19, label %20, label %33
20: ; preds = %17
%21 = load i32, i32* %4
%22 = load i32, i32* %7
%23 = mul nsw i32 8, %22
%24 = ashr i32 %21, %23
%25 = sext i32 %24 to i64
%26 = load i64*, i64** %6
%27 = load i32, i32* %7
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i64, i64* %26, i64 %28
store i64 %25, i64* %29
br label %30
30: ; preds = %20
%31 = load i32, i32* %7
%32 = add nsw i32 %31, 1
store i32 %32, i32* %7
br label %17
33: ; preds = %17
br label %34
34: ; preds = %33, %12
ret void
}

LLVM IR (-O2):
define void @store32(i64* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @memcpy(i64* %0, i32* %3, i32 4)
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ perform_rites_of_passage(char *);
int main() {
  perform_rites_of_passage(L"mingw-get.exe");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <perform_rites_of_passage@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i32] [i32 109, i32 105, i32 110, i32 103, i32 119, i32 45, i32 103, i32 101, i32 116, i32 46, i32 101, i32 120, i32 101, i32 0]
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @perform_rites_of_passage(i8* bitcast ([14 x i32]* @.str to i8*))
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}

LLVM IR (-O2):
@.str = [14 x i32] [i32 109, i32 105, i32 110, i32 103, i32 119, i32 45, i32 103, i32 101, i32 116, i32 46, i32 101, i32 120, i32 101, i32 0]
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @perform_rites_of_passage(i8* bitcast ([14 x i32]* @.str to i8*))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
char is_leap(int year) {
  return year % 4 == 0 && (year % 100 != 0 || year % 400 == 0);
}


x86 assembly (clang, -O0):
<is_leap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    $0x0,%edx
mov    %al,-0x5(%rbp)
jne    1153 <is_leap+0x53>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x6(%rbp)
jne    114d <is_leap+0x4d>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_leap>:
test   $0x3,%dil
je     1109 <is_leap+0x9>
xor    %eax,%eax
ret
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
mov    $0x1,%al
cmp    $0x28f5c28,%edx
jbe    1125 <is_leap+0x25>
ret
ror    $0x4,%ecx
cmp    $0xa3d70b,%ecx
setb   %al
ret

LLVM IR (-O0):
define signext i8 @is_leap(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 4
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %16
6: ; preds = %1
%7 = load i32, i32* %2
%8 = srem i32 %7, 100
%9 = icmp ne i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = srem i32 %11, 400
%13 = icmp eq i32 %12, 0
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ true, %6 ], [ %13, %10 ]
br label %16
16: ; preds = %14, %1
%17 = phi i1 [ false, %1 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
%19 = trunc i32 %18 to i8
ret i8 %19
}

LLVM IR (-O2):
define signext i8 @is_leap(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = srem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i8
br label %11
11: ; preds = %4, %7, %1
%12 = phi i8 [ 0, %1 ], [ 1, %4 ], [ %10, %7 ]
ret i8 %12
}
int af_bits2fmt(int bits) { return (bits / 8 - 1) << 3; }


x86 assembly (clang, -O0):
<af_bits2fmt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
sub    $0x1,%eax
shl    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<af_bits2fmt>:
lea    0x7(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
and    $0xfffffff8,%eax
add    $0xfffffff8,%eax
ret

LLVM IR (-O0):
define i32 @af_bits2fmt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 8
%5 = sub nsw i32 %4, 1
%6 = shl i32 %5, 3
ret i32 %6
}

LLVM IR (-O2):
define i32 @af_bits2fmt(i32 %0) {
%2 = sdiv i32 %0, 8
%3 = shl nsw i32 %2, 3
%4 = add i32 %3, -8
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int syscall(int, int /*<<< orphan*/, int /*<<< orphan*/);
int setpgid(pid_t pid, pid_t pgid) { return syscall(57, pid, pgid); }


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

x86 assembly (clang, -O2):
<setpgid>:
mov    %esi,%edx
mov    %edi,%esi
mov    $0x39,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @setpgid(i32 %0, i32 %1) {
%3 = tail call i32 @syscall(i32 57, i32 %0, i32 %1)
ret i32 %3
}
unsigned long long ff(unsigned long long a) {
  return a | 0xffffffffff000000ull;
}


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

x86 assembly (clang, -O2):
<ff>:
mov    %rdi,%rax
or     $0xffffffffff000000,%rax
ret

LLVM IR (-O0):
define i64 @ff(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = or i64 %3, -16777216
ret i64 %4
}

LLVM IR (-O2):
define i64 @ff(i64 %0) {
%2 = or i64 %0, -16777216
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ printf(char *);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int main() {
  int s = socket(AF_INET, SOCK_STREAM, 0);
  if (s > 0)
    printf("request socket success \n");
  else
    printf("request socket failed \n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <socket@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1166 <main+0x46>
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
jmp    1172 <main+0x52>
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <socket@plt>
test   %eax,%eax
lea    0xed4(%rip),%rax
lea    0xeb6(%rip),%rdi
cmovg  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [25 x i8] c"request socket success \0A\00"
@.str.1 = [24 x i8] c"request socket failed \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @AF_INET
%4 = load i32, i32* @SOCK_STREAM
%5 = call i32 @socket(i32 %3, i32 %4, i32 0)
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
ret i32 0
}

LLVM IR (-O2):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@str = [23 x i8] c"request socket failed \00"
@str.2 = [24 x i8] c"request socket success \00"
define i32 @main() {
%1 = load i32, i32* @AF_INET
%2 = load i32, i32* @SOCK_STREAM
%3 = tail call i32 @socket(i32 %1, i32 %2, i32 0)
%4 = icmp sgt i32 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0)
%6 = tail call i32 @puts(i8* dereferenceable(1) %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ WSACleanup();
void os_net_shutdown(void) { WSACleanup(); }


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

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

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

LLVM IR (-O2):
define void @os_net_shutdown() {
%1 = tail call i32 (...) @WSACleanup()
ret void
}
/* Variables and functions */
scalar_t__ strncmp(void *, char *, int);
void *search_head(size_t e) {
  e = (e >> 12) << 12;
  while (strncmp((void *)e, "\177ELF", 4))
    e -= 0x1000;
  return (void *)e;
}


x86 assembly (clang, -O0):
<search_head>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0xc,%rax
shl    $0xc,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     115e <search_head+0x4e>
mov    -0x8(%rbp),%rax
sub    $0x1000,%rax
mov    %rax,-0x8(%rbp)
jmp    112c <search_head+0x1c>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<search_head>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
and    $0xfffffffffffff000,%rbx
lea    0xedb(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
add    $0xfffffffffffff000,%rbx
test   %rax,%rax
jne    1130 <search_head+0x20>
add    $0x1000,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"\7FELF\00"
define i8* @search_head(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 12
%5 = shl i64 %4, 12
store i64 %5, i64* %2
br label %6
6: ; preds = %11, %1
%7 = load i64, i64* %2
%8 = inttoptr i64 %7 to i8*
%9 = call i64 @strncmp(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %6
%12 = load i64, i64* %2
%13 = sub i64 %12, 4096
store i64 %13, i64* %2
br label %6
14: ; preds = %6
%15 = load i64, i64* %2
%16 = inttoptr i64 %15 to i8*
ret i8* %16
}

LLVM IR (-O2):
@.str = [5 x i8] c"\7FELF\00"
define i8* @search_head(i64 %0) {
%2 = and i64 %0, -4096
br label %3
3: ; preds = %3, %1
%4 = phi i64 [ %2, %1 ], [ %8, %3 ]
%5 = inttoptr i64 %4 to i8*
%6 = tail call i64 @strncmp(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%7 = icmp eq i64 %6, 0
%8 = add i64 %4, -4096
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = inttoptr i64 %4 to i8*
ret i8* %10
}
int MUD_unpack(num, inBinSize, inArray, outBinSize, outArray)
int num;
int inBinSize;
void *inArray;
int outBinSize;
void *outArray;
{
  return (
      MUD_SEC_GEN_HIST_unpack(num, inBinSize, inArray, outBinSize, outArray));
}


x86 assembly (clang, -O0):
<MUD_unpack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    $0x0,%al
call   1030 <MUD_SEC_GEN_HIST_unpack@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @MUD_unpack(i32 %0, i32 %1, i8* %2, i32 %3, i8* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i8*, i8** %8
%14 = load i32, i32* %9
%15 = load i8*, i8** %10
%16 = call i32 (i32, i32, i8*, i32, i8*, ...) bitcast (i32 (...)* @MUD_SEC_GEN_HIST_unpack to i32 (i32, i32, i8*, i32, i8*, ...)*)(i32 %11, i32 %12, i8* %13, i32 %14, i8* %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @MUD_unpack(i32 %0, i32 %1, i8* %2, i32 %3, i8* %4) {
%6 = tail call i32 (i32, i32, i8*, i32, i8*, ...) bitcast (i32 (...)* @MUD_SEC_GEN_HIST_unpack to i32 (i32, i32, i8*, i32, i8*, ...)*)(i32 %0, i32 %1, i8* %2, i32 %3, i8* %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ add(size_t, int /*<<< orphan*/);
int /*<<< orphan*/ mul(size_t, size_t);
void *xmalloc(int /*<<< orphan*/);
void *xmallocs(size_t mainsize, size_t count, size_t elemsize) {
  return xmalloc(add(mainsize, mul(count, elemsize)));
}


x86 assembly (clang, -O0):
<xmallocs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <mul@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1030 <add@plt>
mov    %eax,%edi
call   1040 <xmalloc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmallocs>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1050 <mul@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <add@plt>
mov    %eax,%edi
pop    %rbx
jmp    1040 <xmalloc@plt>

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

LLVM IR (-O2):
define i8* @xmallocs(i64 %0, i64 %1, i64 %2) {
%4 = tail call i32 @mul(i64 %1, i64 %2)
%5 = tail call i32 @add(i64 %0, i32 %4)
%6 = tail call i8* @xmalloc(i32 %5)
ret i8* %6
}
int callback3_int_int_int(int (*f)(int)) {
  if (f)
    return f(3);
  else
    return 79;
}


x86 assembly (clang, -O0):
<callback3_int_int_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1127 <callback3_int_int_int+0x27>
mov    $0x3,%edi
call   *-0x10(%rbp)
mov    %eax,-0x4(%rbp)
jmp    112e <callback3_int_int_int+0x2e>
movl   $0x4f,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<callback3_int_int_int>:
test   %rdi,%rdi
je     110f <callback3_int_int_int+0xf>
mov    %rdi,%rax
mov    $0x3,%edi
jmp    *%rax
mov    $0x4f,%eax
ret

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

LLVM IR (-O2):
define i32 @callback3_int_int_int(i32 (i32)* %0) {
%2 = icmp eq i32 (i32)* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 %0(i32 3)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 79, %1 ]
ret i32 %6
}
int is_lower_alpha(char c) { return 'a' <= c && c <= 'z'; }


x86 assembly (clang, -O0):
<is_lower_alpha>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x61,%ecx
cmp    %edx,%ecx
mov    %al,-0x2(%rbp)
jg     112d <is_lower_alpha+0x2d>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_lower_alpha>:
add    $0x9f,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_lower_alpha(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sle i32 97, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_lower_alpha(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int setegid(int);
int setgid(int);
int setregid(int rgid, int egid) {
  if (rgid != -1)
    if (setgid(rgid) == -1)
      return (-1);
  if (egid != -1)
    if (setegid(egid) == -1)
      return (-1);
}


x86 assembly (clang, -O0):
<setregid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
je     115a <setregid+0x3a>
mov    -0x8(%rbp),%edi
call   1030 <setgid@plt>
cmp    $0xffffffff,%eax
jne    1155 <setregid+0x35>
movl   $0xffffffff,-0x4(%rbp)
jmp    1186 <setregid+0x66>
jmp    115a <setregid+0x3a>
cmpl   $0xffffffff,-0xc(%rbp)
je     1186 <setregid+0x66>
mov    -0xc(%rbp),%edi
call   1040 <setegid@plt>
cmp    $0xffffffff,%eax
jne    1181 <setregid+0x61>
movl   $0xffffffff,-0x4(%rbp)
jmp    1186 <setregid+0x66>
jmp    1186 <setregid+0x66>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setregid>:
push   %rbx
mov    %esi,%ebx
cmp    $0xffffffff,%edi
je     1145 <setregid+0x25>
call   1030 <setgid@plt>
cmp    $0xffffffff,%ebx
je     113e <setregid+0x1e>
cmp    $0xffffffff,%eax
je     113e <setregid+0x1e>
mov    %ebx,%edi
call   1040 <setegid@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret
cmp    $0xffffffff,%ebx
jne    1137 <setregid+0x17>
jmp    113e <setregid+0x1e>

LLVM IR (-O0):
define i32 @setregid(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 = icmp ne i32 %6, -1
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i32, i32* %4
%10 = call i32 @setgid(i32 %9)
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 -1, i32* %3
br label %23
13: ; preds = %8
br label %14
14: ; preds = %13, %2
%15 = load i32, i32* %5
%16 = icmp ne i32 %15, -1
br i1 %16, label %17, label %23
17: ; preds = %14
%18 = load i32, i32* %5
%19 = call i32 @setegid(i32 %18)
%20 = icmp eq i32 %19, -1
br i1 %20, label %21, label %22
21: ; preds = %17
store i32 -1, i32* %3
br label %23
22: ; preds = %17
br label %23
23: ; preds = %12, %21, %22, %14
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @setregid(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, -1
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = tail call i32 @setgid(i32 %0)
%6 = icmp eq i32 %5, -1
%7 = icmp eq i32 %1, -1
%8 = or i1 %7, %6
br i1 %8, label %13, label %11
9: ; preds = %2
%10 = icmp eq i32 %1, -1
br i1 %10, label %13, label %11
11: ; preds = %4, %9
%12 = tail call i32 @setegid(i32 %1)
br label %13
13: ; preds = %11, %4, %9
ret i32 -1
}
START_NVRAM_VAR_STRUCT(S2_boxee_0_12) {}


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

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

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

LLVM IR (-O2):
define i32 @START_NVRAM_VAR_STRUCT(i32 %0) {
ret i32 undef
}
int test_imm_A8uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0xA8 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_A8uint64_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, 168
%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_A8uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 11010048
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t reverse_bits(uint8_t b) {
  return (((b & 0x80) >> 7) | ((b & 0x40) >> 5) | ((b & 0x20) >> 3) |
          ((b & 0x10) >> 1) | ((b & 0x08) << 1) | ((b & 0x04) << 3) |
          ((b & 0x02) << 5) | ((b & 0x01) << 7));
}


x86 assembly (clang, -O0):
<reverse_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x80,%eax
sar    $0x7,%eax
mov    -0x4(%rbp),%ecx
and    $0x40,%ecx
sar    $0x5,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0x20,%ecx
sar    $0x3,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0x10,%ecx
sar    $0x1,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0x8,%ecx
shl    $0x1,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0x4,%ecx
shl    $0x3,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0x2,%ecx
shl    $0x5,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0x1,%ecx
shl    $0x7,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse_bits>:
rol    $0x4,%dil
mov    %edi,%eax
and    $0x33,%al
shl    $0x2,%al
shr    $0x2,%dil
and    $0x33,%dil
or     %al,%dil
mov    %edi,%eax
and    $0x55,%al
add    %al,%al
shr    %dil
and    $0x55,%dil
or     %al,%dil
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @reverse_bits(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 128
%5 = ashr i32 %4, 7
%6 = load i32, i32* %2
%7 = and i32 %6, 64
%8 = ashr i32 %7, 5
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = and i32 %10, 32
%12 = ashr i32 %11, 3
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = and i32 %14, 16
%16 = ashr i32 %15, 1
%17 = or i32 %13, %16
%18 = load i32, i32* %2
%19 = and i32 %18, 8
%20 = shl i32 %19, 1
%21 = or i32 %17, %20
%22 = load i32, i32* %2
%23 = and i32 %22, 4
%24 = shl i32 %23, 3
%25 = or i32 %21, %24
%26 = load i32, i32* %2
%27 = and i32 %26, 2
%28 = shl i32 %27, 5
%29 = or i32 %25, %28
%30 = load i32, i32* %2
%31 = and i32 %30, 1
%32 = shl i32 %31, 7
%33 = or i32 %29, %32
ret i32 %33
}

LLVM IR (-O2):
define i32 @reverse_bits(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = tail call i8 @llvm.bitreverse.i8(i8 %2)
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
uint64_t leuint64(const uint8_t *t) {
  uint32_t x = t[0] | t[1] << 8 | t[2] << 16 | t[3] << 24;
  uint32_t y = t[4] | t[5] << 8 | t[6] << 16 | t[7] << 24;
  return (uint64_t)x | (uint64_t)y << 32;
}


x86 assembly (clang, -O0):
<leuint64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0xc(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%eax
mov    -0x8(%rbp),%rcx
mov    0x14(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x18(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x1c(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%edx
mov    $0x20,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @leuint64(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = load i32, i32* %9
%11 = shl i32 %10, 8
%12 = or i32 %7, %11
%13 = load i32*, i32** %2
%14 = getelementptr inbounds i32, i32* %13, i64 2
%15 = load i32, i32* %14
%16 = shl i32 %15, 16
%17 = or i32 %12, %16
%18 = load i32*, i32** %2
%19 = getelementptr inbounds i32, i32* %18, i64 3
%20 = load i32, i32* %19
%21 = shl i32 %20, 24
%22 = or i32 %17, %21
store i32 %22, i32* %3
%23 = load i32*, i32** %2
%24 = getelementptr inbounds i32, i32* %23, i64 4
%25 = load i32, i32* %24
%26 = load i32*, i32** %2
%27 = getelementptr inbounds i32, i32* %26, i64 5
%28 = load i32, i32* %27
%29 = shl i32 %28, 8
%30 = or i32 %25, %29
%31 = load i32*, i32** %2
%32 = getelementptr inbounds i32, i32* %31, i64 6
%33 = load i32, i32* %32
%34 = shl i32 %33, 16
%35 = or i32 %30, %34
%36 = load i32*, i32** %2
%37 = getelementptr inbounds i32, i32* %36, i64 7
%38 = load i32, i32* %37
%39 = shl i32 %38, 24
%40 = or i32 %35, %39
store i32 %40, i32* %4
%41 = load i32, i32* %3
%42 = load i32, i32* %4
%43 = shl i32 %42, 32
%44 = or i32 %41, %43
ret i32 %44
}

LLVM IR (-O2):
define i32 @leuint64(i32* nocapture readnone %0) {
ret i32 poison
}
/* Variables and functions */
size_t pso_prsd_max_compressed_size(size_t len) {
  return pso_prsd_max_compressed_size(len) + 8;
}


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

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

LLVM IR (-O0):
define i64 @pso_prsd_max_compressed_size(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @pso_prsd_max_compressed_size(i64 %3)
%5 = add i64 %4, 8
ret i64 %5
}

LLVM IR (-O2):
define i64 @pso_prsd_max_compressed_size(i64 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p256_from_bytes(uintptr_t, uintptr_t);
void fiat_p256_from_bytes(uint64_t out1[4], const uint8_t arg1[32]) {
  internal_fiat_p256_from_bytes((uintptr_t)out1, (uintptr_t)arg1);
}


x86 assembly (clang, -O0):
<fiat_p256_from_bytes>:
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 <internal_fiat_p256_from_bytes@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fiat_p256_from_bytes>:
jmp    1030 <internal_fiat_p256_from_bytes@plt>

LLVM IR (-O0):
define void @fiat_p256_from_bytes(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = ptrtoint i32* %5 to i64
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = call i32 @internal_fiat_p256_from_bytes(i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
define void @fiat_p256_from_bytes(i32* %0, i32* %1) {
%3 = ptrtoint i32* %0 to i64
%4 = ptrtoint i32* %1 to i64
%5 = tail call i32 @internal_fiat_p256_from_bytes(i64 %3, i64 %4)
ret void
}
/* Variables and functions */
size_t str_rindex_n(char const *, char const *, size_t);
size_t u_rindex_n(const char *haystack, const char *needle, size_t n) {
  return str_rindex_n(haystack, needle, n);
}


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

x86 assembly (clang, -O2):
<u_rindex_n>:
jmp    1030 <str_rindex_n@plt>

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

LLVM IR (-O2):
define i64 @u_rindex_n(i8* %0, i8* %1, i64 %2) {
%4 = tail call i64 @str_rindex_n(i8* %0, i8* %1, i64 %2)
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ OCSP_BASICRESP;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ OCSP_BASICRESP_it;
int i2d_OCSP_BASICRESP(OCSP_BASICRESP *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &OCSP_BASICRESP_it);
}


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

x86 assembly (clang, -O2):
<i2d_OCSP_BASICRESP>:
mov    0x2ed1(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

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

LLVM IR (-O2):
@OCSP_BASICRESP_it = global i32 0
define i32 @i2d_OCSP_BASICRESP(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @OCSP_BASICRESP_it)
ret i32 %3
}