xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned long GPIOGetIntNumber(unsigned long);
int /*<<< orphan*/ IntDisable(unsigned long);
int /*<<< orphan*/ IntUnregister(unsigned long);
void GPIOPortIntUnregister(unsigned long ulPort) {
  ;
  ulPort = GPIOGetIntNumber(ulPort);
  IntDisable(ulPort);
  IntUnregister(ulPort);
}


x86 assembly (clang, -O0):
<GPIOPortIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <GPIOGetIntNumber@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <IntDisable@plt>
mov    -0x8(%rbp),%rdi
call   1050 <IntUnregister@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOPortIntUnregister>:
push   %rbx
call   1030 <GPIOGetIntNumber@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <IntDisable@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <IntUnregister@plt>

LLVM IR (-O0):
define void @GPIOPortIntUnregister(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @GPIOGetIntNumber(i64 %3)
store i64 %4, i64* %2
%5 = load i64, i64* %2
%6 = call i32 @IntDisable(i64 %5)
%7 = load i64, i64* %2
%8 = call i32 @IntUnregister(i64 %7)
ret void
}

LLVM IR (-O2):
define void @GPIOPortIntUnregister(i64 %0) {
%2 = tail call i64 @GPIOGetIntNumber(i64 %0)
%3 = tail call i32 @IntDisable(i64 %2)
%4 = tail call i32 @IntUnregister(i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, unsigned char);
void fb_move_cursor(unsigned char pos) {
  outb(0x3D4, 14);
  outb(0x3D5, ((pos >> 8) & 0x00FF));
  outb(0x3D4, 15);
  outb(0x3D5, pos & 0x00FF);
}


x86 assembly (clang, -O0):
<fb_move_cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <outb@plt>
movzbl -0x1(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    $0x3d5,%edi
movzbl %al,%esi
call   1030 <outb@plt>
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <outb@plt>
movzbl -0x1(%rbp),%eax
and    $0xff,%eax
mov    $0x3d5,%edi
movzbl %al,%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_move_cursor>:
push   %rbx
mov    %edi,%ebx
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <outb@plt>
mov    $0x3d5,%edi
xor    %esi,%esi
call   1030 <outb@plt>
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <outb@plt>
mov    $0x3d5,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @fb_move_cursor(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @outb(i32 980, i8 zeroext 14)
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = ashr i32 %5, 8
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i8
%9 = call i32 @outb(i32 981, i8 zeroext %8)
%10 = call i32 @outb(i32 980, i8 zeroext 15)
%11 = load i8, i8* %2
%12 = zext i8 %11 to i32
%13 = and i32 %12, 255
%14 = trunc i32 %13 to i8
%15 = call i32 @outb(i32 981, i8 zeroext %14)
ret void
}

LLVM IR (-O2):
define void @fb_move_cursor(i8 zeroext %0) {
%2 = tail call i32 @outb(i32 980, i8 zeroext 14)
%3 = tail call i32 @outb(i32 981, i8 zeroext 0)
%4 = tail call i32 @outb(i32 980, i8 zeroext 15)
%5 = tail call i32 @outb(i32 981, i8 zeroext %0)
ret void
}
int ck_cc_ctz(unsigned int x) {
  unsigned int i;
  if (x == 0)
    return 0;
  for (i = 0; (x & 1) == 0; i++, x >>= 1)
    ;
  return i;
}


x86 assembly (clang, -O0):
<ck_cc_ctz>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <ck_cc_ctz+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1155 <ck_cc_ctz+0x55>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    114f <ck_cc_ctz+0x4f>
jmp    1138 <ck_cc_ctz+0x38>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <ck_cc_ctz+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ck_cc_ctz>:
xor    %eax,%eax
test   %edi,%edi
je     112d <ck_cc_ctz+0x2d>
mov    %edi,%ecx
and    $0x1,%ecx
jne    112d <ck_cc_ctz+0x2d>
xor    %eax,%eax
mov    %edi,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%eax
shr    %ecx
test   $0x2,%dil
mov    %ecx,%edi
je     1120 <ck_cc_ctz+0x20>
ret

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

LLVM IR (-O2):
define i32 @ck_cc_ctz(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = and i32 %0, 1
%4 = icmp eq i32 %3, 0
%5 = and i1 %2, %4
br i1 %5, label %6, label %13
6: ; preds = %1, %6
%7 = phi i32 [ %9, %6 ], [ 0, %1 ]
%8 = phi i32 [ %10, %6 ], [ %0, %1 ]
%9 = add i32 %7, 1
%10 = lshr i32 %8, 1
%11 = and i32 %8, 2
%12 = icmp eq i32 %11, 0
br i1 %12, label %6, label %13
13: ; preds = %6, %1
%14 = phi i32 [ 0, %1 ], [ %9, %6 ]
ret i32 %14
}
/* Variables and functions */
void test3() {
  int *s = NULL;
  *s = 42;
}


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x2a,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @test3() {
%1 = alloca i32*
store i32* null, i32** %1
%2 = load i32*, i32** %1
store i32 42, i32* %2
ret void
}

LLVM IR (-O2):
/* Variables and functions */
int GET32(int);
void uart_flush(void) {
  while (1) {
    if ((GET32((0x3F000000 + 0x00215054)) & 0x100) == 0)
      break;
  }
}


x86 assembly (clang, -O0):
<uart_flush>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <uart_flush+0x9>
mov    $0x3f215054,%edi
call   1030 <GET32@plt>
and    $0x100,%eax
cmp    $0x0,%eax
jne    1136 <uart_flush+0x26>
jmp    113b <uart_flush+0x2b>
jmp    1119 <uart_flush+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_flush>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x3f215054,%edi
call   1030 <GET32@plt>
test   $0x100,%eax
jne    1120 <uart_flush+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @uart_flush() {
br label %1
1: ; preds = %0, %6
%2 = call i32 @GET32(i32 1059147860)
%3 = and i32 %2, 256
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %7
6: ; preds = %1
br label %1
7: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @uart_flush() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @GET32(i32 1059147860)
%3 = and i32 %2, 256
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %1
5: ; preds = %1
ret void
}
long long integer_range(long long min, long long max) {
  extern long long integer_value(void);
  long long n = integer_value();
  return n < min || max < n ? min : n;
}


x86 assembly (clang, -O0):
<integer_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
call   1030 <integer_value@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jl     1145 <integer_range+0x35>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    1152 <integer_range+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    115a <integer_range+0x4a>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<integer_range>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <integer_value@plt>
cmp    %r14,%rax
mov    %rax,%rcx
cmovg  %rbx,%rcx
cmp    %rbx,%rax
cmovl  %rbx,%rcx
mov    %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @integer_range(i64 %0, i64 %1) {
%3 = tail call i64 @integer_value()
%4 = icmp slt i64 %3, %0
%5 = icmp sgt i64 %3, %1
%6 = or i1 %4, %5
%7 = select i1 %6, i64 %0, i64 %3
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int *mallocReturnFreed() {
  int *p = malloc(12);
  free(p);
  return p;
}


x86 assembly (clang, -O0):
<mallocReturnFreed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xc,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mallocReturnFreed>:
push   %rbx
mov    $0xc,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <free@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i32* @mallocReturnFreed() {
%1 = alloca i32*
%2 = call i32* @malloc(i32 12)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @free(i32* %3)
%5 = load i32*, i32** %1
ret i32* %5
}

LLVM IR (-O2):
define noalias i32* @mallocReturnFreed() {
%1 = tail call i32* @malloc(i32 12)
%2 = tail call i32 @free(i32* %1)
ret i32* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void backupend_handler() {
  printf("\n\n CHILD:The BackUp is finished. Time for me to died father\n\n");
}


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

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

LLVM IR (-O0):
@.str = [62 x i8] c"\0A\0A CHILD:The BackUp is finished. Time for me to died father\0A\0A\00"
define void @backupend_handler() {
%1 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [61 x i8] c"\0A\0A CHILD:The BackUp is finished. Time for me to died father\0A\00"
define void @backupend_handler() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
int isASN_STR(const char *comm) { return strcmp(comm, "asn_str") == 0; }


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

x86 assembly (clang, -O2):
<isASN_STR>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"asn_str\00"
define i32 @isASN_STR(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [8 x i8] c"asn_str\00"
define i32 @isASN_STR(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_Job_SkewHeap(void *job) { free(job); }


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

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

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

LLVM IR (-O2):
define void @free_Job_SkewHeap(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int ADC0_InSeq3();
int /*<<< orphan*/ LedBlueOn();
int /*<<< orphan*/ LedGreenOn();
int /*<<< orphan*/ LedOff();
int /*<<< orphan*/ LedRedOn();
void TermostatoTask(void) {
  int conversione = ADC0_InSeq3();
  if (conversione > 2731) {
    LedOff();
    LedRedOn();
  } else {
    if (conversione < 1364) {
      LedOff();
      LedBlueOn();
    } else {
      LedOff();
      LedGreenOn();
    }
  }
}


x86 assembly (clang, -O0):
<TermostatoTask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <ADC0_InSeq3@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xaab,-0x4(%rbp)
jle    1182 <TermostatoTask+0x32>
mov    $0x0,%al
call   1040 <LedOff@plt>
mov    $0x0,%al
call   1060 <LedRedOn@plt>
jmp    11b5 <TermostatoTask+0x65>
cmpl   $0x554,-0x4(%rbp)
jge    11a2 <TermostatoTask+0x52>
mov    $0x0,%al
call   1040 <LedOff@plt>
mov    $0x0,%al
call   1030 <LedBlueOn@plt>
jmp    11b0 <TermostatoTask+0x60>
mov    $0x0,%al
call   1040 <LedOff@plt>
mov    $0x0,%al
call   1070 <LedGreenOn@plt>
jmp    11b5 <TermostatoTask+0x65>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TermostatoTask>:
push   %rbx
xor    %eax,%eax
call   1050 <ADC0_InSeq3@plt>
cmp    $0xaac,%eax
jl     116e <TermostatoTask+0x1e>
xor    %eax,%eax
call   1040 <LedOff@plt>
xor    %eax,%eax
pop    %rbx
jmp    1060 <LedRedOn@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <LedOff@plt>
xor    %eax,%eax
cmp    $0x553,%ebx
jg     1187 <TermostatoTask+0x37>
pop    %rbx
jmp    1030 <LedBlueOn@plt>
pop    %rbx
jmp    1070 <LedGreenOn@plt>

LLVM IR (-O0):
define void @TermostatoTask() {
%1 = alloca i32
%2 = call i32 (...) @ADC0_InSeq3()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp sgt i32 %3, 2731
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = call i32 (...) @LedOff()
%7 = call i32 (...) @LedRedOn()
br label %18
8: ; preds = %0
%9 = load i32, i32* %1
%10 = icmp slt i32 %9, 1364
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = call i32 (...) @LedOff()
%13 = call i32 (...) @LedBlueOn()
br label %17
14: ; preds = %8
%15 = call i32 (...) @LedOff()
%16 = call i32 (...) @LedGreenOn()
br label %17
17: ; preds = %14, %11
br label %18
18: ; preds = %17, %5
ret void
}

LLVM IR (-O2):
define void @TermostatoTask() {
%1 = tail call i32 (...) @ADC0_InSeq3()
%2 = icmp sgt i32 %1, 2731
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 (...) @LedOff()
%5 = tail call i32 (...) @LedRedOn()
br label %13
6: ; preds = %0
%7 = icmp slt i32 %1, 1364
%8 = tail call i32 (...) @LedOff()
br i1 %7, label %9, label %11
9: ; preds = %6
%10 = tail call i32 (...) @LedBlueOn()
br label %13
11: ; preds = %6
%12 = tail call i32 (...) @LedGreenOn()
br label %13
13: ; preds = %9, %11, %3
ret void
}
int atoi(char *s) {
  int n = 0;
  while (*s >= '0' && *s <= '9') {
    n = 10 * n + (*s - '0');
    s++;
  }
  return n;
}


x86 assembly (clang, -O0):
<atoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0xd(%rbp)
jl     1134 <atoi+0x34>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1144 <atoi+0x44>
jmp    1168 <atoi+0x68>
imul   $0xa,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <atoi+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoi>:
mov    (%rdi),%cl
lea    -0x30(%rcx),%edx
xor    %eax,%eax
cmp    $0x9,%dl
ja     113b <atoi+0x3b>
add    $0x1,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl %cl,%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
lea    -0x30(%rcx),%edx
add    $0x1,%rdi
cmp    $0xa,%dl
jb     1120 <atoi+0x20>
ret

LLVM IR (-O0):
define i32 @atoi(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %16, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp sge i32 %7, 48
br i1 %8, label %9, label %14
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp sle i32 %12, 57
br label %14
14: ; preds = %9, %4
%15 = phi i1 [ false, %4 ], [ %13, %9 ]
br i1 %15, label %16, label %26
16: ; preds = %14
%17 = load i32, i32* %3
%18 = mul nsw i32 10, %17
%19 = load i8*, i8** %2
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = sub nsw i32 %21, 48
%23 = add nsw i32 %18, %22
store i32 %23, i32* %3
%24 = load i8*, i8** %2
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %2
br label %4
26: ; preds = %14
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @atoi(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -48
%4 = icmp ult i8 %3, 10
br i1 %4, label %5, label %17
5: ; preds = %1, %5
%6 = phi i8 [ %14, %5 ], [ %2, %1 ]
%7 = phi i32 [ %12, %5 ], [ 0, %1 ]
%8 = phi i8* [ %13, %5 ], [ %0, %1 ]
%9 = zext i8 %6 to i32
%10 = mul nsw i32 %7, 10
%11 = add i32 %10, -48
%12 = add i32 %11, %9
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %13
%15 = add i8 %14, -48
%16 = icmp ult i8 %15, 10
br i1 %16, label %5, label %17
17: ; preds = %5, %1
%18 = phi i32 [ 0, %1 ], [ %12, %5 ]
ret i32 %18
}
/* Type definitions */
typedef scalar_t__ memcmp;

/* Variables and functions */
size_t strlen(char const *);
char *(strstarts)(const char *string, const char *desired) {
  size_t n = strlen(string);
  size_t m = strlen(desired);
  if (n < m)
    return NULL;
  return (memcmp)(string, desired, m) ? NULL : string;
}


x86 assembly (clang, -O0):
<strstarts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    1155 <strstarts+0x45>
movq   $0x0,-0x8(%rbp)
jmp    117b <strstarts+0x6b>
cmpq   $0x0,-0x28(%rbp)
je     116b <strstarts+0x5b>
xor    %eax,%eax
mov    %rax,-0x30(%rbp)
jmp    1173 <strstarts+0x63>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strstarts>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1030 <strlen@plt>
xor    %ecx,%ecx
test   %rax,%rax
cmovne %rcx,%rbx
cmp    %rax,%r15
cmovb  %rcx,%rbx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @strstarts(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
store i64 %9, i64* %6
%10 = load i8*, i8** %5
%11 = call i64 @strlen(i8* %10)
store i64 %11, i64* %7
%12 = load i64, i64* %6
%13 = load i64, i64* %7
%14 = icmp ult i64 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %2
store i8* null, i8** %3
br label %26
16: ; preds = %2
%17 = load i8*, i8** %4
%18 = load i8*, i8** %5
%19 = load i64, i64* %7
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %16
br label %24
22: ; preds = %16
%23 = load i8*, i8** %4
br label %24
24: ; preds = %22, %21
%25 = phi i8* [ null, %21 ], [ %23, %22 ]
store i8* %25, i8** %3
br label %26
26: ; preds = %24, %15
%27 = load i8*, i8** %3
ret i8* %27
}

LLVM IR (-O2):
define i8* @strstarts(i8* %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = icmp ult i64 %3, %4
%6 = icmp eq i64 %4, 0
%7 = select i1 %6, i8* %0, i8* null
%8 = select i1 %5, i8* null, i8* %7
ret i8* %8
}
/* Variables and functions */
int strncasecmp(char *, char *, int);
void strncasecmp_1() {
  char *x = "Bcd";
  char *y = "abc";
  if (strncasecmp(x, y, 3) != 1)
    (void)*(char *)0;
}


x86 assembly (clang, -O0):
<strncasecmp_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x3,%edx
call   1030 <strncasecmp@plt>
cmp    $0x1,%eax
je     1149 <strncasecmp_1+0x39>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"Bcd\00"
@.str.1 = [4 x i8] c"abc\00"
define void @strncasecmp_1() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %1
%4 = load i8*, i8** %2
%5 = call i32 @strncasecmp(i8* %3, i8* %4, i32 3)
%6 = icmp ne i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = load i8, i8* null
br label %9
9: ; preds = %7, %0
ret void
}

LLVM IR (-O2):
define void @strncasecmp_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void putUsage(const char *s) {
  (void)printf("Usage: %s file ... host:target, or\n", s);
  (void)printf("       %s file ... target (when already connected)\n", s);
}


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

x86 assembly (clang, -O2):
<putUsage>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xefa(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"Usage: %s file ... host:target, or\0A\00"
@.str.1 = [52 x i8] c" %s file ... target (when already connected)\0A\00"
define void @putUsage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"Usage: %s file ... host:target, or\0A\00"
@.str.1 = [52 x i8] c" %s file ... target (when already connected)\0A\00"
define void @putUsage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int main() {
  abort();
  abort();
  abort();
  abort();
  abort();
  abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ feof(int /*<<< orphan*/ *);
int fgetc(int /*<<< orphan*/ *);
int readFile(FILE *fp) {
  int aChar = fgetc(fp);
  if (feof(fp)) {
    return -1;
  }
  return aChar;
}


x86 assembly (clang, -O0):
<readFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <feof@plt>
cmp    $0x0,%rax
je     1157 <readFile+0x37>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <readFile+0x3d>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readFile>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <fgetc@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <feof@plt>
neg    %rax
sbb    %eax,%eax
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @readFile(i32* nocapture %0) {
%2 = tail call i32 @fgetc(i32* %0)
%3 = tail call i64 @feof(i32* %0)
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 %2, i32 -1
ret i32 %5
}
unsigned int bit_test(const unsigned int i, const unsigned int n) {
  if (i & (1 << 31 - n))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<bit_test>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x1f,%ecx
sub    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1135 <bit_test+0x35>
movl   $0x1,-0x4(%rbp)
jmp    113c <bit_test+0x3c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_test>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @bit_test(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* %4
%7 = load i32, i32* %5
%8 = sub i32 31, %7
%9 = shl i32 1, %8
%10 = and i32 %6, %9
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 1, i32* %3
br label %14
13: ; preds = %2
store i32 0, i32* %3
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @bit_test(i32 %0, i32 %1) {
%3 = lshr i32 -2147483648, %1
%4 = and i32 %3, %0
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ VIM_SIF_I2cWriteByte(unsigned char, unsigned char);
void SensorSetReg_MC501CB(unsigned char uAddr, unsigned short uVal) {
  VIM_SIF_I2cWriteByte((unsigned char)uAddr, (unsigned char)uVal);
}


x86 assembly (clang, -O0):
<SensorSetReg_MC501CB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x4(%rbp),%ax
movzbl %cl,%edi
movzbl %al,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SensorSetReg_MC501CB>:
movzbl %sil,%esi
jmp    1030 <VIM_SIF_I2cWriteByte@plt>

LLVM IR (-O0):
define void @SensorSetReg_MC501CB(i8 zeroext %0, i16 zeroext %1) {
%3 = alloca i8
%4 = alloca i16
store i8 %0, i8* %3
store i16 %1, i16* %4
%5 = load i8, i8* %3
%6 = load i16, i16* %4
%7 = trunc i16 %6 to i8
%8 = call i32 @VIM_SIF_I2cWriteByte(i8 zeroext %5, i8 zeroext %7)
ret void
}

LLVM IR (-O2):
define void @SensorSetReg_MC501CB(i8 zeroext %0, i16 zeroext %1) {
%3 = trunc i16 %1 to i8
%4 = tail call i32 @VIM_SIF_I2cWriteByte(i8 zeroext %0, i8 zeroext %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x11() {
  Assert_real((isupper(17) == 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_isupper.c",
              90, ("isupper should be 0 for 0x11"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0x11>:
push   %rax
mov    $0x11,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x5a,%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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x11\00"
define void @t_isupper_0x11() {
%1 = call i64 @isupper(i32 17)
%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 90, i8* getelementptr inbounds ([29 x i8], [29 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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x11\00"
define void @t_isupper_0x11() {
%1 = tail call i64 @isupper(i32 17)
%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 90, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() {
  int i = 4;
  int j = i && 3;
  printf("\n%d", j);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     113f <main+0x2f>
mov    $0x1,%al
mov    %al,-0xd(%rbp)
jmp    113f <main+0x2f>
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"\0A%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ state;
};
struct TYPE_4__ {
  TYPE_1__ xmotion;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned get_XEvent_xmotion_state(void *_p) {
  return (unsigned)((XEvent *)_p)->xmotion.state;
}


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

x86 assembly (clang, -O2):
<get_XEvent_xmotion_state>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define i32 @get_XEvent_xmotion_state(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XEvent_xmotion_state(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
scalar_t__ compare(char *, char *);
int /*<<< orphan*/ printf(char *, char *, char *);
void showmatch(char regex[], char string[]) {
  if (compare(regex, string)) {
    printf("regex: %20s : %20s => Match\n", regex, string);
  } else {
    printf("regex: %20s : %20s => NO match\n", regex, string);
  }
}


x86 assembly (clang, -O0):
<showmatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <compare@plt>
cmp    $0x0,%rax
je     1160 <showmatch+0x40>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
jmp    1174 <showmatch+0x54>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showmatch>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <compare@plt>
test   %rax,%rax
lea    0xee4(%rip),%rax
lea    0xec0(%rip),%rdi
cmove  %rax,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"regex: %20s : %20s => Match\0A\00"
@.str.1 = [32 x i8] c"regex: %20s : %20s => NO match\0A\00"
define void @showmatch(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 i64 @compare(i8* %5, i8* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = load i8*, i8** %4
%12 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11)
br label %17
13: ; preds = %2
%14 = load i8*, i8** %3
%15 = load i8*, i8** %4
%16 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8* %14, i8* %15)
br label %17
17: ; preds = %13, %9
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"regex: %20s : %20s => Match\0A\00"
@.str.1 = [32 x i8] c"regex: %20s : %20s => NO match\0A\00"
define void @showmatch(i8* %0, i8* %1) {
%3 = tail call i64 @compare(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0)
%6 = tail call i32 @printf(i8* %5, i8* %0, i8* %1)
ret void
}
/* Variables and functions */
double pow(double, double);
double pareto(double x, double alpha, double xm) {
  if (x < xm) {
    return 0.0;
  } else {
    return alpha * pow(xm, alpha) / pow(x, alpha + 1);
  }
}


x86 assembly (clang, -O0):
<pareto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1148 <pareto+0x38>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    119a <pareto+0x8a>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe81(%rip),%xmm1
addsd  -0x18(%rbp),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pareto>:
movapd %xmm0,%xmm3
xorpd  %xmm0,%xmm0
ucomisd %xmm3,%xmm2
ja     116a <pareto+0x5a>
sub    $0x18,%rsp
movapd %xmm2,%xmm0
movsd  %xmm1,(%rsp)
movsd  %xmm3,0x8(%rsp)
call   1030 <pow@plt>
movsd  (%rsp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rsp)
addsd  0xeb3(%rip),%xmm1
movsd  0x8(%rsp),%xmm0
call   1030 <pow@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @pareto(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%8 = load double, double* %5
%9 = load double, double* %7
%10 = fcmp olt double %8, %9
br i1 %10, label %11, label %12
11: ; preds = %3
store double 0.000000e+00, double* %4
br label %23
12: ; preds = %3
%13 = load double, double* %6
%14 = load double, double* %7
%15 = load double, double* %6
%16 = call double @pow(double %14, double %15)
%17 = fmul double %13, %16
%18 = load double, double* %5
%19 = load double, double* %6
%20 = fadd double %19, 1.000000e+00
%21 = call double @pow(double %18, double %20)
%22 = fdiv double %17, %21
store double %22, double* %4
br label %23
23: ; preds = %12, %11
%24 = load double, double* %4
ret double %24
}

LLVM IR (-O2):
define double @pareto(double %0, double %1, double %2) {
%4 = fcmp olt double %0, %2
br i1 %4, label %11, label %5
5: ; preds = %3
%6 = tail call double @pow(double %2, double %1)
%7 = fmul double %6, %1
%8 = fadd double %1, 1.000000e+00
%9 = tail call double @pow(double %0, double %8)
%10 = fdiv double %7, %9
br label %11
11: ; preds = %3, %5
%12 = phi double [ %10, %5 ], [ 0.000000e+00, %3 ]
ret double %12
}
/* Variables and functions */
void *malloc(int);
int /*<<< orphan*/ perror_exit(char *);
void *check_malloc(int size) {
  void *p = malloc(size);
  if (p == NULL)
    perror_exit("malloc failed");
  return p;
}


x86 assembly (clang, -O0):
<check_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114e <check_malloc+0x2e>
lea    0xeb7(%rip),%rdi
call   1040 <perror_exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_malloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <check_malloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <perror_exit@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"malloc failed\00"
define noalias i8* @check_malloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @perror_exit(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
float fabs0(float a) {
  if (a < 0.f)
    return a * -1.f;
  return a;
}


x86 assembly (clang, -O0):
<fabs0>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112d <fabs0+0x2d>
movss  0xee2(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1137 <fabs0+0x37>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabs0>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @fabs0(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp olt float %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load float, float* %3
%8 = fmul float %7, -1.000000e+00
store float %8, float* %2
br label %11
9: ; preds = %1
%10 = load float, float* %3
store float %10, float* %2
br label %11
11: ; preds = %9, %6
%12 = load float, float* %2
ret float %12
}

LLVM IR (-O2):
define float @fabs0(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ perft_file(char *);
void test() { perft_file("perft.epd"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"perft.epd\00"
define void @test() {
%1 = call i32 @perft_file(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"perft.epd\00"
define void @test() {
%1 = tail call i32 @perft_file(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
extern void spin_lock_prefetch(const void *ptr) {
  __builtin_prefetch(ptr, 1, 3);
}


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

x86 assembly (clang, -O2):
<spin_lock_prefetch>:
prefetcht0 (%rdi)
ret

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

LLVM IR (-O2):
define void @spin_lock_prefetch(i8* nocapture %0) {
tail call void @llvm.prefetch.p0i8(i8* %0, i32 1, i32 3, i32 1)
ret void
}
void glIsVertexArray(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glIsVertexArray() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char);
void HTTP_EncodeChar(unsigned char chr, unsigned char *encodedchr) {
  sprintf((char *)encodedchr, "%%%X", (char)chr);
}


x86 assembly (clang, -O0):
<HTTP_EncodeChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed3(%rip),%rsi
movsbl -0x1(%rbp),%edx
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HTTP_EncodeChar>:
mov    %rsi,%rax
movsbl %dil,%edx
lea    0xee2(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%%%X\00"
define void @HTTP_EncodeChar(i8 zeroext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
store i8 %0, i8* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8, i8* %3
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext %6)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%%%X\00"
define void @HTTP_EncodeChar(i8 zeroext %0, i8* nocapture writeonly %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext %0)
ret void
}
void store_usblog_notify(int type, void *param1, void *parma2) {}


x86 assembly (clang, -O0):
<store_usblog_notify>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @store_usblog_notify(i32 %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void version() { printf("Version: %s.\n", "v2.0.1"); }


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

x86 assembly (clang, -O2):
<version>:
lea    0xee9(%rip),%rdi
lea    0xef0(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Version: %s.\0A\00"
@.str.1 = [7 x i8] c"v2.0.1\00"
define void @version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"Version: %s.\0A\00"
@.str.1 = [7 x i8] c"v2.0.1\00"
define void @version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void infoSetStopWord(void) {
  printf("Stop after specified word is generated.%s", "\n");
}


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

x86 assembly (clang, -O2):
<infoSetStopWord>:
lea    0xee9(%rip),%rdi
lea    0xf0c(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"Stop after specified word is generated.%s\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @infoSetStopWord() {
%1 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"Stop after specified word is generated.%s\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @infoSetStopWord() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void nil_accept_cb(struct evconnlistener *l, int fd, struct sockaddr *s,
                   int socklen, void *arg) {
  int *p = arg;
  (*p)++;
}


x86 assembly (clang, -O0):
<nil_accept_cb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<nil_accept_cb>:
addl   $0x1,(%r8)
ret

LLVM IR (-O0):
%struct.evconnlistener = type opaque
%struct.sockaddr = type opaque
define void @nil_accept_cb(%struct.evconnlistener* %0, i32 %1, %struct.sockaddr* %2, i32 %3, i8* %4) {
%6 = alloca %struct.evconnlistener*
%7 = alloca i32
%8 = alloca %struct.sockaddr*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32*
store %struct.evconnlistener* %0, %struct.evconnlistener** %6
store i32 %1, i32* %7
store %struct.sockaddr* %2, %struct.sockaddr** %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%12 = load i8*, i8** %10
%13 = bitcast i8* %12 to i32*
store i32* %13, i32** %11
%14 = load i32*, i32** %11
%15 = load i32, i32* %14
%16 = add nsw i32 %15, 1
store i32 %16, i32* %14
ret void
}

LLVM IR (-O2):
%struct.evconnlistener = type opaque
%struct.sockaddr = type opaque
define void @nil_accept_cb(%struct.evconnlistener* nocapture readnone %0, i32 %1, %struct.sockaddr* nocapture readnone %2, i32 %3, i8* nocapture %4) {
%6 = bitcast i8* %4 to i32*
%7 = load i32, i32* %6
%8 = add nsw i32 %7, 1
store i32 %8, i32* %6
ret void
}