xunge/DecIR huggingface dataset:
/* Variables and functions */
int error(int, char *);
int b_case(int argc, char *argv[]) {
  if (argc > 2)
    return error(1, argv[0]);
  return 0;
}


x86 assembly (clang, -O0):
<b_case>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jle    1142 <b_case+0x32>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    $0x1,%edi
call   1030 <error@plt>
mov    %eax,-0x4(%rbp)
jmp    1149 <b_case+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_case>:
cmp    $0x3,%edi
jl     1122 <b_case+0x12>
mov    (%rsi),%rsi
mov    $0x1,%edi
jmp    1030 <error@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @b_case(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 2
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @error(i32 1, i8* %5)
br label %7
7: ; preds = %2, %4
%8 = phi i32 [ %6, %4 ], [ 0, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void splitsecond_main_loop() { printf("hello, world!\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"hello, world!\00"
define void @splitsecond_main_loop() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ checked_free(char *);
char *getStringCat2WithSeparator(char *, char *, char *);
char *getCacheToken(char *prefix, char *suffix) {
  static char *token = NULL;
  checked_free(token);
  token = getStringCat2WithSeparator(prefix, suffix, ".");
  return token;
}


x86 assembly (clang, -O0):
<getCacheToken>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2f01(%rip),%rdi
call   1040 <checked_free@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0xeb5(%rip),%rdx
call   1030 <getStringCat2WithSeparator@plt>
mov    %rax,0x2ee1(%rip)
mov    0x2eda(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCacheToken>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2f07(%rip),%rdi
call   1040 <checked_free@plt>
lea    0xec3(%rip),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <getStringCat2WithSeparator@plt>
mov    %rax,0x2ee9(%rip)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@getCacheToken.token = internal global i8* null
@.str = [2 x i8] c".\00"
define i8* @getCacheToken(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** @getCacheToken.token
%6 = call i32 @checked_free(i8* %5)
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i8* @getStringCat2WithSeparator(i8* %7, i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %9, i8** @getCacheToken.token
%10 = load i8*, i8** @getCacheToken.token
ret i8* %10
}

LLVM IR (-O2):
@getCacheToken.token = internal unnamed_addr global i8* null
@.str = [2 x i8] c".\00"
define i8* @getCacheToken(i8* %0, i8* %1) {
%3 = load i8*, i8** @getCacheToken.token
%4 = tail call i32 @checked_free(i8* %3)
%5 = tail call i8* @getStringCat2WithSeparator(i8* %0, i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** @getCacheToken.token
ret i8* %5
}
void swap_long_integer(void *ptr) {
  char *tptr = (char *)ptr, tchar;
  {
    tchar = tptr[0];
    tptr[0] = tptr[3];
    tptr[3] = tchar;
  };
  {
    tchar = tptr[1];
    tptr[1] = tptr[2];
    tptr[2] = tchar;
  };
}


x86 assembly (clang, -O0):
<swap_long_integer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_long_integer>:
mov    (%rdi),%al
mov    0x3(%rdi),%cl
mov    %cl,(%rdi)
mov    %al,0x3(%rdi)
rolw   $0x8,0x1(%rdi)
ret

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

LLVM IR (-O2):
define void @swap_long_integer(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 3
%4 = load i8, i8* %3
store i8 %4, i8* %0
store i8 %2, i8* %3
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 2
%8 = load i8, i8* %7
store i8 %8, i8* %5
store i8 %6, i8* %7
ret void
}
/* Variables and functions */
float cube(float);
double pow(float, int);
int /*<<< orphan*/ printf(char *, float, double, float);
int main() {
  float y;
  float x;
  while (x++ < 3.0) {
    y = cube(x);
    printf("%f %f %f \n", x, pow(x, 2), y);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  -0xc(%rbp),%xmm0
movss  0xebc(%rip),%xmm2
movaps %xmm0,%xmm1
addss  %xmm2,%xmm1
movss  %xmm1,-0xc(%rbp)
cvtss2sd %xmm0,%xmm1
movsd  0xe9c(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11b4 <main+0x84>
movss  -0xc(%rbp),%xmm0
call   1050 <cube@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
movss  -0x8(%rbp),%xmm2
lea    0xe62(%rip),%rdi
call   1030 <printf@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"%f %f %f \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
br label %4
4: ; preds = %9, %0
%5 = load float, float* %3
%6 = fadd float %5, 1.000000e+00
store float %6, float* %3
%7 = fpext float %5 to double
%8 = fcmp olt double %7, 3.000000e+00
br i1 %8, label %9, label %17
9: ; preds = %4
%10 = load float, float* %3
%11 = call float @cube(float %10)
store float %11, float* %2
%12 = load float, float* %3
%13 = load float, float* %3
%14 = call double @pow(float %13, i32 2)
%15 = load float, float* %2
%16 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), float %12, double %14, float %15)
br label %4
17: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void cred_raise_cap(struct cred_t *cred) {}


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

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

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

LLVM IR (-O2):
%struct.cred_t = type opaque
define void @cred_raise_cap(%struct.cred_t* nocapture %0) {
ret void
}
/* Type definitions */
typedef int int64_t;
typedef int int32_t;

/* Variables and functions */
int32_t FRACMUL(int32_t x, int32_t y) {
  return (int32_t)(((int64_t)x * y) >> 31);
}


x86 assembly (clang, -O0):
<FRACMUL>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
sar    $0x1f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FRACMUL>:
mov    %edi,%eax
imul   %esi,%eax
sar    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @FRACMUL(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 = mul nsw i32 %5, %6
%8 = ashr i32 %7, 31
ret i32 %8
}

LLVM IR (-O2):
define i32 @FRACMUL(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = ashr i32 %3, 31
ret i32 %4
}
void mouseMove(int x, int y) {}


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

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

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

LLVM IR (-O2):
define void @mouseMove(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TimingDelay_Decrement();
void SysTick_Handler(void) { TimingDelay_Decrement(); }


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

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

LLVM IR (-O0):
define void @SysTick_Handler() {
%1 = call i32 (...) @TimingDelay_Decrement()
ret void
}

LLVM IR (-O2):
define void @SysTick_Handler() {
%1 = tail call i32 (...) @TimingDelay_Decrement()
ret void
}
OP(ed, bf) {}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void strcpy_literal_string_Bad() {
  char dst[4];
  strcpy(dst, "test");
}


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

x86 assembly (clang, -O2):
<strcpy_literal_string_Bad>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0x4(%rsp),%rdi
call   1030 <strcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"test\00"
define void @strcpy_literal_string_Bad() {
%1 = alloca [4 x i8]
%2 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"test\00"
define void @strcpy_literal_string_Bad() {
%1 = alloca [4 x i8]
%2 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
void function1() {
  int i, j;
  for (i = 0; i < 20000; i++)
    j += i;
}


x86 assembly (clang, -O0):
<function1>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x4e20,-0x4(%rbp)
jge    112f <function1+0x2f>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <function1+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @function1() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 20000
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = add nsw i32 %8, %7
store i32 %9, i32* %2
br label %10
10: ; preds = %6
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 1
store i32 %12, i32* %1
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @function1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ ispunct(int);
void t_ispunct_0x5e() {
  Assert_real((ispunct(94)),
              "/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_ispunct.c",
              475, ("ispunct should be 1 for ^"));
}


x86 assembly (clang, -O0):
<t_ispunct_0x5e>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5e,%edi
call   1030 <ispunct@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x1db,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_ispunct_0x5e>:
push   %rax
mov    $0x5e,%edi
call   1030 <ispunct@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x1db,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 1 for ^\00"
define void @t_ispunct_0x5e() {
%1 = call i32 @ispunct(i32 94)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 475, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 1 for ^\00"
define void @t_ispunct_0x5e() {
%1 = tail call i32 @ispunct(i32 94)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 475, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t half_add(uint32_t a, uint32_t b) {
  if (b == 0)
    return a;
  uint32_t sum = a ^ b;
  uint32_t carry = (a & b) << 1;
  return half_add(sum, carry);
}


x86 assembly (clang, -O0):
<half_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1133 <half_add+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1156 <half_add+0x46>
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <half_add@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<half_add>:
test   %esi,%esi
je     111d <half_add+0x1d>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %esi,%eax
xor    %edi,%eax
and    %edi,%esi
mov    %eax,%edi
add    %esi,%esi
jne    1110 <half_add+0x10>
ret
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @half_add(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %9, %4 ], [ %1, %2 ]
%6 = phi i32 [ %7, %4 ], [ %0, %2 ]
%7 = xor i32 %5, %6
%8 = and i32 %5, %6
%9 = shl i32 %8, 1
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %2
%12 = phi i32 [ %0, %2 ], [ %7, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x2b() {
  Assert_real((iscntrl(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_iscntrl.c",
              220, ("iscntrl should be 0 for +"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for +\00"
define void @t_iscntrl_0x2b() {
%1 = tail call i64 @iscntrl(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 ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 220, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int gettimeofday(struct timeval *, struct timezone *);
double gettime() {
  struct timeval tp;
  struct timezone tzp;
  int i;
  i = gettimeofday(&tp, &tzp);
  return ((double)tp.tv_sec + (double)tp.tv_usec * 1.e-6);
}


x86 assembly (clang, -O0):
<gettime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <gettimeofday@plt>
mov    %eax,-0x1c(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm1
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  0xec4(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
mulsd  0xec9(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
%struct.timezone = type { i32 }
define double @gettime() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = alloca i32
%4 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
store i32 %4, i32* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = call double @llvm.fmuladd.f64(double %10, double 0x3EB0C6F7A0B5ED8D, double %7)
ret double %11
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
%struct.timezone = type { i32 }
define double @gettime() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = bitcast %struct.timeval* %1 to i8*
%4 = bitcast %struct.timezone* %2 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%10 = load i64, i64* %9
%11 = sitofp i64 %10 to double
%12 = tail call double @llvm.fmuladd.f64(double %11, double 0x3EB0C6F7A0B5ED8D, double %8)
ret double %12
}
void nseel_asm_min_fp_end(void) {}


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

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

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

LLVM IR (-O2):
define void @nseel_asm_min_fp_end() {
ret void
}
/* Variables and functions */
char *strchr(char *, char);
char *find_next_par(char *start) {
  char *dummy = strchr(start, ':');
  if (dummy) {
    *dummy = 0x00;
    dummy++;
  }
  return dummy;
}


x86 assembly (clang, -O0):
<find_next_par>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3a,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114c <find_next_par+0x3c>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_next_par>:
push   %rax
mov    $0x3a,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1129 <find_next_par+0x19>
movb   $0x0,(%rax)
add    $0x1,%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @find_next_par(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 58)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
store i8 0, i8* %2
%5 = getelementptr inbounds i8, i8* %2, i64 1
br label %6
6: ; preds = %4, %1
%7 = phi i8* [ %5, %4 ], [ null, %1 ]
ret i8* %7
}
/* Type definitions */
struct rx_hash_rules {
  int dummy;
};
struct rx_hash_item {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(char *);
void default_free_hash_item(struct rx_hash_item *item,
                            struct rx_hash_rules *rules) {
  free((char *)item);
}


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

x86 assembly (clang, -O2):
<default_free_hash_item>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.rx_hash_item = type { i32 }
%struct.rx_hash_rules = type { i32 }
define void @default_free_hash_item(%struct.rx_hash_item* %0, %struct.rx_hash_rules* %1) {
%3 = alloca %struct.rx_hash_item*
%4 = alloca %struct.rx_hash_rules*
store %struct.rx_hash_item* %0, %struct.rx_hash_item** %3
store %struct.rx_hash_rules* %1, %struct.rx_hash_rules** %4
%5 = load %struct.rx_hash_item*, %struct.rx_hash_item** %3
%6 = bitcast %struct.rx_hash_item* %5 to i8*
%7 = call i32 @free(i8* %6)
ret void
}

LLVM IR (-O2):
%struct.rx_hash_item = type { i32 }
%struct.rx_hash_rules = type { i32 }
define void @default_free_hash_item(%struct.rx_hash_item* nocapture %0, %struct.rx_hash_rules* nocapture readnone %1) {
%3 = bitcast %struct.rx_hash_item* %0 to i8*
%4 = tail call i32 @free(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ m68ki_exception_illegal();
void m68k_op_rtm_32(void) {
  if (0) {
    ;

    ;
    return;
  }
  m68ki_exception_illegal();
}


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

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

LLVM IR (-O0):
define void @m68k_op_rtm_32() {
%1 = call i32 (...) @m68ki_exception_illegal()
ret void
}

LLVM IR (-O2):
define void @m68k_op_rtm_32() {
%1 = tail call i32 (...) @m68ki_exception_illegal()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Uart_SendByte(char const);
int Uart_SendString(const char *str, unsigned int len) {
  unsigned int counter;
  for (counter = 0; counter < len; counter++)
    Uart_SendByte(str[counter]);
  return counter;
}


x86 assembly (clang, -O0):
<Uart_SendString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1150 <Uart_SendString+0x40>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
movsbl (%rax,%rcx,1),%edi
call   1030 <Uart_SendByte@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <Uart_SendString+0x16>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Uart_SendString>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
test   %esi,%esi
je     1143 <Uart_SendString+0x33>
mov    %rdi,%r15
mov    %r14d,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1030 <Uart_SendByte@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1130 <Uart_SendString+0x20>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @Uart_SendString(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @Uart_SendByte(i8 signext %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret i32 %1
}
/* Type definitions */
struct _reent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ BT_kFree(void *);
void *BT_kMalloc(size_t);
int /*<<< orphan*/ memcpy(void *, void *, size_t);
void *_realloc_r(struct _reent *r, void *ptr, size_t size) {
  ;
  void *new = BT_kMalloc(size);
  memcpy(new, ptr, size);
  BT_kFree(ptr);
  return new;
}


x86 assembly (clang, -O0):
<_realloc_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <BT_kMalloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rdi
call   1030 <BT_kFree@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_realloc_r>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdx,%rdi
call   1050 <BT_kMalloc@plt>
mov    %rax,%r15
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <memcpy@plt>
mov    %r14,%rdi
call   1030 <BT_kFree@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct._reent = type { i32 }
define i8* @_realloc_r(%struct._reent* %0, i8* %1, i64 %2) {
%4 = alloca %struct._reent*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store %struct._reent* %0, %struct._reent** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i64, i64* %6
%9 = call i8* @BT_kMalloc(i64 %8)
store i8* %9, i8** %7
%10 = load i8*, i8** %7
%11 = load i8*, i8** %5
%12 = load i64, i64* %6
%13 = call i32 @memcpy(i8* %10, i8* %11, i64 %12)
%14 = load i8*, i8** %5
%15 = call i32 @BT_kFree(i8* %14)
%16 = load i8*, i8** %7
ret i8* %16
}

LLVM IR (-O2):
%struct._reent = type { i32 }
define i8* @_realloc_r(%struct._reent* nocapture readnone %0, i8* %1, i64 %2) {
%4 = tail call i8* @BT_kMalloc(i64 %2)
%5 = tail call i32 @memcpy(i8* %4, i8* %1, i64 %2)
%6 = tail call i32 @BT_kFree(i8* %1)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ btcerr(int *, int *, char *, char *);
int /*<<< orphan*/ printf(char *, int, char *, char *);
void print_error(void) {
  int errorcode, ioerror;
  char rname[16], msg[132];
  btcerr(&errorcode, &ioerror, rname, msg);
  printf("\tBTree error: %d [%s]: %s\n", errorcode, rname, msg);
  return;
}


x86 assembly (clang, -O0):
<print_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
lea    -0x20(%rbp),%rdx
lea    -0xb0(%rbp),%rcx
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <btcerr@plt>
mov    -0x4(%rbp),%esi
lea    -0x20(%rbp),%rdx
lea    -0xb0(%rbp),%rcx
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_error>:
push   %r14
push   %rbx
sub    $0xa8,%rsp
lea    0x8(%rsp),%rdi
lea    0xc(%rsp),%rsi
lea    0x10(%rsp),%rbx
lea    0x20(%rsp),%r14
mov    %rbx,%rdx
mov    %r14,%rcx
call   1030 <btcerr@plt>
mov    0x8(%rsp),%esi
lea    0xeac(%rip),%rdi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1040 <printf@plt>
add    $0xa8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [27 x i8] c"\09BTree error: %d [%s]: %s\0A\00"
define void @print_error() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [16 x i8]
%4 = alloca [132 x i8]
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [132 x i8], [132 x i8]* %4, i64 0, i64 0
%7 = call i32 @btcerr(i32* %1, i32* %2, i8* %5, i8* %6)
%8 = load i32, i32* %1
%9 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%10 = getelementptr inbounds [132 x i8], [132 x i8]* %4, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %8, i8* %9, i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"\09BTree error: %d [%s]: %s\0A\00"
define void @print_error() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [16 x i8]
%4 = alloca [132 x i8]
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [132 x i8], [132 x i8]* %4, i64 0, i64 0
%9 = call i32 @btcerr(i32* %1, i32* %2, i8* %7, i8* %8)
%10 = load i32, i32* %1
%11 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %10, i8* %7, i8* %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __delay_us(int);
void Delay_us(unsigned long x) {
  unsigned long i;
  for (i = 0; i < x; i++) {
    __delay_us(1);
  }
}


x86 assembly (clang, -O0):
<Delay_us>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    114d <Delay_us+0x3d>
mov    $0x1,%edi
call   1030 <__delay_us@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <Delay_us+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Delay_us>:
push   %rbx
test   %rdi,%rdi
je     1130 <Delay_us+0x20>
mov    %rdi,%rbx
nopl   0x0(%rax)
mov    $0x1,%edi
call   1030 <__delay_us@plt>
add    $0xffffffffffffffff,%rbx
jne    1120 <Delay_us+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @Delay_us(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 0, i64* %3
br label %4
4: ; preds = %10, %1
%5 = load i64, i64* %3
%6 = load i64, i64* %2
%7 = icmp ult i64 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = call i32 @__delay_us(i32 1)
br label %10
10: ; preds = %8
%11 = load i64, i64* %3
%12 = add i64 %11, 1
store i64 %12, i64* %3
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @Delay_us(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @__delay_us(i32 1)
%6 = add nuw i64 %4, 1
%7 = icmp eq i64 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
void x(void) {}


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

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

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

LLVM IR (-O2):
define void @x() {
ret void
}
int _write(int file, char *ptr, int len) { return len; }


x86 assembly (clang, -O0):
<_write>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_write>:
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @_write(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @_write(i32 %0, i8* nocapture readnone %1, i32 returned %2) {
ret i32 %2
}
void test_empty_string(void) {
  char buf[] = "";
  trim_right(buf);
  do {
    seatest_assert_string_equal("", buf, __FUNCTION__, 10);
  } while (0);
}


x86 assembly (clang, -O0):
<test_empty_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x1(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1040 <memset@plt>
lea    -0x1(%rbp),%rdi
mov    $0x0,%al
call   1030 <trim_right@plt>
lea    -0x1(%rbp),%rsi
lea    0xeb3(%rip),%rdi
lea    0xe9b(%rip),%rdx
mov    $0xa,%ecx
mov    $0x0,%al
call   1050 <seatest_assert_string_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_empty_string>:
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xf(%rsp)
lea    0xf(%rsp),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <trim_right@plt>
lea    0xed1(%rip),%rdi
lea    0xeb9(%rip),%rdx
mov    %rbx,%rsi
mov    $0xa,%ecx
xor    %eax,%eax
call   1040 <seatest_assert_string_equal@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@__FUNCTION__.test_empty_string = [18 x i8] c"test_empty_string\00"
define void @test_empty_string() {
%1 = alloca [1 x i8]
%2 = bitcast [1 x i8]* %1 to i8*
%3 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @trim_right to i32 (i8*, ...)*)(i8* %3)
br label %5
5: ; preds = %0
%6 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
%7 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_string_equal to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %6, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__FUNCTION__.test_empty_string, i64 0, i64 0), i32 10)
br label %8
8: ; preds = %5
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@__FUNCTION__.test_empty_string = [18 x i8] c"test_empty_string\00"
define void @test_empty_string() {
%1 = alloca [1 x i8]
%2 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
store i8 0, i8* %2
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @trim_right to i32 (i8*, ...)*)(i8* %2)
%4 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_string_equal to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__FUNCTION__.test_empty_string, i64 0, i64 0), i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ioNext();
int scanNext();
int scanConsumeEol(void) {
  ioNext();
  return (scanNext());
}


x86 assembly (clang, -O0):
<scanConsumeEol>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ioNext@plt>
mov    $0x0,%al
call   1040 <scanNext@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<scanConsumeEol>:
push   %rax
xor    %eax,%eax
call   1030 <ioNext@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <scanNext@plt>

LLVM IR (-O0):
define i32 @scanConsumeEol() {
%1 = call i32 (...) @ioNext()
%2 = call i32 (...) @scanNext()
ret i32 %2
}

LLVM IR (-O2):
define i32 @scanConsumeEol() {
%1 = tail call i32 (...) @ioNext()
%2 = tail call i32 (...) @scanNext()
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ verify_seama(char const *, int);
void dump_seama(const char *fname) { verify_seama(fname, 1); }


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

x86 assembly (clang, -O2):
<dump_seama>:
mov    $0x1,%esi
jmp    1030 <verify_seama@plt>

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

LLVM IR (-O2):
define void @dump_seama(i8* %0) {
%2 = tail call i32 @verify_seama(i8* %0, i32 1)
ret void
}
/* Variables and functions */
int stb__wildmatch_raw(char *, char *, int, int);
int stb_wildfindi(char *expr, char *candidate) {
  return stb__wildmatch_raw(expr, candidate, 1, 1);
}


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

x86 assembly (clang, -O2):
<stb_wildfindi>:
mov    $0x1,%edx
mov    $0x1,%ecx
jmp    1030 <stb__wildmatch_raw@plt>

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

LLVM IR (-O2):
define i32 @stb_wildfindi(i8* %0, i8* %1) {
%3 = tail call i32 @stb__wildmatch_raw(i8* %0, i8* %1, i32 1, i32 1)
ret i32 %3
}
float s_to_float(int i) {
  short s = i;
  return s;
}


x86 assembly (clang, -O0):
<s_to_float>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ax
mov    %ax,-0x6(%rbp)
movswl -0x6(%rbp),%eax
cvtsi2ss %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_to_float>:
movswl %di,%eax
cvtsi2ss %eax,%xmm0
ret

LLVM IR (-O0):
define float @s_to_float(i32 %0) {
%2 = alloca i32
%3 = alloca i16
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = trunc i32 %4 to i16
store i16 %5, i16* %3
%6 = load i16, i16* %3
%7 = sitofp i16 %6 to float
ret float %7
}

LLVM IR (-O2):
define float @s_to_float(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = sitofp i16 %2 to float
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test(int);
int main() {
  test((4 * 1024));
  printf("PASSED\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [7 x i8] c"PASSED\00"
define i32 @main() {
%1 = tail call i32 @test(i32 4096)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i32 0
}
unsigned int
calcoloIntervalloMassimoFrequenza(unsigned int massimaFrequenzaCardiaca) {
  unsigned int intervalloMassimo;
  return intervalloMassimo = ((massimaFrequenzaCardiaca * 80) / 100);
}


x86 assembly (clang, -O0):
<calcoloIntervalloMassimoFrequenza>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x50,-0x4(%rbp),%eax
mov    $0x64,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcoloIntervalloMassimoFrequenza>:
shl    $0x4,%edi
lea    (%rdi,%rdi,4),%eax
imul   $0x51eb851f,%rax,%rax
shr    $0x25,%rax
ret

LLVM IR (-O0):
define i32 @calcoloIntervalloMassimoFrequenza(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = mul i32 %4, 80
%6 = udiv i32 %5, 100
store i32 %6, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @calcoloIntervalloMassimoFrequenza(i32 %0) {
%2 = mul i32 %0, 80
%3 = udiv i32 %2, 100
ret i32 %3
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char *addr = malloc(1);
  *addr = 'x';
  printf("%p\n", addr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x78,(%rax)
mov    -0x10(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <malloc@plt>
movb   $0x78,(%rax)
lea    0xecb(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%p\0A\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
store i8 120, i8* %1
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void f2(void) { puts("\nf2"); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"\0Af2\00"
define void @f2() {
%1 = call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"\0Af2\00"
define void @f2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
void i2v_ASN1_BIT_STRING(void) {}


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

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

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

LLVM IR (-O2):
define void @i2v_ASN1_BIT_STRING() {
ret void
}
void tex_change_color(double perct) {}


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

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

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

LLVM IR (-O2):
define void @tex_change_color(double %0) {
ret void
}
void httpd_page_external_cgi_final_sub(struct httpd_cgi_kill *p) { return; }


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

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

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

LLVM IR (-O2):
%struct.httpd_cgi_kill = type opaque
define void @httpd_page_external_cgi_final_sub(%struct.httpd_cgi_kill* nocapture %0) {
ret void
}
float exp2f(float x) {}


x86 assembly (clang, -O0):
<exp2f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @exp2f(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %2
ret float %4
}

LLVM IR (-O2):
define float @exp2f(float %0) {
ret float undef
}
int IntSwap(int *num1, int *num2) {
  int temp;
  temp = *num1;
  *num1 = *num2;
  *num2 = temp;
  return 0;
}


x86 assembly (clang, -O0):
<IntSwap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IntSwap>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @IntSwap(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
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret i32 0
}

LLVM IR (-O2):
define i32 @IntSwap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret i32 0
}
float test_ldexpf(float x, int y) { return __builtin_ldexpf(x, y); }


x86 assembly (clang, -O0):
<test_ldexpf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x8(%rbp),%edi
call   1030 <ldexpf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ldexpf>:
jmp    1030 <ldexpf@plt>

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

LLVM IR (-O2):
define float @test_ldexpf(float %0, i32 %1) {
%3 = tail call float @ldexpf(float %0, i32 %1)
ret float %3
}