xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ abort();
void *calloc(size_t, int);
int /*<<< orphan*/ perror(char *);
void *safe_calloc(size_t n) {
  if (n == 0) {
    return NULL;
  }
  void *ptr = calloc(n, 1);
  if (ptr == NULL) {
    perror("Memory allocation failed");
    abort();
  }
  return ptr;
}


x86 assembly (clang, -O0):
<safe_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <safe_calloc+0x24>
movq   $0x0,-0x8(%rbp)
jmp    118c <safe_calloc+0x5c>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1184 <safe_calloc+0x54>
lea    0xe88(%rip),%rdi
call   1050 <perror@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_calloc>:
push   %rax
test   %rdi,%rdi
je     1147 <safe_calloc+0x17>
mov    $0x1,%esi
call   1040 <calloc@plt>
test   %rax,%rax
je     114b <safe_calloc+0x1b>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret
lea    0xeae(%rip),%rdi
call   1050 <perror@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Memory allocation failed\00"
define i8* @safe_calloc(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* null, i8** %2
br label %18
8: ; preds = %1
%9 = load i64, i64* %3
%10 = call i8* @calloc(i64 %9, i32 1)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%15 = call i32 (...) @abort()
unreachable
16: ; preds = %8
%17 = load i8*, i8** %4
store i8* %17, i8** %2
br label %18
18: ; preds = %16, %7
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
@.str = [25 x i8] c"Memory allocation failed\00"
define i8* @safe_calloc(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call i8* @calloc(i64 %0, i32 1)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %3, %1
%10 = phi i8* [ null, %1 ], [ %4, %3 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void htmlBody() { printf("<BODY>"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"<BODY>\00"
define void @htmlBody() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"<BODY>\00"
define void @htmlBody() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
int compoundLiteralTest() {
  int index = 0;
  for (index = 0; index < 2; index++) {
    int thing = (int[]){0, 1}[index];
    printf("thing: %i\n", thing);
  }
  return 0;
}


x86 assembly (clang, -O0):
<compoundLiteralTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    1168 <compoundLiteralTest+0x58>
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0xc(%rbp)
movslq -0x4(%rbp),%rax
mov    -0x10(%rbp,%rax,4),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <compoundLiteralTest+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"thing: %i\0A\00"
define i32 @compoundLiteralTest() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
void fc_nonblock(int sockfd) { ; }


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

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

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

LLVM IR (-O2):
define void @fc_nonblock(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x2d() {
  Assert_real((isupper(45) == 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/ctype/test_isupper.c",
              230, ("isupper should be 0 for -"));
}


x86 assembly (clang, -O0):
<t_isupper_0x2d>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2d,%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0xe6,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0x2d>:
push   %rax
mov    $0x2d,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xe6,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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/ctype/test_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for -\00"
define void @t_isupper_0x2d() {
%1 = call i64 @isupper(i32 45)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 230, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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/ctype/test_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for -\00"
define void @t_isupper_0x2d() {
%1 = tail call i64 @isupper(i32 45)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 230, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int rand();
int R(int i) { return rand() % i + 1; }


x86 assembly (clang, -O0):
<R>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<R>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
lea    0x1(%rdx),%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @R(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, %0
%4 = add nsw i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *);
int /*<<< orphan*/ stderr;
void rtpp_si_sync_polltbl_fin(void *pub) {
  fprintf(stderr,
          "Method rtpp_sessinfo@%p::sync_polltbl (rtpp_si_sync_polltbl) is "
          "invoked after destruction\x0a",
          pub);
  abort();
}


x86 assembly (clang, -O0):
<rtpp_si_sync_polltbl_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_si_sync_polltbl_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 = [91 x i8] c"Method rtpp_sessinfo@%p::sync_polltbl (rtpp_si_sync_polltbl) is invoked after destruction\0A\00"
define void @rtpp_si_sync_polltbl_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 ([91 x i8], [91 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [91 x i8] c"Method rtpp_sessinfo@%p::sync_polltbl (rtpp_si_sync_polltbl) is invoked after destruction\0A\00"
define void @rtpp_si_sync_polltbl_fin(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int mpv_main(int, char **);
int main(int argc, char *argv[]) { return mpv_main(argc, argv); }


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <mpv_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <mpv_main@plt>

LLVM IR (-O0):
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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @mpv_main(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @mpv_main(i32 %0, i8** %1)
ret i32 %3
}
void loadGame() {}


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

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

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

LLVM IR (-O2):
define void @loadGame() {
ret void
}
/* Variables and functions */
scalar_t__ div10(int);
signed int div10s(signed int v) {
  if (v < 0)
    return -((signed int)div10(-v));
  else
    return (signed int)div10(v);
}


x86 assembly (clang, -O0):
<div10s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    113d <div10s+0x2d>
xor    %edi,%edi
sub    -0x8(%rbp),%edi
call   1030 <div10@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1148 <div10s+0x38>
mov    -0x8(%rbp),%edi
call   1030 <div10@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<div10s>:
push   %rax
test   %edi,%edi
js     111c <div10s+0xc>
call   1030 <div10@plt>
pop    %rcx
ret
neg    %edi
call   1030 <div10@plt>
neg    %eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @div10s(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = sub nsw i32 0, %7
%9 = call i64 @div10(i32 %8)
%10 = trunc i64 %9 to i32
%11 = sub nsw i32 0, %10
store i32 %11, i32* %2
br label %16
12: ; preds = %1
%13 = load i32, i32* %3
%14 = call i64 @div10(i32 %13)
%15 = trunc i64 %14 to i32
store i32 %15, i32* %2
br label %16
16: ; preds = %12, %6
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @div10s(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = sub nsw i32 0, %0
%5 = tail call i64 @div10(i32 %4)
%6 = trunc i64 %5 to i32
%7 = sub nsw i32 0, %6
br label %11
8: ; preds = %1
%9 = tail call i64 @div10(i32 %0)
%10 = trunc i64 %9 to i32
br label %11
11: ; preds = %8, %3
%12 = phi i32 [ %7, %3 ], [ %10, %8 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x34() {
  Assert_real((isbdigit(52) == 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/ctype/test_isbdigit.c",
              265, ("isbdigit should be 0 for 4"));
}


x86 assembly (clang, -O0):
<t_isbdigit_0x34>:
push   %rbp
mov    %rsp,%rbp
mov    $0x34,%edi
call   1040 <isbdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x109,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isbdigit_0x34>:
push   %rax
mov    $0x34,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x109,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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/ctype/test_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for 4\00"
define void @t_isbdigit_0x34() {
%1 = call i64 @isbdigit(i32 52)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 265, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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/ctype/test_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for 4\00"
define void @t_isbdigit_0x34() {
%1 = tail call i64 @isbdigit(i32 52)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 265, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ request_exit(int);
void sighandler(int signum) { request_exit(1); }


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

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

LLVM IR (-O0):
define void @sighandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @request_exit(i32 1)
ret void
}

LLVM IR (-O2):
define void @sighandler(i32 %0) {
%2 = tail call i32 @request_exit(i32 1)
ret void
}
int init(void) {
  x86_energy_set_error_string(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/tud-zih-energy/x86_energy/refs/heads/master/"
      "src/access/procfs.c",
      __func__, 13, "Not yet implemented");
  return 1;
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xf78(%rip),%rsi
mov    $0xd,%edx
lea    0xf71(%rip),%rcx
mov    $0x0,%al
call   1030 <x86_energy_set_error_string@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xf7b(%rip),%rsi
lea    0xf79(%rip),%rcx
mov    $0xd,%edx
xor    %eax,%eax
call   1030 <x86_energy_set_error_string@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [154 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/tud-zih-energy/x86_energy/refs/heads/master/src/access/procfs.c\00"
@__func__.init = [5 x i8] c"init\00"
@.str.1 = [20 x i8] c"Not yet implemented\00"
define i32 @init() {
%1 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @x86_energy_set_error_string to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.init, i64 0, i64 0), i32 13, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [154 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/tud-zih-energy/x86_energy/refs/heads/master/src/access/procfs.c\00"
@__func__.init = [5 x i8] c"init\00"
@.str.1 = [20 x i8] c"Not yet implemented\00"
define i32 @init() {
%1 = tail call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @x86_energy_set_error_string to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.init, i64 0, i64 0), i32 13, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, float const, float const,
                          float const, float const);
void printVector(const char *name, const float vec[4]) {
  printf("vector %s = [ %g %g %g %g ]\n", name, vec[0], vec[1], vec[2], vec[3]);
}


x86 assembly (clang, -O0):
<printVector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm2
mov    -0x10(%rbp),%rax
movss  0xc(%rax),%xmm3
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printVector>:
mov    %rdi,%rax
movss  (%rsi),%xmm0
movss  0x4(%rsi),%xmm1
movss  0x8(%rsi),%xmm2
movss  0xc(%rsi),%xmm3
lea    0xed3(%rip),%rdi
mov    %rax,%rsi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [29 x i8] c"vector %s = [ %g %g %g %g ]\0A\00"
define void @printVector(i8* %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = getelementptr inbounds float, float* %1, i64 1
%5 = load float, float* %4
%6 = getelementptr inbounds float, float* %1, i64 2
%7 = load float, float* %6
%8 = getelementptr inbounds float, float* %1, i64 3
%9 = load float, float* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0, float %3, float %5, float %7, float %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PAGE_RemoveAllObjects();
int /*<<< orphan*/ PAGE_SetModal(int /*<<< orphan*/);
int /*<<< orphan*/ _show_page(int);
void PAGE_TimerInit(int page) {
  PAGE_SetModal(0);
  PAGE_RemoveAllObjects();
  _show_page(page);
}


x86 assembly (clang, -O0):
<PAGE_TimerInit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1050 <PAGE_SetModal@plt>
mov    $0x0,%al
call   1030 <PAGE_RemoveAllObjects@plt>
mov    -0x4(%rbp),%edi
call   1040 <_show_page@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PAGE_TimerInit>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
call   1050 <PAGE_SetModal@plt>
xor    %eax,%eax
call   1030 <PAGE_RemoveAllObjects@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <_show_page@plt>

LLVM IR (-O0):
define void @PAGE_TimerInit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @PAGE_SetModal(i32 0)
%4 = call i32 (...) @PAGE_RemoveAllObjects()
%5 = load i32, i32* %2
%6 = call i32 @_show_page(i32 %5)
ret void
}

LLVM IR (-O2):
define void @PAGE_TimerInit(i32 %0) {
%2 = tail call i32 @PAGE_SetModal(i32 0)
%3 = tail call i32 (...) @PAGE_RemoveAllObjects()
%4 = tail call i32 @_show_page(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  char *string =
      "#include<stdio.h>\n\nint main ( int argc, char *argv[] ) {\n    char "
      "*string = \"%n\";\n    printf(*string, *string);\n}\n";
  printf(string, string);
}


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

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

LLVM IR (-O0):
@.str = [115 x i8] c"#include<stdio.h>\0A\0Aint main ( int argc, char *argv[] ) {\0A char *string = \22%n\22;\0A printf(*string, *string);\0A}\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i8* getelementptr inbounds ([115 x i8], [115 x i8]* @.str, i64 0, i64 0), i8** %5
%6 = load i8*, i8** %5
%7 = load i8*, i8** %5
%8 = call i32 @printf(i8* %6, i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [115 x i8] c"#include<stdio.h>\0A\0Aint main ( int argc, char *argv[] ) {\0A char *string = \22%n\22;\0A printf(*string, *string);\0A}\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([115 x i8], [115 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([115 x i8], [115 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char *, char *);
void unknown_tag(char *filename, char *directive, char *tag) {
  char *title = "Unknown Tag";
  (void)printf(
      "<HR><H2>%s</H2>\nThe requested server-side-includes filename, "
      "%s,\ntried to use the directive %s with an unknown tag, %s.\n<HR>\n",
      title, filename, directive, tag);
}


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

x86 assembly (clang, -O2):
<unknown_tag>:
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xeec(%rip),%rdi
lea    0xed9(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Unknown Tag\00"
@.str.1 = [126 x i8] c"<HR><H2>%s</H2>\0AThe requested server-side-includes filename, %s,\0Atried to use the directive %s with an unknown tag, %s.\0A<HR>\0A\00"
define void @unknown_tag(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %7
%8 = load i8*, i8** %7
%9 = load i8*, i8** %4
%10 = load i8*, i8** %5
%11 = load i8*, i8** %6
%12 = call i32 @printf(i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str.1, i64 0, i64 0), i8* %8, i8* %9, i8* %10, i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Unknown Tag\00"
@.str.1 = [126 x i8] c"<HR><H2>%s</H2>\0AThe requested server-side-includes filename, %s,\0Atried to use the directive %s with an unknown tag, %s.\0A<HR>\0A\00"
define void @unknown_tag(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %2)
ret void
}
/* Variables and functions */
int read(int /*<<< orphan*/, char *, int);
int layer1_read(char *b) {
  if (read(0, b, 1) != 1) {
    return -1;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<layer1_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
xor    %edi,%edi
mov    $0x1,%edx
call   1030 <read@plt>
cmp    $0x1,%eax
je     1141 <layer1_read+0x31>
movl   $0xffffffff,-0x4(%rbp)
jmp    1148 <layer1_read+0x38>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<layer1_read>:
push   %rax
mov    %rdi,%rsi
xor    %edi,%edi
mov    $0x1,%edx
call   1030 <read@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
lea    (%rcx,%rcx,1),%eax
add    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @layer1_read(i8* nocapture %0) {
%2 = tail call i32 @read(i32 0, i8* %0, i32 1)
%3 = icmp eq i32 %2, 1
%4 = select i1 %3, i32 1, i32 -1
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ ptrdiff_t;

/* Variables and functions */
size_t posrelat(ptrdiff_t pos, size_t len) {
  if (pos >= 0)
    return (size_t)pos;
  else if (0u - (size_t)pos > len)
    return 0;
  else
    return len - ((size_t)-pos) + 1;
}


x86 assembly (clang, -O0):
<posrelat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jl     1124 <posrelat+0x24>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1156 <posrelat+0x56>
xor    %eax,%eax
sub    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    1141 <posrelat+0x41>
movq   $0x0,-0x8(%rbp)
jmp    1156 <posrelat+0x56>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    -0x10(%rbp),%rcx
sub    %rcx,%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<posrelat>:
mov    %rdi,%rax
test   %rdi,%rdi
js     1109 <posrelat+0x9>
ret
mov    %rax,%rcx
neg    %rcx
cmp    %rsi,%rcx
jbe    1117 <posrelat+0x17>
xor    %eax,%eax
ret
add    %rsi,%rax
add    $0x1,%rax
ret

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

LLVM IR (-O2):
define i64 @posrelat(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, -1
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = sub i64 0, %0
%6 = icmp ugt i64 %5, %1
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = add nsw i64 %0, 1
%9 = add i64 %8, %1
br label %10
10: ; preds = %4, %2, %7
%11 = phi i64 [ %9, %7 ], [ %0, %2 ], [ 0, %4 ]
ret i64 %11
}
void destruction() {}


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

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

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

LLVM IR (-O2):
define void @destruction() {
ret void
}
void crypto_ccm_module_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @crypto_ccm_module_exit() {
ret void
}
void rt_error(char *mesg, ...) {
  (void)mesg;
  return;
}


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

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

LLVM IR (-O0):
define void @rt_error(i8* %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @rt_error(i8* nocapture %0, ...) {
ret void
}
void leds_set(int mask) {
  (*(volatile unsigned int *)(0x4804C194) = (unsigned int)((mask & 0xf) << 21));
  (*(volatile unsigned int *)(0x4804C190) =
       (unsigned int)((~mask & 0xf) << 21));
}


x86 assembly (clang, -O0):
<leds_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
and    $0xf,%ecx
shl    $0x15,%ecx
mov    $0x4804c194,%eax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
xor    $0xffffffff,%ecx
and    $0xf,%ecx
shl    $0x15,%ecx
mov    $0x4804c190,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<leds_set>:
and    $0xf,%edi
shl    $0x15,%edi
mov    %edi,0x4804c194
xor    $0x1e00000,%edi
mov    %edi,0x4804c190
ret

LLVM IR (-O0):
define void @leds_set(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 15
%5 = shl i32 %4, 21
store volatile i32 %5, i32* inttoptr (i64 1208271252 to i32*)
%6 = load i32, i32* %2
%7 = xor i32 %6, -1
%8 = and i32 %7, 15
%9 = shl i32 %8, 21
store volatile i32 %9, i32* inttoptr (i64 1208271248 to i32*)
ret void
}

LLVM IR (-O2):
define void @leds_set(i32 %0) {
%2 = shl i32 %0, 21
%3 = and i32 %2, 31457280
store volatile i32 %3, i32* inttoptr (i64 1208271252 to i32*)
%4 = xor i32 %3, 31457280
store volatile i32 %4, i32* inttoptr (i64 1208271248 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print(int *, int);
int /*<<< orphan*/ sort(int *, int);
int main() {
  int a[5] = {1, 2, 8, 6, 4};
  int n = 5;
  print(a, n);
  sort(a, n);
  print(a, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
movl   $0x5,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <print@plt>
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1030 <sort@plt>
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <print@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    0xee5(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xeca(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <print@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <sort@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <print@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.a = [5 x i32] [i32 1, i32 2, i32 8, i32 6, i32 4]
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [5 x i32]* %2 to i8*
store i32 5, i32* %3
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @print(i32* %5, i32 %6)
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%9 = load i32, i32* %3
%10 = call i32 @sort(i32* %8, i32 %9)
%11 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%12 = load i32, i32* %3
%13 = call i32 @print(i32* %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [5 x i32] [i32 1, i32 2, i32 8, i32 6, i32 4]
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @print(i32* %3, i32 5)
%5 = call i32 @sort(i32* %3, i32 5)
%6 = call i32 @print(i32* %3, i32 5)
ret i32 0
}
void gdk_color_copy() {}


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

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

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

LLVM IR (-O2):
define void @gdk_color_copy() {
ret void
}
void console_print_prompt(void) {}


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

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

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

LLVM IR (-O2):
define void @console_print_prompt() {
ret void
}
void foo_1_1_2_1_1_1_1_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_2_1_1_1_1_2_2() {
ret void
}
int test_imm_60uint32_mem(unsigned int *val) {
  return ((*val) & (0x60 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_60uint32_mem>:
testb  $0x60,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_60uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 96
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
float foo01(float a, float b, float c) { return (a + b * c); }


x86 assembly (clang, -O0):
<foo01>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo01>:
mulss  %xmm2,%xmm1
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @foo01(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = call float @llvm.fmuladd.f32(float %8, float %9, float %7)
ret float %10
}

LLVM IR (-O2):
define float @foo01(float %0, float %1, float %2) {
%4 = tail call float @llvm.fmuladd.f32(float %1, float %2, float %0)
ret float %4
}
void __DELETE_java_net_UnknownHostException(void *me, void *client_data) {}


x86 assembly (clang, -O0):
<__DELETE_java_net_UnknownHostException>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @__DELETE_java_net_UnknownHostException(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @__DELETE_java_net_UnknownHostException(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ arr;

/* Variables and functions */
int dim(int *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int arr[] = {1, 2, 3, 4};
  printf("%d\n", dim(arr));
  printf("%d\n", (sizeof(arr) / sizeof(*arr)));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
call   1040 <dim@plt>
mov    %eax,%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb4(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movaps 0xed4(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1040 <dim@plt>
lea    0xed1(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.arr = [4 x i32] [i32 1, i32 2, i32 3, i32 4]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @dim(i32* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [4 x i32] [i32 1, i32 2, i32 3, i32 4]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @dim(i32* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
unsigned long EEPROMBlockLock(unsigned long ulBlock) {
  DEBUG_ASSERT(
      ulBlock <
      ((((*((volatile unsigned long *)(0x400AF000)))) & 0x07FF0000) >> 16));
  (*((volatile unsigned long *)(0x400AF004))) = ulBlock;
  (*((volatile unsigned long *)(0x400AF020))) = 0xFFFFFFFF;
  return ((*((volatile unsigned long *)(0x400AF020))));
}


x86 assembly (clang, -O0):
<EEPROMBlockLock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x400af000,%ecx
mov    (%rcx),%rcx
and    $0x7ff0000,%rcx
shr    $0x10,%rcx
cmp    %rcx,%rax
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rcx
mov    $0x400af004,%eax
mov    %rcx,(%rax)
mov    $0x400af020,%eax
mov    $0xffffffff,%ecx
mov    %rcx,(%rax)
mov    $0x400af020,%eax
mov    (%rax),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EEPROMBlockLock>:
push   %rbx
mov    %rdi,%rbx
mov    0x400af000,%rax
40
shr    $0x10,%eax
and    $0x7ff,%eax
xor    %edi,%edi
cmp    %rbx,%rax
seta   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    %rbx,0x400af004
40
mov    $0xffffffff,%eax
mov    %rax,0x400af020
40
mov    0x400af020,%rax
40
pop    %rbx
ret

LLVM IR (-O0):
define i64 @EEPROMBlockLock(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load volatile i64, i64* inttoptr (i64 1074458624 to i64*)
%5 = and i64 %4, 134152192
%6 = lshr i64 %5, 16
%7 = icmp ult i64 %3, %6
%8 = zext i1 %7 to i32
%9 = call i32 @DEBUG_ASSERT(i32 %8)
%10 = load i64, i64* %2
store volatile i64 %10, i64* inttoptr (i64 1074458628 to i64*)
store volatile i64 4294967295, i64* inttoptr (i64 1074458656 to i64*)
%11 = load volatile i64, i64* inttoptr (i64 1074458656 to i64*)
ret i64 %11
}

LLVM IR (-O2):
define i64 @EEPROMBlockLock(i64 %0) {
%2 = load volatile i64, i64* inttoptr (i64 1074458624 to i64*)
%3 = lshr i64 %2, 16
%4 = and i64 %3, 2047
%5 = icmp ugt i64 %4, %0
%6 = zext i1 %5 to i32
%7 = tail call i32 @DEBUG_ASSERT(i32 %6)
store volatile i64 %0, i64* inttoptr (i64 1074458628 to i64*)
store volatile i64 4294967295, i64* inttoptr (i64 1074458656 to i64*)
%8 = load volatile i64, i64* inttoptr (i64 1074458656 to i64*)
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ puts(char *);
void printUsage(const char *command) {
  printf("Usage: %s [OPTION] file.IFF\n\n", command);
  puts(
      "The command `8svxpp' displays a textual representation of a given IFF "
      "file\n"
      "containing 8SVX form chunks, which can be used for manual inspection. "
      "If no\n"
      "IFF file is specified, it reads an IFF file from the standard input.\n\n"
      "Options:\n\n"
      "  -c, --disable-check    Do not check the IFF file\n"
      "  -h, --help             Shows the usage of this command to the user\n"
      "  -v, --version          Shows the version of this command to the user");
}


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

x86 assembly (clang, -O2):
<printUsage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
lea    0xee7(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Usage: %s [OPTION] file.IFF\0A\0A\00"
@.str.1 = [422 x i8] c"The command `8svxpp' displays a textual representation of a given IFF file\0Acontaining 8SVX form chunks, which can be used for manual inspection. If no\0AIFF file is specified, it reads an IFF file from the standard input.\0A\0AOptions:\0A\0A -c, --disable-check Do not check the IFF file\0A -h, --help Shows the usage of this command to the user\0A -v, --version Shows the version of this command to the user\00"
define void @printUsage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @puts(i8* getelementptr inbounds ([422 x i8], [422 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"Usage: %s [OPTION] file.IFF\0A\0A\00"
@.str.1 = [422 x i8] c"The command `8svxpp' displays a textual representation of a given IFF file\0Acontaining 8SVX form chunks, which can be used for manual inspection. If no\0AIFF file is specified, it reads an IFF file from the standard input.\0A\0AOptions:\0A\0A -c, --disable-check Do not check the IFF file\0A -h, --help Shows the usage of this command to the user\0A -v, --version Shows the version of this command to the user\00"
define void @printUsage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([422 x i8], [422 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned int call_step(unsigned int descriptor) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @call_step(i32 %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ readidew(int);
uint16_t ide_read_qua_w(uint16_t addr, void *priv) { return readidew(3); }


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

x86 assembly (clang, -O2):
<ide_read_qua_w>:
mov    $0x3,%edi
jmp    1030 <readidew@plt>

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

LLVM IR (-O2):
define i32 @ide_read_qua_w(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 @readidew(i32 3)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ l;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void testit(int *l) {
  printf("SIZE * / SIZE 0: %lu/%lu\n", sizeof(l), sizeof(l[0]));
}


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

x86 assembly (clang, -O2):
<testit>:
lea    0xee9(%rip),%rdi
mov    $0x8,%esi
mov    $0x4,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"SIZE * / SIZE 0: %lu/%lu\0A\00"
define void @testit(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 8, i32 4)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"SIZE * / SIZE 0: %lu/%lu\0A\00"
define void @testit(i32* nocapture readnone %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 8, i32 4)
ret void
}
/* Type definitions */
struct rtpp_pcache {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct rtpp_pcache *);
void rtpp_pcache_dtor(struct rtpp_pcache *self) { free(self); }


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

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

LLVM IR (-O2):
%struct.rtpp_pcache = type { i32 }
define void @rtpp_pcache_dtor(%struct.rtpp_pcache* nocapture %0) {
%2 = tail call i32 @free(%struct.rtpp_pcache* %0)
ret void
}