xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  time_t rawtime;
  struct tm *timeinfo;
  char buffer[80];
  time(&rawtime);
  timeinfo = localtime(&rawtime);
  strftime(buffer, 80, "%d_%m_%Y", timeinfo);
  puts(buffer);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1050 <time@plt>
lea    -0x8(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x50,%esi
lea    0xe87(%rip),%rdx
call   1060 <strftime@plt>
lea    -0x60(%rbp),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x60,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <time@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
lea    0xe9f(%rip),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x50,%esi
mov    %rax,%rcx
call   1060 <strftime@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [9 x i8] c"%d_%m_%Y\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.tm*
%4 = alloca [80 x i8]
store i32 0, i32* %1
%5 = call i32 @time(i32* %2)
%6 = call %struct.tm* @localtime(i32* %2)
store %struct.tm* %6, %struct.tm** %3
%7 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%8 = load %struct.tm*, %struct.tm** %3
%9 = call i32 @strftime(i8* %7, i32 80, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %struct.tm* %8)
%10 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%11 = call i32 @puts(i8* %10)
ret i32 0
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [9 x i8] c"%d_%m_%Y\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [80 x i8]
%3 = bitcast i32* %1 to i8*
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%5 = call i32 @time(i32* %1)
%6 = call %struct.tm* @localtime(i32* %1)
%7 = call i32 @strftime(i8* %4, i32 80, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %struct.tm* %6)
%8 = call i32 @puts(i8* %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_MD;

/* Variables and functions */
int EINVAL;
int EVP_MD_size(int /*<<< orphan*/ const *);
int /*<<< orphan*/ *EVP_get_digestbyname(char const *);
int crypt_hash_size(const char *name) {
  const EVP_MD *hash_id = EVP_get_digestbyname(name);
  if (!hash_id)
    return -EINVAL;
  return EVP_MD_size(hash_id);
}


x86 assembly (clang, -O0):
<crypt_hash_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <EVP_get_digestbyname@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1157 <crypt_hash_size+0x37>
xor    %eax,%eax
mov    0x2e93(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1163 <crypt_hash_size+0x43>
mov    -0x18(%rbp),%rdi
call   1030 <EVP_MD_size@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypt_hash_size>:
push   %rax
call   1040 <EVP_get_digestbyname@plt>
test   %rax,%rax
je     1134 <crypt_hash_size+0x14>
mov    %rax,%rdi
pop    %rax
jmp    1030 <EVP_MD_size@plt>
mov    0x2ea5(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @crypt_hash_size(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32* @EVP_get_digestbyname(i8* %5)
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = icmp ne i32* %7, null
br i1 %8, label %12, label %9
9: ; preds = %1
%10 = load i32, i32* @EINVAL
%11 = sub nsw i32 0, %10
store i32 %11, i32* %2
br label %15
12: ; preds = %1
%13 = load i32*, i32** %4
%14 = call i32 @EVP_MD_size(i32* %13)
store i32 %14, i32* %2
br label %15
15: ; preds = %12, %9
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @crypt_hash_size(i8* %0) {
%2 = tail call i32* @EVP_get_digestbyname(i8* %0)
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
br label %9
7: ; preds = %1
%8 = tail call i32 @EVP_MD_size(i32* %2)
br label %9
9: ; preds = %7, %4
%10 = phi i32 [ %8, %7 ], [ %6, %4 ]
ret i32 %10
}
void __VERIFIER_assume(int cond) {
  do {
    if (!(cond))
      __builtin_unreachable();
  } while (0);
}


x86 assembly (clang, -O0):
<__VERIFIER_assume>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1111 <__VERIFIER_assume+0x11>
jmp    1116 <__VERIFIER_assume+0x16>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @__VERIFIER_assume(i32 %0) {
%2 = icmp ne i32 %0, 0
tail call void @llvm.assume(i1 %2)
ret void
}
/* Variables and functions */
int findComplement(int);
int /*<<< orphan*/ printf(char *, int, int);
void test(int i) { printf("cmpl(%d) = %d\n", i, findComplement(i)); }


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

x86 assembly (clang, -O2):
<test>:
push   %rbx
mov    %edi,%ebx
call   1040 <findComplement@plt>
lea    0xed1(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"cmpl(%d) = %d\0A\00"
define void @test(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @findComplement(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"cmpl(%d) = %d\0A\00"
define void @test(i32 %0) {
%2 = tail call i32 @findComplement(i32 %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
void foo(int i, int j) {
  int x = i;
  int y = j;
  while (x != 0) {
    x--;
    y--;
  }
  if (i == j)
    __VERIFIER_assert(y == 0);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114b <foo+0x3b>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    112a <foo+0x1a>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1168 <foo+0x58>
cmpl   $0x0,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__VERIFIER_assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
cmp    %edi,%esi
jne    111e <foo+0xe>
mov    $0x1,%edi
jmp    1030 <__VERIFIER_assert@plt>
ret

LLVM IR (-O0):
define void @foo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
store i32 %7, i32* %5
%8 = load i32, i32* %4
store i32 %8, i32* %6
br label %9
9: ; preds = %12, %2
%10 = load i32, i32* %5
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %9
%13 = load i32, i32* %5
%14 = add nsw i32 %13, -1
store i32 %14, i32* %5
%15 = load i32, i32* %6
%16 = add nsw i32 %15, -1
store i32 %16, i32* %6
br label %9
17: ; preds = %9
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = icmp eq i32 %18, %19
br i1 %20, label %21, label %26
21: ; preds = %17
%22 = load i32, i32* %6
%23 = icmp eq i32 %22, 0
%24 = zext i1 %23 to i32
%25 = call i32 @__VERIFIER_assert(i32 %24)
br label %26
26: ; preds = %21, %17
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, %0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @__VERIFIER_assert(i32 1)
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ adaptDistributionMultipliers();
int /*<<< orphan*/ applyDistributionMultipliers();
int /*<<< orphan*/ computeRanks();
int /*<<< orphan*/ copyBestSolutionsToPopulations();
int /*<<< orphan*/ estimateParametersAllPopulations();
int /*<<< orphan*/ generateAndEvaluateNewSolutionsToFillPopulations();
void makePopulations(void) {
  estimateParametersAllPopulations();
  copyBestSolutionsToPopulations();
  applyDistributionMultipliers();
  generateAndEvaluateNewSolutionsToFillPopulations();
  computeRanks();
  adaptDistributionMultipliers();
}


x86 assembly (clang, -O0):
<makePopulations>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <estimateParametersAllPopulations@plt>
mov    $0x0,%al
call   1070 <copyBestSolutionsToPopulations@plt>
mov    $0x0,%al
call   1050 <applyDistributionMultipliers@plt>
mov    $0x0,%al
call   1060 <generateAndEvaluateNewSolutionsToFillPopulations@plt>
mov    $0x0,%al
call   1080 <computeRanks@plt>
mov    $0x0,%al
call   1030 <adaptDistributionMultipliers@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<makePopulations>:
push   %rax
xor    %eax,%eax
call   1040 <estimateParametersAllPopulations@plt>
xor    %eax,%eax
call   1070 <copyBestSolutionsToPopulations@plt>
xor    %eax,%eax
call   1050 <applyDistributionMultipliers@plt>
xor    %eax,%eax
call   1060 <generateAndEvaluateNewSolutionsToFillPopulations@plt>
xor    %eax,%eax
call   1080 <computeRanks@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <adaptDistributionMultipliers@plt>

LLVM IR (-O0):
define void @makePopulations() {
%1 = call i32 (...) @estimateParametersAllPopulations()
%2 = call i32 (...) @copyBestSolutionsToPopulations()
%3 = call i32 (...) @applyDistributionMultipliers()
%4 = call i32 (...) @generateAndEvaluateNewSolutionsToFillPopulations()
%5 = call i32 (...) @computeRanks()
%6 = call i32 (...) @adaptDistributionMultipliers()
ret void
}

LLVM IR (-O2):
define void @makePopulations() {
%1 = tail call i32 (...) @estimateParametersAllPopulations()
%2 = tail call i32 (...) @copyBestSolutionsToPopulations()
%3 = tail call i32 (...) @applyDistributionMultipliers()
%4 = tail call i32 (...) @generateAndEvaluateNewSolutionsToFillPopulations()
%5 = tail call i32 (...) @computeRanks()
%6 = tail call i32 (...) @adaptDistributionMultipliers()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bif_register_arity4(char const *,
                                       float (*)(float, float, float, float));
void nanocalc_register_bif_arity4(const char *name,
                                  float (*fun)(float, float, float, float)) {
  bif_register_arity4(name, fun);
}


x86 assembly (clang, -O0):
<nanocalc_register_bif_arity4>:
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 <bif_register_arity4@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nanocalc_register_bif_arity4>:
jmp    1030 <bif_register_arity4@plt>

LLVM IR (-O0):
define void @nanocalc_register_bif_arity4(i8* %0, float (float, float, float, float)* %1) {
%3 = alloca i8*
%4 = alloca float (float, float, float, float)*
store i8* %0, i8** %3
store float (float, float, float, float)* %1, float (float, float, float, float)** %4
%5 = load i8*, i8** %3
%6 = load float (float, float, float, float)*, float (float, float, float, float)** %4
%7 = call i32 @bif_register_arity4(i8* %5, float (float, float, float, float)* %6)
ret void
}

LLVM IR (-O2):
define void @nanocalc_register_bif_arity4(i8* %0, float (float, float, float, float)* %1) {
%3 = tail call i32 @bif_register_arity4(i8* %0, float (float, float, float, float)* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delay_loop_ibex(unsigned long);
int usleep_ibex(unsigned long usec) {
  unsigned long usec_cycles;
  usec_cycles = (50ULL * 1000 * 1000) * usec / 1000 / 1000 / 8;
  delay_loop_ibex(usec_cycles);
  return 0;
}


x86 assembly (clang, -O0):
<usleep_ibex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
imul   $0x2faf080,-0x8(%rbp),%rax
02
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %rcx
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %rcx
shr    $0x3,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <delay_loop_ibex@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usleep_ibex>:
push   %rax
imul   $0x2faf080,%rdi,%rax
movabs $0x431bde82d7b634db,%rcx
de 1b 43
mul    %rcx
mov    %rdx,%rdi
shr    $0x15,%rdi
call   1030 <delay_loop_ibex@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @usleep_ibex(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = mul i64 50000000, %4
%6 = udiv i64 %5, 1000
%7 = udiv i64 %6, 1000
%8 = udiv i64 %7, 8
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = call i32 @delay_loop_ibex(i64 %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @usleep_ibex(i64 %0) {
%2 = mul i64 %0, 50000000
%3 = udiv i64 %2, 8000000
%4 = tail call i32 @delay_loop_ibex(i64 %3)
ret i32 0
}
int isgraph(int c) { return c > ' ' && c <= '~'; }


x86 assembly (clang, -O0):
<isgraph>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1120 <isgraph+0x20>
cmpl   $0x7e,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isgraph>:
add    $0xffffffdf,%edi
xor    %eax,%eax
cmp    $0x5e,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isgraph(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 32
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 126
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isgraph(i32 %0) {
%2 = add i32 %0, -33
%3 = icmp ult i32 %2, 94
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int /*<<< orphan*/);
int waitCommand(char **args) {
  *args++;
  if (*args) {
    return -1;
  }
  sleep(0);
  return 0;
}


x86 assembly (clang, -O0):
<waitCommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1142 <waitCommand+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    1150 <waitCommand+0x40>
xor    %edi,%edi
call   1030 <sleep@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitCommand>:
push   %rbx
mov    $0xffffffff,%ebx
cmpq   $0x0,0x8(%rdi)
jne    1126 <waitCommand+0x16>
xor    %ebx,%ebx
xor    %edi,%edi
call   1030 <sleep@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @waitCommand(i8** nocapture %0) {
%2 = getelementptr inbounds i8*, i8** %0, i64 1
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @sleep(i32 0)
br label %7
7: ; preds = %1, %5
%8 = phi i32 [ 0, %5 ], [ -1, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void display(const char *str) { fputs(str, stdout); }


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @display(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stdout
%5 = call i32 @fputs(i8* %3, i32 %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @display(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fputs(i8* %0, i32 %2)
ret void
}
/* Variables and functions */
scalar_t__ read_buf(char *, char const *, char *);
int /*<<< orphan*/ sscanf(char *, char *, int *);
void read_int(char *buf, const char *key, int *value) {
  char buf2[1024];
  if (read_buf(buf, key, buf2))
    sscanf(buf2, "%d", value);
}


x86 assembly (clang, -O0):
<read_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x420(%rbp),%rdx
call   1030 <read_buf@plt>
cmp    $0x0,%rax
je     116c <read_int+0x4c>
lea    -0x420(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xe99(%rip),%rsi
call   1040 <sscanf@plt>
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_int>:
push   %rbx
sub    $0x400,%rsp
mov    %rdx,%rbx
mov    %rsp,%rdx
call   1030 <read_buf@plt>
test   %rax,%rax
je     114a <read_int+0x2a>
lea    0xec1(%rip),%rsi
mov    %rsp,%rdi
mov    %rbx,%rdx
call   1040 <sscanf@plt>
add    $0x400,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @read_int(i8* %0, i8* %1, i32* %2) {
%4 = alloca [1024 x i8]
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%6 = call i64 @read_buf(i8* %0, i8* %1, i8* %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %3
%9 = call i32 @sscanf(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %10
10: ; preds = %8, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ int80(int, int, int *, int /*<<< orphan*/,
                         int /*<<< orphan*/, int /*<<< orphan*/);
int releaseMutex(int mutex) {
  int ret = 0;
  int80(24, mutex, &ret, 0, 0, 0);
  return ret;
}


x86 assembly (clang, -O0):
<releaseMutex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x18,%edi
lea    -0x8(%rbp),%rdx
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <int80@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<releaseMutex>:
push   %rax
mov    %edi,%esi
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    $0x18,%edi
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <int80@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @releaseMutex(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = call i32 @int80(i32 24, i32 %4, i32* %3, i32 0, i32 0, i32 0)
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @releaseMutex(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 @int80(i32 24, i32 %0, i32* %2, i32 0, i32 0, i32 0)
%5 = load i32, i32* %2
ret i32 %5
}
void convert_to_graphviz(struct knoten *wurzel) {}


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

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

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

LLVM IR (-O2):
%struct.knoten = type opaque
define void @convert_to_graphviz(%struct.knoten* nocapture %0) {
ret void
}
unsigned long long f4(unsigned long long x) {
  if (x >= 0x8000000000000000ULL)
    x = 0x8000000000000000ULL;
  return x;
}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movabs $0x8000000000000000,%rax
cmp    %rax,-0x8(%rbp)
jb     112a <f4+0x2a>
movabs $0x8000000000000000,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
test   %rdi,%rdi
movabs $0x8000000000000000,%rax
cmovns %rdi,%rax
ret

LLVM IR (-O0):
define i64 @f4(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp uge i64 %3, -9223372036854775808
br i1 %4, label %5, label %6
5: ; preds = %1
store i64 -9223372036854775808, i64* %2
br label %6
6: ; preds = %5, %1
%7 = load i64, i64* %2
ret i64 %7
}

LLVM IR (-O2):
define i64 @f4(i64 %0) {
%2 = icmp slt i64 %0, 0
%3 = select i1 %2, i64 -9223372036854775808, i64 %0
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ e(int);
int /*<<< orphan*/ set_err(char *);
compl_ind() {
  char arr[20];
  int i;
  set_err("compl_ind");
  arr[10] = 111;
  i = 0;
  if (arr[i + 10] != 111)
    e(1);
}


x86 assembly (clang, -O0):
<compl_ind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xed1(%rip),%rdi
call   1040 <set_err@plt>
movb   $0x6f,-0x16(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0xa,%eax
cltq
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x6f,%eax
je     115f <compl_ind+0x3f>
mov    $0x1,%edi
call   1030 <e@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"compl_ind\00"
define i32 @compl_ind() {
%1 = tail call i32 @set_err(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
struct fid_ep {
  int dummy;
};
struct fid_domain {
  int dummy;
};
struct fi_info {
  int dummy;
};

/* Variables and functions */
int gnix_scalable_ep_open(struct fid_domain *, struct fi_info *,
                          struct fid_ep **, void *);
int fi_scalable_ep(struct fid_domain *domain, struct fi_info *info,
                   struct fid_ep **sep, void *context) {
  return gnix_scalable_ep_open(domain, info, sep, context);
}


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

x86 assembly (clang, -O2):
<fi_scalable_ep>:
jmp    1030 <gnix_scalable_ep_open@plt>

LLVM IR (-O0):
%struct.fid_domain = type { i32 }
%struct.fi_info = type { i32 }
%struct.fid_ep = type { i32 }
define i32 @fi_scalable_ep(%struct.fid_domain* %0, %struct.fi_info* %1, %struct.fid_ep** %2, i8* %3) {
%5 = alloca %struct.fid_domain*
%6 = alloca %struct.fi_info*
%7 = alloca %struct.fid_ep**
%8 = alloca i8*
store %struct.fid_domain* %0, %struct.fid_domain** %5
store %struct.fi_info* %1, %struct.fi_info** %6
store %struct.fid_ep** %2, %struct.fid_ep*** %7
store i8* %3, i8** %8
%9 = load %struct.fid_domain*, %struct.fid_domain** %5
%10 = load %struct.fi_info*, %struct.fi_info** %6
%11 = load %struct.fid_ep**, %struct.fid_ep*** %7
%12 = load i8*, i8** %8
%13 = call i32 @gnix_scalable_ep_open(%struct.fid_domain* %9, %struct.fi_info* %10, %struct.fid_ep** %11, i8* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.fid_domain = type { i32 }
%struct.fi_info = type { i32 }
%struct.fid_ep = type { i32 }
define i32 @fi_scalable_ep(%struct.fid_domain* %0, %struct.fi_info* %1, %struct.fid_ep** %2, i8* %3) {
%5 = tail call i32 @gnix_scalable_ep_open(%struct.fid_domain* %0, %struct.fi_info* %1, %struct.fid_ep** %2, i8* %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int add(int x, int y) {
  printf("Result %d\n", x + y);
  return 0;
}


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

x86 assembly (clang, -O2):
<add>:
push   %rax
add    %edi,%esi
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Result %d\0A\00"
define i32 @add(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 = add nsw i32 %5, %6
%8 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"Result %d\0A\00"
define i32 @add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int omp_get_num_threads();
int omp_get_thread_num();
int /*<<< orphan*/ printf(char *, int, int, int, int);
void affiche(int valeur1, int valeur2) {
#pragma omp parallel firstprivate(valeur2) shared(valeur1)
  {
    int id_threadOMP = omp_get_thread_num();
    int nb_threadOMP = omp_get_num_threads();
    valeur2++;
    valeur1++;
    printf("Mon rang est : %d sur %d - valeur1 : %d - valeur2 : %d\n",
           id_threadOMP, nb_threadOMP, valeur1, valeur2);
  }
}


x86 assembly (clang, -O0):
<affiche>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1050 <omp_get_num_threads@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%r8d
lea    0xe88(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<affiche>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1050 <omp_get_num_threads@plt>
add    $0x1,%ebx
add    $0x1,%ebp
lea    0xeaa(%rip),%rdi
mov    %r14d,%esi
mov    %eax,%edx
mov    %ebp,%ecx
mov    %ebx,%r8d
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [56 x i8] c"Mon rang est : %d sur %d - valeur1 : %d - valeur2 : %d\0A\00"
define void @affiche(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = call i32 (...) @omp_get_thread_num()
store i32 %7, i32* %5
%8 = call i32 (...) @omp_get_num_threads()
store i32 %8, i32* %6
%9 = load i32, i32* %4
%10 = add nsw i32 %9, 1
store i32 %10, i32* %4
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %14, i32 %15, i32 %16)
ret void
}

LLVM IR (-O2):
@.str = [56 x i8] c"Mon rang est : %d sur %d - valeur1 : %d - valeur2 : %d\0A\00"
define void @affiche(i32 %0, i32 %1) {
%3 = tail call i32 (...) @omp_get_thread_num()
%4 = tail call i32 (...) @omp_get_num_threads()
%5 = add nsw i32 %1, 1
%6 = add nsw i32 %0, 1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4, i32 %6, i32 %5)
ret void
}
signed long long f10(signed long long v_foo) {
  signed long long v_shr = v_foo << 2;
  signed long long v_and = v_shr & 255;
  return v_and;
}


x86 assembly (clang, -O0):
<f10>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x2,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0xff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f10>:
shl    $0x2,%edi
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i64 @f10(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = shl i64 %5, 2
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = and i64 %7, 255
store i64 %8, i64* %4
%9 = load i64, i64* %4
ret i64 %9
}

LLVM IR (-O2):
define i64 @f10(i64 %0) {
%2 = shl i64 %0, 2
%3 = and i64 %2, 252
ret i64 %3
}
int x9_process_synack(struct mypacket *packet) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.mypacket = type opaque
define i32 @x9_process_synack(%struct.mypacket* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x2b() {
  Assert_real((isodigit(43) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              220, ("isodigit should be 0 for +"));
}


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

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

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for +\00"
define void @t_isodigit_0x2b() {
%1 = call i64 @isodigit(i32 43)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 220, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for +\00"
define void @t_isodigit_0x2b() {
%1 = tail call i64 @isodigit(i32 43)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 220, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
double __cycles_percent(long long cycles, long long total) {
  return (double)(cycles * 100) / total;
}


x86 assembly (clang, -O0):
<__cycles_percent>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
imul   $0x64,-0x8(%rbp),%rax
cvtsi2sd %rax,%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__cycles_percent>:
imul   $0x64,%rdi,%rax
cvtsi2sd %rax,%xmm0
cvtsi2sd %rsi,%xmm1
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @__cycles_percent(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = mul nsw i64 %5, 100
%7 = sitofp i64 %6 to double
%8 = load i64, i64* %4
%9 = sitofp i64 %8 to double
%10 = fdiv double %7, %9
ret double %10
}

LLVM IR (-O2):
define double @__cycles_percent(i64 %0, i64 %1) {
%3 = mul nsw i64 %0, 100
%4 = sitofp i64 %3 to double
%5 = sitofp i64 %1 to double
%6 = fdiv double %4, %5
ret double %6
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ chdir(char *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ getcwd(char *, int);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ stdout;
int child_func() {
  char buf[1024];
  getcwd(buf, sizeof(buf));
  puts(buf);
  chdir("/etc");
  getcwd(buf, sizeof(buf));
  puts(buf);
  fflush(stdout);
  return 0;
}


x86 assembly (clang, -O0):
<child_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
lea    -0x400(%rbp),%rdi
mov    $0x400,%esi
call   1050 <getcwd@plt>
lea    -0x400(%rbp),%rdi
call   1030 <puts@plt>
lea    0xe91(%rip),%rdi
call   1040 <chdir@plt>
lea    -0x400(%rbp),%rdi
mov    $0x400,%esi
call   1050 <getcwd@plt>
lea    -0x400(%rbp),%rdi
call   1030 <puts@plt>
mov    0x2e48(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<child_func>:
push   %rbx
sub    $0x400,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x400,%esi
call   1050 <getcwd@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xe99(%rip),%rdi
call   1040 <chdir@plt>
mov    %rbx,%rdi
mov    $0x400,%esi
call   1050 <getcwd@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    0x2e58(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"/etc\00"
@stdout = global i32 0
define i32 @child_func() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i32 @getcwd(i8* %2, i32 1024)
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%5 = call i32 @puts(i8* %4)
%6 = call i32 @chdir(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%8 = call i32 @getcwd(i8* %7, i32 1024)
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%10 = call i32 @puts(i8* %9)
%11 = load i32, i32* @stdout
%12 = call i32 @fflush(i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"/etc\00"
@stdout = global i32 0
define i32 @child_func() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i32 @getcwd(i8* %2, i32 1024)
%4 = call i32 @puts(i8* %2)
%5 = call i32 @chdir(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @getcwd(i8* %2, i32 1024)
%7 = call i32 @puts(i8* %2)
%8 = load i32, i32* @stdout
%9 = call i32 @fflush(i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memmove(char *, char *, int);
void mid(char *src, int start, int length) {
  memmove(src, &src[start], length);
  src[length] = '\0';
}


x86 assembly (clang, -O0):
<mid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
mov    -0x10(%rbp),%edx
call   1030 <memmove@plt>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mid>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
movslq %esi,%rsi
add    %rdi,%rsi
call   1030 <memmove@plt>
movslq %ebp,%rax
movb   $0x0,(%rbx,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @mid(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i32, i32* %6
%13 = call i32 @memmove(i8* %7, i8* %11, i32 %12)
%14 = load i8*, i8** %4
%15 = load i32, i32* %6
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
store i8 0, i8* %17
ret void
}

LLVM IR (-O2):
define void @mid(i8* %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = tail call i32 @memmove(i8* %0, i8* %5, i32 %2)
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 0, i8* %8
ret void
}
int sunxi_serial_tstc(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @sunxi_serial_tstc() {
ret i32 0
}

LLVM IR (-O2):
define i32 @sunxi_serial_tstc() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
int /*<<< orphan*/ exit(int);
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *str_sav(char *string) {
  char *tmpstr;
  tmpstr = (char *)malloc(strlen(string) + 1);
  if (tmpstr == NULL) {
    error("out of memory");
    exit(1);
  }
  strcpy(tmpstr, string);
  return tmpstr;
}


x86 assembly (clang, -O0):
<str_sav>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1196 <str_sav+0x46>
lea    0xe79(%rip),%rdi
call   1060 <error@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_sav>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
test   %rax,%rax
je     1183 <str_sav+0x33>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xe76(%rip),%rdi
call   1060 <error@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"out of memory\00"
define i8* @str_sav(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = call i32 @error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %1
%15 = load i8*, i8** %3
%16 = load i8*, i8** %2
%17 = call i32 @strcpy(i8* %15, i8* %16)
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define i8* @str_sav(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = tail call i32 @error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %1
%11 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}
unsigned int MaxBitrate(unsigned long sampleRate) {
  return (unsigned int)(6144.0 * (double)sampleRate / (double)1024 + .5);
}


x86 assembly (clang, -O0):
<MaxBitrate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movaps 0xef1(%rip),%xmm1
movq   -0x8(%rbp),%xmm0
punpckldq %xmm1,%xmm0
movapd 0xef0(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0xee9(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee5(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xee1(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MaxBitrate>:
movq   %rdi,%xmm0
punpckldq 0xef3(%rip),%xmm0
subpd  0xefb(%rip),%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
addsd  %xmm0,%xmm1
mulsd  0xef7(%rip),%xmm1
mulsd  0xef7(%rip),%xmm1
addsd  0xef7(%rip),%xmm1
cvttsd2si %xmm1,%rax
ret

LLVM IR (-O0):
define i32 @MaxBitrate(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = uitofp i64 %3 to double
%5 = fmul double 6.144000e+03, %4
%6 = fdiv double %5, 1.024000e+03
%7 = fadd double %6, 5.000000e-01
%8 = fptoui double %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @MaxBitrate(i64 %0) {
%2 = uitofp i64 %0 to double
%3 = fmul double %2, 6.144000e+03
%4 = fmul double %3, 0x3F50000000000000
%5 = fadd double %4, 5.000000e-01
%6 = fptoui double %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ __wait4(int /*<<< orphan*/, int *, int /*<<< orphan*/,
                           int /*<<< orphan*/ *);
pid_t wait(int *status) { return __wait4((pid_t)-1, status, 0, NULL); }


x86 assembly (clang, -O0):
<wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0xffffffff,%edi
xor    %edx,%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <__wait4@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait>:
mov    %rdi,%rsi
mov    $0xffffffff,%edi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <__wait4@plt>

LLVM IR (-O0):
define i32 @wait(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @__wait4(i32 -1, i32* %3, i32 0, i32* null)
ret i32 %4
}

LLVM IR (-O2):
define i32 @wait(i32* %0) {
%2 = tail call i32 @__wait4(i32 -1, i32* %0, i32 0, i32* null)
ret i32 %2
}
int md_media_changed(struct gendisk *disk) {
  int a;
  return a;
}


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

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

LLVM IR (-O0):
%struct.gendisk = type opaque
define i32 @md_media_changed(%struct.gendisk* %0) {
%2 = alloca %struct.gendisk*
%3 = alloca i32
store %struct.gendisk* %0, %struct.gendisk** %2
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
%struct.gendisk = type opaque
define i32 @md_media_changed(%struct.gendisk* nocapture readnone %0) {
ret i32 undef
}
unsigned long long f1(unsigned long long x) {
  if (x < 0x7fffffffffffffffULL)
    x = 0x7fffffffffffffffULL;
  return x;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movabs $0x7fffffffffffffff,%rax
ff ff 7f
cmp    %rax,-0x8(%rbp)
jae    112a <f1+0x2a>
movabs $0x7fffffffffffffff,%rax
ff ff 7f
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
test   %rdi,%rdi
movabs $0x7fffffffffffffff,%rax
ff ff 7f
cmovs  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @f1(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ult i64 %3, 9223372036854775807
br i1 %4, label %5, label %6
5: ; preds = %1
store i64 9223372036854775807, i64* %2
br label %6
6: ; preds = %5, %1
%7 = load i64, i64* %2
ret i64 %7
}

LLVM IR (-O2):
define i64 @f1(i64 %0) {
%2 = icmp ugt i64 %0, 9223372036854775807
%3 = select i1 %2, i64 %0, i64 9223372036854775807
ret i64 %3
}
int test_imm_85int8_mem(signed char *val) {
  return ((*val) & (-0x85 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_85int8_mem>:
movsbl (%rdi),%eax
test   $0xffffff7b,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_85int8_mem(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 = and i32 %5, -133
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_85int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -133
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
char *_FP_strerror(int errcode) {
  static char number[8];
  sprintf(number, "%03d", errcode);
  return number;
}


x86 assembly (clang, -O0):
<_FP_strerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0x2f04(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2ef1(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_FP_strerror>:
push   %rbx
mov    %edi,%edx
lea    0x2f0f(%rip),%rbx
lea    0xedf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@_FP_strerror.number = internal global [8 x i8] zeroinitializer
@.str = [5 x i8] c"%03d\00"
define i8* @_FP_strerror(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @sprintf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @_FP_strerror.number, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @_FP_strerror.number, i64 0, i64 0)
}

LLVM IR (-O2):
@_FP_strerror.number = internal global [8 x i8] zeroinitializer
@.str = [5 x i8] c"%03d\00"
define i8* @_FP_strerror(i32 %0) {
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @_FP_strerror.number, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @_FP_strerror.number, i64 0, i64 0)
}
void EchoP$Leds$led0Toggle(void) { LedsP$Leds$led0Toggle(); }


x86 assembly (clang, -O0):
<EchoP$Leds$led0Toggle>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <LedsP$Leds$led0Toggle@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<EchoP$Leds$led0Toggle>:
xor    %eax,%eax
jmp    1030 <LedsP$Leds$led0Toggle@plt>

LLVM IR (-O0):
define void @"EchoP$Leds$led0Toggle"() {
%1 = call i32 (...) @"LedsP$Leds$led0Toggle"()
ret void
}

LLVM IR (-O2):
define void @"EchoP$Leds$led0Toggle"() {
%1 = tail call i32 (...) @"LedsP$Leds$led0Toggle"()
ret void
}