xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ LOG_print(char *, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int);
void MEMORY_validate(char *ptr, int n) {
  if (!ptr) {
    LOG_print("Error: malloc( %d ).\n", n);
    printf("Error: malloc( %d ).\n", n);
    exit((1));
  }
}


x86 assembly (clang, -O0):
<MEMORY_validate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1172 <MEMORY_validate+0x42>
mov    -0xc(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1040 <LOG_print@plt>
mov    -0xc(%rbp),%esi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MEMORY_validate>:
test   %rdi,%rdi
je     1136 <MEMORY_validate+0x6>
ret
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
lea    0xebd(%rip),%r14
mov    %r14,%rdi
call   1040 <LOG_print@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Error: malloc( %d ).\0A\00"
define void @MEMORY_validate(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %13, label %7
7: ; preds = %2
%8 = load i32, i32* %4
%9 = call i32 @LOG_print(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Error: malloc( %d ).\0A\00"
define void @MEMORY_validate(i8* readnone %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = tail call i32 @LOG_print(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %1)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %1)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret void
}
/* Variables and functions */
double floor(double);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  double x = 1.1;
  double i = floor(x);
  (void)i;
  fprintf(stderr, "PASS\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xec2(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <floor@plt>
movsd  %xmm0,-0x20(%rbp)
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
lea    0xea6(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [6 x i8] c"PASS\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double 1.100000e+00, double* %6
%8 = load double, double* %6
%9 = call double @llvm.floor.f64(double %8)
store double %9, double* %7
%10 = load double, double* %7
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c"PASS\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int os_excall(int (*extfn)(void *), void *arg) { return ((*extfn)(arg)); }


x86 assembly (clang, -O0):
<os_excall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_excall>:
mov    %rdi,%rax
mov    %rsi,%rdi
jmp    *%rax

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

LLVM IR (-O2):
define i32 @os_excall(i32 (i8*)* nocapture %0, i8* %1) {
%3 = tail call i32 %0(i8* %1)
ret i32 %3
}
void XSetTile() {}


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

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

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

LLVM IR (-O2):
define void @XSetTile() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_139() {
  Assert_real((isqrt(139) == 11),
              "/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/stdlib/isqrt.c",
              700, ("Integer square root of 139 should be 11"));
}


x86 assembly (clang, -O0):
<t_sqrt_139>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8b,%edi
call   1030 <isqrt@plt>
cmp    $0xb,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x2bc,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_139>:
push   %rax
mov    $0x8b,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xb,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x2bc,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 139 should be 11\00"
define void @t_sqrt_139() {
%1 = call i32 @isqrt(i32 139)
%2 = icmp eq i32 %1, 11
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 700, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 139 should be 11\00"
define void @t_sqrt_139() {
%1 = tail call i32 @isqrt(i32 139)
%2 = icmp eq i32 %1, 11
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 700, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void av_image_copy_to_buffer() {}


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

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

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

LLVM IR (-O2):
define void @av_image_copy_to_buffer() {
ret void
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
struct list_head *list_last(struct list_head const *);
struct list_head *list_prev(const struct list_head *node) {
  return list_last(node);
}


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

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

LLVM IR (-O0):
%struct.list_head = type { i32 }
define %struct.list_head* @list_prev(%struct.list_head* %0) {
%2 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %2
%3 = load %struct.list_head*, %struct.list_head** %2
%4 = call %struct.list_head* @list_last(%struct.list_head* %3)
ret %struct.list_head* %4
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define %struct.list_head* @list_prev(%struct.list_head* %0) {
%2 = tail call %struct.list_head* @list_last(%struct.list_head* %0)
ret %struct.list_head* %2
}
/* Variables and functions */
int /*<<< orphan*/ s(int, int);
void H(int e) { s(184, e); }


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

x86 assembly (clang, -O2):
<H>:
mov    %edi,%esi
mov    $0xb8,%edi
jmp    1030 <s@plt>

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

LLVM IR (-O2):
define void @H(i32 %0) {
%2 = tail call i32 @s(i32 184, i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *read_nonseekable_stream(int /*<<< orphan*/ *, size_t *);
char **text_to_lines(char *const, size_t, int *);
char **read_stream_lines(FILE *f, int *nlines) {
  size_t text_len;
  char *const text = read_nonseekable_stream(f, &text_len);
  return (text == NULL) ? NULL : text_to_lines(text, text_len, nlines);
}


x86 assembly (clang, -O0):
<read_stream_lines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <read_nonseekable_stream@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1157 <read_stream_lines+0x37>
xor    %eax,%eax
mov    %rax,-0x28(%rbp)
jmp    116c <read_stream_lines+0x4c>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <text_to_lines@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_stream_lines>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0x8(%rsp),%rsi
call   1030 <read_nonseekable_stream@plt>
test   %rax,%rax
je     1149 <read_stream_lines+0x29>
mov    0x8(%rsp),%rsi
mov    %rax,%rdi
mov    %rbx,%rdx
call   1040 <text_to_lines@plt>
jmp    114b <read_stream_lines+0x2b>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i8** @read_stream_lines(i32* %0, i32* %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = call i8* @read_nonseekable_stream(i32* %0, i64* %3)
%6 = icmp eq i8* %5, null
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i64, i64* %3
%9 = call i8** @text_to_lines(i8* %5, i64 %8, i32* %1)
br label %10
10: ; preds = %2, %7
%11 = phi i8** [ %9, %7 ], [ null, %2 ]
ret i8** %11
}
void CDC_BulkIn(void) {}


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

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

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

LLVM IR (-O2):
define void @CDC_BulkIn() {
ret void
}
int test_imm_59uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x59 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_59uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 382252089344
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void handler(int signo) { printf("You can't kill me!\n"); }


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"You can't kill me!\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [19 x i8] c"You can't kill me!\00"
define void @handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void quit(int _) {
  printf("exit\n");
  exit(0);
}


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"exit\0A\00"
define void @quit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [5 x i8] c"exit\00"
define void @quit(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ display;
};
typedef TYPE_1__ XButtonReleasedEvent;

/* Variables and functions */
void *get_XButtonReleasedEvent_display(void *_p) {
  return (void *)((XButtonReleasedEvent *)_p)->display;
}


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

x86 assembly (clang, -O2):
<get_XButtonReleasedEvent_display>:
mov    (%rdi),%rax
ret

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

LLVM IR (-O2):
define i8* @get_XButtonReleasedEvent_display(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ link_error();
void f2(unsigned short s) {
  if ((unsigned char)s == 0)
    return;
  if (s == 0)
    link_error();
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%ax
movzbl %al,%eax
cmp    $0x0,%eax
jne    1134 <f2+0x24>
jmp    1148 <f2+0x38>
movzwl -0x2(%rbp),%eax
cmp    $0x0,%eax
jne    1148 <f2+0x38>
mov    $0x0,%al
call   1030 <link_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f2(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = trunc i16 %3 to i8
%5 = zext i8 %4 to i32
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
br label %14
8: ; preds = %1
%9 = load i16, i16* %2
%10 = zext i16 %9 to i32
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 (...) @link_error()
br label %14
14: ; preds = %7, %12, %8
ret void
}

LLVM IR (-O2):
define void @f2(i16 zeroext %0) {
ret void
}
/* Variables and functions */
int INT_MAX;
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("%d\n", INT_MAX);
  for (int i = 0; i < INT_MAX; i++)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%esi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2ea3(%rip),%rcx
cmp    (%rcx),%eax
jge    1160 <main+0x50>
jmp    1152 <main+0x42>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113b <main+0x2b>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@INT_MAX = global i32 0
define i32 @main() {
%1 = load i32, i32* @INT_MAX
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int cairo_code_draw_casCellLabel_get_width() { return 28; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_casCellLabel_get_width() {
ret i32 28
}

LLVM IR (-O2):
define i32 @cairo_code_draw_casCellLabel_get_width() {
ret i32 28
}
/* Variables and functions */
double sqrt(double);
double normVect(double *x) {
  return (sqrt(x[0] * x[0] + x[1] * x[1] + x[2] * x[2]));
}


x86 assembly (clang, -O0):
<normVect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<normVect>:
movsd  (%rdi),%xmm1
movsd  0x8(%rdi),%xmm0
mulsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1141 <normVect+0x31>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @normVect(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 1
%11 = load double, double* %10
%12 = load double*, double** %2
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = fmul double %11, %14
%16 = call double @llvm.fmuladd.f64(double %5, double %8, double %15)
%17 = load double*, double** %2
%18 = getelementptr inbounds double, double* %17, i64 2
%19 = load double, double* %18
%20 = load double*, double** %2
%21 = getelementptr inbounds double, double* %20, i64 2
%22 = load double, double* %21
%23 = call double @llvm.fmuladd.f64(double %19, double %22, double %16)
%24 = call double @sqrt(double %23)
ret double %24
}

LLVM IR (-O2):
define double @normVect(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = fmul double %4, %4
%6 = tail call double @llvm.fmuladd.f64(double %2, double %2, double %5)
%7 = getelementptr inbounds double, double* %0, i64 2
%8 = load double, double* %7
%9 = tail call double @llvm.fmuladd.f64(double %8, double %8, double %6)
%10 = tail call double @sqrt(double %9)
ret double %10
}
void dumb() {}


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

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

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

LLVM IR (-O2):
define void @dumb() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGABRT;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ raise(int /*<<< orphan*/);
void sigusr2_handler(int signo) {
  printf("Child process handles sigusr2.\n");
  raise(SIGABRT);
}


x86 assembly (clang, -O0):
<sigusr2_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1040 <printf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigusr2_handler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1030 <raise@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Child process handles sigusr2.\0A\00"
@SIGABRT = global i32 0
define void @sigusr2_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @SIGABRT
%5 = call i32 @raise(i32 %4)
ret void
}

LLVM IR (-O2):
@SIGABRT = global i32 0
@str = [31 x i8] c"Child process handles sigusr2.\00"
define void @sigusr2_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* @SIGABRT
%4 = tail call i32 @raise(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __p3dfft_MOD_p3dfft_ftran_r2c(double *, double *);
void p3dfft_ftran_r2c(double *A, double *B) {
  __p3dfft_MOD_p3dfft_ftran_r2c(A, B);
}


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

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

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

LLVM IR (-O2):
define void @p3dfft_ftran_r2c(double* %0, double* %1) {
%3 = tail call i32 @__p3dfft_MOD_p3dfft_ftran_r2c(double* %0, double* %1)
ret void
}
unsigned getval_226() { return 3225997705U; }


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

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

LLVM IR (-O0):
define i32 @getval_226() {
ret i32 -1068969591
}

LLVM IR (-O2):
define i32 @getval_226() {
ret i32 -1068969591
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  bool keep_going = true;
  while (keep_going) {
    printf("keep going for ever\n");
    keep_going = false;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1148 <main+0x38>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"keep going for ever\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %3
8: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@str = [20 x i8] c"keep going for ever\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int pathconN_nm10_n_out(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @pathconN_nm10_n_out() {
ret i32 2
}

LLVM IR (-O2):
define i32 @pathconN_nm10_n_out() {
ret i32 2
}
/* Variables and functions */
double abs(double);
double UC_11_5_5(double M_2_v_s_d, double M_2_v_sym_u_d) {
  return (abs(M_2_v_s_d) / M_2_v_sym_u_d);
}


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

x86 assembly (clang, -O2):
<UC_11_5_5>:
push   %rax
movsd  %xmm1,(%rsp)
call   1030 <abs@plt>
divsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @UC_11_5_5(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = call double @abs(double %5)
%7 = load double, double* %4
%8 = fdiv double %6, %7
ret double %8
}

LLVM IR (-O2):
define double @UC_11_5_5(double %0, double %1) {
%3 = tail call double @abs(double %0)
%4 = fdiv double %3, %1
ret double %4
}
/* Variables and functions */
size_t BITMAP_N_LONGS(size_t);
size_t bitmap_n_longs(size_t n_bits) { return BITMAP_N_LONGS(n_bits); }


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

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

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

LLVM IR (-O2):
define i64 @bitmap_n_longs(i64 %0) {
%2 = tail call i64 @BITMAP_N_LONGS(i64 %0)
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int syscall(int, int, int /*<<< orphan*/);
int fchmod(int fd, mode_t mode) { return syscall(94, fd, mode); }


x86 assembly (clang, -O0):
<fchmod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    $0x5e,%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fchmod>:
mov    %esi,%edx
mov    %edi,%esi
mov    $0x5e,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @fchmod(i32 %0, i32 %1) {
%3 = tail call i32 @syscall(i32 94, i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
struct xdg_surface {
  int dummy;
};
struct wl_proxy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_destroy(struct wl_proxy *);
int /*<<< orphan*/ wl_proxy_marshal(struct wl_proxy *, int /*<<< orphan*/);
void xdg_surface_destroy(struct xdg_surface *xdg_surface) {
  wl_proxy_marshal((struct wl_proxy *)xdg_surface, 0);
  wl_proxy_destroy((struct wl_proxy *)xdg_surface);
}


x86 assembly (clang, -O0):
<xdg_surface_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1040 <wl_proxy_marshal@plt>
mov    -0x8(%rbp),%rdi
call   1030 <wl_proxy_destroy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdg_surface_destroy>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
call   1040 <wl_proxy_marshal@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <wl_proxy_destroy@plt>

LLVM IR (-O0):
%struct.xdg_surface = type { i32 }
%struct.wl_proxy = type { i32 }
define void @xdg_surface_destroy(%struct.xdg_surface* %0) {
%2 = alloca %struct.xdg_surface*
store %struct.xdg_surface* %0, %struct.xdg_surface** %2
%3 = load %struct.xdg_surface*, %struct.xdg_surface** %2
%4 = bitcast %struct.xdg_surface* %3 to %struct.wl_proxy*
%5 = call i32 @wl_proxy_marshal(%struct.wl_proxy* %4, i32 0)
%6 = load %struct.xdg_surface*, %struct.xdg_surface** %2
%7 = bitcast %struct.xdg_surface* %6 to %struct.wl_proxy*
%8 = call i32 @wl_proxy_destroy(%struct.wl_proxy* %7)
ret void
}

LLVM IR (-O2):
%struct.xdg_surface = type { i32 }
%struct.wl_proxy = type { i32 }
define void @xdg_surface_destroy(%struct.xdg_surface* %0) {
%2 = bitcast %struct.xdg_surface* %0 to %struct.wl_proxy*
%3 = tail call i32 @wl_proxy_marshal(%struct.wl_proxy* %2, i32 0)
%4 = tail call i32 @wl_proxy_destroy(%struct.wl_proxy* %2)
ret void
}
/* Type definitions */
struct libavl_allocator {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
void *malloc(size_t);
void *tavl_malloc(struct libavl_allocator *allocator, size_t size) {
  assert(allocator != NULL && size > 0);
  return malloc(size);
}


x86 assembly (clang, -O0):
<tavl_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     114b <tavl_malloc+0x2b>
cmpq   $0x0,-0x10(%rbp)
seta   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tavl_malloc>:
push   %rbx
mov    %rsi,%rbx
test   %rdi,%rdi
setne  %al
test   %rsi,%rsi
setne  %cl
and    %al,%cl
movzbl %cl,%edi
call   1030 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <malloc@plt>

LLVM IR (-O0):
%struct.libavl_allocator = type { i32 }
define i8* @tavl_malloc(%struct.libavl_allocator* %0, i64 %1) {
%3 = alloca %struct.libavl_allocator*
%4 = alloca i64
store %struct.libavl_allocator* %0, %struct.libavl_allocator** %3
store i64 %1, i64* %4
%5 = load %struct.libavl_allocator*, %struct.libavl_allocator** %3
%6 = icmp ne %struct.libavl_allocator* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i64, i64* %4
%9 = icmp ugt i64 %8, 0
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i64, i64* %4
%15 = call i8* @malloc(i64 %14)
ret i8* %15
}

LLVM IR (-O2):
%struct.libavl_allocator = type { i32 }
define noalias i8* @tavl_malloc(%struct.libavl_allocator* readnone %0, i64 %1) {
%3 = icmp ne %struct.libavl_allocator* %0, null
%4 = icmp ne i64 %1, 0
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = tail call i8* @malloc(i64 %1)
ret i8* %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
char *fgets_or_exit(char *buffer, int size, FILE *stream) {
  if (fgets(buffer, size, stream) == NULL) {
    fprintf(stdout, "Connexion interrompue\n");
    exit(1);
  }
  return buffer;
}


x86 assembly (clang, -O0):
<fgets_or_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <fgets@plt>
cmp    $0x0,%rax
jne    117c <fgets_or_exit+0x4c>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
lea    0xe93(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgets_or_exit>:
push   %rbx
mov    %rdi,%rbx
call   1030 <fgets@plt>
test   %rax,%rax
je     1143 <fgets_or_exit+0x13>
mov    %rbx,%rax
pop    %rbx
ret
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
lea    0xead(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [23 x i8] c"Connexion interrompue\0A\00"
define i8* @fgets_or_exit(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32*, i32** %6
%10 = call i32* @fgets(i8* %7, i32 %8, i32* %9)
%11 = icmp eq i32* %10, null
br i1 %11, label %12, label %16
12: ; preds = %3
%13 = load i32, i32* @stdout
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %3
%17 = load i8*, i8** %4
ret i8* %17
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [23 x i8] c"Connexion interrompue\0A\00"
define i8* @fgets_or_exit(i8* returned %0, i32 %1, i32* nocapture %2) {
%4 = tail call i32* @fgets(i8* %0, i32 %1, i32* %2)
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = load i32, i32* @stdout
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %3
ret i8* %0
}
void PWMGenFaultClear(unsigned long ulBase, unsigned long ulGen,
                      unsigned long ulGroup, unsigned long ulFaultTriggers) {
  ;
  ;
  ;
  ;

  ;
  (*((volatile unsigned long *)(((ulBase) + 0x00000800 +
                                 ((ulGen)-0x00000040) * 2) +
                                0x00000004))) = ulFaultTriggers;
}


x86 assembly (clang, -O0):
<PWMGenFaultClear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
add    $0x800,%rax
mov    -0x10(%rbp),%rdx
sub    $0x40,%rdx
shl    $0x1,%rdx
add    %rdx,%rax
mov    %rcx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMGenFaultClear>:
mov    %rcx,0x784(%rdi,%rsi,2)
ret

LLVM IR (-O0):
define void @PWMGenFaultClear(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %8
%10 = load i64, i64* %5
%11 = add i64 %10, 2048
%12 = load i64, i64* %6
%13 = sub i64 %12, 64
%14 = mul i64 %13, 2
%15 = add i64 %11, %14
%16 = add i64 %15, 4
%17 = inttoptr i64 %16 to i64*
store volatile i64 %9, i64* %17
ret void
}

LLVM IR (-O2):
define void @PWMGenFaultClear(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = shl i64 %1, 1
%6 = add i64 %0, 1924
%7 = add i64 %6, %5
%8 = inttoptr i64 %7 to i64*
store volatile i64 %3, i64* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ move_b(unsigned long *, unsigned short *);
void bi(unsigned long *p, unsigned short *o) {
  move_b(p, o);
  move_b(p, o);
  move_b(p, o);
  move_b(p, o);
}


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

x86 assembly (clang, -O2):
<bi>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <move_b@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <move_b@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <move_b@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <move_b@plt>

LLVM IR (-O0):
define void @bi(i64* %0, i16* %1) {
%3 = alloca i64*
%4 = alloca i16*
store i64* %0, i64** %3
store i16* %1, i16** %4
%5 = load i64*, i64** %3
%6 = load i16*, i16** %4
%7 = call i32 @move_b(i64* %5, i16* %6)
%8 = load i64*, i64** %3
%9 = load i16*, i16** %4
%10 = call i32 @move_b(i64* %8, i16* %9)
%11 = load i64*, i64** %3
%12 = load i16*, i16** %4
%13 = call i32 @move_b(i64* %11, i16* %12)
%14 = load i64*, i64** %3
%15 = load i16*, i16** %4
%16 = call i32 @move_b(i64* %14, i16* %15)
ret void
}

LLVM IR (-O2):
define void @bi(i64* %0, i16* %1) {
%3 = tail call i32 @move_b(i64* %0, i16* %1)
%4 = tail call i32 @move_b(i64* %0, i16* %1)
%5 = tail call i32 @move_b(i64* %0, i16* %1)
%6 = tail call i32 @move_b(i64* %0, i16* %1)
ret void
}
/* Variables and functions */
scalar_t__ isupper(char);
char tolower(char);
char *downcase(char *t) {
  char *s = t;
  while (*s) {
    if (isupper(*s))
      *s = tolower(*s);
    s++;
  }
  return t;
}


x86 assembly (clang, -O0):
<downcase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     117c <downcase+0x5c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isupper@plt>
cmp    $0x0,%rax
je     116b <downcase+0x4b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1134 <downcase+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<downcase>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1165 <downcase+0x45>
mov    %r14,%rbx
jmp    114c <downcase+0x2c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1165 <downcase+0x45>
movsbl %al,%edi
call   1040 <isupper@plt>
test   %rax,%rax
je     1140 <downcase+0x20>
movsbl (%rbx),%edi
call   1030 <tolower@plt>
mov    %al,(%rbx)
jmp    1140 <downcase+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @downcase(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %12
%5 = phi i8 [ %14, %12 ], [ %2, %1 ]
%6 = phi i8* [ %13, %12 ], [ %0, %1 ]
%7 = tail call i64 @isupper(i8 signext %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %4
%10 = load i8, i8* %6
%11 = tail call signext i8 @tolower(i8 signext %10)
store i8 %11, i8* %6
br label %12
12: ; preds = %9, %4
%13 = getelementptr inbounds i8, i8* %6, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %12, %1
ret i8* %0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void ComparatorIntDisable(uint32_t ui32Base, uint32_t ui32Comp) {
  ASSERT(ui32Base == 0x4003C000);
  ASSERT(ui32Comp < 3);
  (*((volatile uint32_t *)(ui32Base + 0x00000008))) &= ~(1 << ui32Comp);
}


x86 assembly (clang, -O0):
<ComparatorIntDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x4003c000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
cmpl   $0x3,-0x8(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
xor    $0xffffffff,%edx
mov    -0x4(%rbp),%eax
add    $0x8,%eax
cltq
mov    (%rax),%ecx
and    %edx,%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ComparatorIntDisable>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
cmp    $0x4003c000,%ebp
sete   %dil
call   1030 <ASSERT@plt>
xor    %edi,%edi
cmp    $0x3,%ebx
setl   %dil
call   1030 <ASSERT@plt>
mov    $0xfffffffe,%eax
mov    %ebx,%ecx
rol    %cl,%eax
movslq %ebp,%rcx
and    %eax,0x8(%rcx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @ComparatorIntDisable(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 1073987584
%7 = zext i1 %6 to i32
%8 = call i32 @ASSERT(i32 %7)
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 3
%11 = zext i1 %10 to i32
%12 = call i32 @ASSERT(i32 %11)
%13 = load i32, i32* %4
%14 = shl i32 1, %13
%15 = xor i32 %14, -1
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 8
%18 = sext i32 %17 to i64
%19 = inttoptr i64 %18 to i32*
%20 = load volatile i32, i32* %19
%21 = and i32 %20, %15
store volatile i32 %21, i32* %19
ret void
}

LLVM IR (-O2):
define void @ComparatorIntDisable(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1073987584
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = icmp slt i32 %1, 3
%7 = zext i1 %6 to i32
%8 = tail call i32 @ASSERT(i32 %7)
%9 = shl nuw i32 1, %1
%10 = xor i32 %9, -1
%11 = add nsw i32 %0, 8
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
%14 = load volatile i32, i32* %13
%15 = and i32 %14, %10
store volatile i32 %15, i32* %13
ret void
}
__attribute__((always_)) int hausy_is_footer_pulse(unsigned long pulse) {
  return (pulse <= ((unsigned long)12000 + (200 * 20)) &&
          pulse >= ((unsigned long)12000 - (200 * 20)));
}


x86 assembly (clang, -O0):
<hausy_is_footer_pulse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x3e80,-0x8(%rbp)
mov    %al,-0x9(%rbp)
ja     1129 <hausy_is_footer_pulse+0x29>
cmpq   $0x1f40,-0x8(%rbp)
setae  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hausy_is_footer_pulse>:
add    $0xffffffffffffe0c0,%rdi
xor    %eax,%eax
cmp    $0x1f41,%rdi
setb   %al
ret

LLVM IR (-O0):
define i32 @hausy_is_footer_pulse(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ule i64 %3, 16000
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp uge i64 %6, 8000
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @hausy_is_footer_pulse(i64 %0) {
%2 = add i64 %0, -8000
%3 = icmp ult i64 %2, 8001
%4 = zext i1 %3 to i32
ret i32 %4
}
int fs_parent_dir(char *path) {
  char *parent = 0;
  for (; *path; ++path) {
    if (*path == '/' || *path == '\\')
      parent = path;
  }
  if (parent) {
    *parent = 0;
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<fs_parent_dir>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115b <fs_parent_dir+0x5b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
je     113d <fs_parent_dir+0x3d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
jne    1145 <fs_parent_dir+0x45>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    114a <fs_parent_dir+0x4a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <fs_parent_dir+0x10>
cmpq   $0x0,-0x18(%rbp)
je     1179 <fs_parent_dir+0x79>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1180 <fs_parent_dir+0x80>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_parent_dir>:
xor    %eax,%eax
jmp    1117 <fs_parent_dir+0x17>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rdi,%rax
add    $0x1,%rdi
movzbl (%rdi),%ecx
cmp    $0x2f,%cl
je     1110 <fs_parent_dir+0x10>
cmp    $0x5c,%cl
je     1110 <fs_parent_dir+0x10>
test   %cl,%cl
jne    1113 <fs_parent_dir+0x13>
test   %rax,%rax
je     1133 <fs_parent_dir+0x33>
movb   $0x0,(%rax)
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @fs_parent_dir(i8* %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i8* [ %0, %1 ], [ %9, %7 ]
%4 = phi i8* [ null, %1 ], [ %8, %7 ]
%5 = load i8, i8* %3
switch i8 %5, label %7 [
i8 0, label %10
i8 47, label %6
i8 92, label %6
]
6: ; preds = %2, %2
br label %7
7: ; preds = %2, %6
%8 = phi i8* [ %3, %6 ], [ %4, %2 ]
%9 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
10: ; preds = %2
%11 = icmp eq i8* %4, null
br i1 %11, label %13, label %12
12: ; preds = %10
store i8 0, i8* %4
br label %13
13: ; preds = %10, %12
%14 = phi i32 [ 0, %12 ], [ 1, %10 ]
ret i32 %14
}
/* Variables and functions */
int __builtin_arc_clri();
int foo(void) { return __builtin_arc_clri(); }


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

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

LLVM IR (-O0):
define i32 @foo() {
%1 = call i32 (...) @__builtin_arc_clri()
ret i32 %1
}

LLVM IR (-O2):
define i32 @foo() {
%1 = tail call i32 (...) @__builtin_arc_clri()
ret i32 %1
}
int refresh() { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @refresh() {
ret i32 0
}