xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int *searchRange(int *, int, int, int *);
int main(void) {
  int x[] = {5, 7, 7, 8, 8, 10};
  int i;
  int *res = searchRange(x, 1, 11, &i);
  printf("%d %d\n", res[0], res[1]);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x1,%esi
mov    $0xb,%edx
lea    -0x24(%rbp),%rcx
call   1040 <searchRange@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    (%rax),%esi
mov    -0x30(%rbp),%rax
mov    0x4(%rax),%edx
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xee5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rcx
mov    $0x1,%esi
mov    $0xb,%edx
call   1040 <searchRange@plt>
mov    (%rax),%esi
mov    0x4(%rax),%edx
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [6 x i32] [i32 5, i32 7, i32 7, i32 8, i32 8, i32 10]
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i32]
%3 = alloca i32
%4 = alloca i32*
store i32 0, i32* %1
%5 = bitcast [6 x i32]* %2 to i8*
%6 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%7 = call i32* @searchRange(i32* %6, i32 1, i32 11, i32* %3)
store i32* %7, i32** %4
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = load i32*, i32** %4
%12 = getelementptr inbounds i32, i32* %11, i64 1
%13 = load i32, i32* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %13)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [6 x i32] [i32 5, i32 7, i32 7, i32 8, i32 8, i32 10]
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca [6 x i32]
%2 = alloca i32
%3 = bitcast [6 x i32]* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%6 = call i32* @searchRange(i32* %5, i32 1, i32 11, i32* %2)
%7 = load i32, i32* %6
%8 = getelementptr inbounds i32, i32* %6, i64 1
%9 = load i32, i32* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ vx86_NBSB_Write8(int, unsigned char, unsigned char);
void sb_Write8(unsigned char offset, unsigned char val) {
  vx86_NBSB_Write8(2, offset, val);
}


x86 assembly (clang, -O0):
<sb_Write8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
mov    $0x2,%edi
movzbl %al,%esi
movzbl -0x2(%rbp),%edx
call   1030 <vx86_NBSB_Write8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sb_Write8>:
mov    %esi,%edx
mov    %edi,%esi
mov    $0x2,%edi
jmp    1030 <vx86_NBSB_Write8@plt>

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

LLVM IR (-O2):
define void @sb_Write8(i8 zeroext %0, i8 zeroext %1) {
%3 = tail call i32 @vx86_NBSB_Write8(i32 2, i8 zeroext %0, i8 zeroext %1)
ret void
}
/* Variables and functions */
char *strpbrk(char const *, char const *);
char *eager_strpbrk(const char *string, const char *separators) {
  char *tmp_ptr;
  char *ptr = NULL;
  for (tmp_ptr = strpbrk(string, separators); tmp_ptr;
       tmp_ptr = strpbrk(tmp_ptr, separators))
    ptr = tmp_ptr++;
  return ptr;
}


x86 assembly (clang, -O0):
<eager_strpbrk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strpbrk@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     116d <eager_strpbrk+0x5d>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strpbrk@plt>
mov    %rax,-0x18(%rbp)
jmp    1139 <eager_strpbrk+0x29>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eager_strpbrk>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1030 <strpbrk@plt>
test   %rax,%rax
je     1146 <eager_strpbrk+0x36>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rax,%rbx
lea    0x1(%rax),%rdi
mov    %r14,%rsi
call   1030 <strpbrk@plt>
test   %rax,%rax
jne    1130 <eager_strpbrk+0x20>
jmp    1148 <eager_strpbrk+0x38>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @eager_strpbrk(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strpbrk(i8* %0, i8* %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %10, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %8, %5 ], [ %3, %2 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = tail call i8* @strpbrk(i8* %7, i8* %1)
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %5
10: ; preds = %5, %2
%11 = phi i8* [ null, %2 ], [ %6, %5 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void handler(int signo __attribute__((unused))) {
  printf("Caught signal being tested!\n");
  printf("Test PASSED\n");
  exit(0);
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<handler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Caught signal being tested!\0A\00"
@.str.1 = [13 x i8] c"Test PASSED\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [28 x i8] c"Caught signal being tested!\00"
@str.2 = [12 x i8] c"Test PASSED\00"
define void @handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.2, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
int aq100x_set_speed_duplex(struct cphy *phy, int speed, int duplex) {
  return -1;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.cphy = type opaque
define i32 @aq100x_set_speed_duplex(%struct.cphy* %0, i32 %1, i32 %2) {
%4 = alloca %struct.cphy*
%5 = alloca i32
%6 = alloca i32
store %struct.cphy* %0, %struct.cphy** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 -1
}

LLVM IR (-O2):
%struct.cphy = type opaque
define i32 @aq100x_set_speed_duplex(%struct.cphy* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 -1
}
void tfree(p) void *const p;
{ free(p); }


x86 assembly (clang, -O0):
<tfree>:
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):
<tfree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @tfree(i8* nocapture %0) {
tail call void @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0xb7() {
  Assert_real((isgraph(183) == 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_isgraph.c",
              920, ("isgraph should be 0 for 0xb7"));
}


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

x86 assembly (clang, -O2):
<t_isgraph_0xb7>:
push   %rax
mov    $0xb7,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x398,%edx
pop    %rax
jmp    1030 <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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xb7\00"
define void @t_isgraph_0xb7() {
%1 = call i64 @isgraph(i32 183)
%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 920, 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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xb7\00"
define void @t_isgraph_0xb7() {
%1 = tail call i64 @isgraph(i32 183)
%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 920, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ from_init();
__attribute__((constructor)) void func_init(void) { from_init(); }


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

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

LLVM IR (-O0):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @func_init, i8* null }]
define void @func_init() {
%1 = call i32 (...) @from_init()
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @func_init, i8* null }]
define void @func_init() {
%1 = tail call i32 (...) @from_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mouse_wait(int);
int /*<<< orphan*/ outb(int, char);
void mouse_write(char a_write) {
  mouse_wait(1);
  outb(0x64, 0xD4);
  mouse_wait(1);
  outb(0x60, a_write);
}


x86 assembly (clang, -O0):
<mouse_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%edi
call   1030 <mouse_wait@plt>
mov    $0x64,%edi
mov    $0xffffffd4,%esi
call   1040 <outb@plt>
mov    $0x1,%edi
call   1030 <mouse_wait@plt>
mov    $0x60,%edi
movsbl -0x1(%rbp),%esi
call   1040 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mouse_write>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%edi
call   1030 <mouse_wait@plt>
mov    $0x64,%edi
mov    $0xffffffd4,%esi
call   1040 <outb@plt>
mov    $0x1,%edi
call   1030 <mouse_wait@plt>
mov    $0x60,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <outb@plt>

LLVM IR (-O0):
define void @mouse_write(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @mouse_wait(i32 1)
%4 = call i32 @outb(i32 100, i8 signext -44)
%5 = call i32 @mouse_wait(i32 1)
%6 = load i8, i8* %2
%7 = call i32 @outb(i32 96, i8 signext %6)
ret void
}

LLVM IR (-O2):
define void @mouse_write(i8 signext %0) {
%2 = tail call i32 @mouse_wait(i32 1)
%3 = tail call i32 @outb(i32 100, i8 signext -44)
%4 = tail call i32 @mouse_wait(i32 1)
%5 = tail call i32 @outb(i32 96, i8 signext %0)
ret void
}
/* Variables and functions */
scalar_t__ malloc(size_t);
char *trio_create(size_t size) { return (char *)malloc(size); }


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

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

LLVM IR (-O0):
define i8* @trio_create(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @trio_create(i64 %0) {
%2 = tail call i64 @malloc(i64 %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
unsigned char _BitScanForward(unsigned long *Index, unsigned long Mask) {
  *Index = __builtin_ctzl(Mask);
  return (Mask != 0);
}


x86 assembly (clang, -O0):
<_BitScanForward>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
bsf    %rax,%rax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_BitScanForward>:
bsf    %rsi,%rax
mov    %rax,(%rdi)
setne  %al
ret

LLVM IR (-O0):
define zeroext i8 @_BitScanForward(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = call i64 @llvm.cttz.i64(i64 %5, i1 true)
%7 = trunc i64 %6 to i32
%8 = sext i32 %7 to i64
%9 = load i64*, i64** %3
store i64 %8, i64* %9
%10 = load i64, i64* %4
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i32
%13 = trunc i32 %12 to i8
ret i8 %13
}

LLVM IR (-O2):
define zeroext i8 @_BitScanForward(i64* nocapture writeonly %0, i64 %1) {
%3 = tail call i64 @llvm.cttz.i64(i64 %1, i1 true)
store i64 %3, i64* %0
%4 = icmp ne i64 %1, 0
%5 = zext i1 %4 to i8
ret i8 %5
}
void glBufferData(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glBufferData() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emit(char *);
int /*<<< orphan*/ ret_timing(int);
void i_dbtr(void) {
  emit("add esi,byte 2\n");
  ret_timing(8);
}


x86 assembly (clang, -O0):
<i_dbtr>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <emit@plt>
mov    $0x8,%edi
call   1040 <ret_timing@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<i_dbtr>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <emit@plt>
mov    $0x8,%edi
pop    %rax
jmp    1040 <ret_timing@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"add esi,byte 2\0A\00"
define void @i_dbtr() {
%1 = call i32 @emit(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @ret_timing(i32 8)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"add esi,byte 2\0A\00"
define void @i_dbtr() {
%1 = tail call i32 @emit(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @ret_timing(i32 8)
ret void
}
/* Variables and functions */
int ARSTREAM_TCPSender_Main(int, char **);
int main(int argc, char *argv[]) { return ARSTREAM_TCPSender_Main(argc, argv); }


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <ARSTREAM_TCPSender_Main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <ARSTREAM_TCPSender_Main@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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @ARSTREAM_TCPSender_Main(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @ARSTREAM_TCPSender_Main(i32 %0, i8** %1)
ret i32 %3
}
void smash_singleq(char *str) {
  for (; *str != '\0'; str++) {
    if (*str == '\'')
      *str = '`';
    else if (*str == '"')
      *str = '`';
  }
  return;
}


x86 assembly (clang, -O0):
<smash_singleq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1166 <smash_singleq+0x66>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x27,%eax
jne    1134 <smash_singleq+0x34>
mov    -0x8(%rbp),%rax
movb   $0x60,(%rax)
jmp    1150 <smash_singleq+0x50>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
jne    114b <smash_singleq+0x4b>
mov    -0x8(%rbp),%rax
movb   $0x60,(%rax)
jmp    1150 <smash_singleq+0x50>
jmp    1155 <smash_singleq+0x55>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <smash_singleq+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<smash_singleq>:
jmp    1117 <smash_singleq+0x17>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x60,(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0x22,%al
je     1110 <smash_singleq+0x10>
cmp    $0x27,%al
je     1110 <smash_singleq+0x10>
test   %al,%al
jne    1113 <smash_singleq+0x13>
ret

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

LLVM IR (-O2):
define void @smash_singleq(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
switch i8 %4, label %6 [
i8 0, label %8
i8 39, label %5
i8 34, label %5
]
5: ; preds = %2, %2
store i8 96, i8* %3
br label %6
6: ; preds = %5, %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
8: ; preds = %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void cpu_to_le32s(uint32_t *p) {}


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

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

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

LLVM IR (-O2):
define void @cpu_to_le32s(i32* nocapture %0) {
ret void
}
/* Variables and functions */
bool SHAREMIND_MAP_KEY_EQUALS_voidptr(void *const k1, void *const k2) {
  return k1 == k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_MAP_KEY_EQUALS_voidptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_MAP_KEY_EQUALS_voidptr>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_MAP_KEY_EQUALS_voidptr(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 = icmp eq i8* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @SHAREMIND_MAP_KEY_EQUALS_voidptr(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
struct device_node *of_find_compatible_node(struct device_node *from,
                                            const char *type,
                                            const char *compat) {
  return ((void *)0);
}


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

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

LLVM IR (-O0):
%struct.device_node = type opaque
define %struct.device_node* @of_find_compatible_node(%struct.device_node* %0, i8* %1, i8* %2) {
%4 = alloca %struct.device_node*
%5 = alloca i8*
%6 = alloca i8*
store %struct.device_node* %0, %struct.device_node** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret %struct.device_node* null
}

LLVM IR (-O2):
%struct.device_node = type opaque
define noalias %struct.device_node* @of_find_compatible_node(%struct.device_node* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
ret %struct.device_node* null
}
void test_38_2(int *mem) { __atomic_fetch_nand(mem, 1, 4); }


x86 assembly (clang, -O0):
<test_38_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    %ecx,-0x18(%rbp)
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%esi
mov    %eax,%edx
and    %esi,%edx
mov    %edx,-0x28(%rbp)
not    %edx
lock cmpxchg %edx,(%rcx)
sete   %cl
mov    %eax,-0x24(%rbp)
test   $0x1,%cl
mov    %eax,-0x14(%rbp)
jne    1150 <test_38_2+0x50>
jmp    1122 <test_38_2+0x22>
mov    -0x24(%rbp),%eax
mov    %eax,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_38_2>:
mov    (%rdi),%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
not    %ecx
or     $0xfffffffe,%ecx
lock cmpxchg %ecx,(%rdi)
jne    1110 <test_38_2+0x10>
ret

LLVM IR (-O0):
define void @test_38_2(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
store i32 1, i32* %3
%6 = load i32, i32* %3
%7 = atomicrmw nand i32* %5, i32 %6 acq_rel
store i32 %7, i32* %4
%8 = load i32, i32* %4
ret void
}

LLVM IR (-O2):
define void @test_38_2(i32* nocapture %0) {
%2 = atomicrmw nand i32* %0, i32 1 acq_rel
ret void
}
/* Variables and functions */
int ipv6_addr_split(char *, char, int);
int ipv6_addr_split_prefix(char *addr_str) {
  return ipv6_addr_split(addr_str, '/', 128);
}


x86 assembly (clang, -O0):
<ipv6_addr_split_prefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
mov    $0x80,%edx
call   1030 <ipv6_addr_split@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipv6_addr_split_prefix>:
mov    $0x2f,%esi
mov    $0x80,%edx
jmp    1030 <ipv6_addr_split@plt>

LLVM IR (-O0):
define i32 @ipv6_addr_split_prefix(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @ipv6_addr_split(i8* %3, i8 signext 47, i32 128)
ret i32 %4
}

LLVM IR (-O2):
define i32 @ipv6_addr_split_prefix(i8* %0) {
%2 = tail call i32 @ipv6_addr_split(i8* %0, i8 signext 47, i32 128)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ mdaq_pwm_stop(int);
void mdaq_pwm_ZVSFB_stop(void) {
  mdaq_pwm_stop(0);
  mdaq_pwm_stop(1);
  mdaq_pwm_stop(2);
  mdaq_pwm_stop(3);
}


x86 assembly (clang, -O0):
<mdaq_pwm_ZVSFB_stop>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <mdaq_pwm_stop@plt>
mov    $0x1,%edi
call   1030 <mdaq_pwm_stop@plt>
mov    $0x2,%edi
call   1030 <mdaq_pwm_stop@plt>
mov    $0x3,%edi
call   1030 <mdaq_pwm_stop@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mdaq_pwm_ZVSFB_stop>:
push   %rax
xor    %edi,%edi
call   1030 <mdaq_pwm_stop@plt>
mov    $0x1,%edi
call   1030 <mdaq_pwm_stop@plt>
mov    $0x2,%edi
call   1030 <mdaq_pwm_stop@plt>
mov    $0x3,%edi
pop    %rax
jmp    1030 <mdaq_pwm_stop@plt>

LLVM IR (-O0):
define void @mdaq_pwm_ZVSFB_stop() {
%1 = call i32 @mdaq_pwm_stop(i32 0)
%2 = call i32 @mdaq_pwm_stop(i32 1)
%3 = call i32 @mdaq_pwm_stop(i32 2)
%4 = call i32 @mdaq_pwm_stop(i32 3)
ret void
}

LLVM IR (-O2):
define void @mdaq_pwm_ZVSFB_stop() {
%1 = tail call i32 @mdaq_pwm_stop(i32 0)
%2 = tail call i32 @mdaq_pwm_stop(i32 1)
%3 = tail call i32 @mdaq_pwm_stop(i32 2)
%4 = tail call i32 @mdaq_pwm_stop(i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void display_usage() {
  printf("digitalWrite --pin <pin> --value <value>\n");
  printf("\t<pin>\te.g. P8_45\n");
  printf("\t<value>\t0 = LOW, 1 = HIGH\n");
  printf("\n");
}


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

x86 assembly (clang, -O2):
<display_usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
lea    0xef5(%rip),%rdi
call   1040 <puts@plt>
lea    0xefb(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"digitalWrite --pin <pin> --value <value>\0A\00"
@.str.1 = [19 x i8] c"\09<pin>\09e.g. P8_45\0A\00"
@.str.2 = [28 x i8] c"\09<value>\090 = LOW, 1 = HIGH\0A\00"
@.str.3 = [2 x i8] c"\0A\00"
define void @display_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [41 x i8] c"digitalWrite --pin <pin> --value <value>\00"
@str.4 = [18 x i8] c"\09<pin>\09e.g. P8_45\00"
@str.5 = [27 x i8] c"\09<value>\090 = LOW, 1 = HIGH\00"
define void @display_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @putchar(i32 10)
ret void
}
int omp_get_num_threads() { return 1; }


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

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

LLVM IR (-O0):
define i32 @omp_get_num_threads() {
ret i32 1
}

LLVM IR (-O2):
define i32 @omp_get_num_threads() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ _sys_call(int, int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
void setScreensaver(int seconds) {
  _sys_call(0x20, seconds, 0, 0);
  printf("Screensaver timeout set to %d seconds\n", seconds);
}


x86 assembly (clang, -O0):
<setScreensaver>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x20,%edi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1040 <_sys_call@plt>
mov    -0x4(%rbp),%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setScreensaver>:
push   %rbx
mov    %edi,%ebx
mov    $0x20,%edi
mov    %ebx,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1040 <_sys_call@plt>
lea    0xec6(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"Screensaver timeout set to %d seconds\0A\00"
define void @setScreensaver(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_sys_call(i32 32, i32 %3, i32 0, i32 0)
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"Screensaver timeout set to %d seconds\0A\00"
define void @setScreensaver(i32 %0) {
%2 = tail call i32 @_sys_call(i32 32, i32 %0, i32 0, i32 0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int MemFree(void *mem_addr) {}


x86 assembly (clang, -O0):
<MemFree>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @MemFree(i8* nocapture readnone %0) {
ret i32 undef
}
void gtk_icon_info_get_attach_points() {}


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

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

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

LLVM IR (-O2):
define void @gtk_icon_info_get_attach_points() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0xb1() {
  Assert_real((isgraph(177) == 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_isgraph.c",
              890, ("isgraph should be 0 for 0xb1"));
}


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

x86 assembly (clang, -O2):
<t_isgraph_0xb1>:
push   %rax
mov    $0xb1,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x37a,%edx
pop    %rax
jmp    1030 <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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xb1\00"
define void @t_isgraph_0xb1() {
%1 = call i64 @isgraph(i32 177)
%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 890, 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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xb1\00"
define void @t_isgraph_0xb1() {
%1 = tail call i64 @isgraph(i32 177)
%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 890, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ q_isalpha(int);
scalar_t__ q_isdigit(int);
int q_isalnum(int c) { return (q_isalpha(c) || q_isdigit(c)); }


x86 assembly (clang, -O0):
<q_isalnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <q_isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1157 <q_isalnum+0x37>
mov    -0x4(%rbp),%edi
call   1030 <q_isdigit@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<q_isalnum>:
push   %rbx
mov    %edi,%ebx
call   1040 <q_isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <q_isalnum+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <q_isdigit@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @q_isalnum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @q_isalpha(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @q_isdigit(i32 %7)
%9 = icmp ne i64 %8, 0
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 @q_isalnum(i32 %0) {
%2 = tail call i64 @q_isalpha(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @q_isdigit(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ printf(char *);
void check(char *buf) {
  unsigned int i;
  char *ptr;
  if (!(ptr = malloc(12)))
    return;
  for (i = 0; i < 8; i++)
    ptr[i] = buf[i];
  ptr[i] = '\0';
  printf(ptr);
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xc,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1149 <check+0x29>
jmp    1190 <check+0x70>
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jae    117c <check+0x5c>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    (%rax,%rcx,1),%dl
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1150 <check+0x30>
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp),%ecx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
push   %rbx
mov    %rdi,%rbx
mov    $0xc,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1146 <check+0x26>
mov    (%rbx),%rcx
mov    %rcx,(%rax)
movb   $0x0,0x8(%rax)
mov    %rax,%rdi
pop    %rbx
jmp    1030 <printf@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @check(i8* nocapture %0) {
%2 = tail call dereferenceable_or_null(12) i8* @malloc(i32 12)
%3 = icmp eq i8* %2, null
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = bitcast i8* %0 to i64*
%6 = bitcast i8* %2 to i64*
%7 = load i64, i64* %5
store i64 %7, i64* %6
%8 = getelementptr inbounds i8, i8* %2, i64 8
store i8 0, i8* %8
%9 = tail call i32 @printf(i8* %2)
br label %10
10: ; preds = %1, %4
ret void
}
int __gnat_tty_supported(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @__gnat_tty_supported() {
ret i32 1
}

LLVM IR (-O2):
define i32 @__gnat_tty_supported() {
ret i32 1
}
char *cacher_mot(char *mot_bis, int taille_mot) {
  for (int i = 0; i < taille_mot; i++) {
    *(mot_bis + i) = '\xB8';
  }
  *(mot_bis + taille_mot) = '\0';
  return mot_bis;
}


x86 assembly (clang, -O0):
<cacher_mot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1138 <cacher_mot+0x38>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0xb8,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <cacher_mot+0x12>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cacher_mot>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
test   %esi,%esi
jle    112b <cacher_mot+0x1b>
mov    %ebp,%edx
mov    %rbx,%rdi
mov    $0xb8,%esi
call   1030 <memset@plt>
movslq %ebp,%rax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @cacher_mot(i8* returned writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 0, i8* %8
ret i8* %0
}
double min(double a, double b) {
  double res;
  if (a < b)
    res = a;
  else
    res = b;
  return res;
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <min+0x31>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    113b <min+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
minsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @min(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fcmp olt double %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %3
store double %10, double* %5
br label %13
11: ; preds = %2
%12 = load double, double* %4
store double %12, double* %5
br label %13
13: ; preds = %11, %9
%14 = load double, double* %5
ret double %14
}

LLVM IR (-O2):
define double @min(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
int parallel_clauses(void) {
  int a, b[100];
#pragma acc parallel firstprivate(a, b)
  ;
  return 0;
}


x86 assembly (clang, -O0):
<parallel_clauses>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
xor    %eax,%eax
add    $0x120,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @parallel_clauses() {
%1 = alloca i32
%2 = alloca [100 x i32]
ret i32 0
}

LLVM IR (-O2):
define i32 @parallel_clauses() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t bswap_le32(uint32_t v) { return v; }


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

x86 assembly (clang, -O2):
<bswap_le32>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @bswap_le32(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void usage(char *prog) {
  printf("Usage: %s\n			--tty, -t	tty device to "
         "use\n			--number, -n	port selector\n		"
         "	--power, -p	enable power\n			--usb, "
         "-u	enable usb\n			--debug, -d	Enables "
         "debugging messages\n			--help, -h	this "
         "help\n			\n		Several port numbers "
         "can be set simultaneously e.g.:\n		%s -n0 -n1 -n2 -n3 "
         "-pu\n		The above will turn on all power and usb ports\n",
         prog, prog);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
mov    %rdx,%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [323 x i8] c"Usage: %s\0A\09\09\09--tty, -t\09tty device to use\0A\09\09\09--number, -n\09port selector\0A\09\09\09--power, -p\09enable power\0A\09\09\09--usb, -u\09enable usb\0A\09\09\09--debug, -d\09Enables debugging messages\0A\09\09\09--help, -h\09this help\0A\09\09\09\0A\09\09Several port numbers can be set simultaneously e.g.:\0A\09\09%s -n0 -n1 -n2 -n3 -pu\0A\09\09The above will turn on all power and usb ports\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([323 x i8], [323 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [323 x i8] c"Usage: %s\0A\09\09\09--tty, -t\09tty device to use\0A\09\09\09--number, -n\09port selector\0A\09\09\09--power, -p\09enable power\0A\09\09\09--usb, -u\09enable usb\0A\09\09\09--debug, -d\09Enables debugging messages\0A\09\09\09--help, -h\09this help\0A\09\09\09\0A\09\09Several port numbers can be set simultaneously e.g.:\0A\09\09%s -n0 -n1 -n2 -n3 -pu\0A\09\09The above will turn on all power and usb ports\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([323 x i8], [323 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int test_1dim();
int test_2dim();
int main() {
  bool flag1 = test_1dim();
  bool flag2 = test_2dim();
  if (flag1 && flag2) {
    printf("PASS\n");
    return 0;
  } else {
    printf("ERROR\n");
    return 1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <test_1dim@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <test_2dim@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     117f <main+0x4f>
cmpl   $0x0,-0xc(%rbp)
je     117f <main+0x4f>
lea    0xe92(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1192 <main+0x62>
lea    0xe80(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <test_1dim@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <test_2dim@plt>
test   %ebx,%ebx
setne  %cl
test   %eax,%eax
setne  %al
and    %cl,%al
lea    0xeb2(%rip),%rcx
lea    0xea5(%rip),%rdi
cmovne %rcx,%rdi
xor    $0x1,%al
movzbl %al,%ebx
call   1040 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@str = [6 x i8] c"ERROR\00"
@str.2 = [5 x i8] c"PASS\00"
define i32 @main() {
%1 = tail call i32 (...) @test_1dim()
%2 = tail call i32 (...) @test_2dim()
%3 = icmp ne i32 %1, 0
%4 = icmp ne i32 %2, 0
%5 = select i1 %3, i1 %4, i1 false
%6 = select i1 %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0)
%7 = xor i1 %5, true
%8 = zext i1 %7 to i32
%9 = tail call i32 @puts(i8* dereferenceable(1) %6)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ create_drive_direct(int, int);
void create_spin(int velocity) { create_drive_direct(velocity, -1 * velocity); }


x86 assembly (clang, -O0):
<create_spin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
imul   $0xffffffff,-0x4(%rbp),%esi
call   1030 <create_drive_direct@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_spin>:
mov    %edi,%esi
neg    %esi
jmp    1030 <create_drive_direct@plt>

LLVM IR (-O0):
define void @create_spin(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 -1, %4
%6 = call i32 @create_drive_direct(i32 %3, i32 %5)
ret void
}

LLVM IR (-O2):
define void @create_spin(i32 %0) {
%2 = sub nsw i32 0, %0
%3 = tail call i32 @create_drive_direct(i32 %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ShowTraps();
int /*<<< orphan*/ n32016_ShowRegs(int);
void Dump(void) {
  n32016_ShowRegs(0xFF);
  ShowTraps();
  ;
}


x86 assembly (clang, -O0):
<Dump>:
push   %rbp
mov    %rsp,%rbp
mov    $0xff,%edi
call   1040 <n32016_ShowRegs@plt>
mov    $0x0,%al
call   1030 <ShowTraps@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Dump>:
push   %rax
mov    $0xff,%edi
call   1040 <n32016_ShowRegs@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <ShowTraps@plt>

LLVM IR (-O0):
define void @Dump() {
%1 = call i32 @n32016_ShowRegs(i32 255)
%2 = call i32 (...) @ShowTraps()
ret void
}

LLVM IR (-O2):
define void @Dump() {
%1 = tail call i32 @n32016_ShowRegs(i32 255)
%2 = tail call i32 (...) @ShowTraps()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void noFunc() { printf("Function name can't be found in ./lib/libfei.so!\n"); }


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

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

LLVM IR (-O0):
@.str = [50 x i8] c"Function name can't be found in ./lib/libfei.so!\0A\00"
define void @noFunc() {
%1 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [49 x i8] c"Function name can't be found in ./lib/libfei.so!\00"
define void @noFunc() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
ret void
}