xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ isspace(char);
char *skip_space_at_begin(char *p) {
  char *p1;
  p1 = p;
  if (!p)
    return NULL;
  while (isspace(*p1))
    p1++;
  return p1;
}


x86 assembly (clang, -O0):
<skip_space_at_begin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    113c <skip_space_at_begin+0x2c>
movq   $0x0,-0x8(%rbp)
jmp    1170 <skip_space_at_begin+0x60>
jmp    1141 <skip_space_at_begin+0x31>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1168 <skip_space_at_begin+0x58>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1141 <skip_space_at_begin+0x31>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_space_at_begin>:
push   %rbx
test   %rdi,%rdi
je     1134 <skip_space_at_begin+0x24>
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   (%rax)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <skip_space_at_begin+0x10>
jmp    1136 <skip_space_at_begin+0x26>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @skip_space_at_begin(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
store i8* %5, i8** %4
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %1
store i8* null, i8** %2
br label %20
9: ; preds = %1
br label %10
10: ; preds = %15, %9
%11 = load i8*, i8** %4
%12 = load i8, i8* %11
%13 = call i64 @isspace(i8 signext %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %10
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %4
br label %10
18: ; preds = %10
%19 = load i8*, i8** %4
store i8* %19, i8** %2
br label %20
20: ; preds = %18, %8
%21 = load i8*, i8** %2
ret i8* %21
}

LLVM IR (-O2):
define i8* @skip_space_at_begin(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i8* [ %8, %3 ], [ %0, %1 ]
%5 = load i8, i8* %4
%6 = tail call i64 @isspace(i8 signext %5)
%7 = icmp eq i64 %6, 0
%8 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %7, label %9, label %3
9: ; preds = %3, %1
%10 = phi i8* [ null, %1 ], [ %4, %3 ]
ret i8* %10
}
/* Type definitions */
struct in_addr {
  int /*<<< orphan*/ s_addr;
};
typedef int /*<<< orphan*/ socklen_t;
typedef int /*<<< orphan*/ in_addr_t;

/* Variables and functions */
int /*<<< orphan*/ PF_INET;
int /*<<< orphan*/ inet_ntop(int /*<<< orphan*/, struct in_addr *, char *,
                             int /*<<< orphan*/);
char *in_addr_t2str(in_addr_t addr, char *buf, socklen_t size) {
  struct in_addr a;
  a.s_addr = addr;
  inet_ntop(PF_INET, &a, buf, size);
  return buf;
}


x86 assembly (clang, -O0):
<in_addr_t2str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    -0x18(%rbp),%rsi
call   1030 <inet_ntop@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<in_addr_t2str>:
push   %rbx
sub    $0x10,%rsp
mov    %edx,%ecx
mov    %rsi,%rbx
mov    %edi,0x8(%rsp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
mov    %rbx,%rdx
call   1030 <inet_ntop@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
@PF_INET = global i32 0
define i8* @in_addr_t2str(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca %struct.in_addr
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %7, i32 0, i32 0
store i32 %8, i32* %9
%10 = load i32, i32* @PF_INET
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = call i32 @inet_ntop(i32 %10, %struct.in_addr* %7, i8* %11, i32 %12)
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
@PF_INET = global i32 0
define i8* @in_addr_t2str(i32 %0, i8* returned %1, i32 %2) {
%4 = alloca %struct.in_addr
%5 = bitcast %struct.in_addr* %4 to i8*
%6 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %4, i64 0, i32 0
store i32 %0, i32* %6
%7 = load i32, i32* @PF_INET
%8 = call i32 @inet_ntop(i32 %7, %struct.in_addr* %4, i8* %1, i32 %2)
ret i8* %1
}
/* Variables and functions */
char *duplica_string(char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char s[50] = "Campos verdes";
  char *s_duplicado;
  s_duplicado = duplica_string(s);
  printf("%s\n", s_duplicado);
  free(s_duplicado);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xea6(%rip),%rsi
mov    $0x32,%edx
call   1060 <memcpy@plt>
lea    -0x40(%rbp),%rdi
call   1050 <duplica_string@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
movaps 0xee4(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeac(%rip),%xmm0
movaps %xmm0,(%rsp)
movw   $0x0,0x30(%rsp)
mov    %rsp,%rdi
call   1050 <duplica_string@plt>
mov    %rax,%rbx
lea    0xec1(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s = [50 x i8] c"Campos verdes\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [50 x i8]
%3 = alloca i8*
store i32 0, i32* %1
%4 = bitcast [50 x i8]* %2 to i8*
%5 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%6 = call i8* @duplica_string(i8* %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i8*, i8** %3
%10 = call i32 @free(i8* %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [50 x i8] c"Campos verdes\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [50 x i8]
%2 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%3 = call i8* @duplica_string(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @free(i8* %3)
ret i32 0
}
int empty(int t) {
  if (t == 0)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<empty>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <empty+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1124 <empty+0x24>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<empty>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @empty(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void foo(int *r) {
  assert(*r == 42);
  assert(!(*r != 42));
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x2a,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
cmpl   $0x2a,(%rax)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
cmpl   $0x2a,(%rbx)
sete   %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmpl   $0x2a,(%rbx)
sete   %dil
pop    %rbx
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @foo(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 42
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i32*, i32** %2
%9 = load i32, i32* %8
%10 = icmp ne i32 %9, 42
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
ret void
}

LLVM IR (-O2):
define void @foo(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 42
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = load i32, i32* %0
%7 = icmp eq i32 %6, 42
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
ret void
}
/* Variables and functions */
void *compare_double_context(void) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @compare_double_context() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @compare_double_context() {
ret i8* null
}
__attribute__((no, noclone)) unsigned __int128 t153_5add(unsigned __int128 x) {
  unsigned __int128 r;
  if (__builtin_add_overflow(x, (unsigned __int128)(-1), &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t153_5add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
add    $0xffffffffffffffff,%rdx
adc    $0xffffffffffffffff,%rcx
setb   %al
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x38(%rbp)
test   $0x1,%al
jne    1158 <t153_5add+0x48>
jmp    115f <t153_5add+0x4f>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t153_5add>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
adc    $0xffffffffffffffff,%r14
jae    112b <t153_5add+0x1b>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %rbx,%rax
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t153_5add(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = call { i128, i1 } @llvm.uadd.with.overflow.i128(i128 %11, i128 -1)
%13 = extractvalue { i128, i1 } %12, 1
%14 = extractvalue { i128, i1 } %12, 0
store i128 %14, i128* %6
br i1 %13, label %15, label %17
15: ; preds = %2
%16 = call i32 (...) @bar()
br label %17
17: ; preds = %15, %2
%18 = load i128, i128* %6
store i128 %18, i128* %3
%19 = bitcast i128* %3 to { i64, i64 }*
%20 = load { i64, i64 }, { i64, i64 }* %19
ret { i64, i64 } %20
}

LLVM IR (-O2):
define { i64, i64 } @t153_5add(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = tail call { i128, i1 } @llvm.uadd.with.overflow.i128(i128 %6, i128 -1)
%8 = extractvalue { i128, i1 } %7, 1
%9 = extractvalue { i128, i1 } %7, 0
br i1 %8, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i128 %9 to i64
%14 = lshr i128 %9, 64
%15 = trunc i128 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
/* Variables and functions */
int strcmp(char *, char *);
int string_compare(void *string1, void *string2) {
  int result;
  result = strcmp((char *)string1, (char *)string2);
  if (result < 0) {
    return -1;
  } else if (result > 0) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<string_compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1146 <string_compare+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <string_compare+0x53>
cmpl   $0x0,-0x1c(%rbp)
jle    115c <string_compare+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1163 <string_compare+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_compare>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    $0xffffffff,%eax
cmovns %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @string_compare(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = call i32 @strcmp(i8* %7, i8* %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 -1, i32* %3
br label %18
13: ; preds = %2
%14 = load i32, i32* %6
%15 = icmp sgt i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 1, i32* %3
br label %18
17: ; preds = %13
store i32 0, i32* %3
br label %18
18: ; preds = %17, %16, %12
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @string_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
%6 = icmp sgt i32 %3, -1
%7 = select i1 %6, i32 %5, i32 -1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ rd_string(char *, int);
int /*<<< orphan*/ strip_bytes(int);
void rd_ghost(void) {
  char buf[64];
  rd_string(buf, 64);
  strip_bytes(60);
}


x86 assembly (clang, -O0):
<rd_ghost>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x40(%rbp),%rdi
mov    $0x40,%esi
call   1040 <rd_string@plt>
mov    $0x3c,%edi
call   1030 <strip_bytes@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rd_ghost>:
sub    $0x48,%rsp
mov    %rsp,%rdi
mov    $0x40,%esi
call   1040 <rd_string@plt>
mov    $0x3c,%edi
call   1030 <strip_bytes@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
define void @rd_ghost() {
%1 = alloca [64 x i8]
%2 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%3 = call i32 @rd_string(i8* %2, i32 64)
%4 = call i32 @strip_bytes(i32 60)
ret void
}

LLVM IR (-O2):
define void @rd_ghost() {
%1 = alloca [64 x i8]
%2 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%3 = call i32 @rd_string(i8* %2, i32 64)
%4 = call i32 @strip_bytes(i32 60)
ret void
}
/* Variables and functions */
int intel_ich_gpio_set(int, int);
int intel_ich_gpio32_raise(void) { return intel_ich_gpio_set(32, 1); }


x86 assembly (clang, -O0):
<intel_ich_gpio32_raise>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
mov    $0x1,%esi
call   1030 <intel_ich_gpio_set@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<intel_ich_gpio32_raise>:
mov    $0x20,%edi
mov    $0x1,%esi
jmp    1030 <intel_ich_gpio_set@plt>

LLVM IR (-O0):
define i32 @intel_ich_gpio32_raise() {
%1 = call i32 @intel_ich_gpio_set(i32 32, i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @intel_ich_gpio32_raise() {
%1 = tail call i32 @intel_ich_gpio_set(i32 32, i32 1)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ puts(char *);
void print_help(const char *prog) {
  printf("%s: [-h] [-v] [-q] FILES\n", prog);
  puts("Remove empty files\n");
  puts("-h       Show this help");
  puts("-v       Be verbose");
  puts("-q       Supress error messages");
}


x86 assembly (clang, -O0):
<print_help>:
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    0xed7(%rip),%rdi
call   1030 <puts@plt>
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
lea    0xeeb(%rip),%rdi
call   1030 <puts@plt>
lea    0xef3(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [26 x i8] c"%s: [-h] [-v] [-q] FILES\0A\00"
@.str.1 = [20 x i8] c"Remove empty files\0A\00"
@.str.2 = [24 x i8] c"-h Show this help\00"
@.str.3 = [20 x i8] c"-v Be verbose\00"
@.str.4 = [32 x i8] c"-q Supress error messages\00"
define void @print_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @puts(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 @puts(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"%s: [-h] [-v] [-q] FILES\0A\00"
@.str.1 = [20 x i8] c"Remove empty files\0A\00"
@.str.2 = [24 x i8] c"-h Show this help\00"
@.str.3 = [20 x i8] c"-v Be verbose\00"
@.str.4 = [32 x i8] c"-q Supress error messages\00"
define void @print_help(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0))
ret void
}
void __attribute__((visibility("default")))
border_s_vertical_special_sand_e(unsigned char *pic, unsigned char *mirr) {
  *pic = 0x2E;
  *mirr = 0;
}


x86 assembly (clang, -O0):
<border_s_vertical_special_sand_e>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x2e,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<border_s_vertical_special_sand_e>:
movb   $0x2e,(%rdi)
movb   $0x0,(%rsi)
ret

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

LLVM IR (-O2):
define void @border_s_vertical_special_sand_e(i8* nocapture writeonly %0, i8* nocapture writeonly %1) {
store i8 46, i8* %0
store i8 0, i8* %1
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int sr;

/* Variables and functions */
int or1k_mfspr(int);
int /*<<< orphan*/ or1k_mtspr(int, int);
void or1k_interrupts_enable(void) {
  uint32_t sr = or1k_mfspr(0x0011U);
  sr = (((sr)&0xfffffffbU) | ((!!(1)) << 2));
  or1k_mtspr(0x0011U, sr);
}


x86 assembly (clang, -O0):
<or1k_interrupts_enable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x11,%edi
call   1040 <or1k_mfspr@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xfffffffb,%eax
or     $0x4,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x11,%edi
call   1030 <or1k_mtspr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<or1k_interrupts_enable>:
push   %rax
mov    $0x11,%edi
call   1040 <or1k_mfspr@plt>
or     $0x4,%eax
mov    $0x11,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <or1k_mtspr@plt>

LLVM IR (-O0):
define void @or1k_interrupts_enable() {
%1 = alloca i32
%2 = call i32 @or1k_mfspr(i32 17)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = and i32 %3, -5
%5 = or i32 %4, 4
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = call i32 @or1k_mtspr(i32 17, i32 %6)
ret void
}

LLVM IR (-O2):
define void @or1k_interrupts_enable() {
%1 = tail call i32 @or1k_mfspr(i32 17)
%2 = or i32 %1, 4
%3 = tail call i32 @or1k_mtspr(i32 17, i32 %2)
ret void
}
void GPMCPrefetchWeightedPrioSet(unsigned int baseAddr,
                                 unsigned int accessVal) {
  (*((volatile unsigned int *)(baseAddr + (0x1E0 + ((1 - 1) * (0x4)))))) &=
      ~(0x000F0000u);
  (*((volatile unsigned int *)(baseAddr + (0x1E0 + ((1 - 1) * (0x4)))))) |=
      ((accessVal << (0x00000010u)) & (0x000F0000u));
}


x86 assembly (clang, -O0):
<GPMCPrefetchWeightedPrioSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1e0,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xfff0ffff,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edx
shl    $0x10,%edx
and    $0xf0000,%edx
mov    -0x4(%rbp),%eax
add    $0x1e0,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPMCPrefetchWeightedPrioSet>:
add    $0x1e0,%edi
andl   $0xfff0ffff,(%rdi)
and    $0xf,%esi
shl    $0x10,%esi
or     %esi,(%rdi)
ret

LLVM IR (-O0):
define void @GPMCPrefetchWeightedPrioSet(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = add i32 %5, 480
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -983041
store volatile i32 %10, i32* %8
%11 = load i32, i32* %4
%12 = shl i32 %11, 16
%13 = and i32 %12, 983040
%14 = load i32, i32* %3
%15 = add i32 %14, 480
%16 = zext i32 %15 to i64
%17 = inttoptr i64 %16 to i32*
%18 = load volatile i32, i32* %17
%19 = or i32 %18, %13
store volatile i32 %19, i32* %17
ret void
}

LLVM IR (-O2):
define void @GPMCPrefetchWeightedPrioSet(i32 %0, i32 %1) {
%3 = add i32 %0, 480
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -983041
store volatile i32 %7, i32* %5
%8 = shl i32 %1, 16
%9 = and i32 %8, 983040
%10 = load volatile i32, i32* %5
%11 = or i32 %10, %9
store volatile i32 %11, i32* %5
ret void
}
int is_11_digits(const char *phoneNumber) {
  int count = 0;
  int i;
  for (i = 0; phoneNumber[i] != '\0'; i++)
    count++;
  if (count == 11)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_11_digits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1142 <is_11_digits+0x42>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1116 <is_11_digits+0x16>
cmpl   $0xb,-0x14(%rbp)
jne    1158 <is_11_digits+0x58>
movl   $0x1,-0x4(%rbp)
jmp    115f <is_11_digits+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_11_digits>:
cmpb   $0x0,(%rdi)
je     1123 <is_11_digits+0x23>
mov    $0x1,%ecx
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,(%rdi,%rcx,1)
lea    0x1(%rcx),%rcx
jne    1110 <is_11_digits+0x10>
xor    %eax,%eax
cmp    $0xc,%ecx
sete   %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_11_digits(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %1
%7 = load i8*, i8** %3
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %20
14: ; preds = %6
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
store i32 %16, i32* %4
br label %17
17: ; preds = %14
%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* %4
%22 = icmp eq i32 %21, 11
br i1 %22, label %23, label %24
23: ; preds = %20
store i32 1, i32* %2
br label %25
24: ; preds = %20
store i32 0, i32* %2
br label %25
25: ; preds = %24, %23
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @is_11_digits(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %6, %4 ], [ 0, %1 ]
%6 = add nuw nsw i64 %5, 1
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %4
10: ; preds = %4
%11 = trunc i64 %6 to i32
%12 = icmp eq i32 %11, 11
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %10, %1
%15 = phi i32 [ 0, %1 ], [ %13, %10 ]
ret i32 %15
}
/* Variables and functions */
int lsda_open2(char *, int, int, char *, char *);
int lsda_open_salt(char *filen, int mode, char *key, char *salt) {
  return lsda_open2(filen, mode, -1, key, salt);
}


x86 assembly (clang, -O0):
<lsda_open_salt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    $0xffffffff,%edx
call   1030 <lsda_open2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lsda_open_salt>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    $0xffffffff,%edx
jmp    1030 <lsda_open2@plt>

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

LLVM IR (-O2):
define i32 @lsda_open_salt(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = tail call i32 @lsda_open2(i8* %0, i32 %1, i32 -1, i8* %2, i8* %3)
ret i32 %5
}
void umocktypes_free_unsignedlonglong(unsigned long long *value) {
  (void)value;
}


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

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

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

LLVM IR (-O2):
define void @umocktypes_free_unsignedlonglong(i64* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("hello rt-thread\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 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [16 x i8] c"hello rt-thread\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write(char *);
void main() { write("Hello World"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"Hello World\00"
define void @main() {
%1 = call i32 @write(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello World\00"
define void @main() {
%1 = tail call i32 @write(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
void _Jv_DetachCurrentThread() {}


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

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

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

LLVM IR (-O2):
define void @_Jv_DetachCurrentThread() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void f(void) { printf("hi!\n"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"hi!\0A\00"
define void @f() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [4 x i8] c"hi!\00"
define void @f() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int /*<<< orphan*/ lectExclu(int);
int open(char *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int fichier =
      open("/media/data/git/Cours/L3/S5/SY5/Renaud/TP7/test.txt", O_RDWR);
  lectExclu(fichier);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <open@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <lectExclu@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <open@plt>
mov    %eax,%edi
call   1040 <lectExclu@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [52 x i8] c"/media/data/git/Cours/L3/S5/SY5/Renaud/TP7/test.txt\00"
@O_RDWR = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i32, i32* @O_RDWR
%7 = call i32 @open(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = call i32 @lectExclu(i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [52 x i8] c"/media/data/git/Cours/L3/S5/SY5/Renaud/TP7/test.txt\00"
@O_RDWR = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @O_RDWR
%4 = tail call i32 @open(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @lectExclu(i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: htpasswd [-c] passwordfile username\n");
  fprintf(stderr, "The -c flag creates a new file.\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    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xee3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"Usage: htpasswd [-c] passwordfile username\0A\00"
@.str.1 = [33 x i8] c"The -c flag creates a new file.\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"Usage: htpasswd [-c] passwordfile username\0A\00"
@.str.1 = [33 x i8] c"The -c flag creates a new file.\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
double deg2hour(double x) { return (x / 15.0); }


x86 assembly (clang, -O0):
<deg2hour>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @deg2hour(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 1.500000e+01
ret double %4
}

LLVM IR (-O2):
define double @deg2hour(double %0) {
%2 = fdiv double %0, 1.500000e+01
ret double %2
}
int wizard(uname)
char *uname;
{
  int flag;
  flag = checkout(uname);
  if (flag)
    printf("You are the Great wizard %s.\n", uname);
  return flag;
}


x86 assembly (clang, -O0):
<wizard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <checkout@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1156 <wizard+0x36>
mov    -0x8(%rbp),%rsi
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wizard>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <checkout@plt>
mov    %eax,%ebp
test   %eax,%eax
je     1144 <wizard+0x24>
lea    0xec6(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [30 x i8] c"You are the Great wizard %s.\0A\00"
define i32 @wizard(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @checkout to i32 (i8*, ...)*)(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %8, %1
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@.str = [30 x i8] c"You are the Great wizard %s.\0A\00"
define i32 @wizard(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @checkout to i32 (i8*, ...)*)(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %4, %1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ wserror_fun(char const *);
void wserror(const char *msg) {
  wserror_fun(msg);
  exit(1);
}


x86 assembly (clang, -O0):
<wserror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <wserror_fun@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<wserror>:
push   %rax
call   1030 <wserror_fun@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @wserror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @wserror_fun(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @wserror(i8* %0) {
%2 = tail call i32 @wserror_fun(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int64_t utime_get_useconds(int64_t v) { return v % 1000000; }


x86 assembly (clang, -O0):
<utime_get_useconds>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utime_get_useconds>:
movslq %edi,%rax
imul   $0x431bde83,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x32,%rcx
add    %edx,%ecx
imul   $0xf4240,%ecx,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @utime_get_useconds(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 1000000
ret i32 %4
}

LLVM IR (-O2):
define i32 @utime_get_useconds(i32 %0) {
%2 = srem i32 %0, 1000000
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ bar(int /*<<< orphan*/);
void foo2(void) {
#pragma omp critical
#pragma omp critical
  bar(0);
}


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

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

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

LLVM IR (-O2):
define void @foo2() {
%1 = tail call i32 @bar(i32 0)
ret void
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ nrerror(char *);
double *dblVector(long nLow, long nHigh) {
  double *v;
  v = (double *)malloc((size_t)((nHigh - nLow + 1 + 1) * sizeof(double)));
  if (!v)
    nrerror("Memory allocation failure in dblVector().");
  return v - nLow + 1;
}


x86 assembly (clang, -O0):
<dblVector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
sub    -0x8(%rbp),%rdi
add    $0x1,%rdi
add    $0x1,%rdi
shl    $0x3,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1164 <dblVector+0x44>
lea    0xea1(%rip),%rdi
call   1030 <nrerror@plt>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    -0x8(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
add    $0x8,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dblVector>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
sub    %rdi,%rsi
lea    0x10(,%rsi,8),%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114b <dblVector+0x2b>
lea    0xeba(%rip),%rdi
call   1030 <nrerror@plt>
shl    $0x3,%r14
sub    %r14,%rbx
add    $0x8,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [42 x i8] c"Memory allocation failure in dblVector().\00"
define double* @dblVector(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca double*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = add nsw i64 %8, 1
%10 = add nsw i64 %9, 1
%11 = mul i64 %10, 8
%12 = call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to double*
store double* %13, double** %5
%14 = load double*, double** %5
%15 = icmp ne double* %14, null
br i1 %15, label %18, label %16
16: ; preds = %2
%17 = call i32 @nrerror(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %2
%19 = load double*, double** %5
%20 = load i64, i64* %3
%21 = sub i64 0, %20
%22 = getelementptr inbounds double, double* %19, i64 %21
%23 = getelementptr inbounds double, double* %22, i64 1
ret double* %23
}

LLVM IR (-O2):
@.str = [42 x i8] c"Memory allocation failure in dblVector().\00"
define double* @dblVector(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = shl i64 %3, 3
%5 = add i64 %4, 16
%6 = tail call i64 @malloc(i64 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @nrerror(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = inttoptr i64 %6 to double*
%12 = sub i64 0, %0
%13 = getelementptr inbounds double, double* %11, i64 %12
%14 = getelementptr inbounds double, double* %13, i64 1
ret double* %14
}
/* Variables and functions */
int factorial(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%i\n", factorial(4));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = tail call i32 @factorial(i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
struct callbacks {
  int dummy;
};

/* Variables and functions */
long long parse_rate(char *, struct callbacks *);
void parse_max_pacing_rate(char *arg, void *out, struct callbacks *cb) {
  *(long long *)out = parse_rate(arg, cb);
}


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

x86 assembly (clang, -O2):
<parse_max_pacing_rate>:
push   %rbx
mov    %rsi,%rbx
mov    %rdx,%rsi
call   1030 <parse_rate@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
%struct.callbacks = type { i32 }
define void @parse_max_pacing_rate(i8* %0, i8* %1, %struct.callbacks* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.callbacks*
store i8* %0, i8** %4
store i8* %1, i8** %5
store %struct.callbacks* %2, %struct.callbacks** %6
%7 = load i8*, i8** %4
%8 = load %struct.callbacks*, %struct.callbacks** %6
%9 = call i64 @parse_rate(i8* %7, %struct.callbacks* %8)
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to i64*
store i64 %9, i64* %11
ret void
}

LLVM IR (-O2):
%struct.callbacks = type { i32 }
define void @parse_max_pacing_rate(i8* %0, i8* nocapture writeonly %1, %struct.callbacks* %2) {
%4 = tail call i64 @parse_rate(i8* %0, %struct.callbacks* %2)
%5 = bitcast i8* %1 to i64*
store i64 %4, i64* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exec(void const *);
int /*<<< orphan*/ putchar(char);
void process(const void *tree) {
  putchar('\t');
  exec(tree);
  putchar('\n');
}


x86 assembly (clang, -O0):
<process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x9,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%rdi
call   1040 <exec@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process>:
push   %rbx
mov    %rdi,%rbx
mov    $0x9,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
call   1040 <exec@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @process(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @putchar(i8 signext 9)
%4 = load i8*, i8** %2
%5 = call i32 @exec(i8* %4)
%6 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @process(i8* %0) {
%2 = tail call i32 @putchar(i8 signext 9)
%3 = tail call i32 @exec(i8* %0)
%4 = tail call i32 @putchar(i8 signext 10)
ret void
}
/* Variables and functions */
scalar_t__ ft_memalloc(int);
char *char_to_string(char c) {
  char *result;
  result = (char *)ft_memalloc(sizeof(char) * 1);
  result[0] = c;
  result[1] = '\0';
  return (result);
}


x86 assembly (clang, -O0):
<char_to_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%edi
call   1030 <ft_memalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x1(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_to_string>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%edi
call   1030 <ft_memalloc@plt>
mov    %bl,(%rax)
movb   $0x0,0x1(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define i8* @char_to_string(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8*
store i8 %0, i8* %2
%4 = call i64 @ft_memalloc(i32 1)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %3
%6 = load i8, i8* %2
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
store i8 %6, i8* %8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
store i8 0, i8* %10
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @char_to_string(i8 signext %0) {
%2 = tail call i64 @ft_memalloc(i32 1)
%3 = inttoptr i64 %2 to i8*
store i8 %0, i8* %3
%4 = getelementptr inbounds i8, i8* %3, i64 1
store i8 0, i8* %4
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ waitpid(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
int main() {
  waitpid(-1, NULL, 0);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @waitpid(i32 -1, i32* null, i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_tagstruct_get_volume() {
  printf("NOT IMPLEMENTED:"
         "pa_tagstruct_get_volume"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [41 x i8] c"NOT IMPLEMENTED:pa_tagstruct_get_volume\0A\00"
define i32 @pa_tagstruct_get_volume() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [40 x i8] c"NOT IMPLEMENTED:pa_tagstruct_get_volume\00"
define i32 @pa_tagstruct_get_volume() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int drand48();
int /*<<< orphan*/ sleep(int);
void randwait(int secs) {
  int len;
  len = (int)((drand48() * secs) + 1);
  sleep(len);
}


x86 assembly (clang, -O0):
<randwait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <drand48@plt>
imul   -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <sleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randwait>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <drand48@plt>
imul   %eax,%ebx
add    $0x1,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <sleep@plt>

LLVM IR (-O0):
define void @randwait(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @drand48()
%5 = load i32, i32* %2
%6 = mul nsw i32 %4, %5
%7 = add nsw i32 %6, 1
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i32 @sleep(i32 %8)
ret void
}

LLVM IR (-O2):
define void @randwait(i32 %0) {
%2 = tail call i32 (...) @drand48()
%3 = mul nsw i32 %2, %0
%4 = add nsw i32 %3, 1
%5 = tail call i32 @sleep(i32 %4)
ret void
}