xunge/DecIR huggingface dataset:
void foo219(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo219(i32 %0) {
ret void
}
void acpi_reboot(void) {}


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

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

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

LLVM IR (-O2):
define void @acpi_reboot() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lisys_error_set(int, int /*<<< orphan*/ *);
char *lisys_group_get_name(int gid) {
  lisys_error_set(1024, NULL);
  return NULL;
}


x86 assembly (clang, -O0):
<lisys_group_get_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x400,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <lisys_error_set@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lisys_group_get_name>:
push   %rax
mov    $0x400,%edi
xor    %esi,%esi
call   1030 <lisys_error_set@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @lisys_group_get_name(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @lisys_error_set(i32 1024, i32* null)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @lisys_group_get_name(i32 %0) {
%2 = tail call i32 @lisys_error_set(i32 1024, i32* null)
ret i8* null
}
/* Variables and functions */
void *calloc(size_t const, size_t const);
int /*<<< orphan*/ exit_if_null(void *);
void *calloc_exit_if_null(const size_t num, const size_t size) {
  void *p = calloc(num, size);
  exit_if_null(p);
  return p;
}


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

x86 assembly (clang, -O2):
<calloc_exit_if_null>:
push   %rbx
call   1040 <calloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <exit_if_null@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @calloc_exit_if_null(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = tail call i32 @exit_if_null(i8* %3)
ret i8* %3
}
func234() {}


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

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

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

LLVM IR (-O2):
define i32 @func234() {
ret i32 undef
}
int do_202() { return 202; }


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

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

LLVM IR (-O0):
define i32 @do_202() {
ret i32 202
}

LLVM IR (-O2):
define i32 @do_202() {
ret i32 202
}
double func_ret_double() { return 2.14; }


x86 assembly (clang, -O0):
<func_ret_double>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_ret_double>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @func_ret_double() {
ret double 2.140000e+00
}

LLVM IR (-O2):
define double @func_ret_double() {
ret double 2.140000e+00
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  printf("%s", "Daniel "
               "Marchena "
               "Parreira\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [26 x i8] c"Daniel Marchena Parreira\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [26 x i8] c"Daniel Marchena Parreira\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char const *dlerror();
const char *dylib_error(void) { return dlerror(); }


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

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

LLVM IR (-O0):
define i8* @dylib_error() {
%1 = call i8* (...) @dlerror()
ret i8* %1
}

LLVM IR (-O2):
define i8* @dylib_error() {
%1 = tail call i8* (...) @dlerror()
ret i8* %1
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ print_usage();
int /*<<< orphan*/ printf(char *);
int print_help() {
  print_usage();
  printf("Option:\n"
         "  -h  --help    Show usage and options\n"
         "  -d  --debug   Show debug messages\n"
         "  -v  --version Show version number\n");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <print_usage@plt>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_help>:
push   %rax
xor    %eax,%eax
call   1040 <print_usage@plt>
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ea5(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [120 x i8] c"Option:\0A -h --help Show usage and options\0A -d --debug Show debug messages\0A -v --version Show version number\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @print_help() {
%1 = call i32 (...) @print_usage()
%2 = call i32 @printf(i8* getelementptr inbounds ([120 x i8], [120 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [119 x i8] c"Option:\0A -h --help Show usage and options\0A -d --debug Show debug messages\0A -v --version Show version number\00"
define i32 @print_help() {
%1 = tail call i32 (...) @print_usage()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([119 x i8], [119 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
int modctl() {
  printf("proc-stub:%s\n", __func__);
  return -1;
}


x86 assembly (clang, -O0):
<modctl>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeec(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<modctl>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xeef(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"proc-stub:%s\0A\00"
@__func__.modctl = [7 x i8] c"modctl\00"
define i32 @modctl() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__func__.modctl, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [14 x i8] c"proc-stub:%s\0A\00"
@__func__.modctl = [7 x i8] c"modctl\00"
define i32 @modctl() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__func__.modctl, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ init();
int /*<<< orphan*/ stdout;
int main(int argc, char **argv) {
  init();
  fputs("Returned from init() in main()\n", stdout);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <init@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%esi
lea    0xeb3(%rip),%rdi
call   1030 <fputs@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <init@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1030 <fputs@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Returned from init() in main()\0A\00"
@stdout = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @init()
%7 = load i32, i32* @stdout
%8 = call i32 @fputs(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"Returned from init() in main()\0A\00"
@stdout = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @init()
%4 = load i32, i32* @stdout
%5 = tail call i32 @fputs(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
int fun801() { return 801; }


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

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

LLVM IR (-O0):
define i32 @fun801() {
ret i32 801
}

LLVM IR (-O2):
define i32 @fun801() {
ret i32 801
}
void __semaphore_close(void *h) { sem_destroy(h), free(h); }


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

x86 assembly (clang, -O2):
<__semaphore_close>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <sem_destroy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @__semaphore_close(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @sem_destroy to i32 (i8*, ...)*)(i8* %0)
tail call void @free(i8* %0)
ret void
}
char CaesarDe1(char c) {
  if (c != '\0' && c != '\n' && c != '\r') {
    char out = c - 3;
    return out;
  } else {
    return '\0';
  }
}


x86 assembly (clang, -O0):
<CaesarDe1>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x0,%eax
je     1146 <CaesarDe1+0x46>
movsbl -0x2(%rbp),%eax
cmp    $0xa,%eax
je     1146 <CaesarDe1+0x46>
movsbl -0x2(%rbp),%eax
cmp    $0xd,%eax
je     1146 <CaesarDe1+0x46>
movsbl -0x2(%rbp),%eax
sub    $0x3,%eax
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    114a <CaesarDe1+0x4a>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CaesarDe1>:
cmp    $0xd,%dil
ja     1118 <CaesarDe1+0x18>
movzbl %dil,%eax
mov    $0x2401,%ecx
bt     %rax,%rcx
jae    1118 <CaesarDe1+0x18>
xor    %eax,%eax
ret
lea    -0x3(%rdi),%eax
ret

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

LLVM IR (-O2):
define signext i8 @CaesarDe1(i8 signext %0) {
switch i8 %0, label %2 [
i8 13, label %4
i8 10, label %4
i8 0, label %4
]
2: ; preds = %1
%3 = add i8 %0, -3
br label %4
4: ; preds = %1, %1, %1, %2
%5 = phi i8 [ %3, %2 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ]
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ DisplayNumber(unsigned long);
int ReadNumber();
void testTortureExecute(void) {
  unsigned long tmp;
  tmp = (ReadNumber() & 0x00ff0000L) >> 16;
  DisplayNumber(tmp);
  return;
}


x86 assembly (clang, -O0):
<testTortureExecute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <ReadNumber@plt>
cltq
and    $0xff0000,%rax
sar    $0x10,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <DisplayNumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testTortureExecute>:
push   %rax
xor    %eax,%eax
call   1040 <ReadNumber@plt>
shr    $0x10,%eax
movzbl %al,%edi
pop    %rax
jmp    1030 <DisplayNumber@plt>

LLVM IR (-O0):
define void @testTortureExecute() {
%1 = alloca i64
%2 = call i32 (...) @ReadNumber()
%3 = sext i32 %2 to i64
%4 = and i64 %3, 16711680
%5 = ashr i64 %4, 16
store i64 %5, i64* %1
%6 = load i64, i64* %1
%7 = call i32 @DisplayNumber(i64 %6)
ret void
}

LLVM IR (-O2):
define void @testTortureExecute() {
%1 = tail call i32 (...) @ReadNumber()
%2 = lshr i32 %1, 16
%3 = and i32 %2, 255
%4 = zext i32 %3 to i64
%5 = tail call i32 @DisplayNumber(i64 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PutIndent(int);
int getchar();
int /*<<< orphan*/ puts(char *);
int PutCode(int indent, char *instruction) {
  PutIndent(indent);
  puts(instruction);
  return getchar();
}


x86 assembly (clang, -O0):
<PutCode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <PutIndent@plt>
mov    -0x10(%rbp),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PutCode>:
push   %rbx
mov    %rsi,%rbx
call   1050 <PutIndent@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <getchar@plt>

LLVM IR (-O0):
define i32 @PutCode(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 = call i32 @PutIndent(i32 %5)
%7 = load i8*, i8** %4
%8 = call i32 @puts(i8* %7)
%9 = call i32 (...) @getchar()
ret i32 %9
}

LLVM IR (-O2):
define i32 @PutCode(i32 %0, i8* nocapture %1) {
%3 = tail call i32 @PutIndent(i32 %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %1)
%5 = tail call i32 (...) @getchar()
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ handle_38(int /*<<< orphan*/);
int gen_38() { handle_38(0); }


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

x86 assembly (clang, -O2):
<gen_38>:
xor    %edi,%edi
jmp    1030 <handle_38@plt>

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

LLVM IR (-O2):
define i32 @gen_38() {
%1 = tail call i32 @handle_38(i32 0)
ret i32 undef
}
char *fillstr(char *s, char ch, int n) {
  int i;
  for (i = 0; i <= n; i++)
    s[i] = ch;
  s[n + 1] = '\0';
  return (s);
}


x86 assembly (clang, -O0):
<fillstr>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1140 <fillstr+0x40>
mov    -0x9(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1118 <fillstr+0x18>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fillstr>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
test   %edx,%edx
js     112e <fillstr+0x1e>
mov    %ebp,%edx
add    $0x1,%rdx
movzbl %sil,%esi
mov    %rbx,%rdi
call   1030 <memset@plt>
movslq %ebp,%rax
movb   $0x0,0x1(%rax,%rbx,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @fillstr(i8* returned writeonly %0, i8 signext %1, i32 %2) {
%4 = icmp slt i32 %2, 0
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = zext i32 %2 to i64
%7 = add nuw nsw i64 %6, 1
br label %8
8: ; preds = %5, %3
%9 = add nsw i32 %2, 1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %0, i64 %10
store i8 0, i8* %11
ret i8* %0
}
int test_imm_75uint16_mem(unsigned short *val) {
  return ((*val) & (-0x75 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_75uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xffffff8b,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_75uint16_mem>:
movzwl (%rdi),%eax
test   $0xff8b,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_75uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -117
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int digittoint(c)
int c;
{ return (__maskrune(c, 0xFF)); }


x86 assembly (clang, -O0):
<digittoint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xff,%esi
mov    $0x0,%al
call   1030 <__maskrune@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<digittoint>:
mov    $0xff,%esi
xor    %eax,%eax
jmp    1030 <__maskrune@plt>

LLVM IR (-O0):
define i32 @digittoint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, i32, ...) bitcast (i32 (...)* @__maskrune to i32 (i32, i32, ...)*)(i32 %3, i32 255)
ret i32 %4
}

LLVM IR (-O2):
define i32 @digittoint(i32 %0) {
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @__maskrune to i32 (i32, i32, ...)*)(i32 %0, i32 255)
ret i32 %2
}
unsigned long assemble_17(x, y, z)
unsigned int x, y, z;
{
  unsigned long temp;
  int q;
  temp =
      ((((((z & (~((-1) << q))) << q) | (x & (~((-1) << q)))) & (~((-1) << q)))
        << 11) |
       ((((((y) >> (31 - (1)) & ((1 << ((1) - (1) + 1)) - 1)) & (~((-1) << 1)))
          << 10) |
         (((y) >> (31 - (9)) & ((1 << ((9) - (0) + 1)) - 1)) &
          (~((-1) << 10)))) &
        (~((-1) << 11))));
  return temp;
}


x86 assembly (clang, -O0):
<assemble_17>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x1c(%rbp),%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x1c(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%ecx
mov    %ecx,-0x20(%rbp)
mov    -0x1c(%rbp),%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
mov    -0x20(%rbp),%ecx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x1c(%rbp),%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
shl    $0xb,%eax
mov    -0x8(%rbp),%ecx
shr    $0x1e,%ecx
and    $0x1,%ecx
and    $0x1,%ecx
shl    $0xa,%ecx
mov    -0x8(%rbp),%edx
shr    $0x16,%edx
and    $0x3ff,%edx
and    $0x3ff,%edx
or     %edx,%ecx
and    $0x7ff,%ecx
or     %ecx,%eax
mov    %eax,%eax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @assemble_17(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %6
%10 = load i32, i32* %8
%11 = shl i32 -1, %10
%12 = xor i32 %11, -1
%13 = and i32 %9, %12
%14 = load i32, i32* %8
%15 = shl i32 %13, %14
%16 = load i32, i32* %4
%17 = load i32, i32* %8
%18 = shl i32 -1, %17
%19 = xor i32 %18, -1
%20 = and i32 %16, %19
%21 = or i32 %15, %20
%22 = load i32, i32* %8
%23 = shl i32 -1, %22
%24 = xor i32 %23, -1
%25 = and i32 %21, %24
%26 = shl i32 %25, 11
%27 = load i32, i32* %5
%28 = lshr i32 %27, 30
%29 = and i32 %28, 1
%30 = and i32 %29, 1
%31 = shl i32 %30, 10
%32 = load i32, i32* %5
%33 = lshr i32 %32, 22
%34 = and i32 %33, 1023
%35 = and i32 %34, 1023
%36 = or i32 %31, %35
%37 = and i32 %36, 2047
%38 = or i32 %26, %37
%39 = zext i32 %38 to i64
store i64 %39, i64* %7
%40 = load i64, i64* %7
ret i64 %40
}

LLVM IR (-O2):
define i64 @assemble_17(i32 %0, i32 %1, i32 %2) {
ret i64 poison
}
/* Variables and functions */
unsigned char GPIOPinRead(int, unsigned char);
unsigned char button_test(unsigned char button) {
  return GPIOPinRead(0x40025000, button);
}


x86 assembly (clang, -O0):
<button_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x40025000,%edi
movzbl -0x1(%rbp),%esi
call   1030 <GPIOPinRead@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<button_test>:
mov    %edi,%esi
mov    $0x40025000,%edi
jmp    1030 <GPIOPinRead@plt>

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

LLVM IR (-O2):
define zeroext i8 @button_test(i8 zeroext %0) {
%2 = tail call zeroext i8 @GPIOPinRead(i32 1073893376, i8 zeroext %0)
ret i8 %2
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ write_byte(int);
void pop_r64(uint8_t reg) {
  if (reg > 7)
    write_byte(0x40 | 0x01);
  write_byte(0x58 | (reg & 7));
}


x86 assembly (clang, -O0):
<pop_r64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x7,-0x4(%rbp)
jle    112f <pop_r64+0x1f>
mov    $0x41,%edi
call   1030 <write_byte@plt>
mov    -0x4(%rbp),%edi
and    $0x7,%edi
or     $0x58,%edi
call   1030 <write_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pop_r64>:
push   %rbx
mov    %edi,%ebx
cmp    $0x8,%edi
jl     1122 <pop_r64+0x12>
mov    $0x41,%edi
call   1030 <write_byte@plt>
and    $0x7,%ebx
or     $0x58,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <write_byte@plt>

LLVM IR (-O0):
define void @pop_r64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 7
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @write_byte(i32 65)
br label %7
7: ; preds = %5, %1
%8 = load i32, i32* %2
%9 = and i32 %8, 7
%10 = or i32 88, %9
%11 = call i32 @write_byte(i32 %10)
ret void
}

LLVM IR (-O2):
define void @pop_r64(i32 %0) {
%2 = icmp sgt i32 %0, 7
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @write_byte(i32 65)
br label %5
5: ; preds = %3, %1
%6 = and i32 %0, 7
%7 = or i32 %6, 88
%8 = tail call i32 @write_byte(i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
char getConversionType(char *arg) {
  if (!strcmp(arg, "3")) {
    return 3;
  } else if (!strcmp(arg, "6")) {
    return 6;
  }
  return -1;
}


x86 assembly (clang, -O0):
<getConversionType>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    113e <getConversionType+0x2e>
movb   $0x3,-0x1(%rbp)
jmp    1169 <getConversionType+0x59>
mov    -0x10(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1160 <getConversionType+0x50>
movb   $0x6,-0x1(%rbp)
jmp    1169 <getConversionType+0x59>
jmp    1165 <getConversionType+0x55>
movb   $0xff,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getConversionType>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     113b <getConversionType+0x2b>
lea    0xed7(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
neg    %eax
sbb    %eax,%eax
or     $0x6,%al
pop    %rbx
ret
mov    $0x3,%al
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"3\00"
@.str.1 = [2 x i8] c"6\00"
define signext i8 @getConversionType(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i8 6, i8 -1
br label %8
8: ; preds = %4, %1
%9 = phi i8 [ 3, %1 ], [ %7, %4 ]
ret i8 %9
}
int hid_exit(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @hid_exit() {
ret i32 0
}

LLVM IR (-O2):
define i32 @hid_exit() {
ret i32 0
}
int getV1(int count) { return 6 + 1 * count; }


x86 assembly (clang, -O0):
<getV1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x0,%eax
add    $0x6,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getV1>:
lea    0x6(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @getV1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 1, %3
%5 = add nsw i32 6, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @getV1(i32 %0) {
%2 = add nsw i32 %0, 6
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ strcmp(char *, char *);
int strtol(char *, char **, int);
int parse(char *opt) {
  char *remainder;
  int return_val = strtol(opt, &remainder, 10);
  if (strcmp(remainder, opt) == 0) {
    printf("Error parsing: %s\n", opt);
    exit(1);
  }
  return return_val;
}


x86 assembly (clang, -O0):
<parse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0xa,%edx
call   1050 <strtol@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1192 <parse+0x52>
mov    -0x8(%rbp),%rsi
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %rsp,%rsi
mov    $0xa,%edx
call   1050 <strtol@plt>
mov    %eax,%ebp
mov    (%rsp),%rdi
mov    %rbx,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     116f <parse+0x2f>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xe8a(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Error parsing: %s\0A\00"
define i32 @parse(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strtol(i8* %5, i8** %3, i32 10)
store i32 %6, i32* %4
%7 = load i8*, i8** %3
%8 = load i8*, i8** %2
%9 = call i64 @strcmp(i8* %7, i8* %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %1
%12 = load i8*, i8** %2
%13 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %1
%16 = load i32, i32* %4
ret i32 %16
}

LLVM IR (-O2):
@.str = [19 x i8] c"Error parsing: %s\0A\00"
define i32 @parse(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i32 @strtol(i8* %0, i8** %2, i32 10)
%5 = load i8*, i8** %2
%6 = tail call i64 @strcmp(i8* %5, i8* %0)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void my_crt_fatal_error(const char *str) {
  printf("%s\n", str);
  exit(1);
}


x86 assembly (clang, -O0):
<my_crt_fatal_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @my_crt_fatal_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @my_crt_fatal_error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
int munlockall(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @munlockall() {
ret i32 0
}

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


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

x86 assembly (clang, -O2):
<ReloadCmailMsgProc>:
xor    %edi,%edi
jmp    1030 <ReloadCmailMsgEvent@plt>

LLVM IR (-O0):
define void @ReloadCmailMsgProc() {
%1 = call i32 @ReloadCmailMsgEvent(i32 0)
ret void
}

LLVM IR (-O2):
define void @ReloadCmailMsgProc() {
%1 = tail call i32 @ReloadCmailMsgEvent(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ remove(char *);
void deletefile() {
  if (remove("changelog.txt") == 0)
    printf("%s file deleted.\n", "changelog.txt");
  else
    printf("Unable to delete the file: %s.\n", "changelog.txt");
}


x86 assembly (clang, -O0):
<deletefile>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <remove@plt>
cmp    $0x0,%rax
jne    1152 <deletefile+0x32>
lea    0xecd(%rip),%rdi
lea    0xeb8(%rip),%rsi
call   1040 <printf@plt>
jmp    1165 <deletefile+0x45>
lea    0xec7(%rip),%rdi
lea    0xea0(%rip),%rsi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<deletefile>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <remove@plt>
test   %rax,%rax
lea    0xed4(%rip),%rax
lea    0xedf(%rip),%rdi
cmove  %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"changelog.txt\00"
@.str.1 = [18 x i8] c"%s file deleted.\0A\00"
@.str.2 = [32 x i8] c"Unable to delete the file: %s.\0A\00"
define void @deletefile() {
%1 = call i64 @remove(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"changelog.txt\00"
@.str.1 = [18 x i8] c"%s file deleted.\0A\00"
@.str.2 = [32 x i8] c"Unable to delete the file: %s.\0A\00"
define void @deletefile() {
%1 = tail call i64 @remove(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0)
%4 = tail call i32 @printf(i8* %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
void printt(int t, char *str) { printf("bool test on value %d %s\n", t, str); }


x86 assembly (clang, -O0):
<printt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printt>:
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"bool test on value %d %s\0A\00"
define void @printt(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 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"bool test on value %d %s\0A\00"
define void @printt(i32 %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void usage(void) {
  fflush(stdout);
  fprintf(
      stderr,
      "Incorrect program usage\n\nusage: usm_deinterleave file [-v|-vv|-q]\n\n"
      "-v  : verbose (header info)\n"
      "-vv : more verbose (header and block info)\n"
      "-q  : quiet (only output on error)\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
lea    0xebe(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
lea    0xec1(%rip),%rsi
pop    %rax
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@stderr = global i32 0
@.str = [174 x i8] c"Incorrect program usage\0A\0Ausage: usm_deinterleave file [-v|-vv|-q]\0A\0A-v : verbose (header info)\0A-vv : more verbose (header and block info)\0A-q : quiet (only output on error)\0A\00"
define void @usage() {
%1 = load i32, i32* @stdout
%2 = call i32 @fflush(i32 %1)
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([174 x i8], [174 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@stderr = global i32 0
@.str = [174 x i8] c"Incorrect program usage\0A\0Ausage: usm_deinterleave file [-v|-vv|-q]\0A\0A-v : verbose (header info)\0A-vv : more verbose (header and block info)\0A-q : quiet (only output on error)\0A\00"
define void @usage() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fflush(i32 %1)
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([174 x i8], [174 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char const *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void put_datetime(char *out, void *arg) {
  struct tm *tm;
  time_t curtime = time(NULL);
  tm = localtime(&curtime);
  strftime(out, 64, (const char *)arg, tm);
}


x86 assembly (clang, -O0):
<put_datetime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x1c(%rbp)
lea    -0x1c(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x40,%esi
call   1050 <strftime@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_datetime>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
mov    %rbx,%rdi
mov    $0x40,%esi
mov    %r14,%rdx
mov    %rax,%rcx
call   1050 <strftime@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define void @put_datetime(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca %struct.tm*
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = call i32 @time(i32* null)
store i32 %7, i32* %6
%8 = call %struct.tm* @localtime(i32* %6)
store %struct.tm* %8, %struct.tm** %5
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = load %struct.tm*, %struct.tm** %5
%12 = call i32 @strftime(i8* %9, i32 64, i8* %10, %struct.tm* %11)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define void @put_datetime(i8* %0, i8* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @time(i32* null)
store i32 %5, i32* %3
%6 = call %struct.tm* @localtime(i32* %3)
%7 = call i32 @strftime(i8* %0, i32 64, i8* %1, %struct.tm* %6)
ret void
}
__attribute__((always_)) int bbb() {
  asm("bbb_label: .globl bbb_label");
  return ccc() + 1;
}


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

x86 assembly (clang, -O2):
<bbb>:
push   %rax

LLVM IR (-O0):
define i32 @bbb() {
%1 = call i32 (...) @ccc()
%2 = add nsw i32 %1, 1
ret i32 %2
}

LLVM IR (-O2):
define i32 @bbb() {
tail call void asm sideeffect "bbb_label: .globl bbb_label", "~{dirflag},~{fpsr},~{flags}"()
%1 = tail call i32 (...) @ccc()
%2 = add nsw i32 %1, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d", 13879);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 13879)
ret i32 0
}
int collatz(long int n) {
  int iter = 0;
  while (1) {
    if (n % 2 == 0) {
      n /= 2;
      iter++;
    } else {
      if (n == 1)
        return iter;
      else {
        n = 3 * n + 1;
        iter++;
      }
    }
  }
}


x86 assembly (clang, -O0):
<collatz>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
jne    1147 <collatz+0x47>
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1172 <collatz+0x72>
cmpq   $0x1,-0x8(%rbp)
jne    1157 <collatz+0x57>
mov    -0xc(%rbp),%eax
pop    %rbp
ret
imul   $0x3,-0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1172 <collatz+0x72>
jmp    110f <collatz+0xf>

x86 assembly (clang, -O2):
<collatz>:
xor    %eax,%eax
test   $0x1,%dil
jne    1129 <collatz+0x29>
nopl   0x0(%rax,%rax,1)
mov    %rdi,%rcx
shr    $0x3f,%rcx
add    %rdi,%rcx
sar    %rcx
add    $0x1,%eax
mov    %rcx,%rdi
test   $0x1,%dil
je     1110 <collatz+0x10>
cmp    $0x1,%rdi
je     1142 <collatz+0x42>
lea    (%rdi,%rdi,2),%rdi
add    $0x1,%rdi
add    $0x1,%eax
test   $0x1,%dil
jne    1129 <collatz+0x29>
jmp    1110 <collatz+0x10>
ret

LLVM IR (-O0):
define i32 @collatz(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
store i32 0, i32* %3
br label %4
4: ; preds = %1, %25
%5 = load i64, i64* %2
%6 = srem i64 %5, 2
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = load i64, i64* %2
%10 = sdiv i64 %9, 2
store i64 %10, i64* %2
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %25
13: ; preds = %4
%14 = load i64, i64* %2
%15 = icmp eq i64 %14, 1
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = load i32, i32* %3
ret i32 %17
18: ; preds = %13
%19 = load i64, i64* %2
%20 = mul nsw i64 3, %19
%21 = add nsw i64 %20, 1
store i64 %21, i64* %2
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %24
24: ; preds = %18
br label %25
25: ; preds = %24, %8
br label %4
}

LLVM IR (-O2):
define i32 @collatz(i64 %0) {
br label %2
2: ; preds = %15, %1
%3 = phi i64 [ %0, %1 ], [ %16, %15 ]
%4 = phi i32 [ 0, %1 ], [ %17, %15 ]
%5 = and i64 %3, 1
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = sdiv i64 %3, 2
br label %15
9: ; preds = %2
%10 = icmp eq i64 %3, 1
br i1 %10, label %11, label %12
11: ; preds = %9
ret i32 %4
12: ; preds = %9
%13 = mul nsw i64 %3, 3
%14 = add nsw i64 %13, 1
br label %15
15: ; preds = %12, %7
%16 = phi i64 [ %8, %7 ], [ %14, %12 ]
%17 = add nuw nsw i32 %4, 1
br label %2
}
void main() {
  int i, j, k, n;
  for (i = 0; i < n; i++)
    for (j = i; j < n; j++)
      for (k = j; k < n; k++) {
        if (k <= i - 1) {
          goto ERROR;
        ERROR:;
        }
      }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    118f <main+0x8f>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    117c <main+0x7c>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1169 <main+0x69>
mov    -0xc(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1156 <main+0x56>
jmp    1151 <main+0x51>
jmp    1156 <main+0x56>
jmp    115b <main+0x5b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112f <main+0x2f>
jmp    116e <main+0x6e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111d <main+0x1d>
jmp    1181 <main+0x81>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <main+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
br label %5
5: ; preds = %37, %0
%6 = load i32, i32* %1
%7 = load i32, i32* %4
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %40
9: ; preds = %5
%10 = load i32, i32* %1
store i32 %10, i32* %2
br label %11
11: ; preds = %33, %9
%12 = load i32, i32* %2
%13 = load i32, i32* %4
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %36
15: ; preds = %11
%16 = load i32, i32* %2
store i32 %16, i32* %3
br label %17
17: ; preds = %29, %15
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %32
21: ; preds = %17
%22 = load i32, i32* %3
%23 = load i32, i32* %1
%24 = sub nsw i32 %23, 1
%25 = icmp sle i32 %22, %24
br i1 %25, label %26, label %28
26: ; preds = %21
br label %27
27: ; preds = %26
br label %28
28: ; preds = %27, %21
br label %29
29: ; preds = %28
%30 = load i32, i32* %3
%31 = add nsw i32 %30, 1
store i32 %31, i32* %3
br label %17
32: ; preds = %17
br label %33
33: ; preds = %32
%34 = load i32, i32* %2
%35 = add nsw i32 %34, 1
store i32 %35, i32* %2
br label %11
36: ; preds = %11
br label %37
37: ; preds = %36
%38 = load i32, i32* %1
%39 = add nsw i32 %38, 1
store i32 %39, i32* %1
br label %5
40: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
double RAND_MAX;
double rand();
double randon(double inferior, double superior) {
  double aux =
      (float)inferior + ((superior - inferior) * rand() / (RAND_MAX + 1.0));
  return aux;
}


x86 assembly (clang, -O0):
<randon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movsd  -0x28(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm2,%xmm1
movsd  0xe9d(%rip),%xmm2
mov    0x2e7e(%rip),%rax
addsd  (%rax),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randon>:
sub    $0x18,%rsp
movapd %xmm1,%xmm2
xorps  %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm1
cvtss2sd %xmm1,%xmm1
movsd  %xmm1,0x10(%rsp)
subsd  %xmm0,%xmm2
movsd  %xmm2,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
mulsd  0x8(%rsp),%xmm0
mov    0x2ea1(%rip),%rax
movsd  (%rax),%xmm1
addsd  0xead(%rip),%xmm1
divsd  %xmm1,%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @randon(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = fptrunc double %6 to float
%8 = fpext float %7 to double
%9 = load double, double* %4
%10 = load double, double* %3
%11 = fsub double %9, %10
%12 = call double (...) @rand()
%13 = fmul double %11, %12
%14 = load double, double* @RAND_MAX
%15 = fadd double %14, 1.000000e+00
%16 = fdiv double %13, %15
%17 = fadd double %8, %16
store double %17, double* %5
%18 = load double, double* %5
ret double %18
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @randon(double %0, double %1) {
%3 = fptrunc double %0 to float
%4 = fpext float %3 to double
%5 = fsub double %1, %0
%6 = tail call double (...) @rand()
%7 = fmul double %5, %6
%8 = load double, double* @RAND_MAX
%9 = fadd double %8, 1.000000e+00
%10 = fdiv double %7, %9
%11 = fadd double %10, %4
ret double %11
}