xunge/DecIR huggingface dataset:
/* Variables and functions */
int get_resource_size(char *);
int /*<<< orphan*/ printf(char *, int);
void dec_rmap(char *raw_data) {
  int num_res;
  int tot_size;
  tot_size = get_resource_size(raw_data);
  num_res = (tot_size / 0x10);
  printf("%d resources\n", num_res);
  return;
}


x86 assembly (clang, -O0):
<dec_rmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get_resource_size@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dec_rmap>:
push   %rax
call   1030 <get_resource_size@plt>
lea    0xf(%rax),%esi
test   %eax,%eax
cmovns %eax,%esi
sar    $0x4,%esi
lea    0xec8(%rip),%rdi
pop    %rax
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"%d resources\0A\00"
define void @dec_rmap(i8* %0) {
%2 = tail call i32 @get_resource_size(i8* %0)
%3 = sdiv i32 %2, 16
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void fileNotFound() {
  printf("I can't seem to find my commands :(\n");
  exit(1);
}


x86 assembly (clang, -O0):
<fileNotFound>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fileNotFound>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"I can't seem to find my commands :(\0A\00"
define void @fileNotFound() {
%1 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [36 x i8] c"I can't seem to find my commands :(\00"
define void @fileNotFound() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int time_t;

/* Variables and functions */
int time(int /*<<< orphan*/ *);
void get_yesterday(time_t *startDate, time_t *endDate) {
  time_t t = time(NULL);
  t -= 86400;
  *startDate = t;
  *endDate = t;
}


x86 assembly (clang, -O0):
<get_yesterday>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1030 <time@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x15180,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_yesterday>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
call   1030 <time@plt>
add    $0xfffeae80,%eax
mov    %eax,(%rbx)
mov    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @get_yesterday(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = call i32 @time(i32* null)
store i32 %6, i32* %5
%7 = load i32, i32* %5
%8 = sub nsw i32 %7, 86400
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @get_yesterday(i32* nocapture writeonly %0, i32* nocapture writeonly %1) {
%3 = tail call i32 @time(i32* null)
%4 = add nsw i32 %3, -86400
store i32 %4, i32* %0
store i32 %4, i32* %1
ret void
}
/* Variables and functions */
int html_armored_memlen(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
int html_armored_strlen(char const *str) {
  return html_armored_memlen(str, strlen(str)) + 1;
}


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

x86 assembly (clang, -O2):
<html_armored_strlen>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <html_armored_memlen@plt>
add    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @html_armored_strlen(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @html_armored_memlen(i8* %3, i32 %5)
%7 = add nsw i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @html_armored_strlen(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @html_armored_memlen(i8* %0, i32 %2)
%4 = add nsw i32 %3, 1
ret i32 %4
}
void ASN1_INTEGER_to_BN(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_INTEGER_to_BN() {
ret void
}
void join_minmax_with_sum_signed_Good_FP(int x, int y) {
  int s = x + y;
  if (s < 0)
    s = 0;
  char a[s + 1];
  int i = 0;
  while (i < x + y) {
    if (i > 5) {
      y = 0;
    }
    i++;
  }
  a[i] = 2;
}


x86 assembly (clang, -O0):
<join_minmax_with_sum_signed_Good_FP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1128 <join_minmax_with_sum_signed_Good_FP+0x28>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    -0x8(%rbp),%ecx
cmp    %ecx,%eax
jge    1188 <join_minmax_with_sum_signed_Good_FP+0x88>
cmpl   $0x5,-0x24(%rbp)
jle    117a <join_minmax_with_sum_signed_Good_FP+0x7a>
movl   $0x0,-0x8(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1158 <join_minmax_with_sum_signed_Good_FP+0x58>
mov    -0x30(%rbp),%rax
movslq -0x24(%rbp),%rcx
movb   $0x2,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @join_minmax_with_sum_signed_Good_FP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = add nsw i32 %9, %10
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %2
store i32 0, i32* %5
br label %15
15: ; preds = %14, %2
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
%18 = zext i32 %17 to i64
%19 = call i8* @llvm.stacksave()
store i8* %19, i8** %6
%20 = alloca i8, i64 %18
store i64 %18, i64* %7
store i32 0, i32* %8
br label %21
21: ; preds = %31, %15
%22 = load i32, i32* %8
%23 = load i32, i32* %3
%24 = load i32, i32* %4
%25 = add nsw i32 %23, %24
%26 = icmp slt i32 %22, %25
br i1 %26, label %27, label %34
27: ; preds = %21
%28 = load i32, i32* %8
%29 = icmp sgt i32 %28, 5
br i1 %29, label %30, label %31
30: ; preds = %27
store i32 0, i32* %4
br label %31
31: ; preds = %30, %27
%32 = load i32, i32* %8
%33 = add nsw i32 %32, 1
store i32 %33, i32* %8
br label %21
34: ; preds = %21
%35 = load i32, i32* %8
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i8, i8* %20, i64 %36
store i8 2, i8* %37
%38 = load i8*, i8** %6
ret void
}

LLVM IR (-O2):
define void @join_minmax_with_sum_signed_Good_FP(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ err_msg(char *, int /*<<< orphan*/);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int shutdown(int, int);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
int Shutdown(int sockfd, int howto) {
  int ret;
  ret = shutdown(sockfd, howto);
  if (ret == -1) {
    err_msg("error while shutdown: %s", strerror(errno));
    exit(EXIT_FAILURE);
  } else
    return ret;
}


x86 assembly (clang, -O0):
<Shutdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <shutdown@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1190 <Shutdown+0x50>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    %eax,%esi
lea    0xe83(%rip),%rdi
call   1040 <err_msg@plt>
mov    0x2e4f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Shutdown>:
push   %rax
call   1030 <shutdown@plt>
cmp    $0xffffffff,%eax
je     114d <Shutdown+0xd>
pop    %rcx
ret
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
lea    0xe9e(%rip),%rdi
mov    %eax,%esi
call   1040 <err_msg@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"error while shutdown: %s\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @Shutdown(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @shutdown(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = load i32, i32* @errno
%13 = call i32 @strerror(i32 %12)
%14 = call i32 @err_msg(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = load i32, i32* @EXIT_FAILURE
%16 = call i32 @exit(i32 %15)
unreachable
17: ; preds = %2
%18 = load i32, i32* %5
ret i32 %18
}

LLVM IR (-O2):
@.str = [25 x i8] c"error while shutdown: %s\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @Shutdown(i32 %0, i32 %1) {
%3 = tail call i32 @shutdown(i32 %0, i32 %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i32, i32* @errno
%7 = tail call i32 @strerror(i32 %6)
%8 = tail call i32 @err_msg(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* @EXIT_FAILURE
%10 = tail call i32 @exit(i32 %9)
unreachable
11: ; preds = %2
ret i32 %3
}
int main(void) {
  int i = 0;
  return i;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128GeneralIOPinP__9__IO__makeOutput();
void HplAtm128SpiP__SCK__makeOutput(void) {
  HplAtm128GeneralIOPinP__9__IO__makeOutput();
}


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

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

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

LLVM IR (-O2):
define void @HplAtm128SpiP__SCK__makeOutput() {
%1 = tail call i32 (...) @HplAtm128GeneralIOPinP__9__IO__makeOutput()
ret void
}
print_ar(int a[], int n) {
  while (n-- > 0)
    print_n(*a++), print_c(' ');
  print_c('\n');
}


x86 assembly (clang, -O0):
<print_ar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
jle    116c <print_ar+0x4c>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%edi
mov    $0x0,%al
call   1030 <print_n@plt>
mov    $0x20,%edi
mov    $0x0,%al
call   1040 <print_c@plt>
jmp    112f <print_ar+0xf>
mov    $0xa,%edi
mov    $0x0,%al
call   1040 <print_c@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_ar>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
jle    1151 <print_ar+0x31>
mov    %esi,%ebp
mov    %rdi,%rbx
add    $0x1,%ebp
nop
mov    (%rbx),%edi
add    $0x4,%rbx
xor    %eax,%eax
call   1030 <print_n@plt>
mov    $0x20,%edi
xor    %eax,%eax
call   1040 <print_c@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1130 <print_ar+0x10>
mov    $0xa,%edi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <print_c@plt>

LLVM IR (-O0):
define i32 @print_ar(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
br label %6
6: ; preds = %10, %2
%7 = load i32, i32* %5
%8 = add nsw i32 %7, -1
store i32 %8, i32* %5
%9 = icmp sgt i32 %7, 0
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i32*, i32** %4
%12 = getelementptr inbounds i32, i32* %11, i32 1
store i32* %12, i32** %4
%13 = load i32, i32* %11
%14 = call i32 (i32, ...) bitcast (i32 (...)* @print_n to i32 (i32, ...)*)(i32 %13)
%15 = call i32 (i32, ...) bitcast (i32 (...)* @print_c to i32 (i32, ...)*)(i32 32)
br label %6
16: ; preds = %6
%17 = call i32 (i32, ...) bitcast (i32 (...)* @print_c to i32 (i32, ...)*)(i32 10)
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @print_ar(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32* [ %8, %4 ], [ %0, %2 ]
%7 = add nsw i32 %5, -1
%8 = getelementptr inbounds i32, i32* %6, i64 1
%9 = load i32, i32* %6
%10 = tail call i32 (i32, ...) bitcast (i32 (...)* @print_n to i32 (i32, ...)*)(i32 %9)
%11 = tail call i32 (i32, ...) bitcast (i32 (...)* @print_c to i32 (i32, ...)*)(i32 32)
%12 = icmp ugt i32 %5, 1
br i1 %12, label %4, label %13
13: ; preds = %4, %2
%14 = tail call i32 (i32, ...) bitcast (i32 (...)* @print_c to i32 (i32, ...)*)(i32 10)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  unsigned int tm_sec;
  int tm_min;
  int tm_hour;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
unsigned int now() {
  time_t t;
  time(&t);
  struct tm *tm = localtime(&t);
  return tm->tm_sec + tm->tm_min * 60 + tm->tm_hour * 3600;
}


x86 assembly (clang, -O0):
<now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <time@plt>
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
imul   $0x3c,0x4(%rcx),%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%rcx
imul   $0xe10,0x8(%rcx),%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<now>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <time@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
imul   $0x3c,0x4(%rax),%ecx
add    (%rax),%ecx
imul   $0xe10,0x8(%rax),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32, i32 }
define i32 @now() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = call i32 @time(i32* %1)
%4 = call %struct.tm* @localtime(i32* %1)
store %struct.tm* %4, %struct.tm** %2
%5 = load %struct.tm*, %struct.tm** %2
%6 = getelementptr inbounds %struct.tm, %struct.tm* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = load %struct.tm*, %struct.tm** %2
%9 = getelementptr inbounds %struct.tm, %struct.tm* %8, i32 0, i32 1
%10 = load i32, i32* %9
%11 = mul nsw i32 %10, 60
%12 = add i32 %7, %11
%13 = load %struct.tm*, %struct.tm** %2
%14 = getelementptr inbounds %struct.tm, %struct.tm* %13, i32 0, i32 2
%15 = load i32, i32* %14
%16 = mul nsw i32 %15, 3600
%17 = add i32 %12, %16
ret i32 %17
}

LLVM IR (-O2):
%struct.tm = type { i32, i32, i32 }
define i32 @now() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = call %struct.tm* @localtime(i32* %1)
%5 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 0
%6 = load i32, i32* %5
%7 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 1
%8 = load i32, i32* %7
%9 = mul nsw i32 %8, 60
%10 = add i32 %9, %6
%11 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 2
%12 = load i32, i32* %11
%13 = mul nsw i32 %12, 3600
%14 = add i32 %10, %13
ret i32 %14
}
void vscale(float *v, float div) {
  v[(signed long int)0] = v[(signed long int)0] * div;
  v[(signed long int)1] = v[(signed long int)1] * div;
  v[(signed long int)2] = v[(signed long int)2] * div;
}


x86 assembly (clang, -O0):
<vscale>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mulss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mulss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mulss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vscale>:
movss  (%rdi),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,(%rdi)
movss  0x4(%rdi),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0x4(%rdi)
mulss  0x8(%rdi),%xmm0
movss  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @vscale(float* %0, float %1) {
%3 = alloca float*
%4 = alloca float
store float* %0, float** %3
store float %1, float* %4
%5 = load float*, float** %3
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float, float* %4
%9 = fmul float %7, %8
%10 = load float*, float** %3
%11 = getelementptr inbounds float, float* %10, i64 0
store float %9, float* %11
%12 = load float*, float** %3
%13 = getelementptr inbounds float, float* %12, i64 1
%14 = load float, float* %13
%15 = load float, float* %4
%16 = fmul float %14, %15
%17 = load float*, float** %3
%18 = getelementptr inbounds float, float* %17, i64 1
store float %16, float* %18
%19 = load float*, float** %3
%20 = getelementptr inbounds float, float* %19, i64 2
%21 = load float, float* %20
%22 = load float, float* %4
%23 = fmul float %21, %22
%24 = load float*, float** %3
%25 = getelementptr inbounds float, float* %24, i64 2
store float %23, float* %25
ret void
}

LLVM IR (-O2):
define void @vscale(float* nocapture %0, float %1) {
%3 = load float, float* %0
%4 = fmul float %3, %1
store float %4, float* %0
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = fmul float %6, %1
store float %7, float* %5
%8 = getelementptr inbounds float, float* %0, i64 2
%9 = load float, float* %8
%10 = fmul float %9, %1
store float %10, float* %8
ret void
}
int test_imm_42uint8_reg(unsigned char val) {
  return ((val) & (0x42 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_42uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x42,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_42uint8_reg>:
test   $0x42,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_42uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 66
%6 = icmp ne i32 %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_42uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 66
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ dprintf(int, char *, char *);
int usage(char *a0) {
  dprintf(
      2,
      "Proxychains-NG remote dns daemon\n"
      "--------------------------------\n"
      "usage: %s -i listenip -p port -r remotesubnet\n"
      "all arguments are optional.\n"
      "by default listenip is 127.0.0.1, port 1053 and remotesubnet 224.\n\n",
      a0);
  return 1;
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
lea    0xee5(%rip),%rsi
mov    $0x2,%edi
call   1030 <dprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [208 x i8] c"Proxychains-NG remote dns daemon\0A--------------------------------\0Ausage: %s -i listenip -p port -r remotesubnet\0Aall arguments are optional.\0Aby default listenip is 127.0.0.1, port 1053 and remotesubnet 224.\0A\0A\00"
define i32 @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @dprintf(i32 2, i8* getelementptr inbounds ([208 x i8], [208 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 1
}

LLVM IR (-O2):
@.str = [208 x i8] c"Proxychains-NG remote dns daemon\0A--------------------------------\0Ausage: %s -i listenip -p port -r remotesubnet\0Aall arguments are optional.\0Aby default listenip is 127.0.0.1, port 1053 and remotesubnet 224.\0A\0A\00"
define i32 @usage(i8* %0) {
%2 = tail call i32 @dprintf(i32 2, i8* getelementptr inbounds ([208 x i8], [208 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t *evpd_page_data(uint8_t *data) { return data + 4; }


x86 assembly (clang, -O0):
<evpd_page_data>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<evpd_page_data>:
lea    0x10(%rdi),%rax
ret

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

LLVM IR (-O2):
define i32* @evpd_page_data(i32* readnone %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 4
ret i32* %2
}
/* Variables and functions */
int rand();
int unfair() { return rand() % 10 > 5; }


x86 assembly (clang, -O0):
<unfair>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x5,%edx
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unfair>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
movslq %eax,%rcx
imul   $0x66666667,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rax
add    %edx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ecx
xor    %eax,%eax
cmp    $0x6,%ecx
setge  %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @unfair() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 10
%3 = icmp sgt i32 %2, 5
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @unfair() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 10
%3 = icmp sgt i32 %2, 5
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ munmap(unsigned long *, unsigned long);
void libtcas_unmapfile(unsigned long *mapBuf, unsigned long size) {
  munmap(mapBuf, size);
}


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

x86 assembly (clang, -O2):
<libtcas_unmapfile>:
jmp    1030 <munmap@plt>

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

LLVM IR (-O2):
define void @libtcas_unmapfile(i64* %0, i64 %1) {
%3 = tail call i32 @munmap(i64* %0, i64 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _s2_priv_textab(float, float, float, int /*<<< orphan*/, int,
                                   float, float, char *);
void s2textxzf(float ix, float iy, float iz, float flipx, float flipz,
               char *itext) {
  _s2_priv_textab(ix, iy, iz, 0, 2, flipx, flipz, itext);
}


x86 assembly (clang, -O0):
<s2textxzf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
mov    %rdi,-0x20(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movss  -0x10(%rbp),%xmm3
movss  -0x14(%rbp),%xmm4
mov    -0x20(%rbp),%rdx
xor    %edi,%edi
mov    $0x2,%esi
call   1030 <_s2_priv_textab@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2textxzf>:
mov    %rdi,%rdx
xor    %edi,%edi
mov    $0x2,%esi
jmp    1030 <_s2_priv_textab@plt>

LLVM IR (-O0):
define void @s2textxzf(float %0, float %1, float %2, float %3, float %4, i8* %5) {
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca i8*
store float %0, float* %7
store float %1, float* %8
store float %2, float* %9
store float %3, float* %10
store float %4, float* %11
store i8* %5, i8** %12
%13 = load float, float* %7
%14 = load float, float* %8
%15 = load float, float* %9
%16 = load float, float* %10
%17 = load float, float* %11
%18 = load i8*, i8** %12
%19 = call i32 @_s2_priv_textab(float %13, float %14, float %15, i32 0, i32 2, float %16, float %17, i8* %18)
ret void
}

LLVM IR (-O2):
define void @s2textxzf(float %0, float %1, float %2, float %3, float %4, i8* %5) {
%7 = tail call i32 @_s2_priv_textab(float %0, float %1, float %2, i32 0, i32 2, float %3, float %4, i8* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PATH_MAX;
int /*<<< orphan*/ snprintf(char *, int /*<<< orphan*/, char *, char const *,
                            char const *);
void ert_image_add_path(const char *image_path, const char *image_filename,
                        char *image_full_path_filename_rcv) {
  snprintf(image_full_path_filename_rcv, PATH_MAX, "%s/%s", image_path,
           image_filename);
}


x86 assembly (clang, -O0):
<ert_image_add_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
lea    0xec0(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ert_image_add_path>:
mov    %rdx,%rax
mov    %rsi,%r8
mov    %rdi,%rcx
mov    0x2ed0(%rip),%rdx
mov    (%rdx),%esi
lea    0xed7(%rip),%rdx
mov    %rax,%rdi
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@PATH_MAX = global i32 0
@.str = [6 x i8] c"%s/%s\00"
define void @ert_image_add_path(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = load i32, i32* @PATH_MAX
%9 = load i8*, i8** %4
%10 = load i8*, i8** %5
%11 = call i32 @snprintf(i8* %7, i32 %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10)
ret void
}

LLVM IR (-O2):
@PATH_MAX = global i32 0
@.str = [6 x i8] c"%s/%s\00"
define void @ert_image_add_path(i8* %0, i8* %1, i8* %2) {
%4 = load i32, i32* @PATH_MAX
%5 = tail call i32 @snprintf(i8* %2, i32 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
int consume_slash_op(char *p) {
  if (p[1] == '=') {
    return 2;
  }
  return 1;
}


x86 assembly (clang, -O0):
<consume_slash_op>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x3d,%eax
jne    1125 <consume_slash_op+0x25>
movl   $0x2,-0x4(%rbp)
jmp    112c <consume_slash_op+0x2c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<consume_slash_op>:
xor    %eax,%eax
cmpb   $0x3d,0x1(%rdi)
sete   %al
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @consume_slash_op(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 61
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 2, i32* %2
br label %11
10: ; preds = %1
store i32 1, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @consume_slash_op(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 61
%5 = select i1 %4, i32 2, i32 1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ BootComCheckActivationRequest();
int /*<<< orphan*/ BootComInit();
int /*<<< orphan*/ Init();
int /*<<< orphan*/ LedToggle();
int /*<<< orphan*/ NetInit();
int /*<<< orphan*/ NetTask();
int main(void) {
  Init();
  NetInit();
  BootComInit();
  while (1) {
    LedToggle();
    NetTask();
    BootComCheckActivationRequest();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <Init@plt>
mov    $0x0,%al
call   1070 <NetInit@plt>
mov    $0x0,%al
call   1040 <BootComInit@plt>
mov    $0x0,%al
call   1030 <LedToggle@plt>
mov    $0x0,%al
call   1050 <NetTask@plt>
mov    $0x0,%al
call   1080 <BootComCheckActivationRequest@plt>
jmp    1184 <main+0x24>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <Init@plt>
xor    %eax,%eax
call   1070 <NetInit@plt>
xor    %eax,%eax
call   1040 <BootComInit@plt>
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <LedToggle@plt>
xor    %eax,%eax
call   1050 <NetTask@plt>
xor    %eax,%eax
call   1080 <BootComCheckActivationRequest@plt>
jmp    1180 <main+0x20>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @Init()
%3 = call i32 (...) @NetInit()
%4 = call i32 (...) @BootComInit()
br label %5
5: ; preds = %0, %5
%6 = call i32 (...) @LedToggle()
%7 = call i32 (...) @NetTask()
%8 = call i32 (...) @BootComCheckActivationRequest()
br label %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @Init()
%2 = tail call i32 (...) @NetInit()
%3 = tail call i32 (...) @BootComInit()
br label %4
4: ; preds = %0, %4
%5 = tail call i32 (...) @LedToggle()
%6 = tail call i32 (...) @NetTask()
%7 = tail call i32 (...) @BootComCheckActivationRequest()
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void doit(int c) {
  if (c > 1)
    printf("in library!\n");
  return;
}


x86 assembly (clang, -O0):
<doit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    1131 <doit+0x21>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doit>:
cmp    $0x2,%edi
jl     1121 <doit+0x11>
lea    0xee4(%rip),%rdi
jmp    1030 <puts@plt>
ret

LLVM IR (-O0):
@.str = [13 x i8] c"in library!\0A\00"
define void @doit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@str = [12 x i8] c"in library!\00"
define void @doit(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int O_APPEND;
int O_CREAT;
int O_NDELAY;
int O_WRONLY;
int open(char const *, int, int);
int open_append(const char *fn) {
  return open(fn, O_WRONLY | O_NDELAY | O_APPEND | O_CREAT, 0600);
}


x86 assembly (clang, -O0):
<open_append>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
mov    0x2ea8(%rip),%rax
or     (%rax),%esi
mov    0x2e87(%rip),%rax
or     (%rax),%esi
mov    0x2eb6(%rip),%rax
or     (%rax),%esi
mov    $0x180,%edx
call   1030 <open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_append>:
mov    0x2eb1(%rip),%rax
mov    0x2eba(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2e97(%rip),%rax
or     (%rax),%esi
mov    0x2ec6(%rip),%rax
or     (%rax),%esi
mov    $0x180,%edx
jmp    1030 <open@plt>

LLVM IR (-O0):
@O_WRONLY = global i32 0
@O_NDELAY = global i32 0
@O_APPEND = global i32 0
@O_CREAT = global i32 0
define i32 @open_append(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @O_WRONLY
%5 = load i32, i32* @O_NDELAY
%6 = or i32 %4, %5
%7 = load i32, i32* @O_APPEND
%8 = or i32 %6, %7
%9 = load i32, i32* @O_CREAT
%10 = or i32 %8, %9
%11 = call i32 @open(i8* %3, i32 %10, i32 384)
ret i32 %11
}

LLVM IR (-O2):
@O_WRONLY = global i32 0
@O_NDELAY = global i32 0
@O_APPEND = global i32 0
@O_CREAT = global i32 0
define i32 @open_append(i8* nocapture %0) {
%2 = load i32, i32* @O_WRONLY
%3 = load i32, i32* @O_NDELAY
%4 = or i32 %3, %2
%5 = load i32, i32* @O_APPEND
%6 = or i32 %4, %5
%7 = load i32, i32* @O_CREAT
%8 = or i32 %6, %7
%9 = tail call i32 @open(i8* %0, i32 %8, i32 384)
ret i32 %9
}
long long int mul(long long int base, long long int exp) {
  long long int res = 1;
  while (exp--) {
    res *= base;
  }
  return res;
}


x86 assembly (clang, -O0):
<mul>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
je     113f <mul+0x3f>
mov    -0x8(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <mul+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul>:
test   %rsi,%rsi
je     111b <mul+0x1b>
lea    -0x1(%rsi),%rax
mov    %esi,%ecx
and    $0x7,%ecx
cmp    $0x7,%rax
jae    1121 <mul+0x21>
mov    $0x1,%eax
jmp    1156 <mul+0x56>
mov    $0x1,%eax
ret
and    $0xfffffffffffffff8,%rsi
mov    $0x1,%eax
nopw   0x0(%rax,%rax,1)
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
add    $0xfffffffffffffff8,%rsi
jne    1130 <mul+0x30>
test   %rcx,%rcx
je     116a <mul+0x6a>
nopl   0x0(%rax,%rax,1)
imul   %rdi,%rax
add    $0xffffffffffffffff,%rcx
jne    1160 <mul+0x60>
ret

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

LLVM IR (-O2):
define i64 @mul(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %33, label %4
4: ; preds = %2
%5 = add i64 %1, -1
%6 = and i64 %1, 7
%7 = icmp ult i64 %5, 7
br i1 %7, label %23, label %8
8: ; preds = %4
%9 = and i64 %1, -8
br label %10
10: ; preds = %10, %8
%11 = phi i64 [ 1, %8 ], [ %20, %10 ]
%12 = phi i64 [ 0, %8 ], [ %21, %10 ]
%13 = mul nsw i64 %11, %0
%14 = mul nsw i64 %13, %0
%15 = mul nsw i64 %14, %0
%16 = mul nsw i64 %15, %0
%17 = mul nsw i64 %16, %0
%18 = mul nsw i64 %17, %0
%19 = mul nsw i64 %18, %0
%20 = mul nsw i64 %19, %0
%21 = add i64 %12, 8
%22 = icmp eq i64 %21, %9
br i1 %22, label %23, label %10
23: ; preds = %10, %4
%24 = phi i64 [ undef, %4 ], [ %20, %10 ]
%25 = phi i64 [ 1, %4 ], [ %20, %10 ]
%26 = icmp eq i64 %6, 0
br i1 %26, label %33, label %27
27: ; preds = %23, %27
%28 = phi i64 [ %30, %27 ], [ %25, %23 ]
%29 = phi i64 [ %31, %27 ], [ 0, %23 ]
%30 = mul nsw i64 %28, %0
%31 = add i64 %29, 1
%32 = icmp eq i64 %31, %6
br i1 %32, label %33, label %27
33: ; preds = %23, %27, %2
%34 = phi i64 [ 1, %2 ], [ %24, %23 ], [ %30, %27 ]
ret i64 %34
}
/* Variables and functions */
int core4_safe(char const *);
int U_EMRSTROKEPATH_safe(const char *record) { return (core4_safe(record)); }


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

x86 assembly (clang, -O2):
<U_EMRSTROKEPATH_safe>:
jmp    1030 <core4_safe@plt>

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

LLVM IR (-O2):
define i32 @U_EMRSTROKEPATH_safe(i8* %0) {
%2 = tail call i32 @core4_safe(i8* %0)
ret i32 %2
}
/* Variables and functions */
float mulsignf(int, float);
float signf(float d) { return mulsignf(1, d); }


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

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

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

LLVM IR (-O2):
define float @signf(float %0) {
%2 = tail call float @mulsignf(i32 1, float %0)
ret float %2
}
/* Variables and functions */
scalar_t__ M_PI;
float tanf(float);
float smff2w_2(float f) {
  return tanf((f > 0.3195f   ? 0.3195f
               : f < 0.0001f ? 0.0001f
                             : f) *
              (float)M_PI);
}


x86 assembly (clang, -O0):
<smff2w_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xed6(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1145 <smff2w_2+0x35>
movss  0xec5(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    117d <smff2w_2+0x6d>
movss  0xeb7(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1169 <smff2w_2+0x59>
movss  0xea5(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1173 <smff2w_2+0x63>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
mov    0x2e5f(%rip),%rax
cvtsi2ssq (%rax),%xmm1
mulss  %xmm1,%xmm0
call   1030 <tanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smff2w_2>:
movss  0xee8(%rip),%xmm1
maxss  %xmm0,%xmm1
movss  0xee0(%rip),%xmm2
movaps %xmm2,%xmm3
cmpltss %xmm0,%xmm3
movaps %xmm3,%xmm0
andnps %xmm1,%xmm0
andps  %xmm2,%xmm3
orps   %xmm0,%xmm3
mov    0x2ea9(%rip),%rax
xorps  %xmm0,%xmm0
cvtsi2ssq (%rax),%xmm0
mulss  %xmm3,%xmm0
jmp    1030 <tanf@plt>

LLVM IR (-O0):
@M_PI = global i64 0
define float @smff2w_2(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp ogt float %3, 0x3FD472B020000000
br i1 %4, label %5, label %6
5: ; preds = %1
br label %14
6: ; preds = %1
%7 = load float, float* %2
%8 = fcmp olt float %7, 0x3F1A36E2E0000000
br i1 %8, label %9, label %10
9: ; preds = %6
br label %12
10: ; preds = %6
%11 = load float, float* %2
br label %12
12: ; preds = %10, %9
%13 = phi float [ 0x3F1A36E2E0000000, %9 ], [ %11, %10 ]
br label %14
14: ; preds = %12, %5
%15 = phi float [ 0x3FD472B020000000, %5 ], [ %13, %12 ]
%16 = load i64, i64* @M_PI
%17 = sitofp i64 %16 to float
%18 = fmul float %15, %17
%19 = call float @tanf(float %18)
ret float %19
}

LLVM IR (-O2):
@M_PI = global i64 0
define float @smff2w_2(float %0) {
%2 = fcmp ogt float %0, 0x3FD472B020000000
%3 = fcmp olt float %0, 0x3F1A36E2E0000000
%4 = select i1 %3, float 0x3F1A36E2E0000000, float %0
%5 = select i1 %2, float 0x3FD472B020000000, float %4
%6 = load i64, i64* @M_PI
%7 = sitofp i64 %6 to float
%8 = fmul float %5, %7
%9 = tail call float @tanf(float %8)
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ bfwrite(char *);
void cmdMoveLeft(int iCount) {
  int z;
  for (z = 0; z < iCount; z++) {
    bfwrite("<<");
  }
}


x86 assembly (clang, -O0):
<cmdMoveLeft>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <cmdMoveLeft+0x38>
lea    0xecb(%rip),%rdi
call   1030 <bfwrite@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <cmdMoveLeft+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmdMoveLeft>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    113d <cmdMoveLeft+0x2d>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <bfwrite@plt>
add    $0xffffffff,%ebx
jne    1130 <cmdMoveLeft+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"<<\00"
define void @cmdMoveLeft(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* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = call i32 @bfwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"<<\00"
define void @cmdMoveLeft(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @bfwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void something(int i) {
  if (i != -1)
    abort();
}


x86 assembly (clang, -O0):
<something>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
je     112c <something+0x1c>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<something>:
cmp    $0xffffffff,%edi
jne    1116 <something+0x6>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @something(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @something(i32 %0) {
%2 = icmp eq i32 %0, -1
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void sum_n(int n) {
  int sum = 0;
  for (int i = 0; i <= n; i++) {
    sum += i;
  }
  printf("Sum: %d\n", sum);
}


x86 assembly (clang, -O0):
<sum_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     114c <sum_n+0x3c>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <sum_n+0x19>
mov    -0x8(%rbp),%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_n>:
mov    %edi,%eax
lea    -0x1(%rdi),%ecx
imul   %rax,%rcx
shr    %rcx
add    %edi,%ecx
xor    %esi,%esi
test   %edi,%edi
cmovns %ecx,%esi
lea    0xed4(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"Sum: %d\0A\00"
define void @sum_n(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = zext i32 %0 to i33
%4 = add nsw i32 %0, -1
%5 = zext i32 %4 to i33
%6 = mul i33 %3, %5
%7 = lshr i33 %6, 1
%8 = trunc i33 %7 to i32
%9 = add i32 %8, %0
%10 = select i1 %2, i32 0, i32 %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stdout;
int wait_num_pending();
void report_pending(void) {
  printf("STOPPING. Pending queries: %d                      \r",
         wait_num_pending());
  fflush(stdout);
}


x86 assembly (clang, -O0):
<report_pending>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <wait_num_pending@plt>
mov    %eax,%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<report_pending>:
push   %rax
xor    %eax,%eax
call   1050 <wait_num_pending@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"STOPPING. Pending queries: %d \0D\00"
@stdout = global i32 0
define void @report_pending() {
%1 = call i32 (...) @wait_num_pending()
%2 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @stdout
%4 = call i32 @fflush(i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [53 x i8] c"STOPPING. Pending queries: %d \0D\00"
@stdout = global i32 0
define void @report_pending() {
%1 = tail call i32 (...) @wait_num_pending()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
ret void
}
__attribute__((visibility("default"))) short int byte_in_short_out(char arg,
                                                                   ...) {
  return (short int)arg;
}


x86 assembly (clang, -O0):
<byte_in_short_out>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i16 @byte_in_short_out(i8 signext %0, ...) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i16
ret i16 %4
}

LLVM IR (-O2):
define signext i16 @byte_in_short_out(i8 signext %0, ...) {
%2 = sext i8 %0 to i16
ret i16 %2
}