xunge/DecIR huggingface dataset:
void freeheaders(char **headers) {
  char **curheader = headers;
  while (*curheader) {
    free(*curheader);
    curheader++;
  };
  free(headers);
}


x86 assembly (clang, -O0):
<freeheaders>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     114f <freeheaders+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <freeheaders+0x14>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeheaders>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <freeheaders+0x31>
lea    0x8(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <freeheaders+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @freeheaders(i8** %0) {
%2 = alloca i8**
%3 = alloca i8**
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
store i8** %4, i8*** %3
br label %5
5: ; preds = %9, %1
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %14
9: ; preds = %5
%10 = load i8**, i8*** %3
%11 = load i8*, i8** %10
%12 = load i8**, i8*** %3
%13 = getelementptr inbounds i8*, i8** %12, i32 1
store i8** %13, i8*** %3
br label %5
14: ; preds = %5
%15 = load i8**, i8*** %2
%16 = bitcast i8** %15 to i8*
ret void
}

LLVM IR (-O2):
define void @freeheaders(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %10, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %8, %4 ], [ %2, %1 ]
%6 = phi i8** [ %7, %4 ], [ %0, %1 ]
tail call void @free(i8* %5)
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %4
10: ; preds = %4, %1
%11 = bitcast i8** %0 to i8*
tail call void @free(i8* %11)
ret void
}
void free_arr(int **arr, int s) {
  int i = 0;
  for (i = 0; i < s; i++) {
    free(arr[i]);
  }
  free(arr);
}


x86 assembly (clang, -O0):
<free_arr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1158 <free_arr+0x48>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <free_arr+0x1d>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_arr>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <free_arr+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_arr+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_arr(i32** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32*, i32** %0, i64 %7
%9 = bitcast i32** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast i32** %0 to i8*
tail call void @free(i8* %14)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_socket_query();
int main() {
  test_socket_query();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_socket_query()
ret i32 0
}
/* Variables and functions */
int MAP_ANON;
void *MAP_FAILED;
int MAP_PRIVATE;
int PROT_READ;
int PROT_WRITE;
void *mmap(int /*<<< orphan*/, long, int, int, int, int /*<<< orphan*/);
void *get_mmap(long sz) {
  void *p = mmap(0, sz, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);
  if (p == MAP_FAILED)
    return NULL;
  return p;
}


x86 assembly (clang, -O0):
<get_mmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    0x2ed1(%rip),%rax
mov    (%rax),%edx
mov    0x2ea8(%rip),%rax
or     (%rax),%edx
mov    0x2e8f(%rip),%rax
mov    (%rax),%ecx
mov    0x2e8e(%rip),%rax
or     (%rax),%ecx
xor    %r9d,%r9d
mov    $0xffffffff,%r8d
mov    %r9d,%edi
call   1030 <mmap@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x2e5c(%rip),%rcx
cmp    (%rcx),%rax
jne    117a <get_mmap+0x6a>
movq   $0x0,-0x8(%rbp)
jmp    1182 <get_mmap+0x72>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_mmap>:
push   %rbx
mov    %rdi,%rsi
mov    0x2edd(%rip),%rax
mov    0x2eb6(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    0x2e9b(%rip),%rax
mov    0x2e9c(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
xor    %ebx,%ebx
xor    %edi,%edi
mov    $0xffffffff,%r8d
xor    %r9d,%r9d
call   1030 <mmap@plt>
mov    0x2e6f(%rip),%rcx
cmp    (%rcx),%rax
cmove  %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_PRIVATE = global i32 0
@MAP_ANON = global i32 0
@MAP_FAILED = global i8* null
define i8* @get_mmap(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = load i32, i32* @PROT_READ
%7 = load i32, i32* @PROT_WRITE
%8 = or i32 %6, %7
%9 = load i32, i32* @MAP_PRIVATE
%10 = load i32, i32* @MAP_ANON
%11 = or i32 %9, %10
%12 = call i8* @mmap(i32 0, i64 %5, i32 %8, i32 %11, i32 -1, i32 0)
store i8* %12, i8** %4
%13 = load i8*, i8** %4
%14 = load i8*, i8** @MAP_FAILED
%15 = icmp eq i8* %13, %14
br i1 %15, label %16, label %17
16: ; preds = %1
store i8* null, i8** %2
br label %19
17: ; preds = %1
%18 = load i8*, i8** %4
store i8* %18, i8** %2
br label %19
19: ; preds = %17, %16
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_PRIVATE = global i32 0
@MAP_ANON = global i32 0
@MAP_FAILED = global i8* null
define i8* @get_mmap(i64 %0) {
%2 = load i32, i32* @PROT_READ
%3 = load i32, i32* @PROT_WRITE
%4 = or i32 %3, %2
%5 = load i32, i32* @MAP_PRIVATE
%6 = load i32, i32* @MAP_ANON
%7 = or i32 %6, %5
%8 = tail call i8* @mmap(i32 0, i64 %0, i32 %4, i32 %7, i32 -1, i32 0)
%9 = load i8*, i8** @MAP_FAILED
%10 = icmp eq i8* %8, %9
%11 = select i1 %10, i8* null, i8* %8
ret i8* %11
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t weird_rol8(uint8_t input, int count) {
  if (count == 0)
    return 0;
  return ((input << count) & 0xff) | (input & 0xff) >> (8 - count);
}


x86 assembly (clang, -O0):
<weird_rol8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1120 <weird_rol8+0x20>
movl   $0x0,-0x4(%rbp)
jmp    1147 <weird_rol8+0x47>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
and    $0xff,%eax
mov    -0x8(%rbp),%edx
and    $0xff,%edx
mov    $0x8,%ecx
sub    -0xc(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<weird_rol8>:
test   %esi,%esi
je     111b <weird_rol8+0x1b>
mov    %edi,%eax
mov    %esi,%ecx
shl    %cl,%eax
movzbl %al,%edx
movzbl %dil,%eax
mov    $0x8,%cl
sub    %sil,%cl
shr    %cl,%eax
or     %edx,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @weird_rol8(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 0, i32* %3
br label %20
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = shl i32 %10, %11
%13 = and i32 %12, 255
%14 = load i32, i32* %4
%15 = and i32 %14, 255
%16 = load i32, i32* %5
%17 = sub nsw i32 8, %16
%18 = ashr i32 %15, %17
%19 = or i32 %13, %18
store i32 %19, i32* %3
br label %20
20: ; preds = %9, %8
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @weird_rol8(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = shl i32 %0, %1
%6 = and i32 %5, 255
%7 = and i32 %0, 255
%8 = sub nsw i32 8, %1
%9 = lshr i32 %7, %8
%10 = or i32 %6, %9
br label %11
11: ; preds = %2, %4
%12 = phi i32 [ %10, %4 ], [ 0, %2 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
unsigned int myfree(void *ptr) {
  free(ptr);
  return 0;
}


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

x86 assembly (clang, -O2):
<myfree>:
push   %rax
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @myfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int free_visitor(const char *key, void *data, void *arg, int nsiblings) {
  (void)key;
  (void)arg;
  (void)nsiblings;
  free(data);
  return 0;
}


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

x86 assembly (clang, -O2):
<free_visitor>:
push   %rax
mov    %rsi,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @free_visitor(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %7
%11 = load i32, i32* %8
%12 = load i8*, i8** %6
%13 = call i32 @free(i8* %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @free_visitor(i8* nocapture readnone %0, i8* nocapture %1, i8* nocapture readnone %2, i32 %3) {
%5 = tail call i32 @free(i8* %1)
ret i32 0
}
int rsock_udp_optname_to_int(const char *str, long len, int *valp) {
  switch (len) {
  case 4:
    return -1;
  case 8:
    return -1;
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<rsock_udp_optname_to_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
sub    $0x4,%rax
je     113a <rsock_udp_optname_to_int+0x3a>
jmp    1127 <rsock_udp_optname_to_int+0x27>
mov    -0x28(%rbp),%rax
sub    $0x8,%rax
je     1146 <rsock_udp_optname_to_int+0x46>
jmp    1152 <rsock_udp_optname_to_int+0x52>
movl   $0xffffffff,-0x4(%rbp)
jmp    1159 <rsock_udp_optname_to_int+0x59>
movl   $0xffffffff,-0x4(%rbp)
jmp    1159 <rsock_udp_optname_to_int+0x59>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @rsock_udp_optname_to_int(i8* %0, i64 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i32* %2, i32** %7
%8 = load i64, i64* %6
switch i64 %8, label %11 [
i64 4, label %9
i64 8, label %10
]
9: ; preds = %3
store i32 -1, i32* %4
br label %12
10: ; preds = %3
store i32 -1, i32* %4
br label %12
11: ; preds = %3
store i32 -1, i32* %4
br label %12
12: ; preds = %11, %10, %9
%13 = load i32, i32* %4
ret i32 %13
}

LLVM IR (-O2):
define i32 @rsock_udp_optname_to_int(i8* nocapture readnone %0, i64 %1, i32* nocapture readnone %2) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ color(int);
int /*<<< orphan*/ io_hlt();
int /*<<< orphan*/ printk(char *);
void int_Double_fault(void) {
  color(0xff0000);
  printk("Double fault!!!");
  io_hlt();
}


x86 assembly (clang, -O0):
<int_Double_fault>:
push   %rbp
mov    %rsp,%rbp
mov    $0xff0000,%edi
call   1050 <color@plt>
lea    0xebb(%rip),%rdi
call   1030 <printk@plt>
mov    $0x0,%al
call   1040 <io_hlt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_Double_fault>:
push   %rax
mov    $0xff0000,%edi
call   1050 <color@plt>
lea    0xebe(%rip),%rdi
call   1030 <printk@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <io_hlt@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Double fault!!!\00"
define void @int_Double_fault() {
%1 = call i32 @color(i32 16711680)
%2 = call i32 @printk(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @io_hlt()
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Double fault!!!\00"
define void @int_Double_fault() {
%1 = tail call i32 @color(i32 16711680)
%2 = tail call i32 @printk(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @io_hlt()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
void closeWithError_2(char *error2) {
  char errMsj2[50];
  sprintf(errMsj2,
          "\x1B[31m"
          "%s"
          "\033[0m",
          error2);
  perror(errMsj2);
  exit(1);
}


x86 assembly (clang, -O0):
<closeWithError_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xeb5(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x40(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<closeWithError_2>:
push   %rbx
sub    $0x40,%rsp
mov    %rdi,%rdx
lea    0xec1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"\1B[31m%s\1B[0m\00"
define void @closeWithError_2(i8* %0) {
%2 = alloca i8*
%3 = alloca [50 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%8 = call i32 @perror(i8* %7)
%9 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [12 x i8] c"\1B[31m%s\1B[0m\00"
define void @closeWithError_2(i8* %0) {
%2 = alloca [50 x i8]
%3 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @perror(i8* %3)
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void perror_exit(int errcode, const char *s) {
  fflush(stdout);
  fprintf(stderr, "%s: ", "run-test262");
  perror(s);
  exit(errcode);
}


x86 assembly (clang, -O0):
<perror_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
lea    0xe93(%rip),%rsi
lea    0xe91(%rip),%rdx
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1050 <perror@plt>
mov    -0x4(%rbp),%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<perror_exit>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
lea    0xe9a(%rip),%rsi
lea    0xe98(%rip),%rdx
call   1030 <fprintf@plt>
mov    %rbx,%rdi
call   1050 <perror@plt>
mov    %ebp,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@stderr = global i32 0
@.str = [5 x i8] c"%s: \00"
@.str.1 = [12 x i8] c"run-test262\00"
define void @perror_exit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* @stdout
%6 = call i32 @fflush(i32 %5)
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%9 = load i8*, i8** %4
%10 = call i32 @perror(i8* %9)
%11 = load i32, i32* %3
%12 = call i32 @exit(i32 %11)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@stderr = global i32 0
@.str = [5 x i8] c"%s: \00"
@.str.1 = [12 x i8] c"run-test262\00"
define void @perror_exit(i32 %0, i8* nocapture %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @perror(i8* %1)
%8 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ putchar(unsigned short);
void putwchar(unsigned short x) {
  putchar(x >> 8);
  putchar(x);
}


x86 assembly (clang, -O0):
<putwchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
movzwl %ax,%edi
call   1030 <putchar@plt>
movzwl -0x2(%rbp),%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putwchar>:
push   %rbx
mov    %edi,%ebx
shr    $0x8,%edi
call   1030 <putchar@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @putwchar(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = ashr i32 %4, 8
%6 = trunc i32 %5 to i16
%7 = call i32 @putchar(i16 zeroext %6)
%8 = load i16, i16* %2
%9 = call i32 @putchar(i16 zeroext %8)
ret void
}

LLVM IR (-O2):
define void @putwchar(i16 zeroext %0) {
%2 = lshr i16 %0, 8
%3 = tail call i32 @putchar(i16 zeroext %2)
%4 = tail call i32 @putchar(i16 zeroext %0)
ret void
}
void leave_room() {}


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

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

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

LLVM IR (-O2):
define void @leave_room() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_event_source_set_priority(void *s, int64_t priority) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_event_source_set_priority>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
mov    0x2ecc(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_event_source_set_priority>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

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

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_event_source_set_priority(i8* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
void aswap(int *p, int a, int b) {
  int h;
  h = p[a];
  p[a] = p[b];
  p[b] = h;
}


x86 assembly (clang, -O0):
<aswap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<aswap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

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

LLVM IR (-O2):
define void @aswap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
int ft_abs(int i) {
  if (i < 0)
    i *= -1;
  return (i);
}


x86 assembly (clang, -O0):
<ft_abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1118 <ft_abs+0x18>
imul   $0xffffffff,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ft_abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
int sched_timestamp() {}


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

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

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

LLVM IR (-O2):
define i32 @sched_timestamp() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int, char *, char *);
char *ExtrairLogs(int sessao, char *codigo_ativacao) {
  static char resp[256];
  sprintf(resp, "%d|%05d|%s|||%s", sessao, 15000,
          "Transf\xc3\xaarencia completa", "QXJxdWl2byBkZSBMb2c=");
  return resp;
}


x86 assembly (clang, -O0):
<ExtrairLogs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edx
lea    0x2f17(%rip),%rdi
lea    0xed0(%rip),%rsi
mov    $0x3a98,%ecx
lea    0xed4(%rip),%r8
lea    0xee5(%rip),%r9
call   1030 <sprintf@plt>
lea    0x2ef1(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ExtrairLogs>:
push   %rbx
mov    %edi,%edx
lea    0x2f26(%rip),%rbx
lea    0xedf(%rip),%rsi
lea    0xee8(%rip),%r8
lea    0xef9(%rip),%r9
mov    %rbx,%rdi
mov    $0x3a98,%ecx
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@ExtrairLogs.resp = internal global [256 x i8] zeroinitializer
@.str = [16 x i8] c"%d|%05d|%s|||%s\00"
@.str.1 = [24 x i8] c"Transf\C3\AArencia completa\00"
@.str.2 = [21 x i8] c"QXJxdWl2byBkZSBMb2c=\00"
define i8* @ExtrairLogs(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = call i32 @sprintf(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @ExtrairLogs.resp, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5, i32 15000, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @ExtrairLogs.resp, i64 0, i64 0)
}

LLVM IR (-O2):
@ExtrairLogs.resp = internal global [256 x i8] zeroinitializer
@.str = [16 x i8] c"%d|%05d|%s|||%s\00"
@.str.1 = [24 x i8] c"Transf\C3\AArencia completa\00"
@.str.2 = [21 x i8] c"QXJxdWl2byBkZSBMb2c=\00"
define i8* @ExtrairLogs(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([256 x i8], [256 x i8]* @ExtrairLogs.resp, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %0, i32 15000, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @ExtrairLogs.resp, i64 0, i64 0)
}
void calc_hora(int horaI, int minI, int horaF, int minF, int *ph, int *pm) {
  *ph = horaF - horaI;
  *pm = minF - minI;
  if (*pm < 0)
    *pm *= (-1);
}


x86 assembly (clang, -O0):
<calc_hora>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0xc(%rbp),%ecx
sub    -0x4(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%ecx
sub    -0x8(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
cmpl   $0x0,(%rax)
jge    1146 <calc_hora+0x46>
mov    -0x20(%rbp),%rax
imul   $0xffffffff,(%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_hora>:
sub    %edi,%edx
mov    %edx,(%r8)
sub    %esi,%ecx
mov    %ecx,%eax
neg    %eax
cmovs  %ecx,%eax
mov    %eax,(%r9)
ret

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

LLVM IR (-O2):
define void @calc_hora(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture writeonly %4, i32* nocapture writeonly %5) {
%7 = sub nsw i32 %2, %0
store i32 %7, i32* %4
%8 = sub nsw i32 %3, %1
%9 = tail call i32 @llvm.abs.i32(i32 %8, i1 true)
store i32 %9, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hw_console_output(char *);
int main() {
  while (1) {
    hw_console_output("hello\n");
  };
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <hw_console_output@plt>
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <hw_console_output@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [7 x i8] c"hello\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 @hw_console_output(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %2
}

LLVM IR (-O2):
@.str = [7 x i8] c"hello\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @hw_console_output(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int a, b;
  a = 24;
  b = -24;
  printf("a = %d\n", a);
  printf("b = %d\n", b);
  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   $0x18,-0x14(%rbp)
movl   $0xffffffe8,-0x18(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xebb(%rip),%rdi
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    $0x18,%esi
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
mov    $0xffffffe8,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"a = %d\0A\00"
@.str.1 = [8 x i8] c"b = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 24)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 -24)
ret i32 0
}
/* Type definitions */
struct instrument {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ inst_wrtstr(struct instrument *, char *);
int /*<<< orphan*/ sleep(int);
void inst_488_2_rst(struct instrument *gd, int delay_secs) {
  inst_wrtstr(gd, "*RST\n");
  sleep(delay_secs);
}


x86 assembly (clang, -O0):
<inst_488_2_rst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec6(%rip),%rsi
call   1030 <inst_wrtstr@plt>
mov    -0xc(%rbp),%edi
call   1040 <sleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inst_488_2_rst>:
push   %rbx
mov    %esi,%ebx
lea    0xed6(%rip),%rsi
call   1030 <inst_wrtstr@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <sleep@plt>

LLVM IR (-O0):
%struct.instrument = type { i32 }
@.str = [6 x i8] c"*RST\0A\00"
define void @inst_488_2_rst(%struct.instrument* %0, i32 %1) {
%3 = alloca %struct.instrument*
%4 = alloca i32
store %struct.instrument* %0, %struct.instrument** %3
store i32 %1, i32* %4
%5 = load %struct.instrument*, %struct.instrument** %3
%6 = call i32 @inst_wrtstr(%struct.instrument* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %4
%8 = call i32 @sleep(i32 %7)
ret void
}

LLVM IR (-O2):
%struct.instrument = type { i32 }
@.str = [6 x i8] c"*RST\0A\00"
define void @inst_488_2_rst(%struct.instrument* %0, i32 %1) {
%3 = tail call i32 @inst_wrtstr(%struct.instrument* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @sleep(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  (void)fprintf(stderr, "Usage: test_rename"
                        " source destination\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"Usage: test_rename source destination\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"Usage: test_rename source destination\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int delay_line_max_samples(float, float, int);
int delay_line_bytes_alloc(float sr, float iPitchMod, int n) {
  int nBytes = 0;
  nBytes += (delay_line_max_samples(sr, iPitchMod, n) * (int)sizeof(float));
  return nBytes;
}


x86 assembly (clang, -O0):
<delay_line_bytes_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mov    -0xc(%rbp),%edi
call   1030 <delay_line_max_samples@plt>
shl    $0x2,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay_line_bytes_alloc>:
push   %rax
call   1030 <delay_line_max_samples@plt>
shl    $0x2,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @delay_line_bytes_alloc(float %0, float %1, i32 %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca i32
%7 = alloca i32
store float %0, float* %4
store float %1, float* %5
store i32 %2, i32* %6
store i32 0, i32* %7
%8 = load float, float* %4
%9 = load float, float* %5
%10 = load i32, i32* %6
%11 = call i32 @delay_line_max_samples(float %8, float %9, i32 %10)
%12 = mul nsw i32 %11, 4
%13 = load i32, i32* %7
%14 = add nsw i32 %13, %12
store i32 %14, i32* %7
%15 = load i32, i32* %7
ret i32 %15
}

LLVM IR (-O2):
define i32 @delay_line_bytes_alloc(float %0, float %1, i32 %2) {
%4 = tail call i32 @delay_line_max_samples(float %0, float %1, i32 %2)
%5 = shl nsw i32 %4, 2
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ x;
typedef int /*<<< orphan*/ mbstate_t;

/* Variables and functions */
int main(void) {
  mbstate_t x;
  return sizeof(x) - sizeof(mbstate_t);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printArr(int *, int);
int /*<<< orphan*/ shellsort(int *, int);
main() {
  int len = 12;
  int v[] = {11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0};
  printArr(v, len);
  shellsort(v, len);
  printArr(v, len);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0xc,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x30,%edx
call   1030 <memcpy@plt>
lea    -0x40(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1040 <printArr@plt>
lea    -0x40(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1050 <shellsort@plt>
lea    -0x40(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1040 <printArr@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
movaps 0xef4(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebc(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xc,%esi
call   1030 <printArr@plt>
mov    %rbx,%rdi
mov    $0xc,%esi
call   1040 <shellsort@plt>
mov    %rbx,%rdi
mov    $0xc,%esi
call   1030 <printArr@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@__const.main.v = [12 x i32] [i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0]
define i32 @main() {
%1 = alloca [12 x i32]
%2 = bitcast [12 x i32]* %1 to i8*
%3 = getelementptr inbounds [12 x i32], [12 x i32]* %1, i64 0, i64 0
%4 = call i32 @printArr(i32* %3, i32 12)
%5 = call i32 @shellsort(i32* %3, i32 12)
%6 = call i32 @printArr(i32* %3, i32 12)
ret i32 0
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t I2CMasterBurstCountGet(uint32_t ui32Base) {
  ;
  return ((*((volatile unsigned long *)(ui32Base + 0x00000034))));
}


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

x86 assembly (clang, -O2):
<I2CMasterBurstCountGet>:
mov    %rdi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
mov    0x34(%rax),%rax
ret

LLVM IR (-O0):
define i64 @I2CMasterBurstCountGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add i64 %3, 52
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @I2CMasterBurstCountGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add i64 %3, 52
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}
int change_syscall(tcp, new) struct tcb *tcp;
int new;
{ return -1; }


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

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

LLVM IR (-O0):
%struct.tcb = type opaque
define i32 @change_syscall(%struct.tcb* %0, i32 %1) {
%3 = alloca %struct.tcb*
%4 = alloca i32
store %struct.tcb* %0, %struct.tcb** %3
store i32 %1, i32* %4
ret i32 -1
}

LLVM IR (-O2):
%struct.tcb = type opaque
define i32 @change_syscall(%struct.tcb* nocapture readnone %0, i32 %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_DGRAM;
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int openNetHandle(void) {
  int sock;
  sock = socket(AF_INET, SOCK_DGRAM, 0);
  if (sock >= 0)
    return sock;
  else
    return -1;
}


x86 assembly (clang, -O0):
<openNetHandle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <socket@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1149 <openNetHandle+0x39>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <openNetHandle+0x40>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<openNetHandle>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
mov    0x2ebf(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <socket@plt>
test   %eax,%eax
mov    $0xffffffff,%ecx
cmovs  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
define i32 @openNetHandle() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @AF_INET
%4 = load i32, i32* @SOCK_DGRAM
%5 = call i32 @socket(i32 %3, i32 %4, i32 0)
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp sge i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = load i32, i32* %2
store i32 %9, i32* %1
br label %11
10: ; preds = %0
store i32 -1, i32* %1
br label %11
11: ; preds = %10, %8
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
define i32 @openNetHandle() {
%1 = load i32, i32* @AF_INET
%2 = load i32, i32* @SOCK_DGRAM
%3 = tail call i32 @socket(i32 %1, i32 %2, i32 0)
%4 = icmp sgt i32 %3, -1
%5 = select i1 %4, i32 %3, i32 -1
ret i32 %5
}
void flush_resends(struct neighbour *neigh) {}


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

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

LLVM IR (-O0):
%struct.neighbour = type opaque
define void @flush_resends(%struct.neighbour* %0) {
%2 = alloca %struct.neighbour*
store %struct.neighbour* %0, %struct.neighbour** %2
ret void
}

LLVM IR (-O2):
%struct.neighbour = type opaque
define void @flush_resends(%struct.neighbour* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ doing_stuff();
func() { doing_stuff(); }


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <doing_stuff@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @func() {
%1 = alloca i32
%2 = call i32 (...) @doing_stuff()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @func() {
%1 = tail call i32 (...) @doing_stuff()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int, int, char *);
void out(char *s, int a1, int a2, char *p) {
  printf("%s\t%d\t%d\t%s\n", s, a1, a2, p ? p : "");
}


x86 assembly (clang, -O0):
<out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1152 <out+0x42>
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    1162 <out+0x52>
lea    0xeb3(%rip),%rax
mov    %rax,-0x30(%rbp)
jmp    1162 <out+0x52>
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%edx
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%r8
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<out>:
mov    %edx,%eax
mov    %esi,%edx
mov    %rdi,%rsi
test   %rcx,%rcx
lea    0xeeb(%rip),%r8
cmovne %rcx,%r8
lea    0xed4(%rip),%rdi
mov    %eax,%ecx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"%s\09%d\09%d\09%s\0A\00"
@.str.1 = [1 x i8] zeroinitializer
define void @out(i8* %0, i32 %1, i32 %2, i8* %3) {
%5 = icmp eq i8* %3, null
%6 = select i1 %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* %3
%7 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i32 %2, i8* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMR96_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMR96_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

LLVM IR (-O0):
define void @U_WMR96_swap(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
%7 = call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @U_WMR96_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
unsigned long _pcictrl(int, int, unsigned long, unsigned long);
int /*<<< orphan*/ monLock();
int /*<<< orphan*/ monUnlock();
unsigned long mon_pcictrl(int interface, int cmd, unsigned long arg1,
                          unsigned long arg2) {
  unsigned long val;
  monLock();
  val = _pcictrl(interface, cmd, arg1, arg2);
  monUnlock();
  return (val);
}


x86 assembly (clang, -O0):
<mon_pcictrl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <monLock@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1050 <_pcictrl@plt>
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1040 <monUnlock@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mon_pcictrl>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <monLock@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r15,%rdx
mov    %r14,%rcx
call   1050 <_pcictrl@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <monUnlock@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i64 @mon_pcictrl(i32 %0, i32 %1, i64 %2, i64 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
store i32 %0, i32* %5
store i32 %1, i32* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%10 = call i32 (...) @monLock()
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = load i64, i64* %7
%14 = load i64, i64* %8
%15 = call i64 @_pcictrl(i32 %11, i32 %12, i64 %13, i64 %14)
store i64 %15, i64* %9
%16 = call i32 (...) @monUnlock()
%17 = load i64, i64* %9
ret i64 %17
}

LLVM IR (-O2):
define i64 @mon_pcictrl(i32 %0, i32 %1, i64 %2, i64 %3) {
%5 = tail call i32 (...) @monLock()
%6 = tail call i64 @_pcictrl(i32 %0, i32 %1, i64 %2, i64 %3)
%7 = tail call i32 (...) @monUnlock()
ret i64 %6
}