xunge/DecIR huggingface dataset:
void *memq_dequeue(void *tail, void **head, void **mem) {
  void *link;
  if (*head == tail) {
    return 0;
  }
  link = *head;
  if (mem) {
    *mem = *((void **)link + 1);
  }
  *head = *((void **)link);
  return link;
}


x86 assembly (clang, -O0):
<memq_dequeue>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
cmp    -0x10(%rbp),%rax
jne    112e <memq_dequeue+0x2e>
movq   $0x0,-0x8(%rbp)
jmp    1169 <memq_dequeue+0x69>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1153 <memq_dequeue+0x53>
mov    -0x28(%rbp),%rax
mov    0x8(%rax),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memq_dequeue>:
mov    (%rsi),%rax
cmp    %rdi,%rax
je     111b <memq_dequeue+0x1b>
test   %rdx,%rdx
je     1114 <memq_dequeue+0x14>
mov    0x8(%rax),%rcx
mov    %rcx,(%rdx)
mov    (%rax),%rcx
mov    %rcx,(%rsi)
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @memq_dequeue(i8* readnone %0, i8** nocapture %1, i8** writeonly %2) {
%4 = load i8*, i8** %1
%5 = icmp eq i8* %4, %0
br i1 %5, label %15, label %6
6: ; preds = %3
%7 = icmp eq i8** %2, null
br i1 %7, label %12, label %8
8: ; preds = %6
%9 = getelementptr inbounds i8, i8* %4, i64 8
%10 = bitcast i8* %9 to i8**
%11 = load i8*, i8** %10
store i8* %11, i8** %2
br label %12
12: ; preds = %8, %6
%13 = bitcast i8* %4 to i8**
%14 = load i8*, i8** %13
store i8* %14, i8** %1
br label %15
15: ; preds = %3, %12
%16 = phi i8* [ %4, %12 ], [ null, %3 ]
ret i8* %16
}
/* Variables and functions */
int /*<<< orphan*/ atoi_check(char *, int *);
int atoi_check8(char *a, int *res) {
  if (!(atoi_check(a, res)) || *res < 0 || *res > 0xff)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<atoi_check8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <atoi_check@plt>
cmp    $0x0,%eax
je     1153 <atoi_check8+0x43>
mov    -0x18(%rbp),%rax
cmpl   $0x0,(%rax)
jl     1153 <atoi_check8+0x43>
mov    -0x18(%rbp),%rax
cmpl   $0xff,(%rax)
jle    115f <atoi_check8+0x4f>
movl   $0x0,-0x4(%rbp)
jmp    1166 <atoi_check8+0x56>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoi_check8>:
push   %rbx
mov    %rsi,%rbx
call   1030 <atoi_check@plt>
test   %eax,%eax
je     112a <atoi_check8+0x1a>
xor    %eax,%eax
cmpl   $0x100,(%rbx)
setb   %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @atoi_check8(i8* %0, i32* %1) {
%3 = tail call i32 @atoi_check(i8* %0, i32* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i32, i32* %1
%7 = icmp ult i32 %6, 256
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 0, %2 ], [ %8, %5 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ *stdout;
void helpAndLeave(const char *progname, int status) {
  FILE *stream = stderr;
  if (status == EXIT_SUCCESS) {
    stream = stdout;
  }
  fprintf(stream, "Usage: %s <frwx> <file>\n", progname);
  exit(status);
}


x86 assembly (clang, -O0):
<helpAndLeave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e89(%rip),%rcx
cmp    (%rcx),%eax
jne    115d <helpAndLeave+0x3d>
mov    0x2e82(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<helpAndLeave>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rdx
mov    0x2ea3(%rip),%rax
cmp    %esi,(%rax)
jne    113a <helpAndLeave+0x1a>
mov    0x2ea0(%rip),%rax
jmp    1141 <helpAndLeave+0x21>
mov    0x2e9f(%rip),%rax
mov    (%rax),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32* null
@EXIT_SUCCESS = global i32 0
@stdout = global i32* null
@.str = [25 x i8] c"Usage: %s <frwx> <file>\0A\00"
define void @helpAndLeave(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32*, i32** @stderr
store i32* %6, i32** %5
%7 = load i32, i32* %4
%8 = load i32, i32* @EXIT_SUCCESS
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32*, i32** @stdout
store i32* %11, i32** %5
br label %12
12: ; preds = %10, %2
%13 = load i32*, i32** %5
%14 = load i8*, i8** %3
%15 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = load i32, i32* %4
%17 = call i32 @exit(i32 %16)
unreachable
}

LLVM IR (-O2):
@stderr = global i32* null
@EXIT_SUCCESS = global i32 0
@stdout = global i32* null
@.str = [25 x i8] c"Usage: %s <frwx> <file>\0A\00"
define void @helpAndLeave(i8* %0, i32 %1) {
%3 = load i32, i32* @EXIT_SUCCESS
%4 = icmp eq i32 %3, %1
%5 = load i32*, i32** @stdout
%6 = load i32*, i32** @stderr
%7 = select i1 %4, i32* %5, i32* %6
%8 = tail call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0)
%9 = tail call i32 @exit(i32 %1)
unreachable
}
TEST(testX, second) { ASSERT_EQ(20, X(4, 5)); }


x86 assembly (clang, -O0):
<TEST>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x4,%edi
mov    $0x5,%esi
mov    $0x0,%al
call   1040 <X@plt>
mov    %eax,%esi
mov    $0x14,%edi
mov    $0x0,%al
call   1030 <ASSERT_EQ@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TEST>:
push   %rax
mov    $0x4,%edi
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <X@plt>
mov    $0x14,%edi
mov    %eax,%esi
xor    %eax,%eax
pop    %rcx
jmp    1030 <ASSERT_EQ@plt>

LLVM IR (-O0):
define i32 @TEST(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (i32, i32, ...) bitcast (i32 (...)* @X to i32 (i32, i32, ...)*)(i32 4, i32 5)
%7 = call i32 (i32, i32, ...) bitcast (i32 (...)* @ASSERT_EQ to i32 (i32, i32, ...)*)(i32 20, i32 %6)
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @TEST(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @X to i32 (i32, i32, ...)*)(i32 4, i32 5)
%4 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @ASSERT_EQ to i32 (i32, i32, ...)*)(i32 20, i32 %3)
ret i32 undef
}
int test_imm_9Fint8_mem(signed char *val) {
  return ((*val) & (0x9F << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_9Fint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -97
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void salir() {
  endwin();
  exit(0);
}


x86 assembly (clang, -O0):
<salir>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <endwin@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<salir>:
push   %rax
xor    %eax,%eax
call   1030 <endwin@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @salir() {
%1 = call i32 (...) @endwin()
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @salir() {
%1 = tail call i32 (...) @endwin()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ read_unixtstamp(char *, int *);
void test_no_decimals_with_dot() {
  char *str = "1234.";
  uint64_t dest;
  read_unixtstamp(str, &dest);
  assert((dest / 1000000000) == 1234 && (dest % 1000000000) == 0);
}


x86 assembly (clang, -O0):
<test_no_decimals_with_dot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <read_unixtstamp@plt>
mov    -0xc(%rbp),%eax
mov    $0x3b9aca00,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x4d2,%ecx
mov    %al,-0xd(%rbp)
jne    1172 <test_no_decimals_with_dot+0x52>
mov    -0xc(%rbp),%eax
mov    $0x3b9aca00,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_no_decimals_with_dot>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <read_unixtstamp@plt>
xor    %edi,%edi
call   1030 <assert@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"1234.\00"
define void @test_no_decimals_with_dot() {
%1 = alloca i8*
%2 = alloca i32
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @read_unixtstamp(i8* %3, i32* %2)
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 1000000000
%7 = icmp eq i32 %6, 1234
br i1 %7, label %8, label %12
8: ; preds = %0
%9 = load i32, i32* %2
%10 = srem i32 %9, 1000000000
%11 = icmp eq i32 %10, 0
br label %12
12: ; preds = %8, %0
%13 = phi i1 [ false, %0 ], [ %11, %8 ]
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"1234.\00"
define void @test_no_decimals_with_dot() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @read_unixtstamp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call i32 @assert(i32 0)
ret void
}
float fahrenheit_to_celsius(float f) {
  float ret = 5.0 / 9.0 * (f - 32.0);
  return ret;
}


x86 assembly (clang, -O0):
<fahrenheit_to_celsius>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeee(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xeda(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fahrenheit_to_celsius>:
cvtss2sd %xmm0,%xmm0
addsd  0xef4(%rip),%xmm0
mulsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @fahrenheit_to_celsius(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fpext float %4 to double
%6 = fsub double %5, 3.200000e+01
%7 = fmul double 0x3FE1C71C71C71C72, %6
%8 = fptrunc double %7 to float
store float %8, float* %3
%9 = load float, float* %3
ret float %9
}

LLVM IR (-O2):
define float @fahrenheit_to_celsius(float %0) {
%2 = fpext float %0 to double
%3 = fadd double %2, -3.200000e+01
%4 = fmul double %3, 0x3FE1C71C71C71C72
%5 = fptrunc double %4 to float
ret float %5
}
int missing_optvar(char opt) {
  switch (opt) {
  case 'c':
  case 'd':
  case 't':
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<missing_optvar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xffffff9d,%eax
sub    $0x2,%eax
jb     1133 <missing_optvar+0x33>
jmp    1122 <missing_optvar+0x22>
mov    -0xc(%rbp),%eax
sub    $0x74,%eax
jne    113f <missing_optvar+0x3f>
jmp    1133 <missing_optvar+0x33>
movl   $0x1,-0x4(%rbp)
jmp    1146 <missing_optvar+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<missing_optvar>:
add    $0xffffff9d,%edi
cmp    $0x11,%edi
ja     1118 <missing_optvar+0x18>
mov    $0x1,%eax
mov    $0x20003,%ecx
bt     %edi,%ecx
jae    1118 <missing_optvar+0x18>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @missing_optvar(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %7 [
i32 99, label %6
i32 100, label %6
i32 116, label %6
]
6: ; preds = %1, %1, %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @missing_optvar(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %3 [
i32 99, label %4
i32 100, label %4
i32 116, label %4
]
3: ; preds = %1
br label %4
4: ; preds = %1, %1, %1, %3
%5 = phi i32 [ 0, %3 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ bgWhite(char *);
int /*<<< orphan*/ printColor(int /*<<< orphan*/);
void cmBgWhite(char *str) { printColor(bgWhite(str)); }


x86 assembly (clang, -O0):
<cmBgWhite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <bgWhite@plt>
mov    %eax,%edi
call   1040 <printColor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmBgWhite>:
push   %rax
call   1030 <bgWhite@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <printColor@plt>

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

LLVM IR (-O2):
define void @cmBgWhite(i8* %0) {
%2 = tail call i32 @bgWhite(i8* %0)
%3 = tail call i32 @printColor(i32 %2)
ret void
}
void ft_print_numbers(void) {
  int b;
  b = '0';
  while (b <= '9') {
    ft_putchar(b);
    b++;
  }
  ft_putchar("\n");
}


x86 assembly (clang, -O0):
<ft_print_numbers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x30,-0x4(%rbp)
cmpl   $0x39,-0x4(%rbp)
jg     1141 <ft_print_numbers+0x31>
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <ft_putchar@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <ft_print_numbers+0xf>
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <ft_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_print_numbers>:
push   %rax
mov    $0x30,%edi
xor    %eax,%eax
call   1030 <ft_putchar@plt>
mov    $0x31,%edi
xor    %eax,%eax
call   1030 <ft_putchar@plt>
mov    $0x32,%edi
xor    %eax,%eax
call   1030 <ft_putchar@plt>
mov    $0x33,%edi
xor    %eax,%eax
call   1030 <ft_putchar@plt>
mov    $0x34,%edi
xor    %eax,%eax
call   1030 <ft_putchar@plt>
mov    $0x35,%edi
xor    %eax,%eax
call   1030 <ft_putchar@plt>
mov    $0x36,%edi
xor    %eax,%eax
call   1030 <ft_putchar@plt>
mov    $0x37,%edi
xor    %eax,%eax
call   1030 <ft_putchar@plt>
mov    $0x38,%edi
xor    %eax,%eax
call   1030 <ft_putchar@plt>
mov    $0x39,%edi
xor    %eax,%eax
call   1030 <ft_putchar@plt>
lea    0xe70(%rip),%rdi
xor    %eax,%eax
pop    %rcx
jmp    1030 <ft_putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @ft_print_numbers() {
%1 = alloca i32
store i32 48, i32* %1
br label %2
2: ; preds = %5, %0
%3 = load i32, i32* %1
%4 = icmp sle i32 %3, 57
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 (i32, ...) bitcast (i32 (...)* @ft_putchar to i32 (i32, ...)*)(i32 %6)
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %2
10: ; preds = %2
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @ft_putchar to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @ft_print_numbers() {
%1 = tail call i32 (i32, ...) bitcast (i32 (...)* @ft_putchar to i32 (i32, ...)*)(i32 48)
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @ft_putchar to i32 (i32, ...)*)(i32 49)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @ft_putchar to i32 (i32, ...)*)(i32 50)
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @ft_putchar to i32 (i32, ...)*)(i32 51)
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @ft_putchar to i32 (i32, ...)*)(i32 52)
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @ft_putchar to i32 (i32, ...)*)(i32 53)
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @ft_putchar to i32 (i32, ...)*)(i32 54)
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @ft_putchar to i32 (i32, ...)*)(i32 55)
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @ft_putchar to i32 (i32, ...)*)(i32 56)
%10 = tail call i32 (i32, ...) bitcast (i32 (...)* @ft_putchar to i32 (i32, ...)*)(i32 57)
%11 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ft_putchar to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dreport(int, int);
int /*<<< orphan*/ lreport(int, long);
void sreport(int sct, long bytes) {
  dreport(9, sct);
  lreport(8, bytes);
}


x86 assembly (clang, -O0):
<sreport>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x9,%edi
call   1040 <dreport@plt>
mov    -0x10(%rbp),%rsi
mov    $0x8,%edi
call   1030 <lreport@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sreport>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%esi
mov    $0x9,%edi
call   1040 <dreport@plt>
mov    $0x8,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <lreport@plt>

LLVM IR (-O0):
define void @sreport(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = call i32 @dreport(i32 9, i32 %5)
%7 = load i64, i64* %4
%8 = call i32 @lreport(i32 8, i64 %7)
ret void
}

LLVM IR (-O2):
define void @sreport(i32 %0, i64 %1) {
%3 = tail call i32 @dreport(i32 9, i32 %0)
%4 = tail call i32 @lreport(i32 8, i64 %1)
ret void
}
void tls_init_trust_list(void *ctx) {}


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

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

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

LLVM IR (-O2):
define void @tls_init_trust_list(i8* nocapture %0) {
ret void
}
int memory_hash(void *ptr) { return ((int)ptr) % 503; }


x86 assembly (clang, -O0):
<memory_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x1f7,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memory_hash>:
movslq %edi,%rax
imul   $0xffffffff824a4e61,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x8,%ecx
add    %edx,%ecx
imul   $0x1f7,%ecx,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @memory_hash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i32
%5 = srem i32 %4, 503
ret i32 %5
}

LLVM IR (-O2):
define i32 @memory_hash(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = srem i32 %3, 503
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ q(int);
void t(int constant_propagated_par) {
  int local_var = constant_propagated_par + 1;
  q(local_var);
  q(local_var);
  q(local_var);
  q(local_var);
  q(local_var);
  q(local_var);
  q(local_var);
  q(local_var);
  q(local_var);
  q(local_var);
  q(local_var);
}


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

x86 assembly (clang, -O2):
<t>:
push   %rbx
mov    %edi,%ebx
add    $0x1,%ebx
mov    %ebx,%edi
call   1030 <q@plt>
mov    %ebx,%edi
call   1030 <q@plt>
mov    %ebx,%edi
call   1030 <q@plt>
mov    %ebx,%edi
call   1030 <q@plt>
mov    %ebx,%edi
call   1030 <q@plt>
mov    %ebx,%edi
call   1030 <q@plt>
mov    %ebx,%edi
call   1030 <q@plt>
mov    %ebx,%edi
call   1030 <q@plt>
mov    %ebx,%edi
call   1030 <q@plt>
mov    %ebx,%edi
call   1030 <q@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <q@plt>

LLVM IR (-O0):
define void @t(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @q(i32 %6)
%8 = load i32, i32* %3
%9 = call i32 @q(i32 %8)
%10 = load i32, i32* %3
%11 = call i32 @q(i32 %10)
%12 = load i32, i32* %3
%13 = call i32 @q(i32 %12)
%14 = load i32, i32* %3
%15 = call i32 @q(i32 %14)
%16 = load i32, i32* %3
%17 = call i32 @q(i32 %16)
%18 = load i32, i32* %3
%19 = call i32 @q(i32 %18)
%20 = load i32, i32* %3
%21 = call i32 @q(i32 %20)
%22 = load i32, i32* %3
%23 = call i32 @q(i32 %22)
%24 = load i32, i32* %3
%25 = call i32 @q(i32 %24)
%26 = load i32, i32* %3
%27 = call i32 @q(i32 %26)
ret void
}

LLVM IR (-O2):
define void @t(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = tail call i32 @q(i32 %2)
%4 = tail call i32 @q(i32 %2)
%5 = tail call i32 @q(i32 %2)
%6 = tail call i32 @q(i32 %2)
%7 = tail call i32 @q(i32 %2)
%8 = tail call i32 @q(i32 %2)
%9 = tail call i32 @q(i32 %2)
%10 = tail call i32 @q(i32 %2)
%11 = tail call i32 @q(i32 %2)
%12 = tail call i32 @q(i32 %2)
%13 = tail call i32 @q(i32 %2)
ret void
}
int modulo(int n, int m) {
  if (n < 0)
    return m + n;
  return n % m;
}


x86 assembly (clang, -O0):
<modulo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1122 <modulo+0x22>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    112c <modulo+0x2c>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<modulo>:
test   %edi,%edi
js     110c <modulo+0xc>
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret
add    %edi,%esi
mov    %esi,%eax
ret

LLVM IR (-O0):
define i32 @modulo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = add nsw i32 %9, %10
store i32 %11, i32* %3
br label %16
12: ; preds = %2
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = srem i32 %13, %14
store i32 %15, i32* %3
br label %16
16: ; preds = %12, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @modulo(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = add nsw i32 %1, %0
br label %8
6: ; preds = %2
%7 = srem i32 %0, %1
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ %5, %4 ], [ %7, %6 ]
ret i32 %9
}
void c_func(int nin, double x[], int nout, double y[]) {
  double E = x[0];
  double F = x[1];
  double L = x[2];
  double I = x[3];
  y[0] = F * L * L * L / (3.0 * E * I);
}


x86 assembly (clang, -O0):
<c_func>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x30(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  0xe9b(%rip),%xmm1
mulsd  -0x28(%rbp),%xmm1
mulsd  -0x40(%rbp),%xmm1
divsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_func>:
movsd  (%rsi),%xmm0
movsd  0x10(%rsi),%xmm1
movsd  0x8(%rsi),%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm2
mulsd  0xede(%rip),%xmm0
mulsd  0x18(%rsi),%xmm0
divsd  %xmm0,%xmm2
movsd  %xmm2,(%rcx)
ret

LLVM IR (-O0):
define void @c_func(i32 %0, double* %1, i32 %2, double* %3) {
%5 = alloca i32
%6 = alloca double*
%7 = alloca i32
%8 = alloca double*
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store i32 %0, i32* %5
store double* %1, double** %6
store i32 %2, i32* %7
store double* %3, double** %8
%13 = load double*, double** %6
%14 = getelementptr inbounds double, double* %13, i64 0
%15 = load double, double* %14
store double %15, double* %9
%16 = load double*, double** %6
%17 = getelementptr inbounds double, double* %16, i64 1
%18 = load double, double* %17
store double %18, double* %10
%19 = load double*, double** %6
%20 = getelementptr inbounds double, double* %19, i64 2
%21 = load double, double* %20
store double %21, double* %11
%22 = load double*, double** %6
%23 = getelementptr inbounds double, double* %22, i64 3
%24 = load double, double* %23
store double %24, double* %12
%25 = load double, double* %10
%26 = load double, double* %11
%27 = fmul double %25, %26
%28 = load double, double* %11
%29 = fmul double %27, %28
%30 = load double, double* %11
%31 = fmul double %29, %30
%32 = load double, double* %9
%33 = fmul double 3.000000e+00, %32
%34 = load double, double* %12
%35 = fmul double %33, %34
%36 = fdiv double %31, %35
%37 = load double*, double** %8
%38 = getelementptr inbounds double, double* %37, i64 0
store double %36, double* %38
ret void
}

LLVM IR (-O2):
define void @c_func(i32 %0, double* nocapture %1, i32 %2, double* nocapture writeonly %3) {
%5 = load double, double* %1
%6 = getelementptr inbounds double, double* %1, i64 1
%7 = load double, double* %6
%8 = getelementptr inbounds double, double* %1, i64 2
%9 = load double, double* %8
%10 = getelementptr inbounds double, double* %1, i64 3
%11 = load double, double* %10
%12 = fmul double %7, %9
%13 = fmul double %9, %12
%14 = fmul double %9, %13
%15 = fmul double %5, 3.000000e+00
%16 = fmul double %15, %11
%17 = fdiv double %14, %16
store double %17, double* %3
ret void
}
/* Variables and functions */
int core4_swap(char *, int);
int U_EMRINTERSECTCLIPRECT_swap(char *record, int torev) {
  return (core4_swap(record, torev));
}


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

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

LLVM IR (-O0):
define i32 @U_EMRINTERSECTCLIPRECT_swap(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 = load i32, i32* %4
%7 = call i32 @core4_swap(i8* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @U_EMRINTERSECTCLIPRECT_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core4_swap(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ SwtSub(double, double, double);
void SumSub(double x, double y) { SwtSub(x, y, (double)1.0); }


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

x86 assembly (clang, -O2):
<SumSub>:
movsd  0xee8(%rip),%xmm2
jmp    1030 <SwtSub@plt>

LLVM IR (-O0):
define void @SumSub(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 @SwtSub(double %5, double %6, double 1.000000e+00)
ret void
}

LLVM IR (-O2):
define void @SumSub(double %0, double %1) {
%3 = tail call i32 @SwtSub(double %0, double %1, double 1.000000e+00)
ret void
}
/* Type definitions */
struct parser {
  int dummy;
};
struct cb_context {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cb_putc(struct cb_context *, char);
struct cb_context *parser_get_context(struct parser *);
void cb_end_rule(struct parser *p) {
  struct cb_context *context = parser_get_context(p);
  cb_putc(context, '\n');
}


x86 assembly (clang, -O0):
<cb_end_rule>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <parser_get_context@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1030 <cb_putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cb_end_rule>:
push   %rax
call   1040 <parser_get_context@plt>
mov    %rax,%rdi
mov    $0xa,%esi
pop    %rax
jmp    1030 <cb_putc@plt>

LLVM IR (-O0):
%struct.parser = type { i32 }
%struct.cb_context = type { i32 }
define void @cb_end_rule(%struct.parser* %0) {
%2 = alloca %struct.parser*
%3 = alloca %struct.cb_context*
store %struct.parser* %0, %struct.parser** %2
%4 = load %struct.parser*, %struct.parser** %2
%5 = call %struct.cb_context* @parser_get_context(%struct.parser* %4)
store %struct.cb_context* %5, %struct.cb_context** %3
%6 = load %struct.cb_context*, %struct.cb_context** %3
%7 = call i32 @cb_putc(%struct.cb_context* %6, i8 signext 10)
ret void
}

LLVM IR (-O2):
%struct.parser = type { i32 }
%struct.cb_context = type { i32 }
define void @cb_end_rule(%struct.parser* %0) {
%2 = tail call %struct.cb_context* @parser_get_context(%struct.parser* %0)
%3 = tail call i32 @cb_putc(%struct.cb_context* %2, i8 signext 10)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ send;
typedef int /*<<< orphan*/ recv;

/* Variables and functions */
int /*<<< orphan*/ plm_docmd(int, char *, int, char *, int);
int /*<<< orphan*/ printf(char *);
void plm_reset(int fd) {
  char send[2] = {0x02, 0x67};
  char recv[3];
  plm_docmd(fd, send, sizeof(send), recv, sizeof(recv));
  printf("PLM reset complete\n");
}


x86 assembly (clang, -O0):
<plm_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0xece(%rip),%ax
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x6(%rbp),%rsi
lea    -0x9(%rbp),%rcx
mov    $0x2,%edx
mov    $0x3,%r8d
call   1040 <plm_docmd@plt>
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plm_reset>:
push   %rax
movw   $0x6702,0x2(%rsp)
lea    0x2(%rsp),%rsi
lea    0x5(%rsp),%rcx
mov    $0x2,%edx
mov    $0x3,%r8d
call   1040 <plm_docmd@plt>
lea    0xeb7(%rip),%rdi
call   1030 <puts@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const.plm_reset.send = [2 x i8] c"\02g"
@.str = [20 x i8] c"PLM reset complete\0A\00"
define void @plm_reset(i32 %0) {
%2 = alloca i32
%3 = alloca [2 x i8]
%4 = alloca [3 x i8]
store i32 %0, i32* %2
%5 = bitcast [2 x i8]* %3 to i8*
%6 = load i32, i32* %2
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 0
%9 = call i32 @plm_docmd(i32 %6, i8* %7, i32 2, i8* %8, i32 3)
%10 = 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"PLM reset complete\00"
define void @plm_reset(i32 %0) {
%2 = alloca i16
%3 = alloca [3 x i8]
%4 = bitcast i16* %2 to i8*
store i16 26370, i16* %2
%5 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%6 = call i32 @plm_docmd(i32 %0, i8* %4, i32 2, i8* %5, i32 3)
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret void
}
void Pete_ZeroMemory(void *pMemory, int nCount) {
  char *pCurrent = (char *)pMemory;
  char *pEnd = (pCurrent + nCount);
  while (pCurrent < pEnd)
    *pCurrent++ = 0;
}


x86 assembly (clang, -O0):
<Pete_ZeroMemory>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    1147 <Pete_ZeroMemory+0x47>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x0,(%rax)
jmp    1122 <Pete_ZeroMemory+0x22>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Pete_ZeroMemory>:
test   %esi,%esi
jle    1133 <Pete_ZeroMemory+0x23>
push   %rax
mov    %esi,%edx
add    %rdi,%rdx
lea    0x1(%rdi),%rax
cmp    %rax,%rdx
cmovbe %rax,%rdx
sub    %rdi,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @Pete_ZeroMemory(i8* writeonly %0, i32 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = zext i32 %1 to i64
%7 = add i64 %3, %6
%8 = add i64 %3, 1
%9 = call i64 @llvm.umax.i64(i64 %7, i64 %8)
%10 = sub i64 %9, %3
br label %11
11: ; preds = %5, %2
ret void
}
/* Variables and functions */
float D_GGX(float, float);
float SpecularNDF(float Roughness4, float NoH) {
  return D_GGX(Roughness4, NoH);
}


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

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

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

LLVM IR (-O2):
define float @SpecularNDF(float %0, float %1) {
%3 = tail call float @D_GGX(float %0, float %1)
ret float %3
}
const char *bzlibVersion(void) { return "0.9.5d"; }


x86 assembly (clang, -O0):
<bzlibVersion>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bzlibVersion>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"0.9.5d\00"
define i8* @bzlibVersion() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [7 x i8] c"0.9.5d\00"
define i8* @bzlibVersion() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
zysex() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @zysex() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ g(int *, int *, int *);
void f(int a, int b, int c) {
  while (a && b && c) {
    g(&a, &b, &c);
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0xd(%rbp)
je     1149 <f+0x39>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     1149 <f+0x39>
cmpl   $0x0,-0xc(%rbp)
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1159 <f+0x49>
jmp    116f <f+0x5f>
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <g@plt>
jmp    1121 <f+0x11>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edi,0xc(%rsp)
mov    %esi,0x8(%rsp)
mov    %edx,0x4(%rsp)
test   %edi,%edi
je     1163 <f+0x53>
test   %esi,%esi
je     1163 <f+0x53>
test   %edx,%edx
je     1163 <f+0x53>
lea    0xc(%rsp),%r14
lea    0x8(%rsp),%r15
lea    0x4(%rsp),%rbx
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1030 <g@plt>
cmpl   $0x0,0xc(%rsp)
je     1163 <f+0x53>
cmpl   $0x0,0x8(%rsp)
je     1163 <f+0x53>
cmpl   $0x0,0x4(%rsp)
jne    1140 <f+0x30>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @f(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = icmp ne i32 %0, 0
%8 = icmp ne i32 %1, 0
%9 = and i1 %7, %8
%10 = icmp ne i32 %2, 0
%11 = and i1 %9, %10
br i1 %11, label %12, label %22
12: ; preds = %3, %12
%13 = call i32 @g(i32* %4, i32* %5, i32* %6)
%14 = load i32, i32* %4
%15 = icmp ne i32 %14, 0
%16 = load i32, i32* %5
%17 = icmp ne i32 %16, 0
%18 = select i1 %15, i1 %17, i1 false
%19 = load i32, i32* %6
%20 = icmp ne i32 %19, 0
%21 = select i1 %18, i1 %20, i1 false
br i1 %21, label %12, label %22
22: ; preds = %12, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void NiveauSauver(int numeroNiveau) {
  FILE *fichier = fopen("avancement.txt", "w");
  fprintf(fichier, "%d", numeroNiveau);
  fclose(fichier);
}


x86 assembly (clang, -O0):
<NiveauSauver>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
lea    0xec6(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeb1(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NiveauSauver>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
lea    0xec4(%rip),%rdi
lea    0xecc(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
lea    0xebf(%rip),%rsi
mov    %rax,%rdi
mov    %ebp,%edx
call   1040 <fprintf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"avancement.txt\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [3 x i8] c"%d\00"
define void @NiveauSauver(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = load i32, i32* %2
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %6)
%8 = load i32*, i32** %3
%9 = call i32 @fclose(i32* %8)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"avancement.txt\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [3 x i8] c"%d\00"
define void @NiveauSauver(i32 %0) {
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @fprintf(i32* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %0)
%4 = tail call i32 @fclose(i32* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ exists(char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
void touch(char *filename) {
  if (exists(filename))
    return;
  FILE *fp;
  fp = fopen(filename, "w");
  fclose(fp);
}


x86 assembly (clang, -O0):
<touch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <exists@plt>
cmp    $0x0,%rax
je     1154 <touch+0x24>
jmp    1171 <touch+0x41>
mov    -0x8(%rbp),%rdi
lea    0xea1(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<touch>:
push   %rbx
mov    %rdi,%rbx
call   1040 <exists@plt>
test   %rax,%rax
je     1140 <touch+0x10>
pop    %rbx
ret
lea    0xeb9(%rip),%rsi
mov    %rbx,%rdi
call   1050 <fopen@plt>
mov    %rax,%rdi
pop    %rbx
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
define void @touch(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @exists(i8* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
br label %13
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32* @fopen(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %10, i32** %3
%11 = load i32*, i32** %3
%12 = call i32 @fclose(i32* %11)
br label %13
13: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
define void @touch(i8* %0) {
%2 = tail call i64 @exists(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @fclose(i32* %5)
br label %7
7: ; preds = %1, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MAP_ANONYMOUS;
void *mmap(void *, size_t, int, int /*<<< orphan*/, int /*<<< orphan*/,
           int /*<<< orphan*/);
void *runtime_alloc(void *start, size_t length, int prot) {
  return mmap(start, length, prot, MAP_ANONYMOUS, 0, 0);
}


x86 assembly (clang, -O0):
<runtime_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    0x2eb3(%rip),%rax
mov    (%rax),%ecx
xor    %r9d,%r9d
mov    %r9d,%r8d
call   1030 <mmap@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<runtime_alloc>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <mmap@plt>

LLVM IR (-O0):
@MAP_ANONYMOUS = global i32 0
define i8* @runtime_alloc(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = load i32, i32* %6
%10 = load i32, i32* @MAP_ANONYMOUS
%11 = call i8* @mmap(i8* %7, i64 %8, i32 %9, i32 %10, i32 0, i32 0)
ret i8* %11
}

LLVM IR (-O2):
@MAP_ANONYMOUS = global i32 0
define i8* @runtime_alloc(i8* %0, i64 %1, i32 %2) {
%4 = load i32, i32* @MAP_ANONYMOUS
%5 = tail call i8* @mmap(i8* %0, i64 %1, i32 %2, i32 %4, i32 0, i32 0)
ret i8* %5
}
void HFlush(void) {}


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

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

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

LLVM IR (-O2):
define void @HFlush() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int getCartTime(int cart) {
  int t;
  printf("Enter the time cart %d is accelerating (sec): ", cart);
  scanf("%d", &t);
  return t;
}


x86 assembly (clang, -O0):
<getCartTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
lea    0xeee(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCartTime>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
lea    0xef9(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"Enter the time cart %d is accelerating (sec): \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @getCartTime(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
@.str = [47 x i8] c"Enter the time cart %d is accelerating (sec): \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @getCartTime(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ reset_mypath();
void Reset_SVG_Path() { reset_mypath(); }


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

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

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

LLVM IR (-O2):
define void @Reset_SVG_Path() {
%1 = tail call i32 (...) @reset_mypath()
ret void
}
__attribute__((constructor)) void empty_constructor() {}


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

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

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

LLVM IR (-O2):
@llvm.global_ctors = appending global [0 x { i32, void ()*, i8* }] zeroinitializer
define void @empty_constructor() {
ret void
}