xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int a;
  for (a = 0; a <= 100; a += 2) {
    printf("%i \n", a);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x64,-0x14(%rbp)
jg     1154 <main+0x44>
mov    -0x14(%rbp),%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xfffffffe,%ebx
lea    0xee0(%rip),%r14
add    $0x2,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
cmp    $0x63,%ebx
jb     1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%i \0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ 0, %2 ], [ %6, %3 ]
%5 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = add nuw nsw i32 %4, 2
%7 = icmp ult i32 %4, 99
br i1 %7, label %3, label %8
8: ; preds = %3
ret i32 0
}
unsigned default_index_translator(void *context, unsigned idx) {
  (void)context;
  return idx;
}


x86 assembly (clang, -O0):
<default_index_translator>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_index_translator>:
mov    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @default_index_translator(i8* nocapture readnone %0, i32 returned %1) {
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ u;

/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int geteuid();
int getuid();
int /*<<< orphan*/ write(int, int *, int);
int main() {
  int u;
  u = getuid();
  write(1, &u, sizeof(u));
  u = geteuid();
  write(1, &u, sizeof(u));
  close(1);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getuid@plt>
mov    %eax,-0x8(%rbp)
mov    $0x1,%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
mov    $0x0,%al
call   1050 <geteuid@plt>
mov    %eax,-0x8(%rbp)
mov    $0x1,%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
mov    $0x1,%edi
call   1060 <close@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1040 <getuid@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rbx
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1030 <write@plt>
xor    %eax,%eax
call   1050 <geteuid@plt>
mov    %eax,0xc(%rsp)
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1030 <write@plt>
mov    $0x1,%edi
call   1060 <close@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @getuid()
store i32 %3, i32* %2
%4 = call i32 @write(i32 1, i32* %2, i32 4)
%5 = call i32 (...) @geteuid()
store i32 %5, i32* %2
%6 = call i32 @write(i32 1, i32* %2, i32 4)
%7 = call i32 @close(i32 1)
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (...) @getuid()
store i32 %3, i32* %1
%4 = call i32 @write(i32 1, i32* %1, i32 4)
%5 = tail call i32 (...) @geteuid()
store i32 %5, i32* %1
%6 = call i32 @write(i32 1, i32* %1, i32 4)
%7 = tail call i32 @close(i32 1)
%8 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct thread {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ thread_dispose(struct thread *);
struct thread *thread_start_joinable(void *, void *);
void thread_start(void *run, void *data) {
  struct thread *t = thread_start_joinable(run, data);
  thread_dispose(t);
}


x86 assembly (clang, -O0):
<thread_start>:
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 <thread_start_joinable@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <thread_dispose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_start>:
push   %rax
call   1040 <thread_start_joinable@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <thread_dispose@plt>

LLVM IR (-O0):
%struct.thread = type { i32 }
define void @thread_start(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca %struct.thread*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call %struct.thread* @thread_start_joinable(i8* %6, i8* %7)
store %struct.thread* %8, %struct.thread** %5
%9 = load %struct.thread*, %struct.thread** %5
%10 = call i32 @thread_dispose(%struct.thread* %9)
ret void
}

LLVM IR (-O2):
%struct.thread = type { i32 }
define void @thread_start(i8* %0, i8* %1) {
%3 = tail call %struct.thread* @thread_start_joinable(i8* %0, i8* %1)
%4 = tail call i32 @thread_dispose(%struct.thread* %3)
ret void
}
/* Type definitions */
struct cred {
  int dummy;
};

/* Variables and functions */
struct cred const *get_new_cred(struct cred *);
int /*<<< orphan*/ validate_creds(struct cred const *);
__attribute__((always_)) const struct cred *get_cred(const struct cred *cred) {
  struct cred *nonconst_cred = (struct cred *)cred;
  validate_creds(cred);
  return get_new_cred(nonconst_cred);
}


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

x86 assembly (clang, -O2):
<get_cred>:
push   %rbx
mov    %rdi,%rbx
call   1040 <validate_creds@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <get_new_cred@plt>

LLVM IR (-O0):
%struct.cred = type { i32 }
define %struct.cred* @get_cred(%struct.cred* %0) {
%2 = alloca %struct.cred*
%3 = alloca %struct.cred*
store %struct.cred* %0, %struct.cred** %2
%4 = load %struct.cred*, %struct.cred** %2
store %struct.cred* %4, %struct.cred** %3
%5 = load %struct.cred*, %struct.cred** %2
%6 = call i32 @validate_creds(%struct.cred* %5)
%7 = load %struct.cred*, %struct.cred** %3
%8 = call %struct.cred* @get_new_cred(%struct.cred* %7)
ret %struct.cred* %8
}

LLVM IR (-O2):
%struct.cred = type { i32 }
define %struct.cred* @get_cred(%struct.cred* %0) {
%2 = tail call i32 @validate_creds(%struct.cred* %0)
%3 = tail call %struct.cred* @get_new_cred(%struct.cred* %0)
ret %struct.cred* %3
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello Appveyor\n");
  getchar();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [15 x i8] c"Hello Appveyor\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
ret i32 0
}
void foo607() {}


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

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

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

LLVM IR (-O2):
define void @foo607() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *, char *);
void showusage(int argc, char **argv) {
  printf("Usage: %s <interface> <target1-ip> <target1-mac> <target2-ip> "
         "<target2-mac>\nExample: %s wlan0 192.168.1.1 12:23:34:45:56:67 "
         "192.168.1.42 11:22:33:44:55:66\n",
         argv[0], argv[0]);
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [156 x i8] c"Usage: %s <interface> <target1-ip> <target1-mac> <target2-ip> <target2-mac>\0AExample: %s wlan0 192.168.1.1 12:23:34:45:56:67 192.168.1.42 11:22:33:44:55:66\0A\00"
define void @showusage(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 0
%7 = load i8*, i8** %6
%8 = load i8**, i8*** %4
%9 = getelementptr inbounds i8*, i8** %8, i64 0
%10 = load i8*, i8** %9
%11 = call i32 @printf(i8* getelementptr inbounds ([156 x i8], [156 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %10)
%12 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [156 x i8] c"Usage: %s <interface> <target1-ip> <target1-mac> <target2-ip> <target2-mac>\0AExample: %s wlan0 192.168.1.1 12:23:34:45:56:67 192.168.1.42 11:22:33:44:55:66\0A\00"
define void @showusage(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([156 x i8], [156 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %3)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ malloc(int);
void i() { (void)malloc(10); }


x86 assembly (clang, -O0):
<i>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <malloc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<i>:
mov    $0xa,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define void @i() {
%1 = call i32 @malloc(i32 10)
ret void
}

LLVM IR (-O2):
define void @i() {
%1 = tail call i32 @malloc(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void restart_usage(int code) {
  fprintf(stderr,
          "Restarts a started honeycomb managed VM instance.\n"
          "\n"
          "Usage: %s restart [-i instance] [-f]\n"
          "\n"
          "	-f: Force stop the VM instance before restarting\n"
          "	-i: Name of the VM instance\n"
          "\n",
          "hc");
  exit(code);
}


x86 assembly (clang, -O0):
<restart_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
lea    0xf68(%rip),%rdx
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<restart_usage>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
lea    0xf70(%rip),%rdx
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [170 x i8] c"Restarts a started honeycomb managed VM instance.\0A\0AUsage: %s restart [-i instance] [-f]\0A\0A\09-f: Force stop the VM instance before restarting\0A\09-i: Name of the VM instance\0A\0A\00"
@.str.1 = [3 x i8] c"hc\00"
define void @restart_usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [170 x i8] c"Restarts a started honeycomb managed VM instance.\0A\0AUsage: %s restart [-i instance] [-f]\0A\0A\09-f: Force stop the VM instance before restarting\0A\09-i: Name of the VM instance\0A\0A\00"
@.str.1 = [3 x i8] c"hc\00"
define void @restart_usage(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *);
int /*<<< orphan*/ stderr;
void rtpp_server_get_ssrc_fin(void *pub) {
  fprintf(stderr,
          "Method rtpp_server@%p::get_ssrc (rtpp_server_get_ssrc) is invoked "
          "after destruction\x0a",
          pub);
  abort();
}


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

x86 assembly (clang, -O2):
<rtpp_server_get_ssrc_fin>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [85 x i8] c"Method rtpp_server@%p::get_ssrc (rtpp_server_get_ssrc) is invoked after destruction\0A\00"
define void @rtpp_server_get_ssrc_fin(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [85 x i8] c"Method rtpp_server@%p::get_ssrc (rtpp_server_get_ssrc) is invoked after destruction\0A\00"
define void @rtpp_server_get_ssrc_fin(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
const char *Thread_Description(void) {
  return "The `Thread` type provides a basic primitive for concurrent "
         "execution. It acts as a basic wrapper around operating system "
         "threads, "
         "using WinThreads on Windows and pthreads otherwise.";
}


x86 assembly (clang, -O0):
<Thread_Description>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Thread_Description>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [183 x i8] c"The `Thread` type provides a basic primitive for concurrent execution. It acts as a basic wrapper around operating system threads, using WinThreads on Windows and pthreads otherwise.\00"
define i8* @Thread_Description() {
ret i8* getelementptr inbounds ([183 x i8], [183 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [183 x i8] c"The `Thread` type provides a basic primitive for concurrent execution. It acts as a basic wrapper around operating system threads, using WinThreads on Windows and pthreads otherwise.\00"
define i8* @Thread_Description() {
ret i8* getelementptr inbounds ([183 x i8], [183 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int uid_t;

/* Variables and functions */
int /*<<< orphan*/ getresuid(int *, int *, int *);
int /*<<< orphan*/ printf(char *, int, int, int);
int main(void) {
  uid_t r, e, s;
  getresuid(&r, &e, &s);
  printf("r=%d e=%d s=%d\n", r, e, s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1040 <getresuid@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1040 <getresuid@plt>
mov    0x14(%rsp),%esi
mov    0x10(%rsp),%edx
mov    0xc(%rsp),%ecx
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"r=%d e=%d s=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @getresuid(i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9, i32 %10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ func(char *, char *);
void stricmp_equal_upper() {
  Assert_real((func("EQUAL", "EQUAL") == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/string/stricmp.c",
              17, ("Should be == 0"));
}


x86 assembly (clang, -O0):
<stricmp_equal_upper>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rsi
mov    %rsi,%rdi
call   1030 <func@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x11,%edx
lea    0xf58(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<stricmp_equal_upper>:
push   %rax
lea    0xed8(%rip),%rdi
mov    %rdi,%rsi
call   1030 <func@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec6(%rip),%rsi
lea    0xf63(%rip),%rcx
mov    $0x11,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"EQUAL\00"
@.str.1 = [164 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/string/stricmp.c\00"
@.str.2 = [15 x i8] c"Should be == 0\00"
define void @stricmp_equal_upper() {
%1 = call i64 @func(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str.1, i64 0, i64 0), i32 17, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"EQUAL\00"
@.str.1 = [164 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/string/stricmp.c\00"
@.str.2 = [15 x i8] c"Should be == 0\00"
define void @stricmp_equal_upper() {
%1 = tail call i64 @func(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str.1, i64 0, i64 0), i32 17, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timespec {
  int dummy;
};
typedef int /*<<< orphan*/ clockid_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int clock_gettime_vdso_wrapper(int /*<<< orphan*/, struct timespec *);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ error(int /*<<< orphan*/, int /*<<< orphan*/, char *);
void clock_gettime_vdso_nofail(clockid_t id, struct timespec *ts) {
  int err;
  err = clock_gettime_vdso_wrapper(id, ts);
  if (err)
    error(EXIT_FAILURE, errno, "clock_gettime");
}


x86 assembly (clang, -O0):
<clock_gettime_vdso_nofail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <clock_gettime_vdso_wrapper@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1166 <clock_gettime_vdso_nofail+0x46>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
mov    0x2e88(%rip),%rax
mov    (%rax),%esi
lea    0xe9f(%rip),%rdx
call   1030 <error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clock_gettime_vdso_nofail>:
push   %rax
call   1040 <clock_gettime_vdso_wrapper@plt>
test   %eax,%eax
je     1149 <clock_gettime_vdso_nofail+0x29>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
mov    0x2ea6(%rip),%rax
mov    (%rax),%esi
lea    0xebd(%rip),%rdx
pop    %rax
jmp    1030 <error@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@EXIT_FAILURE = global i32 0
@errno = global i32 0
@.str = [14 x i8] c"clock_gettime\00"
define void @clock_gettime_vdso_nofail(i32 %0, %struct.timespec* %1) {
%3 = alloca i32
%4 = alloca %struct.timespec*
%5 = alloca i32
store i32 %0, i32* %3
store %struct.timespec* %1, %struct.timespec** %4
%6 = load i32, i32* %3
%7 = load %struct.timespec*, %struct.timespec** %4
%8 = call i32 @clock_gettime_vdso_wrapper(i32 %6, %struct.timespec* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i32, i32* @EXIT_FAILURE
%13 = load i32, i32* @errno
%14 = call i32 @error(i32 %12, i32 %13, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@EXIT_FAILURE = global i32 0
@errno = global i32 0
@.str = [14 x i8] c"clock_gettime\00"
define void @clock_gettime_vdso_nofail(i32 %0, %struct.timespec* %1) {
%3 = tail call i32 @clock_gettime_vdso_wrapper(i32 %0, %struct.timespec* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i32, i32* @EXIT_FAILURE
%7 = load i32, i32* @errno
%8 = tail call i32 @error(i32 %6, i32 %7, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %5, %2
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
size_t flag_fast_fwrd(uint64_t *flag, uint64_t i) {
  size_t a;
  a = i / 64;
  i &= 63;
  return (flag[a] == (uint64_t)(-1)) ? (64 - i) : 0;
}


x86 assembly (clang, -O0):
<flag_fast_fwrd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x40,%ecx
cltd
idiv   %ecx
cltq
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
and    $0x3f,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
cmpl   $0xffffffff,(%rax,%rcx,4)
jne    1147 <flag_fast_fwrd+0x47>
mov    $0x40,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    1151 <flag_fast_fwrd+0x51>
xor    %eax,%eax
mov    %eax,-0x1c(%rbp)
jmp    1151 <flag_fast_fwrd+0x51>
mov    -0x1c(%rbp),%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<flag_fast_fwrd>:
lea    0x3f(%rsi),%eax
test   %esi,%esi
cmovns %esi,%eax
sar    $0x6,%eax
movslq %eax,%rcx
and    $0x3f,%esi
mov    $0x40,%edx
sub    %esi,%edx
xor    %eax,%eax
cmpl   $0xffffffff,(%rdi,%rcx,4)
cmove  %edx,%eax
ret

LLVM IR (-O0):
define i64 @flag_fast_fwrd(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i64
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = sdiv i32 %6, 64
%8 = sext i32 %7 to i64
store i64 %8, i64* %5
%9 = load i32, i32* %4
%10 = and i32 %9, 63
store i32 %10, i32* %4
%11 = load i32*, i32** %3
%12 = load i64, i64* %5
%13 = getelementptr inbounds i32, i32* %11, i64 %12
%14 = load i32, i32* %13
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %19
16: ; preds = %2
%17 = load i32, i32* %4
%18 = sub nsw i32 64, %17
br label %20
19: ; preds = %2
br label %20
20: ; preds = %19, %16
%21 = phi i32 [ %18, %16 ], [ 0, %19 ]
%22 = sext i32 %21 to i64
ret i64 %22
}

LLVM IR (-O2):
define i64 @flag_fast_fwrd(i32* nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 64
%4 = sext i32 %3 to i64
%5 = and i32 %1, 63
%6 = getelementptr inbounds i32, i32* %0, i64 %4
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, -1
%9 = sub nuw nsw i32 64, %5
%10 = select i1 %8, i32 %9, i32 0
%11 = zext i32 %10 to i64
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ gfx_init();
int /*<<< orphan*/ gfx_putchar(char);
void cputs(const char *str) {
  char c;
  gfx_init();
  while ((c = *str++)) {
    gfx_putchar(c);
  }
}


x86 assembly (clang, -O0):
<cputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <gfx_init@plt>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x9(%rbp)
cmp    $0x0,%al
je     115d <cputs+0x3d>
movsbl -0x9(%rbp),%edi
call   1030 <gfx_putchar@plt>
jmp    1133 <cputs+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cputs>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <gfx_init@plt>
mov    (%rbx),%al
test   %al,%al
je     1153 <cputs+0x33>
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edi
call   1030 <gfx_putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1140 <cputs+0x20>
pop    %rbx
ret

LLVM IR (-O0):
define void @cputs(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
%4 = call i32 (...) @gfx_init()
br label %5
5: ; preds = %10, %1
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %2
%8 = load i8, i8* %6
store i8 %8, i8* %3
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %5
%11 = load i8, i8* %3
%12 = call i32 @gfx_putchar(i8 signext %11)
br label %5
13: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @cputs(i8* nocapture %0) {
%2 = tail call i32 (...) @gfx_init()
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %1, %5
%6 = phi i8 [ %10, %5 ], [ %3, %1 ]
%7 = phi i8* [ %8, %5 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = tail call i32 @gfx_putchar(i8 signext %6)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ itoa(int, char *);
int /*<<< orphan*/ printf(char *, ...);
main() {
  int n = 25203307;
  char s[10];
  itoa(n, s);
  printf("s=%s\n", s);
  printf("\nPress any key to end...");
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x180926b,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0xe(%rbp),%rsi
call   1050 <itoa@plt>
lea    -0xe(%rbp),%rsi
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0x6(%rsp),%rbx
mov    $0x180926b,%edi
mov    %rbx,%rsi
call   1050 <itoa@plt>
lea    0xeb2(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xea7(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"s=%s\0A\00"
@.str.1 = [25 x i8] c"\0APress any key to end...\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
store i32 25203307, i32* %1
%3 = load i32, i32* %1
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = call i32 @itoa(i32 %3, i8* %4)
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"s=%s\0A\00"
@.str.1 = [25 x i8] c"\0APress any key to end...\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @itoa(i32 25203307, i8* %2)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ srand(unsigned int);
void uninitvar_srand(void) {
  unsigned int seed;
  (void)srand(seed);
}


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

x86 assembly (clang, -O2):
<uninitvar_srand>:
jmp    1030 <srand@plt>

LLVM IR (-O0):
define void @uninitvar_srand() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 @srand(i32 %2)
ret void
}

LLVM IR (-O2):
define void @uninitvar_srand() {
%1 = tail call i32 @srand(i32 undef)
ret void
}
const char *bool_to_str(int val) { return val ? "yes" : "no"; }


x86 assembly (clang, -O0):
<bool_to_str>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xef3(%rip),%rax
lea    0xee8(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bool_to_str>:
test   %edi,%edi
lea    0xefb(%rip),%rcx
lea    0xef0(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"yes\00"
@.str.1 = [3 x i8] c"no\00"
define i8* @bool_to_str(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
ret i8* %6
}

LLVM IR (-O2):
@.str = [4 x i8] c"yes\00"
@.str.1 = [3 x i8] c"no\00"
define i8* @bool_to_str(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
main() {
  int a[4] = {0};
  return 3 [a];
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i32]
store i32 0, i32* %1
%3 = bitcast [4 x i32]* %2 to i8*
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 3
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void startupTests() {}


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

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

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

LLVM IR (-O2):
define void @startupTests() {
ret void
}
void draw_samples(int channel) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_epel_h16_8_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int echo(const char *msg) {
  printf("A STRING: %s\n", msg);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"A STRING: %s\0A\00"
define i32 @echo(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
void abe_lock_execution(void) {}


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

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

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

LLVM IR (-O2):
define void @abe_lock_execution() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int fd;
  fd = open("1", O_RDONLY);
  if (fd >= 0)
    printf("open handle value:%d\n", fd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1040 <open@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1160 <main+0x40>
mov    -0x8(%rbp),%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1040 <open@plt>
test   %eax,%eax
js     1148 <main+0x28>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"1\00"
@O_RDONLY = global i32 0
@.str.1 = [22 x i8] c"open handle value:%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @O_RDONLY
%4 = call i32 @open(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %7, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"1\00"
@O_RDONLY = global i32 0
@.str.1 = [22 x i8] c"open handle value:%d\0A\00"
define i32 @main() {
%1 = load i32, i32* @O_RDONLY
%2 = tail call i32 @open(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp sgt i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %2)
br label %6
6: ; preds = %4, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ PRIO_PROCESS;
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ panic(char *, int);
int setpriority(int /*<<< orphan*/, int /*<<< orphan*/, int);
int set_proc_prio(int priority) {
  int ret = setpriority(PRIO_PROCESS, getpid(), priority);
  if (ret)
    panic("Can't set nice val to %i!\n", priority);
  return 0;
}


x86 assembly (clang, -O0):
<set_proc_prio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
mov    -0x4(%rbp),%edx
call   1040 <setpriority@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1177 <set_proc_prio+0x47>
mov    -0x4(%rbp),%esi
lea    0xe8e(%rip),%rdi
call   1050 <panic@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_proc_prio>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ea4(%rip),%rax
mov    (%rax),%ebp
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %ebp,%edi
mov    %eax,%esi
mov    %ebx,%edx
call   1040 <setpriority@plt>
test   %eax,%eax
je     1162 <set_proc_prio+0x32>
lea    0xea5(%rip),%rdi
mov    %ebx,%esi
call   1050 <panic@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@PRIO_PROCESS = global i32 0
@.str = [27 x i8] c"Can't set nice val to %i!\0A\00"
define i32 @set_proc_prio(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* @PRIO_PROCESS
%5 = call i32 (...) @getpid()
%6 = load i32, i32* %2
%7 = call i32 @setpriority(i32 %4, i32 %5, i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i32, i32* %2
%12 = call i32 @panic(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %10, %1
ret i32 0
}

LLVM IR (-O2):
@PRIO_PROCESS = global i32 0
@.str = [27 x i8] c"Can't set nice val to %i!\0A\00"
define i32 @set_proc_prio(i32 %0) {
%2 = load i32, i32* @PRIO_PROCESS
%3 = tail call i32 (...) @getpid()
%4 = tail call i32 @setpriority(i32 %2, i32 %3, i32 %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @panic(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %8
8: ; preds = %6, %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ tests_url_encode();
int main(int argc, char **argv) {
  int failures;
  failures = 0;
  failures += tests_url_encode();
  if (failures)
    exit(EXIT_FAILURE);
  else
    exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x0,%al
call   1040 <tests_url_encode@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1169 <main+0x49>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <tests_url_encode@plt>
test   %eax,%eax
jne    113a <main+0x1a>
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = call i64 (...) @tests_url_encode()
%8 = load i32, i32* %6
%9 = sext i32 %8 to i64
%10 = add nsw i64 %9, %7
%11 = trunc i64 %10 to i32
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %2
%15 = load i32, i32* @EXIT_FAILURE
%16 = call i32 @exit(i32 %15)
unreachable
17: ; preds = %2
%18 = load i32, i32* @EXIT_SUCCESS
%19 = call i32 @exit(i32 %18)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 (...) @tests_url_encode()
%4 = trunc i64 %3 to i32
%5 = icmp eq i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
%10 = load i32, i32* @EXIT_SUCCESS
%11 = tail call i32 @exit(i32 %10)
unreachable
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int test_prefix(int nr, uint32_t value) { return ((value >> nr) == 1); }


x86 assembly (clang, -O0):
<test_prefix>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    %cl,%eax
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_prefix>:
mov    %edi,%ecx
sar    %cl,%esi
xor    %eax,%eax
cmp    $0x1,%esi
sete   %al
ret

LLVM IR (-O0):
define i32 @test_prefix(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = ashr i32 %5, %6
%8 = icmp eq i32 %7, 1
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_prefix(i32 %0, i32 %1) {
%3 = ashr i32 %1, %0
%4 = icmp eq i32 %3, 1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
double atan2(double, double);
double __arctan2(double x, double y) { return atan2(x, y); }


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

x86 assembly (clang, -O2):
<__arctan2>:
jmp    1030 <atan2@plt>

LLVM IR (-O0):
define double @__arctan2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @atan2(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @__arctan2(double %0, double %1) {
%3 = tail call double @atan2(double %0, double %1)
ret double %3
}
long int cast_char_long(char x) { return (long int)x; }


x86 assembly (clang, -O0):
<cast_char_long>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbq -0x1(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cast_char_long>:
movslq %edi,%rax
ret

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

LLVM IR (-O2):
define i64 @cast_char_long(i8 signext %0) {
%2 = sext i8 %0 to i64
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ SPI_Send(int);
void MC33927_ZeroDeadtime(void) { SPI_Send(0x80); }


x86 assembly (clang, -O0):
<MC33927_ZeroDeadtime>:
push   %rbp
mov    %rsp,%rbp
mov    $0x80,%edi
call   1030 <SPI_Send@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<MC33927_ZeroDeadtime>:
mov    $0x80,%edi
jmp    1030 <SPI_Send@plt>

LLVM IR (-O0):
define void @MC33927_ZeroDeadtime() {
%1 = call i32 @SPI_Send(i32 128)
ret void
}

LLVM IR (-O2):
define void @MC33927_ZeroDeadtime() {
%1 = tail call i32 @SPI_Send(i32 128)
ret void
}
void pinMode(int pin, int mode) {
  (void)pin;
  (void)mode;
}


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

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

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

LLVM IR (-O2):
define void @pinMode(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ unlink(char *);
remove_file(int nb) {
  char file[128];
  sprintf(file, "./f%d", nb);
  unlink(file);
}


x86 assembly (clang, -O0):
<remove_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x8(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%edx
lea    0xec1(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x90(%rbp),%rdi
call   1030 <unlink@plt>
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_file>:
push   %rbx
sub    $0x80,%rsp
mov    %edi,%edx
lea    0xecf(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <unlink@plt>
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"./f%d\00"
define i32 @remove_file(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [128 x i8]
store i32 %0, i32* %3
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%9 = call i32 @unlink(i8* %8)
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@.str = [6 x i8] c"./f%d\00"
define i32 @remove_file(i32 %0) {
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i32 @unlink(i8* %3)
ret i32 undef
}
void gtk_image_get_animation() {}


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

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

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

LLVM IR (-O2):
define void @gtk_image_get_animation() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void wuff_free(void *mem) { free(mem); }


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

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

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

LLVM IR (-O2):
define void @wuff_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int rdar11185138_bar() {
  int y;
  int x = y = 0;
  x = 2;
  y = 2;
  return x + y;
}


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

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

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

LLVM IR (-O2):
define i32 @rdar11185138_bar() {
ret i32 4
}
unsigned long asm_btr(unsigned long *f, unsigned long i) {
  unsigned long ret;
  asm("btrq  %2, %1 \n"
      "sbbq %0, %0"
      : "=r"(ret)
      : "m"(*f), "r"(i));
  return ret;
}


x86 assembly (clang, -O0):
<asm_btr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
btr    %rcx,(%rax)
sbb    %rax,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<asm_btr>:
btr    %rsi,(%rdi)
sbb    %rax,%rax
ret

LLVM IR (-O0):
define i64 @asm_btr(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%6 = load i64*, i64** %3
%7 = load i64, i64* %4
%8 = call i64 asm "btrq $2, $1 \0Asbbq $0, $0", "=r,*m,r,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %6, i64 %7)
store i64 %8, i64* %5
%9 = load i64, i64* %5
ret i64 %9
}

LLVM IR (-O2):
define i64 @asm_btr(i64* %0, i64 %1) {
%3 = tail call i64 asm "btrq $2, $1 \0Asbbq $0, $0", "=r,*m,r,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %0, i64 %1)
ret i64 %3
}