xunge/DecIR huggingface dataset:
/* Variables and functions */
int isupper(char const);
int chaz_ConfWriterC_sym_is_uppercase(const char *sym) {
  return isupper(sym[0]);
}


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

x86 assembly (clang, -O2):
<chaz_ConfWriterC_sym_is_uppercase>:
movsbl (%rdi),%edi
jmp    1030 <isupper@plt>

LLVM IR (-O0):
define i32 @chaz_ConfWriterC_sym_is_uppercase(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = call i32 @isupper(i8 signext %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @chaz_ConfWriterC_sym_is_uppercase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @isupper(i8 signext %2)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fscanf(int /*<<< orphan*/ *, char *, int *);
bool read_bool(FILE *file, bool *out) {
  int value;
  if (fscanf(file, "=%d ", &value) < 1)
    return false;
  *out = (bool)value;
  return true;
}


x86 assembly (clang, -O0):
<read_bool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed5(%rip),%rsi
lea    -0x1c(%rbp),%rdx
call   1030 <fscanf@plt>
cmp    $0x1,%eax
jge    1149 <read_bool+0x39>
movl   $0x0,-0x4(%rbp)
jmp    1159 <read_bool+0x49>
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_bool>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0xee1(%rip),%rsi
lea    0xc(%rsp),%rdx
call   1030 <fscanf@plt>
test   %eax,%eax
jle    113a <read_bool+0x2a>
mov    0xc(%rsp),%eax
mov    %eax,(%rbx)
mov    $0x1,%eax
jmp    113c <read_bool+0x2c>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"=%d \00"
define i32 @read_bool(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = icmp slt i32 %5, 1
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = load i32, i32* %3
store i32 %8, i32* %1
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ 1, %7 ], [ 0, %2 ]
ret i32 %10
}
/* Type definitions */
struct avltree {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ *avltree_retrieve(struct avltree *, void const *);
bool avltree_contains(struct avltree *__restrict tree, const void *key) {
  return avltree_retrieve(tree, key) != NULL;
}


x86 assembly (clang, -O0):
<avltree_contains>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <avltree_retrieve@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<avltree_contains>:
push   %rax
call   1030 <avltree_retrieve@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.avltree = type { i32 }
define i32 @avltree_contains(%struct.avltree* noalias %0, i8* %1) {
%3 = alloca %struct.avltree*
%4 = alloca i8*
store %struct.avltree* %0, %struct.avltree** %3
store i8* %1, i8** %4
%5 = load %struct.avltree*, %struct.avltree** %3
%6 = load i8*, i8** %4
%7 = call i32* @avltree_retrieve(%struct.avltree* %5, i8* %6)
%8 = icmp ne i32* %7, null
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
%struct.avltree = type { i32 }
define i32 @avltree_contains(%struct.avltree* noalias %0, i8* %1) {
%3 = tail call i32* @avltree_retrieve(%struct.avltree* %0, i8* %1)
%4 = icmp ne i32* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}
void long2ape(unsigned char *p, const unsigned long value) {
  p[0] = (unsigned char)(value >> 0);
  p[1] = (unsigned char)(value >> 8);
  p[2] = (unsigned char)(value >> 16);
  p[3] = (unsigned char)(value >> 24);
}


x86 assembly (clang, -O0):
<long2ape>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x0,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
shr    $0x8,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
shr    $0x10,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x10(%rbp),%rax
shr    $0x18,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<long2ape>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @long2ape(i8* nocapture writeonly %0, i64 %1) {
%3 = trunc i64 %1 to i8
store i8 %3, i8* %0
%4 = lshr i64 %1, 8
%5 = trunc i64 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
%7 = lshr i64 %1, 16
%8 = trunc i64 %7 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
%10 = lshr i64 %1, 24
%11 = trunc i64 %10 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
/* Type definitions */
struct fosphor {
  int dummy;
};

/* Variables and functions */
int fosphor_cl_process(struct fosphor *, void *, int);
int fosphor_process(struct fosphor *self, void *samples, int len) {
  return fosphor_cl_process(self, samples, len);
}


x86 assembly (clang, -O0):
<fosphor_process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <fosphor_cl_process@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fosphor_process>:
jmp    1030 <fosphor_cl_process@plt>

LLVM IR (-O0):
%struct.fosphor = type { i32 }
define i32 @fosphor_process(%struct.fosphor* %0, i8* %1, i32 %2) {
%4 = alloca %struct.fosphor*
%5 = alloca i8*
%6 = alloca i32
store %struct.fosphor* %0, %struct.fosphor** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load %struct.fosphor*, %struct.fosphor** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @fosphor_cl_process(%struct.fosphor* %7, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.fosphor = type { i32 }
define i32 @fosphor_process(%struct.fosphor* %0, i8* %1, i32 %2) {
%4 = tail call i32 @fosphor_cl_process(%struct.fosphor* %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
scalar_t__ getline(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char str[1000];
  while (getline(str, 1000) != 0)
    printf("%s", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1040 <getline@plt>
cmp    $0x0,%rax
je     1165 <main+0x45>
lea    -0x3f0(%rbp),%rsi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
jmp    1132 <main+0x12>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1040 <getline@plt>
test   %rax,%rax
je     116d <main+0x4d>
lea    0xebd(%rip),%r14
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1040 <getline@plt>
test   %rax,%rax
jne    1150 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1000 x i8]
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%5 = call i64 @getline(i8* %4, i32 1000)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %3
10: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i64 @getline(i8* %2, i32 1000)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %0, %5
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%7 = call i64 @getline(i8* %2, i32 1000)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %5
9: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char const *, char *);
void version() {
  printf(((const char *)("powertop version %s\n")), "1.11-1");
  exit(0);
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xee3(%rip),%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<version>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xee6(%rip),%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"powertop version %s\0A\00"
@.str.1 = [7 x i8] c"1.11-1\00"
define void @version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [21 x i8] c"powertop version %s\0A\00"
@.str.1 = [7 x i8] c"1.11-1\00"
define void @version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int rand();
int main(int argc, char **argv) {
  int x;
  int r = rand();
  if (!(0 > r)) {
    x = 42;
  } else {
    x = 7;
  }
  return x;
}


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)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x18(%rbp)
xor    %eax,%eax
cmp    -0x18(%rbp),%eax
jg     1147 <main+0x37>
movl   $0x2a,-0x14(%rbp)
jmp    114e <main+0x3e>
movl   $0x7,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
test   %eax,%eax
mov    $0x7,%ecx
mov    $0x2a,%eax
cmovs  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
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
%8 = call i32 (...) @rand()
store i32 %8, i32* %7
%9 = load i32, i32* %7
%10 = icmp sgt i32 0, %9
br i1 %10, label %12, label %11
11: ; preds = %2
store i32 42, i32* %6
br label %13
12: ; preds = %2
store i32 7, i32* %6
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %6
ret i32 %14
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @rand()
%4 = icmp slt i32 %3, 0
%5 = select i1 %4, i32 7, i32 42
ret i32 %5
}
void foo130(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo130(i32 %0) {
ret void
}
int get_bit(int number, int bit) { return (number & (1 << bit)) != 0; }


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

x86 assembly (clang, -O2):
<get_bit>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @get_bit(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = and i32 %3, 1
ret i32 %4
}
/* Variables and functions */
unsigned int w5100_readSn_byte(unsigned int, int);
unsigned w5100_readSnPORT(unsigned sock) {
  unsigned res = w5100_readSn_byte(sock, 0x0004);
  res = (res << 8) + w5100_readSn_byte(sock, 0x0004 + 1);
  return res;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x4,%esi
call   1030 <w5100_readSn_byte@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x5,%esi
call   1030 <w5100_readSn_byte@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x4,%esi
call   1030 <w5100_readSn_byte@plt>
mov    %eax,%ebp
shl    $0x8,%ebp
mov    %ebx,%edi
mov    $0x5,%esi
call   1030 <w5100_readSn_byte@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @w5100_readSnPORT(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @w5100_readSn_byte(i32 %4, i32 4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = shl i32 %6, 8
%8 = load i32, i32* %2
%9 = call i32 @w5100_readSn_byte(i32 %8, i32 5)
%10 = add i32 %7, %9
store i32 %10, i32* %3
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @w5100_readSnPORT(i32 %0) {
%2 = tail call i32 @w5100_readSn_byte(i32 %0, i32 4)
%3 = shl i32 %2, 8
%4 = tail call i32 @w5100_readSn_byte(i32 %0, i32 5)
%5 = add i32 %3, %4
ret i32 %5
}
const char *tor_api_get_provider_version(void) {
  return "tor "
         "0.4.2.7";
}


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"tor 0.4.2.7\00"
define i8* @tor_api_get_provider_version() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [12 x i8] c"tor 0.4.2.7\00"
define i8* @tor_api_get_provider_version() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("\nLernmoment für Include Guard!\n");
  printf("\nEs gibt 3 Header in diesem Beispiel.\n");
  printf("Wenn du die Kommentarzeichen an der Zeile #include Ohne.h entfernst, "
         "wird es einen Fehler beim kompilieren geben.\n");
  return EXIT_SUCCESS;
}


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>
lea    0xeef(%rip),%rdi
call   1030 <printf@plt>
lea    0xf0a(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [33 x i8] c"\0ALernmoment f\C3\BCr Include Guard!\0A\00"
@.str.1 = [39 x i8] c"\0AEs gibt 3 Header in diesem Beispiel.\0A\00"
@.str.2 = [115 x i8] c"Wenn du die Kommentarzeichen an der Zeile #include Ohne.h entfernst, wird es einen Fehler beim kompilieren geben.\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([115 x i8], [115 x i8]* @.str.2, i64 0, i64 0))
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [32 x i8] c"\0ALernmoment f\C3\BCr Include Guard!\00"
@str.3 = [38 x i8] c"\0AEs gibt 3 Header in diesem Beispiel.\00"
@str.4 = [114 x i8] c"Wenn du die Kommentarzeichen an der Zeile #include Ohne.h entfernst, wird es einen Fehler beim kompilieren geben.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([114 x i8], [114 x i8]* @str.4, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ d;
typedef int /*<<< orphan*/ c;
typedef int /*<<< orphan*/ b;
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int);
void main() {
  int a;
  char b;
  float c;
  double d;
  printf("Tamanho do int: %d\n"
         "Tamanho do char: %d\n"
         "Tamanho do float: %d\n"
         "Tamanho do double: %d\n",
         sizeof(a), sizeof(b), sizeof(c), sizeof(d));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xee1(%rip),%rdi
mov    $0x4,%ecx
mov    $0x1,%edx
mov    $0x8,%r8d
mov    %ecx,%esi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [83 x i8] c"Tamanho do int: %d\0ATamanho do char: %d\0ATamanho do float: %d\0ATamanho do double: %d\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca float
%4 = alloca double
%5 = call i32 @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0), i32 4, i32 1, i32 4, i32 8)
ret void
}

LLVM IR (-O2):
@.str = [83 x i8] c"Tamanho do int: %d\0ATamanho do char: %d\0ATamanho do float: %d\0ATamanho do double: %d\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0), i32 4, i32 1, i32 4, i32 8)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ wcscoll(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void uninivar_wcscoll(void) {
  wchar_t *cs;
  wchar_t *ct;
  (void)wcscoll(cs, ct);
}


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

x86 assembly (clang, -O2):
<uninivar_wcscoll>:
jmp    1030 <wcscoll@plt>

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

LLVM IR (-O2):
define void @uninivar_wcscoll() {
%1 = tail call i32 @wcscoll(i32* undef, i32* undef)
ret void
}
/* Variables and functions */
int SIGUSR1;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stderr;
char *strsignal(int);
void catch_sig(int sig) {
  if (sig != SIGUSR1) {
    fprintf(stderr, "Caught wrong signal %s\n", strsignal(sig));
  } else {
    printf("Caught SIGUSR1 in handler\n");
  }
}


x86 assembly (clang, -O0):
<catch_sig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ea3(%rip),%rcx
cmp    (%rcx),%eax
je     1178 <catch_sig+0x48>
mov    0x2e84(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <strsignal@plt>
mov    -0x8(%rbp),%edi
mov    %rax,%rdx
lea    0xe92(%rip),%rsi
call   1040 <fprintf@plt>
jmp    1184 <catch_sig+0x54>
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<catch_sig>:
push   %rbx
mov    0x2eb0(%rip),%rax
cmp    %edi,(%rax)
jne    1149 <catch_sig+0x19>
lea    0xed5(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%ebx
call   1050 <strsignal@plt>
lea    0xea2(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
pop    %rbx
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@SIGUSR1 = global i32 0
@stderr = global i32 0
@.str = [24 x i8] c"Caught wrong signal %s\0A\00"
@.str.1 = [27 x i8] c"Caught SIGUSR1 in handler\0A\00"
define void @catch_sig(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGUSR1
%5 = icmp ne i32 %3, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = load i32, i32* %2
%9 = call i8* @strsignal(i32 %8)
%10 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %13
11: ; preds = %1
%12 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %6
ret void
}

LLVM IR (-O2):
@SIGUSR1 = global i32 0
@stderr = global i32 0
@.str = [24 x i8] c"Caught wrong signal %s\0A\00"
@str = [26 x i8] c"Caught SIGUSR1 in handler\00"
define void @catch_sig(i32 %0) {
%2 = load i32, i32* @SIGUSR1
%3 = icmp eq i32 %2, %0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i8* @strsignal(i32 %0)
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %10
8: ; preds = %1
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
br label %10
10: ; preds = %8, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sbinputc(unsigned int);
void sbinlong(unsigned i) {
  sbinputc(i >> 24);
  sbinputc(i >> 16);
  sbinputc(i >> 8);
  sbinputc(i);
}


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

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

LLVM IR (-O0):
define void @sbinlong(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 24
%5 = call i32 @sbinputc(i32 %4)
%6 = load i32, i32* %2
%7 = lshr i32 %6, 16
%8 = call i32 @sbinputc(i32 %7)
%9 = load i32, i32* %2
%10 = lshr i32 %9, 8
%11 = call i32 @sbinputc(i32 %10)
%12 = load i32, i32* %2
%13 = call i32 @sbinputc(i32 %12)
ret void
}

LLVM IR (-O2):
define void @sbinlong(i32 %0) {
%2 = lshr i32 %0, 24
%3 = tail call i32 @sbinputc(i32 %2)
%4 = lshr i32 %0, 16
%5 = tail call i32 @sbinputc(i32 %4)
%6 = lshr i32 %0, 8
%7 = tail call i32 @sbinputc(i32 %6)
%8 = tail call i32 @sbinputc(i32 %0)
ret void
}
void DisableRTCAlarm(void) {}


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

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

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

LLVM IR (-O2):
define void @DisableRTCAlarm() {
ret void
}
/* Variables and functions */
int fabs(double);
double azimuthPDF(double r) {
  if ((r > 1) || (r < 0))
    r = 1. / fabs(r);
  ;
  return 2 * 3.14159265358979323846 * r;
}


x86 assembly (clang, -O0):
<azimuthPDF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     1142 <azimuthPDF+0x32>
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1161 <azimuthPDF+0x51>
movsd  -0x8(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xea8(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xe9f(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<azimuthPDF>:
push   %rax
ucomisd 0xee7(%rip),%xmm0
ja     1125 <azimuthPDF+0x15>
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    113d <azimuthPDF+0x2d>
call   1030 <fabs@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0xec7(%rip),%xmm0
divsd  %xmm1,%xmm0
mulsd  0xec3(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @azimuthPDF(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 1.000000e+00
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load double, double* %2
%7 = fcmp olt double %6, 0.000000e+00
br i1 %7, label %8, label %13
8: ; preds = %5, %1
%9 = load double, double* %2
%10 = call i32 @fabs(double %9)
%11 = sitofp i32 %10 to double
%12 = fdiv double 1.000000e+00, %11
store double %12, double* %2
br label %13
13: ; preds = %8, %5
%14 = load double, double* %2
%15 = fmul double 0x401921FB54442D18, %14
ret double %15
}

LLVM IR (-O2):
define double @azimuthPDF(double %0) {
%2 = fcmp ogt double %0, 1.000000e+00
%3 = fcmp olt double %0, 0.000000e+00
%4 = or i1 %2, %3
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = tail call i32 @fabs(double %0)
%7 = sitofp i32 %6 to double
%8 = fdiv double 1.000000e+00, %7
br label %9
9: ; preds = %1, %5
%10 = phi double [ %8, %5 ], [ %0, %1 ]
%11 = fmul double %10, 0x401921FB54442D18
ret double %11
}
void RTFileAioReqGetUser(void) {}


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

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

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

LLVM IR (-O2):
define void @RTFileAioReqGetUser() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
scalar_t__ vmreset(int);
void power_reset() {
  int id;
  scanf("%d", &id);
  if (vmreset(id)) {
    printf("ok\n");
  } else {
    printf("error\n");
  }
}


x86 assembly (clang, -O0):
<power_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1040 <vmreset@plt>
cmp    $0x0,%rax
je     116b <power_reset+0x3b>
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
jmp    1177 <power_reset+0x47>
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<power_reset>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <vmreset@plt>
test   %rax,%rax
lea    0xeae(%rip),%rax
lea    0xead(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"ok\0A\00"
@.str.2 = [7 x i8] c"error\0A\00"
define void @power_reset() {
%1 = alloca i32
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%3 = load i32, i32* %1
%4 = call i64 @vmreset(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [6 x i8] c"error\00"
@str.3 = [3 x i8] c"ok\00"
define void @power_reset() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i64 @vmreset(i32 %4)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str.3, i64 0, i64 0)
%8 = call i32 @puts(i8* dereferenceable(1) %7)
ret void
}
/* Type definitions */
typedef char uint8_t;

/* Variables and functions */
uint8_t pdu_phone_is_packed(uint8_t *phone) { return *phone != '+'; }


x86 assembly (clang, -O0):
<pdu_phone_is_packed>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2b,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pdu_phone_is_packed>:
cmpb   $0x2b,(%rdi)
setne  %al
ret

LLVM IR (-O0):
define signext i8 @pdu_phone_is_packed(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp ne i32 %5, 43
%7 = zext i1 %6 to i32
%8 = trunc i32 %7 to i8
ret i8 %8
}

LLVM IR (-O2):
define signext i8 @pdu_phone_is_packed(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp ne i8 %2, 43
%4 = zext i1 %3 to i8
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ remove(char *);
void sigterm_handler(int i) {
  remove("/var/run/tempd.pid");
  exit(0);
}


x86 assembly (clang, -O0):
<sigterm_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <remove@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sigterm_handler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <remove@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"/var/run/tempd.pid\00"
define void @sigterm_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @remove(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [19 x i8] c"/var/run/tempd.pid\00"
define void @sigterm_handler(i32 %0) {
%2 = tail call i32 @remove(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main() {
  char a = 'e';
  char b = 's';
  char c = 'e';
  char d = 'd';
  printf("1 = %c\n", a);
  printf("2 = %c\n", b);
  printf("3 = %c\n", c);
  printf("4 = %c\n", d);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x65,-0x1(%rbp)
movb   $0x73,-0x2(%rbp)
movb   $0x65,-0x3(%rbp)
movb   $0x64,-0x4(%rbp)
lea    0xed1(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
movsbl -0x2(%rbp),%esi
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
movsbl -0x3(%rbp),%esi
call   1030 <printf@plt>
lea    0xeb9(%rip),%rdi
movsbl -0x4(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"1 = %c\0A\00"
@.str.1 = [8 x i8] c"2 = %c\0A\00"
@.str.2 = [8 x i8] c"3 = %c\0A\00"
@.str.3 = [8 x i8] c"4 = %c\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8 signext 101)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8 signext 115)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8 signext 101)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8 signext 100)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ halt();
int /*<<< orphan*/ printf(char *, char *);
void fatal(char *msg) {
  printf("FATAL ERROR: %s\n", msg);
  halt();
}


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

x86 assembly (clang, -O2):
<fatal>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <halt@plt>

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

LLVM IR (-O2):
@.str = [17 x i8] c"FATAL ERROR: %s\0A\00"
define void @fatal(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 (...) @halt()
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t round_to(uint32_t value, uint32_t multiple) {
  uint32_t result = value;
  if (value % multiple)
    result += (multiple - value % multiple);
  return result;
}


x86 assembly (clang, -O0):
<round_to>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
je     1138 <round_to+0x38>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    -0x10(%rbp),%eax
sub    %edx,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_to>:
mov    %edi,%eax
cltd
idiv   %esi
sub    %edx,%esi
test   %edx,%edx
cmove  %edx,%esi
lea    (%rsi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @round_to(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp eq i32 %3, 0
%5 = sub nsw i32 %1, %3
%6 = select i1 %4, i32 0, i32 %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void ftp_html(char *f) { printf("<A HREF=\"ftp://%s\">%s</A>", f, f); }


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"<A HREF=\22ftp://%s\22>%s</A>\00"
define void @ftp_html(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"<A HREF=\22ftp://%s\22>%s</A>\00"
define void @ftp_html(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ mkdir(char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
int main(void) {
  int i = 1;
  char c[16];
  sprintf(c, "%d", i);
  mkdir(c);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%edx
lea    0xeac(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x20(%rbp),%rdi
call   1030 <mkdir@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <mkdir@plt>
xor    %edi,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @mkdir(i8* %2)
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int fa_mpeg_round(int);
int log2(float);
int fa_estimate_sf_fast(float T, float t) {
  float ratio;
  int sf;
  if (t > 0) {
    ratio = T / t;
    sf = fa_mpeg_round((8. / 3.) * (log2(ratio)));
  } else {
    sf = 0;
  }
  return sf;
}


x86 assembly (clang, -O0):
<fa_estimate_sf_fast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    117d <fa_estimate_sf_fast+0x5d>
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
call   1030 <log2@plt>
cvtsi2sd %eax,%xmm1
movsd  0xe98(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <fa_mpeg_round@plt>
mov    %eax,-0x10(%rbp)
jmp    1184 <fa_estimate_sf_fast+0x64>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fa_estimate_sf_fast>:
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm1
jbe    114b <fa_estimate_sf_fast+0x2b>
push   %rax
divss  %xmm1,%xmm0
call   1030 <log2@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xebf(%rip),%xmm0
cvttsd2si %xmm0,%edi
pop    %rax
jmp    1040 <fa_mpeg_round@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @fa_estimate_sf_fast(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca i32
store float %0, float* %3
store float %1, float* %4
%7 = load float, float* %4
%8 = fcmp ogt float %7, 0.000000e+00
br i1 %8, label %9, label %19
9: ; preds = %2
%10 = load float, float* %3
%11 = load float, float* %4
%12 = fdiv float %10, %11
store float %12, float* %5
%13 = load float, float* %5
%14 = call i32 @log2(float %13)
%15 = sitofp i32 %14 to double
%16 = fmul double 0x4005555555555555, %15
%17 = fptosi double %16 to i32
%18 = call i32 @fa_mpeg_round(i32 %17)
store i32 %18, i32* %6
br label %20
19: ; preds = %2
store i32 0, i32* %6
br label %20
20: ; preds = %19, %9
%21 = load i32, i32* %6
ret i32 %21
}

LLVM IR (-O2):
define i32 @fa_estimate_sf_fast(float %0, float %1) {
%3 = fcmp ogt float %1, 0.000000e+00
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = fdiv float %0, %1
%6 = tail call i32 @log2(float %5)
%7 = sitofp i32 %6 to double
%8 = fmul double %7, 0x4005555555555555
%9 = fptosi double %8 to i32
%10 = tail call i32 @fa_mpeg_round(i32 %9)
br label %11
11: ; preds = %2, %4
%12 = phi i32 [ %10, %4 ], [ 0, %2 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ handle_35(int /*<<< orphan*/);
int gen_35() { handle_35(0); }


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

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

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

LLVM IR (-O2):
define i32 @gen_35() {
%1 = tail call i32 @handle_35(i32 0)
ret i32 undef
}
/* Variables and functions */
unsigned long long clz(unsigned long long);
unsigned long long log2i(unsigned long long x) {
  if (x != 0)
    return sizeof(unsigned long long) * 8 - 1 - clz(x);
  else
    return 0;
}


x86 assembly (clang, -O0):
<log2i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1144 <log2i+0x34>
mov    -0x10(%rbp),%rdi
call   1030 <clz@plt>
mov    %rax,%rcx
mov    $0x3f,%eax
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    114c <log2i+0x3c>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2i>:
test   %rdi,%rdi
je     112b <log2i+0x1b>
push   %rax
call   1030 <clz@plt>
mov    %rax,%rcx
mov    $0x3f,%eax
sub    %rcx,%rax
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @log2i(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i64, i64* %3
%8 = call i64 @clz(i64 %7)
%9 = sub i64 63, %8
store i64 %9, i64* %2
br label %11
10: ; preds = %1
store i64 0, i64* %2
br label %11
11: ; preds = %10, %6
%12 = load i64, i64* %2
ret i64 %12
}

LLVM IR (-O2):
define i64 @log2i(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i64 @clz(i64 %0)
%5 = sub i64 63, %4
br label %6
6: ; preds = %1, %3
%7 = phi i64 [ %5, %3 ], [ 0, %1 ]
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ indexedReadWriteTest();
int /*<<< orphan*/ mapTest();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ searchTest();
int /*<<< orphan*/ writeRandomTest();
int main(void) {
  printf("\nStart of TLB tests.\n\n");
  indexedReadWriteTest();
  writeRandomTest();
  searchTest();
  mapTest();
  printf("\nEnd of TLB tests.\n");
  while (1)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <indexedReadWriteTest@plt>
mov    $0x0,%al
call   1060 <writeRandomTest@plt>
mov    $0x0,%al
call   1050 <searchTest@plt>
mov    $0x0,%al
call   1070 <mapTest@plt>
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
jmp    1193 <main+0x43>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xea8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <indexedReadWriteTest@plt>
xor    %eax,%eax
call   1060 <writeRandomTest@plt>
xor    %eax,%eax
call   1050 <searchTest@plt>
xor    %eax,%eax
call   1070 <mapTest@plt>
lea    0xe96(%rip),%rdi
call   1030 <puts@plt>
cs nopw 0x0(%rax,%rax,1)
nop
jmp    1190 <main+0x40>

LLVM IR (-O0):
@.str = [23 x i8] c"\0AStart of TLB tests.\0A\0A\00"
@.str.1 = [20 x i8] c"\0AEnd of TLB tests.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @indexedReadWriteTest()
%4 = call i32 (...) @writeRandomTest()
%5 = call i32 (...) @searchTest()
%6 = call i32 (...) @mapTest()
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %0, %8
br label %8
}

LLVM IR (-O2):
@str = [22 x i8] c"\0AStart of TLB tests.\0A\00"
@str.2 = [19 x i8] c"\0AEnd of TLB tests.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @indexedReadWriteTest()
%3 = tail call i32 (...) @writeRandomTest()
%4 = tail call i32 (...) @searchTest()
%5 = tail call i32 (...) @mapTest()
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.2, i64 0, i64 0))
br label %7
7: ; preds = %0, %7
br label %7
}
/* Variables and functions */
scalar_t__ is_string(char *);
scalar_t__ isdigit(char);
int is_numeric(char *s) {
  if (is_string(s) == 0 && isdigit(*s) != 0) {
    return 0;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<is_numeric>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <is_string@plt>
cmp    $0x0,%rax
jne    1161 <is_numeric+0x41>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1161 <is_numeric+0x41>
movl   $0x0,-0x4(%rbp)
jmp    1168 <is_numeric+0x48>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_numeric>:
push   %rbx
mov    %rdi,%rbx
call   1040 <is_string@plt>
test   %rax,%rax
jne    1142 <is_numeric+0x22>
movsbl (%rbx),%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1142 <is_numeric+0x22>
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_numeric(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @is_string(i8* %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = load i8, i8* %8
%10 = call i64 @isdigit(i8 signext %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %7
store i32 0, i32* %2
br label %14
13: ; preds = %7, %1
store i32 -1, i32* %2
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @is_numeric(i8* %0) {
%2 = tail call i64 @is_string(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i8, i8* %0
%6 = tail call i64 @isdigit(i8 signext %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %4, %1
br label %9
9: ; preds = %4, %8
%10 = phi i32 [ -1, %8 ], [ 0, %4 ]
ret i32 %10
}