xunge/DecIR huggingface dataset:
int CHAR_TO_DIGIT(char CH, int NUM_BASE) {
  int DIGIT = -1;
  if ((CH >= '0') && (CH <= '9'))
    DIGIT = (int)(CH - '0');
  if ((CH >= 'A') && (CH <= 'Z'))
    DIGIT = ((int)(CH - 'A')) + 10;
  if (DIGIT >= NUM_BASE)
    DIGIT = -1;
  return DIGIT;
}


x86 assembly (clang, -O0):
<CHAR_TO_DIGIT>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     1138 <CHAR_TO_DIGIT+0x38>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
jg     1138 <CHAR_TO_DIGIT+0x38>
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     115f <CHAR_TO_DIGIT+0x5f>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
jg     115f <CHAR_TO_DIGIT+0x5f>
movsbl -0x1(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1172 <CHAR_TO_DIGIT+0x72>
movl   $0xffffffff,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CHAR_TO_DIGIT>:
lea    -0x30(%rdi),%eax
lea    -0x30(%rdi),%ecx
cmp    $0xa,%al
mov    $0xffffffff,%r8d
cmovae %r8d,%ecx
lea    -0x41(%rdi),%edx
lea    -0x37(%rdi),%eax
cmp    $0x1a,%dl
cmovae %ecx,%eax
cmp    %esi,%eax
cmovge %r8d,%eax
ret

LLVM IR (-O0):
define i32 @CHAR_TO_DIGIT(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
%5 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
store i32 -1, i32* %5
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = icmp sge i32 %7, 48
br i1 %8, label %9, label %17
9: ; preds = %2
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = icmp sle i32 %11, 57
br i1 %12, label %13, label %17
13: ; preds = %9
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = sub nsw i32 %15, 48
store i32 %16, i32* %5
br label %17
17: ; preds = %13, %9, %2
%18 = load i8, i8* %3
%19 = sext i8 %18 to i32
%20 = icmp sge i32 %19, 65
br i1 %20, label %21, label %30
21: ; preds = %17
%22 = load i8, i8* %3
%23 = sext i8 %22 to i32
%24 = icmp sle i32 %23, 90
br i1 %24, label %25, label %30
25: ; preds = %21
%26 = load i8, i8* %3
%27 = sext i8 %26 to i32
%28 = sub nsw i32 %27, 65
%29 = add nsw i32 %28, 10
store i32 %29, i32* %5
br label %30
30: ; preds = %25, %21, %17
%31 = load i32, i32* %5
%32 = load i32, i32* %4
%33 = icmp sge i32 %31, %32
br i1 %33, label %34, label %35
34: ; preds = %30
store i32 -1, i32* %5
br label %35
35: ; preds = %34, %30
%36 = load i32, i32* %5
ret i32 %36
}

LLVM IR (-O2):
define i32 @CHAR_TO_DIGIT(i8 signext %0, i32 %1) {
%3 = sext i8 %0 to i32
%4 = add i8 %0, -48
%5 = icmp ult i8 %4, 10
%6 = add nsw i32 %3, -48
%7 = select i1 %5, i32 %6, i32 -1
%8 = add i8 %0, -65
%9 = icmp ult i8 %8, 26
%10 = add nsw i32 %3, -55
%11 = select i1 %9, i32 %10, i32 %7
%12 = icmp slt i32 %11, %1
%13 = select i1 %12, i32 %11, i32 -1
ret i32 %13
}
int test_imm_6Cint64_highword_reg(long long val) {
  return ((val >> 32) & (0x6C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_6Cint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0x6c,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_6Cint64_highword_reg>:
movabs $0x6c00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_6Cint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 108
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_6Cint64_highword_reg(i64 %0) {
%2 = and i64 %0, 463856467968
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void success_or_failure(int res) {
  if (res == 0) {
    printf("\x1B[32m"
           "success!\n"
           "\x1B[0m");
  } else {
    printf("\x1B[31m"
           "failure!\n"
           "\x1B[0m");
  }
}


x86 assembly (clang, -O0):
<success_or_failure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1136 <success_or_failure+0x26>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
jmp    1142 <success_or_failure+0x32>
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<success_or_failure>:
test   %edi,%edi
lea    0xee7(%rip),%rax
lea    0xef3(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"\1B[32msuccess!\0A\1B[0m\00"
@.str.1 = [19 x i8] c"\1B[31mfailure!\0A\1B[0m\00"
define void @success_or_failure(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"\1B[32msuccess!\0A\1B[0m\00"
@.str.1 = [19 x i8] c"\1B[31mfailure!\0A\1B[0m\00"
define void @success_or_failure(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0)
%4 = tail call i32 @printf(i8* dereferenceable(1) %3)
ret void
}
int dgtpicom_init() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dgtpicom_init() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ getword(char, int /*<<< orphan*/);
Fcomment() { getword(')', 0); }


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

x86 assembly (clang, -O2):
<Fcomment>:
mov    $0x29,%edi
xor    %esi,%esi
jmp    1030 <getword@plt>

LLVM IR (-O0):
define i32 @Fcomment() {
%1 = alloca i32
%2 = call i32 @getword(i8 signext 41, i32 0)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @Fcomment() {
%1 = tail call i32 @getword(i8 signext 41, i32 0)
ret i32 undef
}
int ret8() { return 8; }


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

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

LLVM IR (-O0):
define i32 @ret8() {
ret i32 8
}

LLVM IR (-O2):
define i32 @ret8() {
ret i32 8
}
/* Variables and functions */
void Reserved_Handler19(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<Reserved_Handler19>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <Reserved_Handler19+0x9>
jmp    1109 <Reserved_Handler19+0x9>

x86 assembly (clang, -O2):
<Reserved_Handler19>:
jmp    1100 <Reserved_Handler19>

LLVM IR (-O0):
define void @Reserved_Handler19() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @Reserved_Handler19() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int bar(int, int, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int foo(int, int, int);
int main(void) {
  if (foo(5, 10, 21) != 12)
    abort();
  if (bar(9, 12, 15) != 150)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
mov    $0xa,%esi
mov    $0x15,%edx
call   1050 <foo@plt>
cmp    $0xc,%eax
je     1173 <main+0x33>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x9,%edi
mov    $0xc,%esi
mov    $0xf,%edx
call   1040 <bar@plt>
cmp    $0x96,%eax
je     1199 <main+0x59>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0xa,%esi
mov    $0x15,%edx
call   1050 <foo@plt>
cmp    $0xc,%eax
jne    117c <main+0x3c>
mov    $0x9,%edi
mov    $0xc,%esi
mov    $0xf,%edx
call   1040 <bar@plt>
cmp    $0x96,%eax
jne    117c <main+0x3c>
xor    %edi,%edi
call   1060 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 5, i32 10, i32 21)
%3 = icmp ne i32 %2, 12
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i32 @bar(i32 9, i32 12, i32 15)
%8 = icmp ne i32 %7, 150
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %6
%12 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 5, i32 10, i32 21)
%2 = icmp eq i32 %1, 12
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @bar(i32 9, i32 12, i32 15)
%7 = icmp eq i32 %6, 150
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %5
%11 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ g(int, int *);
void f(int *x, int y) {
  int z;
  if (y > 0) {
    f(&z, y - 1);
    *x = y * z + 1;
  } else
    *x = 2;
  if (*x > 2)
    g(y, x);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    115d <f+0x3d>
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
lea    -0x10(%rbp),%rdi
call   1030 <f@plt>
mov    -0xc(%rbp),%ecx
imul   -0x10(%rbp),%ecx
add    $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
jmp    1167 <f+0x47>
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
mov    -0x8(%rbp),%rax
cmpl   $0x2,(%rax)
jle    1180 <f+0x60>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1040 <g@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %esi,%esi
jle    1158 <f+0x38>
mov    %esi,%ebx
lea    -0x1(%rbx),%esi
lea    0x4(%rsp),%rdi
call   1030 <f@plt>
mov    0x4(%rsp),%eax
imul   %ebx,%eax
lea    0x1(%rax),%ecx
mov    %ecx,(%r14)
cmp    $0x2,%eax
jl     115f <f+0x3f>
mov    %ebx,%edi
mov    %r14,%rsi
call   1040 <g@plt>
jmp    115f <f+0x3f>
movl   $0x2,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @f(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* %4
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %2
%9 = load i32, i32* %4
%10 = sub nsw i32 %9, 1
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = mul nsw i32 %11, %12
%14 = add nsw i32 %13, 1
%15 = load i32*, i32** %3
store i32 %14, i32* %15
br label %18
16: ; preds = %2
%17 = load i32*, i32** %3
store i32 2, i32* %17
br label %18
18: ; preds = %16, %8
%19 = load i32*, i32** %3
%20 = load i32, i32* %19
%21 = icmp sgt i32 %20, 2
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = load i32, i32* %4
%24 = load i32*, i32** %3
%25 = call i32 @g(i32 %23, i32* %24)
br label %26
26: ; preds = %22, %18
ret void
}

LLVM IR (-O2):
define void @f(i32* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = icmp sgt i32 %1, 0
br i1 %5, label %7, label %6
6: ; preds = %2
store i32 2, i32* %0
br label %15
7: ; preds = %2
%8 = add nsw i32 %1, -1
%9 = load i32, i32* %3
%10 = mul nsw i32 %9, %1
%11 = add nsw i32 %10, 1
store i32 %11, i32* %0
%12 = icmp sgt i32 %10, 1
br i1 %12, label %13, label %15
13: ; preds = %7
%14 = call i32 @g(i32 %1, i32* %0)
br label %15
15: ; preds = %6, %13, %7
ret void
}
void XtCallbackReleaseCacheRef() {}


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

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

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

LLVM IR (-O2):
define void @XtCallbackReleaseCacheRef() {
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
long mstime() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return tv.tv_sec * 1000 + tv.tv_usec / 1000;
}


x86 assembly (clang, -O0):
<mstime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mstime>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq (%rsp),%rax
imul   $0x3e8,%rax,%rcx
movslq 0x4(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i64 @mstime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sdiv i32 %7, 1000
%9 = add nsw i32 %5, %8
%10 = sext i32 %9 to i64
ret i64 %10
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i64 @mstime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %9, %6
%11 = sext i32 %10 to i64
ret i64 %11
}
int test_imm_EFint8_reg(signed char val) {
  return ((val) & (0xEF << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_EFint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xef,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_EFint8_reg>:
test   $0xef,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_EFint8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 239
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_EFint8_reg(i8 signext %0) {
%2 = and i8 %0, -17
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
double random();
double obtiene_siguiente_random(void) { return random(); }


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

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

LLVM IR (-O0):
define double @obtiene_siguiente_random() {
%1 = call double (...) @random()
ret double %1
}

LLVM IR (-O2):
define double @obtiene_siguiente_random() {
%1 = tail call double (...) @random()
ret double %1
}
void quitarComentarios(char *string) {
  while (*string != '\0') {
    if (*string == '#')
      *string = '\0';
    else
      string++;
  }
}


x86 assembly (clang, -O0):
<quitarComentarios>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1145 <quitarComentarios+0x45>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
jne    1134 <quitarComentarios+0x34>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
jmp    1140 <quitarComentarios+0x40>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <quitarComentarios+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<quitarComentarios>:
mov    (%rdi),%al
cmp    $0x23,%al
jne    1119 <quitarComentarios+0x19>
cs nopw 0x0(%rax,%rax,1)
movb   $0x0,(%rdi)
xor    %eax,%eax
cmp    $0x23,%al
je     1110 <quitarComentarios+0x10>
test   %al,%al
je     1123 <quitarComentarios+0x23>
add    $0x1,%rdi
jmp    1100 <quitarComentarios>
ret

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

LLVM IR (-O2):
define void @quitarComentarios(i8* nocapture %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %9, %8 ], [ %0, %1 ]
%4 = load i8, i8* %3
br label %5
5: ; preds = %2, %7
%6 = phi i8 [ %4, %2 ], [ 0, %7 ]
switch i8 %6, label %8 [
i8 0, label %10
i8 35, label %7
]
7: ; preds = %5
store i8 0, i8* %3
br label %5
8: ; preds = %5
%9 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
10: ; preds = %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x23() {
  Assert_real((isalnum(35) == 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_isalnum.c",
              180, ("isalnum should be 0 for #"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0x23>:
push   %rax
mov    $0x23,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xb4,%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_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 0 for #\00"
define void @t_isalnum_0x23() {
%1 = call i64 @isalnum(i32 35)
%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 180, 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_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 0 for #\00"
define void @t_isalnum_0x23() {
%1 = tail call i64 @isalnum(i32 35)
%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 180, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct sip_msg {
  int dummy;
};

/* Variables and functions */
int uri_param_2(struct sip_msg *, char *, char *);
int uri_param_1(struct sip_msg *_msg, char *_param, char *_str2) {
  return uri_param_2(_msg, _param, (char *)0);
}


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

x86 assembly (clang, -O2):
<uri_param_1>:
xor    %edx,%edx
jmp    1030 <uri_param_2@plt>

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

LLVM IR (-O2):
%struct.sip_msg = type { i32 }
define i32 @uri_param_1(%struct.sip_msg* %0, i8* %1, i8* nocapture readnone %2) {
%4 = tail call i32 @uri_param_2(%struct.sip_msg* %0, i8* %1, i8* null)
ret i32 %4
}
void UART_ScbEnableIntr(void) {}


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

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

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

LLVM IR (-O2):
define void @UART_ScbEnableIntr() {
ret void
}
main() {
  __asm__("movl $5, %eax\n"
          "mov $5, %edi\n"
          "syscall\n");
  return 7;
}


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

x86 assembly (clang, -O2):
<main>:
mov    $0x5,%eax
mov    $0x5,%edi
syscall
mov    $0x7,%eax
ret

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

LLVM IR (-O2):
define i32 @main() {
tail call void asm sideeffect "movl $$5, %eax\0Amov $$5, %edi\0Asyscall\0A", "~{dirflag},~{fpsr},~{flags}"()
ret i32 7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XGrabKeyboard() {
  printf("XGrabKeyboard called\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [21 x i8] c"XGrabKeyboard called\00"
define i32 @XGrabKeyboard() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void foo187(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo187(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *, char *, char *, int);
void the_assert(char *condition, char *file, char *func, int line,
                bool do_fart) {
  if (do_fart) {
    printf("%s failed at: %s:%s:%d", condition, file, func, line);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<the_assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     116b <the_assert+0x4b>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<the_assert>:
test   %r8d,%r8d
jne    1126 <the_assert+0x6>
ret
push   %rax
mov    %ecx,%eax
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xec7(%rip),%rdi
mov    %eax,%r8d
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [23 x i8] c"%s failed at: %s:%s:%d\00"
define void @the_assert(i8* %0, i8* %1, i8* %2, i32 %3, i32 %4) {
%6 = icmp eq i32 %4, 0
br i1 %6, label %10, label %7
7: ; preds = %5
%8 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %2, i32 %3)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mew_duart_print(char const *);
void mew_debug_print(const char *message) { mew_duart_print(message); }


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

x86 assembly (clang, -O2):
<mew_debug_print>:
jmp    1030 <mew_duart_print@plt>

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

LLVM IR (-O2):
define void @mew_debug_print(i8* %0) {
%2 = tail call i32 @mew_duart_print(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ udelay(int);
void mdelay(unsigned long n) {
  while (--n)
    udelay(1000);
}


x86 assembly (clang, -O0):
<mdelay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     1141 <mdelay+0x31>
mov    $0x3e8,%edi
call   1030 <udelay@plt>
jmp    111c <mdelay+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mdelay>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
je     1130 <mdelay+0x20>
nopw   0x0(%rax,%rax,1)
mov    $0x3e8,%edi
call   1030 <udelay@plt>
add    $0xffffffffffffffff,%rbx
jne    1120 <mdelay+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @mdelay(i64 %0) {
%2 = add i64 %0, -1
%3 = icmp eq i64 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ %2, %1 ]
%6 = tail call i32 @udelay(i32 1000)
%7 = add i64 %5, -1
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %1
ret void
}
void ft_striteri(char *s, void (*f)(unsigned int, char *)) {
  unsigned int i;
  i = 0;
  if (s && f)
    while (*s)
      f(i++, s++);
}


x86 assembly (clang, -O0):
<ft_striteri>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1169 <ft_striteri+0x69>
cmpq   $0x0,-0x10(%rbp)
je     1169 <ft_striteri+0x69>
jmp    1132 <ft_striteri+0x32>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1164 <ft_striteri+0x64>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%edi
mov    %edi,%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    %rsi,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
call   *%rax
jmp    1132 <ft_striteri+0x32>
jmp    1169 <ft_striteri+0x69>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_striteri>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1135 <ft_striteri+0x35>
mov    %rsi,%r14
test   %rsi,%rsi
je     1135 <ft_striteri+0x35>
mov    %rdi,%r15
cmpb   $0x0,(%rdi)
je     1135 <ft_striteri+0x35>
xor    %ebx,%ebx
nopl   0x0(%rax)
lea    (%r15,%rbx,1),%rsi
mov    %ebx,%edi
call   *%r14
cmpb   $0x0,0x1(%r15,%rbx,1)
lea    0x1(%rbx),%rbx
jne    1120 <ft_striteri+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @ft_striteri(i8* %0, void (i32, i8*)* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne void (i32, i8*)* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %16
6: ; preds = %2
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, 0
br i1 %8, label %16, label %9
9: ; preds = %6, %9
%10 = phi i32 [ %12, %9 ], [ 0, %6 ]
%11 = phi i8* [ %13, %9 ], [ %0, %6 ]
%12 = add i32 %10, 1
%13 = getelementptr inbounds i8, i8* %11, i64 1
tail call void %1(i32 %10, i8* %11)
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %9
16: ; preds = %9, %6, %2
ret void
}
/* Variables and functions */
int serialRead(int, unsigned char *);
int serialReadEscape(int fd, unsigned char *_byte) {
  int size = serialRead(fd, _byte);
  if (_byte[0] == 0x05)
    size = serialRead(fd, _byte);
  return size;
}


x86 assembly (clang, -O0):
<serialReadEscape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <serialRead@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x5,%eax
jne    114d <serialReadEscape+0x3d>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <serialRead@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serialReadEscape>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1030 <serialRead@plt>
cmpb   $0x5,(%rbx)
jne    1132 <serialReadEscape+0x22>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <serialRead@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @serialReadEscape(i32 %0, i8* %1) {
%3 = tail call i32 @serialRead(i32 %0, i8* %1)
%4 = load i8, i8* %1
%5 = icmp eq i8 %4, 5
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @serialRead(i32 %0, i8* %1)
br label %8
8: ; preds = %6, %2
%9 = phi i32 [ %7, %6 ], [ %3, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ calc();
int main() { calc(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @calc()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @calc()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int sayi, toplam;
  printf("1'den 10'a kadar olan sayilari toplama\n");
  sayi = 0;
  toplam = 0;
  while (sayi < 11) {
    toplam = toplam + sayi;
    sayi = sayi + 1;
  }
  printf("Sayilarin toplami %d'dir", toplam);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xb,-0x8(%rbp)
jge    115c <main+0x4c>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113b <main+0x2b>
mov    -0xc(%rbp),%esi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [40 x i8] c"1'den 10'a kadar olan sayilari toplama\0A\00"
@.str.1 = [25 x i8] c"Sayilarin toplami %d'dir\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
store i32 0, i32* %3
br label %5
5: ; preds = %8, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 11
br i1 %7, label %8, label %14
8: ; preds = %5
%9 = load i32, i32* %3
%10 = load i32, i32* %2
%11 = add nsw i32 %9, %10
store i32 %11, i32* %3
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %5
14: ; preds = %5
%15 = load i32, i32* %3
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [25 x i8] c"Sayilarin toplami %d'dir\00"
@str = [39 x i8] c"1'den 10'a kadar olan sayilari toplama\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 55)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cleardevice();
void restorecrtmode(void) { cleardevice(); }


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

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

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

LLVM IR (-O2):
define void @restorecrtmode() {
%1 = tail call i32 (...) @cleardevice()
ret void
}
int __attribute__((visibility("default"))) libfunc(void) { return 3; }


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

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

LLVM IR (-O0):
define i32 @libfunc() {
ret i32 3
}

LLVM IR (-O2):
define i32 @libfunc() {
ret i32 3
}
extern int _Z14__get_adc_modev(void) { return 33; }


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

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

LLVM IR (-O0):
define i32 @_Z14__get_adc_modev() {
ret i32 33
}

LLVM IR (-O2):
define i32 @_Z14__get_adc_modev() {
ret i32 33
}
int subrseq(char *s1, char *s2, int l2) {
  if (!*s2)
    return 1;
  if (!*s1)
    return 0;
  return subrseq(s1 + 1, s2, l2 -= (*s1 == s2[l2 - 1]));
}


x86 assembly (clang, -O0):
<subrseq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
jne    113c <subrseq+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1193 <subrseq+0x83>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1155 <subrseq+0x45>
movl   $0x0,-0x4(%rbp)
jmp    1193 <subrseq+0x83>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x1c(%rbp),%edx
sub    %eax,%edx
mov    %edx,-0x1c(%rbp)
call   1030 <subrseq@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<subrseq>:
cmpb   $0x0,(%rsi)
je     111c <subrseq+0x1c>
cs nopw 0x0(%rax,%rax,1)
nop
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <subrseq+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @subrseq(i8* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%8 = load i8*, i8** %6
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %12, label %11
11: ; preds = %3
store i32 1, i32* %4
br label %36
12: ; preds = %3
%13 = load i8*, i8** %5
%14 = load i8, i8* %13
%15 = icmp ne i8 %14, 0
br i1 %15, label %17, label %16
16: ; preds = %12
store i32 0, i32* %4
br label %36
17: ; preds = %12
%18 = load i8*, i8** %5
%19 = getelementptr inbounds i8, i8* %18, i64 1
%20 = load i8*, i8** %6
%21 = load i8*, i8** %5
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = load i8*, i8** %6
%25 = load i32, i32* %7
%26 = sub nsw i32 %25, 1
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %24, i64 %27
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = icmp eq i32 %23, %30
%32 = zext i1 %31 to i32
%33 = load i32, i32* %7
%34 = sub nsw i32 %33, %32
store i32 %34, i32* %7
%35 = call i32 @subrseq(i8* %19, i8* %20, i32 %34)
store i32 %35, i32* %4
br label %36
36: ; preds = %17, %16, %11
%37 = load i32, i32* %4
ret i32 %37
}

LLVM IR (-O2):
define i32 @subrseq(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = load i8, i8* %1
%5 = icmp eq i8 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %10, %6 ], [ %0, %3 ]
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
%10 = getelementptr inbounds i8, i8* %7, i64 1
br i1 %9, label %11, label %6
11: ; preds = %6, %3
%12 = phi i32 [ 1, %3 ], [ 0, %6 ]
ret i32 %12
}
/* Variables and functions */
unsigned short s2s(unsigned short);
__attribute__((__visibility__("default"))) __attribute__((used)) unsigned short
rs2s(unsigned short *x) {
  return s2s(*x);
}


x86 assembly (clang, -O0):
<rs2s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edi
call   1030 <s2s@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rs2s>:
movzwl (%rdi),%edi
jmp    1030 <s2s@plt>

LLVM IR (-O0):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i16 (i16*)* @rs2s to i8*)], section "llvm.metadata"
define zeroext i16 @rs2s(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = call zeroext i16 @s2s(i16 zeroext %4)
ret i16 %5
}

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i16 (i16*)* @rs2s to i8*)], section "llvm.metadata"
define zeroext i16 @rs2s(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = tail call zeroext i16 @s2s(i16 zeroext %2)
ret i16 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
void pack_add_8(uint8_t *buffer, int byteNr, int8_t value) {
  *((int8_t *)(buffer + byteNr)) = value;
}


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

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

LLVM IR (-O0):
define void @pack_add_8(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
store i32 %7, i32* %11
ret void
}

LLVM IR (-O2):
define void @pack_add_8(i32* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
store i32 %2, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ org_xmlvm_runtime_XMLVMArray_initNativeLayer__();
void org_xmlvm_runtime_XMLVMArray___CLINIT_() {

  org_xmlvm_runtime_XMLVMArray_initNativeLayer__();

  return;
}


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

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

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

LLVM IR (-O2):
define void @org_xmlvm_runtime_XMLVMArray___CLINIT_() {
%1 = tail call i32 (...) @org_xmlvm_runtime_XMLVMArray_initNativeLayer__()
ret void
}
char *strchr(const char *s, int ch) {
  for (;; s++) {
    if (*s == (char)ch)
      return (char *)s;
    if (*s == 0)
      return 0;
  }
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x14(%rbp),%ecx
movsbl %cl,%ecx
cmp    %ecx,%eax
jne    112d <strchr+0x2d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1160 <strchr+0x60>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    114a <strchr+0x4a>
movq   $0x0,-0x8(%rbp)
jmp    1160 <strchr+0x60>
jmp    114f <strchr+0x4f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <strchr+0xb>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    %rdi,%rax
movsbl %sil,%ecx
movsbl (%rdi),%edx
cmp    %edx,%ecx
je     1120 <strchr+0x20>
xchg   %ax,%ax
test   %dl,%dl
je     1121 <strchr+0x21>
movsbl 0x1(%rax),%edx
add    $0x1,%rax
cmp    %edx,%ecx
jne    1110 <strchr+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @strchr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
br label %6
6: ; preds = %23, %2
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = load i32, i32* %5
%11 = trunc i32 %10 to i8
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %9, %12
br i1 %13, label %14, label %16
14: ; preds = %6
%15 = load i8*, i8** %4
store i8* %15, i8** %3
br label %26
16: ; preds = %6
%17 = load i8*, i8** %4
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %16
store i8* null, i8** %3
br label %26
22: ; preds = %16
br label %23
23: ; preds = %22
%24 = load i8*, i8** %4
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %4
br label %6
26: ; preds = %21, %14
%27 = load i8*, i8** %3
ret i8* %27
}

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = shl i32 %1, 24
%4 = ashr exact i32 %3, 24
%5 = load i8, i8* %0
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %4, %6
br i1 %7, label %17, label %8
8: ; preds = %2, %12
%9 = phi i8 [ %14, %12 ], [ %5, %2 ]
%10 = phi i8* [ %13, %12 ], [ %0, %2 ]
%11 = icmp eq i8 %9, 0
br i1 %11, label %17, label %12
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %10, i64 1
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %4, %15
br i1 %16, label %17, label %8
17: ; preds = %12, %8, %2
%18 = phi i8* [ %0, %2 ], [ null, %8 ], [ %13, %12 ]
ret i8* %18
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int open(char const *, int, int /*<<< orphan*/);
int txc_libc_open(const char *pathname, int flags, mode_t mode) {
  return open(pathname, flags, mode);
}


x86 assembly (clang, -O0):
<txc_libc_open>:
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    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<txc_libc_open>:
jmp    1030 <open@plt>

LLVM IR (-O0):
define i32 @txc_libc_open(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 i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @open(i8* %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @txc_libc_open(i8* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 @open(i8* %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
char *strstr(const char *str1, const char *str2) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @strstr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @strstr(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
void lpm_arch_end_awake(void) {}


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

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

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

LLVM IR (-O2):
define void @lpm_arch_end_awake() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ portable_sleep(int);
int /*<<< orphan*/ printf(char *, char *);
void fatal(char *str) {
  printf("FATAL: (%s)\n", str);
  while (1)
    portable_sleep(10);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <portable_sleep@plt>
jmp    113c <fatal+0x1c>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <portable_sleep@plt>
jmp    1130 <fatal+0x10>

LLVM IR (-O0):
@.str = [13 x i8] c"FATAL: (%s)\0A\00"
define void @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %3)
br label %5
5: ; preds = %1, %5
%6 = call i32 @portable_sleep(i32 10)
br label %5
}

LLVM IR (-O2):
@.str = [13 x i8] c"FATAL: (%s)\0A\00"
define void @fatal(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %3
3: ; preds = %1, %3
%4 = tail call i32 @portable_sleep(i32 10)
br label %3
}