xunge/DecIR huggingface dataset:
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int width;
};
typedef TYPE_1__ XResizeRequestEvent;

/* Variables and functions */
void set_XResizeRequestEvent_width(void *_p, int _v) {
  ((XResizeRequestEvent *)_p)->width = (int)_v;
}


x86 assembly (clang, -O0):
<set_XResizeRequestEvent_width>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XResizeRequestEvent_width(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XResizeRequestEvent_width(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
int bitcount(int x) { return x * 2; }


x86 assembly (clang, -O0):
<bitcount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitcount>:
lea    (%rdi,%rdi,1),%eax
ret

LLVM IR (-O0):
define i32 @bitcount(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 2
ret i32 %4
}

LLVM IR (-O2):
define i32 @bitcount(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
short log(short);
short internal_log_s(short value) { return log(value); }


x86 assembly (clang, -O0):
<internal_log_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edi
call   1030 <log@plt>
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<internal_log_s>:
jmp    1030 <log@plt>

LLVM IR (-O0):
define signext i16 @internal_log_s(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call signext i16 @log(i16 signext %3)
ret i16 %4
}

LLVM IR (-O2):
define signext i16 @internal_log_s(i16 signext %0) {
%2 = tail call signext i16 @log(i16 signext %0)
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0xf5() {
  Assert_real((isupper(245) == 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",
              1230, ("isupper should be 0 for 0xf5"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0xf5>:
push   %rax
mov    $0xf5,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4ce,%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 0xf5\00"
define void @t_isupper_0xf5() {
%1 = call i64 @isupper(i32 245)
%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 1230, 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 0xf5\00"
define void @t_isupper_0xf5() {
%1 = tail call i64 @isupper(i32 245)
%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 1230, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int nop_connect_callback(int s) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @nop_connect_callback(i32 %0) {
ret i32 0
}
void ECAPAPWMCaptureConfig(unsigned int baseAdd, unsigned int compareVal,
                           unsigned int periodVal) {
  (*((volatile unsigned int *)(baseAdd + (0x8)))) = periodVal;
  (*((volatile unsigned int *)(baseAdd + (0xC)))) = compareVal;
}


x86 assembly (clang, -O0):
<ECAPAPWMCaptureConfig>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x8,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0xc,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ECAPAPWMCaptureConfig>:
lea    0x8(%rdi),%eax
mov    %edx,(%rax)
add    $0xc,%edi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @ECAPAPWMCaptureConfig(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 = add i32 %8, 8
%10 = zext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
store volatile i32 %7, i32* %11
%12 = load i32, i32* %5
%13 = load i32, i32* %4
%14 = add i32 %13, 12
%15 = zext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
store volatile i32 %12, i32* %16
ret void
}

LLVM IR (-O2):
define void @ECAPAPWMCaptureConfig(i32 %0, i32 %1, i32 %2) {
%4 = add i32 %0, 8
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
store volatile i32 %2, i32* %6
%7 = add i32 %0, 12
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store volatile i32 %1, i32* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ printversion();
void printusage(void) {
  printversion();
  printf("usage: -h         - this help\n");
  printf("       -v         - print version\n");
  printf("       -c [file]  - use config file \"file\"\n");
}


x86 assembly (clang, -O0):
<printusage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <printversion@plt>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
lea    0xef8(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printusage>:
push   %rax
xor    %eax,%eax
call   1040 <printversion@plt>
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
lea    0xef9(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"usage: -h - this help\0A\00"
@.str.1 = [35 x i8] c" -v - print version\0A\00"
@.str.2 = [44 x i8] c" -c [file] - use config file \22file\22\0A\00"
define void @printusage() {
%1 = call i32 (...) @printversion()
%2 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [30 x i8] c"usage: -h - this help\00"
@str.3 = [34 x i8] c" -v - print version\00"
@str.4 = [43 x i8] c" -c [file] - use config file \22file\22\00"
define void @printusage() {
%1 = tail call i32 (...) @printversion()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.3, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.4, i64 0, i64 0))
ret void
}
int test_imm_08uint8_mem(unsigned char *val) {
  return ((*val) & (0x08 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_08uint8_mem>:
testb  $0x8,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_08uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 8
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int isContigOrTandem(char status) {
  return ((status == 'C') || (status == 'T'));
}


x86 assembly (clang, -O0):
<isContigOrTandem>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x43,%ecx
mov    %al,-0x2(%rbp)
je     1129 <isContigOrTandem+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x54,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isContigOrTandem>:
cmp    $0x43,%dil
sete   %al
cmp    $0x54,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isContigOrTandem(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 67
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 84
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isContigOrTandem(i8 signext %0) {
%2 = icmp eq i8 %0, 67
%3 = icmp eq i8 %0, 84
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xe8() {
  Assert_real((isdigit(232) == 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_isdigit.c",
              1165, ("isdigit should be 0 for 0xe8"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0xe8>:
push   %rax
mov    $0xe8,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x48d,%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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xe8\00"
define void @t_isdigit_0xe8() {
%1 = call i64 @isdigit(i32 232)
%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 1165, 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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xe8\00"
define void @t_isdigit_0xe8() {
%1 = tail call i64 @isdigit(i32 232)
%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 1165, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
double acos(double);
double intr_wrap_001(double p1) { return acos(p1); }


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

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

LLVM IR (-O0):
define double @intr_wrap_001(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @acos(double %3)
ret double %4
}

LLVM IR (-O2):
define double @intr_wrap_001(double %0) {
%2 = tail call double @acos(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
const char *get_compilation_date(void) {
  static char buffer[100] = {0x00};
  strcpy(buffer, "Mar 16 2022");
  strcat(buffer, " ");
  strcat(buffer, "04:00:37");
  return buffer;
}


x86 assembly (clang, -O0):
<get_compilation_date>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f15(%rip),%rdi
lea    0xece(%rip),%rsi
call   1030 <strcpy@plt>
lea    0x2f02(%rip),%rdi
lea    0xec7(%rip),%rsi
call   1040 <strcat@plt>
lea    0x2eef(%rip),%rdi
lea    0xeb6(%rip),%rsi
call   1040 <strcat@plt>
lea    0x2edc(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_compilation_date>:
push   %rbx
lea    0x2f18(%rip),%rbx
lea    0xed1(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xece(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
lea    0xec1(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@get_compilation_date.buffer = internal global [100 x i8] zeroinitializer
@.str = [12 x i8] c"Mar 16 2022\00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [9 x i8] c"04:00:37\00"
define i8* @get_compilation_date() {
%1 = call i32 @strcpy(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @get_compilation_date.buffer, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @strcat(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @get_compilation_date.buffer, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @strcat(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @get_compilation_date.buffer, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret i8* getelementptr inbounds ([100 x i8], [100 x i8]* @get_compilation_date.buffer, i64 0, i64 0)
}

LLVM IR (-O2):
@get_compilation_date.buffer = internal global [100 x i8] zeroinitializer
@.str = [12 x i8] c"Mar 16 2022\00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [9 x i8] c"04:00:37\00"
define i8* @get_compilation_date() {
%1 = tail call i32 @strcpy(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @get_compilation_date.buffer, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @strcat(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @get_compilation_date.buffer, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @strcat(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @get_compilation_date.buffer, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret i8* getelementptr inbounds ([100 x i8], [100 x i8]* @get_compilation_date.buffer, i64 0, i64 0)
}
/* Variables and functions */
char *strdup(char const *);
char *c_strdup(const char *arg0) { return strdup(arg0); }


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

x86 assembly (clang, -O2):
<c_strdup>:
jmp    1030 <strdup@plt>

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

LLVM IR (-O2):
define noalias i8* @c_strdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
ret i8* %2
}
void fd_at24c512c_initialize(void) {}


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

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

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

LLVM IR (-O2):
define void @fd_at24c512c_initialize() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __ESBMC_assume(int);
int main() {
  unsigned x;
  int i;
  int a[100];
  if (x < 100 && a[x]) {
    i++;
  }
  __ESBMC_assume(i < 100);
  if (i >= 0 && a[i]) {
    i++;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x8(%rbp)
jae    1146 <main+0x36>
mov    -0x8(%rbp),%eax
cmpl   $0x0,-0x1a0(%rbp,%rax,4)
je     1146 <main+0x36>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__ESBMC_assume@plt>
cmpl   $0x0,-0xc(%rbp)
jl     117c <main+0x6c>
movslq -0xc(%rbp),%rax
cmpl   $0x0,-0x1a0(%rbp,%rax,4)
je     117c <main+0x6c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1a0,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [100 x i32]
store i32 0, i32* %1
%5 = load i32, i32* %2
%6 = icmp ult i32 %5, 100
br i1 %6, label %7, label %16
7: ; preds = %0
%8 = load i32, i32* %2
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds [100 x i32], [100 x i32]* %4, i64 0, i64 %9
%11 = load i32, i32* %10
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %7
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %16
16: ; preds = %13, %7, %0
%17 = load i32, i32* %3
%18 = icmp slt i32 %17, 100
%19 = zext i1 %18 to i32
%20 = call i32 @__ESBMC_assume(i32 %19)
%21 = load i32, i32* %3
%22 = icmp sge i32 %21, 0
br i1 %22, label %23, label %32
23: ; preds = %16
%24 = load i32, i32* %3
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [100 x i32], [100 x i32]* %4, i64 0, i64 %25
%27 = load i32, i32* %26
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %32
29: ; preds = %23
%30 = load i32, i32* %3
%31 = add nsw i32 %30, 1
store i32 %31, i32* %3
br label %32
32: ; preds = %29, %23, %16
%33 = load i32, i32* %1
ret i32 %33
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__ESBMC_assume(i32 0)
ret i32 0
}
/* Variables and functions */
int *malloc(int);
int random_integer();
int *random_array(int len) {
  int *arr = malloc(len * sizeof(int));
  for (int i = 0; i < len; i++) {
    arr[i] = random_integer();
  }
  return arr;
}


x86 assembly (clang, -O0):
<random_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1173 <random_array+0x53>
mov    $0x0,%al
call   1040 <random_integer@plt>
mov    %eax,%edx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1145 <random_array+0x25>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_array>:
push   %r15
push   %r14
push   %rbx
mov    %edi,%r14d
lea    0x0(,%r14,4),%edi
call   1030 <malloc@plt>
mov    %rax,%r15
test   %r14d,%r14d
jle    1164 <random_array+0x44>
mov    %r14d,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <random_integer@plt>
mov    %eax,(%r15,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1150 <random_array+0x30>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32* @random_array(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = mul i64 %6, 4
%8 = trunc i64 %7 to i32
%9 = call i32* @malloc(i32 %8)
store i32* %9, i32** %3
store i32 0, i32* %4
br label %10
10: ; preds = %20, %1
%11 = load i32, i32* %4
%12 = load i32, i32* %2
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %23
14: ; preds = %10
%15 = call i32 (...) @random_integer()
%16 = load i32*, i32** %3
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %16, i64 %18
store i32 %15, i32* %19
br label %20
20: ; preds = %14
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
br label %10
23: ; preds = %10
%24 = load i32*, i32** %3
ret i32* %24
}

LLVM IR (-O2):
define noalias i32* @random_array(i32 %0) {
%2 = shl i32 %0, 2
%3 = tail call i32* @malloc(i32 %2)
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = zext i32 %0 to i64
br label %8
7: ; preds = %8, %1
ret i32* %3
8: ; preds = %5, %8
%9 = phi i64 [ 0, %5 ], [ %12, %8 ]
%10 = tail call i32 (...) @random_integer()
%11 = getelementptr inbounds i32, i32* %3, i64 %9
store i32 %10, i32* %11
%12 = add nuw nsw i64 %9, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %7, label %8
}
/* Variables and functions */
int /*<<< orphan*/ sbump___0(int /*<<< orphan*/);
foo() { sbump___0(0); }


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

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

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

LLVM IR (-O2):
define i32 @foo() {
%1 = tail call i32 @sbump___0(i32 0)
ret i32 undef
}
/* Variables and functions */
int merge_N_uncompressFst(void *, unsigned int *, unsigned int, unsigned int *,
                          unsigned int **);
int mergeN(void *ail, unsigned int *ids, unsigned int nids, unsigned int *noccs,
           unsigned int **occs) {
  return merge_N_uncompressFst(ail, ids, nids, noccs, occs);
}


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

x86 assembly (clang, -O2):
<mergeN>:
jmp    1030 <merge_N_uncompressFst@plt>

LLVM IR (-O0):
define i32 @mergeN(i8* %0, i32* %1, i32 %2, i32* %3, i32** %4) {
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32**
store i8* %0, i8** %6
store i32* %1, i32** %7
store i32 %2, i32* %8
store i32* %3, i32** %9
store i32** %4, i32*** %10
%11 = load i8*, i8** %6
%12 = load i32*, i32** %7
%13 = load i32, i32* %8
%14 = load i32*, i32** %9
%15 = load i32**, i32*** %10
%16 = call i32 @merge_N_uncompressFst(i8* %11, i32* %12, i32 %13, i32* %14, i32** %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @mergeN(i8* %0, i32* %1, i32 %2, i32* %3, i32** %4) {
%6 = tail call i32 @merge_N_uncompressFst(i8* %0, i32* %1, i32 %2, i32* %3, i32** %4)
ret i32 %6
}
char get_highfreq_letter(char *p_str) { return 0; }


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

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

LLVM IR (-O0):
define signext i8 @get_highfreq_letter(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8 0
}

LLVM IR (-O2):
define signext i8 @get_highfreq_letter(i8* nocapture readnone %0) {
ret i8 0
}
/* Variables and functions */
int /*<<< orphan*/ anp_init();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ pause();
int /*<<< orphan*/ start_tests();
int main(int argc, char *argv[]) {
  anp_init();
  start_tests();
  pause();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <anp_init@plt>
mov    $0x0,%al
call   1030 <start_tests@plt>
mov    $0x0,%al
call   1050 <pause@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <anp_init@plt>
xor    %eax,%eax
call   1030 <start_tests@plt>
xor    %eax,%eax
call   1050 <pause@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @anp_init()
%7 = call i32 (...) @start_tests()
%8 = call i32 (...) @pause()
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @anp_init()
%4 = tail call i32 (...) @start_tests()
%5 = tail call i32 (...) @pause()
%6 = tail call i32 @exit(i32 0)
unreachable
}
int fun190() { return 190; }


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

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

LLVM IR (-O0):
define i32 @fun190() {
ret i32 190
}

LLVM IR (-O2):
define i32 @fun190() {
ret i32 190
}
void I2CGlobalWakeUpEnable(unsigned int baseAdd) {
  (*((volatile unsigned int *)(baseAdd + (0x10)))) |= (0x00000004u);
}


x86 assembly (clang, -O0):
<I2CGlobalWakeUpEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     $0x4,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CGlobalWakeUpEnable>:
add    $0x10,%edi
orl    $0x4,(%rdi)
ret

LLVM IR (-O0):
define void @I2CGlobalWakeUpEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 16
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = or i32 %7, 4
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @I2CGlobalWakeUpEnable(i32 %0) {
%2 = add i32 %0, 16
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = or i32 %5, 4
store volatile i32 %6, i32* %4
ret void
}
int execute_kexec_load() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_kexec_load() {
ret i32 0
}
/* Type definitions */
struct stat {
  long long st_size;
};

/* Variables and functions */
int /*<<< orphan*/ stat(char *, struct stat *);
long long fileSize(char *file) {
  struct stat buf;
  stat(file, &buf);
  return buf.st_size;
}


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

x86 assembly (clang, -O2):
<fileSize>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i64 }
define i64 @fileSize(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @stat(i8* %4, %struct.stat* %3)
%6 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%7 = load i64, i64* %6
ret i64 %7
}

LLVM IR (-O2):
%struct.stat = type { i64 }
define i64 @fileSize(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}
int smp_link_data_cmp_(void *link_data_, void *data_) {
  int *link_data = link_data_;
  int *data = data_;
  if (*link_data == *data)
    return (0);
  else
    return (-2);
}


x86 assembly (clang, -O0):
<smp_link_data_cmp_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jne    113a <smp_link_data_cmp_+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1141 <smp_link_data_cmp_+0x41>
movl   $0xfffffffe,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<smp_link_data_cmp_>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
sete   %cl
lea    (%rcx,%rcx,1),%eax
add    $0xfffffffe,%eax
ret

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

LLVM IR (-O2):
define i32 @smp_link_data_cmp_(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp eq i32 %5, %6
%8 = select i1 %7, i32 0, i32 -2
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ track_del(int);
int rawsock_close(int sock) {
  if (!sock)
    return 1;
  track_del(sock);
  close(sock);
  return 1;
}


x86 assembly (clang, -O0):
<rawsock_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1141 <rawsock_close+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1158 <rawsock_close+0x38>
mov    -0x8(%rbp),%edi
call   1030 <track_del@plt>
mov    -0x8(%rbp),%edi
call   1040 <close@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rawsock_close>:
test   %edi,%edi
je     1134 <rawsock_close+0x14>
push   %rbx
mov    %edi,%ebx
call   1030 <track_del@plt>
mov    %ebx,%edi
call   1040 <close@plt>
pop    %rbx
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @rawsock_close(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @track_del(i32 %0)
%5 = tail call i32 @close(i32 %0)
br label %6
6: ; preds = %1, %3
ret i32 1
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int type;
};
typedef TYPE_1__ XSelectionClearEvent;

/* Variables and functions */
void set_XSelectionClearEvent_type(void *_p, int _v) {
  ((XSelectionClearEvent *)_p)->type = (int)_v;
}


x86 assembly (clang, -O0):
<set_XSelectionClearEvent_type>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XSelectionClearEvent_type(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XSelectionClearEvent_type(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int syscon_clear_dobldobl_Laurent_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(557, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_clear_dobldobl_Laurent_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x22d,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_clear_dobldobl_Laurent_system>:
mov    $0x22d,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @syscon_clear_dobldobl_Laurent_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 557, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @syscon_clear_dobldobl_Laurent_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 557, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ removeChars(char *, char *);
int main() {
  char str[30] = "My name is Rathore";
  removeChars(str, "yaet");
  printf("%s", str);
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec9(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    0xec3(%rip),%ax
mov    %ax,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
lea    0xeb6(%rip),%rsi
call   1040 <removeChars@plt>
lea    -0x20(%rbp),%rsi
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movups 0xed2(%rip),%xmm0
movups %xmm0,0xe(%rsp)
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xecb(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <removeChars@plt>
lea    0xebe(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str = [30 x i8] c"My name is Rathore\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [5 x i8] c"yaet\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca [30 x i8]
%2 = bitcast [30 x i8]* %1 to i8*
%3 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%4 = call i32 @removeChars(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [30 x i8] c"My name is Rathore\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [5 x i8] c"yaet\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [30 x i8]
%2 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%3 = call i32 @removeChars(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ kprintf(char *, char const *, int, char const *);
void _z_failed(const char *file, int line, const char *func) {
  kprintf("%s:%d[%s]: kernel panic\r\n", file, line, func);
  while (1)
    ;
}


x86 assembly (clang, -O0):
<_z_failed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xecb(%rip),%rdi
call   1030 <kprintf@plt>
jmp    113a <_z_failed+0x2a>

x86 assembly (clang, -O2):
<_z_failed>:
push   %rax
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee0(%rip),%rdi
call   1030 <kprintf@plt>
cs nopw 0x0(%rax,%rax,1)
nop
jmp    1130 <_z_failed+0x20>

LLVM IR (-O0):
@.str = [26 x i8] c"%s:%d[%s]: kernel panic\0D\0A\00"
define void @_z_failed(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i32 @kprintf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8, i8* %9)
br label %11
11: ; preds = %3, %11
br label %11
}

LLVM IR (-O2):
@.str = [26 x i8] c"%s:%d[%s]: kernel panic\0D\0A\00"
define void @_z_failed(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @kprintf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %2)
br label %5
5: ; preds = %3, %5
br label %5
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
scalar_t__ difftime(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  time_t t1, t2;
  t1 = time(NULL);
  sleep(10);
  t2 = time(NULL);
  printf("%lf", (double)difftime(t2, t1));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x4(%rbp)
mov    $0xa,%edi
call   1060 <sleep@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1040 <difftime@plt>
cvtsi2sd %rax,%xmm0
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%ebx
mov    $0xa,%edi
call   1060 <sleep@plt>
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
mov    %ebx,%esi
call   1040 <difftime@plt>
cvtsi2sd %rax,%xmm0
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call i32 @sleep(i32 10)
%5 = call i32 @time(i32* null)
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = load i32, i32* %1
%8 = call i64 @difftime(i32 %6, i32 %7)
%9 = sitofp i64 %8 to double
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @sleep(i32 10)
%3 = tail call i32 @time(i32* null)
%4 = tail call i64 @difftime(i32 %3, i32 %1)
%5 = sitofp i64 %4 to double
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_matrix(void *m) {
  void **els = (void **)m;
  free(els[0]);
  free(m);
}


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

x86 assembly (clang, -O2):
<free_matrix>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_matrix(i8* %0) {
%2 = alloca i8*
%3 = alloca i8**
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i8**
store i8** %5, i8*** %3
%6 = load i8**, i8*** %3
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = call i32 @free(i8* %8)
%10 = load i8*, i8** %2
%11 = call i32 @free(i8* %10)
ret void
}

LLVM IR (-O2):
define void @free_matrix(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = tail call i32 @free(i8* %3)
%5 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ find_min_array(int *, int);
void main() {
  int a[] = {10, 12, 20, 30, 25, 40, 32, 31, 35, 50, 60};
  int len = sizeof(a) / sizeof(a[0]);
  find_min_array(a, len);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x2c,%edx
call   1030 <memcpy@plt>
movl   $0xb,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1040 <find_min_array@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movups 0xf01(%rip),%xmm0
movups %xmm0,0x1c(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xb,%esi
call   1030 <find_min_array@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [11 x i32] [i32 10, i32 12, i32 20, i32 30, i32 25, i32 40, i32 32, i32 31, i32 35, i32 50, i32 60]
define void @main() {
%1 = alloca [11 x i32]
%2 = alloca i32
%3 = bitcast [11 x i32]* %1 to i8*
store i32 11, i32* %2
%4 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @find_min_array(i32* %4, i32 %5)
ret void
}

LLVM IR (-O2):
@__const.main.a = [11 x i32] [i32 10, i32 12, i32 20, i32 30, i32 25, i32 40, i32 32, i32 31, i32 35, i32 50, i32 60]
define void @main() {
%1 = alloca [11 x i32]
%2 = bitcast [11 x i32]* %1 to i8*
%3 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 0
%4 = call i32 @find_min_array(i32* %3, i32 11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_aaaa();
int /*<<< orphan*/ test_add_by_ip();
int /*<<< orphan*/ test_add_by_mac();
int /*<<< orphan*/ test_read_both();
int /*<<< orphan*/ test_read_dhcpconfig();
int /*<<< orphan*/ test_read_userconfig();
int /*<<< orphan*/ test_write_userconfig();
int main(int argc, char **argv) {
  test_read_userconfig();
  test_read_dhcpconfig();
  test_read_both();
  test_aaaa();
  test_add_by_ip();
  test_add_by_mac();
  test_write_userconfig();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <test_read_userconfig@plt>
mov    $0x0,%al
call   1070 <test_read_dhcpconfig@plt>
mov    $0x0,%al
call   1080 <test_read_both@plt>
mov    $0x0,%al
call   1060 <test_aaaa@plt>
mov    $0x0,%al
call   1090 <test_add_by_ip@plt>
mov    $0x0,%al
call   1050 <test_add_by_mac@plt>
mov    $0x0,%al
call   1040 <test_write_userconfig@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_read_userconfig@plt>
xor    %eax,%eax
call   1070 <test_read_dhcpconfig@plt>
xor    %eax,%eax
call   1080 <test_read_both@plt>
xor    %eax,%eax
call   1060 <test_aaaa@plt>
xor    %eax,%eax
call   1090 <test_add_by_ip@plt>
xor    %eax,%eax
call   1050 <test_add_by_mac@plt>
xor    %eax,%eax
call   1040 <test_write_userconfig@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @test_read_userconfig()
%7 = call i32 (...) @test_read_dhcpconfig()
%8 = call i32 (...) @test_read_both()
%9 = call i32 (...) @test_aaaa()
%10 = call i32 (...) @test_add_by_ip()
%11 = call i32 (...) @test_add_by_mac()
%12 = call i32 (...) @test_write_userconfig()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_read_userconfig()
%4 = tail call i32 (...) @test_read_dhcpconfig()
%5 = tail call i32 (...) @test_read_both()
%6 = tail call i32 (...) @test_aaaa()
%7 = tail call i32 (...) @test_add_by_ip()
%8 = tail call i32 (...) @test_add_by_mac()
%9 = tail call i32 (...) @test_write_userconfig()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ merge(double *, int, int, int);
void mergesort(double *A, int p, int r) {
  int q;
  if (p < r) {
    q = (p + r) / 2;
    mergesort(A, p, q);
    mergesort(A, q + 1, r);
    merge(A, p, q, r);
  }
}


x86 assembly (clang, -O0):
<mergesort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1182 <mergesort+0x62>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <mergesort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <mergesort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <merge@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mergesort>:
cmp    %edx,%esi
jge    1172 <mergesort+0x52>
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r12d
mov    %rdi,%r15
lea    (%r14,%r12,1),%eax
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
mov    %ebx,%edx
call   1040 <mergesort@plt>
lea    0x1(%rbx),%esi
mov    %r15,%rdi
mov    %r14d,%edx
call   1040 <mergesort@plt>
mov    %r15,%rdi
mov    %r12d,%esi
mov    %ebx,%edx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <merge@plt>
ret

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

LLVM IR (-O2):
define void @mergesort(double* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %6, label %5
5: ; preds = %3, %6
ret void
6: ; preds = %3
%7 = add nsw i32 %2, %1
%8 = sdiv i32 %7, 2
tail call void @mergesort(double* %0, i32 %1, i32 %8)
%9 = add nsw i32 %8, 1
tail call void @mergesort(double* %0, i32 %9, i32 %2)
%10 = tail call i32 @merge(double* %0, i32 %1, i32 %8, i32 %2)
br label %5
}